allow default drive to be changed in cart image

git-svn-id: http://svn.code.sf.net/p/netboot65/code@218 93682198-c243-4bdb-bd91-e943c89aac3b
This commit is contained in:
jonnosan 2009-11-13 12:39:41 +00:00
parent 86d05c56e6
commit 28d1ce6c43
5 changed files with 22 additions and 21 deletions

View File

@ -69,7 +69,7 @@
.import dns_server_msg
.import tftp_server_msg
.import press_a_key_to_continue
.import cfg_default_drive
.import print_a
.import print_cr
.import print
@ -416,19 +416,13 @@ cmp #KEYCODE_F7
cmp #'+'
bne @not_plus
inc io_device_no
bpl :+
dec io_device_no
:
inc cfg_default_drive
jmp @config_menu
@not_plus:
cmp #'-'
bne @not_minus
dec io_device_no
bpl :+
inc io_device_no
:
dec cfg_default_drive
jmp @config_menu
@not_minus:
@ -576,9 +570,11 @@ disk_boot:
.import io_filename
.import io_read_file
.import io_load_address
lda #00 ;use default drive
sta io_device_no
lda cfg_default_drive
sec
sbc #7
sta io_device_no
ldax #directory_buffer
jsr io_read_catalogue
@ -738,9 +734,7 @@ exit_ping:
print_default_drive:
ldax #default_drive
jsr print_ascii_as_native
lda io_device_no
clc
adc #08
lda cfg_default_drive
jsr print_hex
jmp print_cr

View File

@ -4,8 +4,9 @@
# $22=netmask (4 bytes)
# $26=gateway (4 bytes)
# $2A=DNS (4 bytes)
# $2E=TFTP server (4 bytes)
# $2E= DHCP server (4 bytes) (not changeable)
# $32=TFTP server (4 bytes)
# $36=drive (1 byte)
@cartridge_offsets={
#symobol => offset, length
@ -14,7 +15,8 @@
:netmask=>[0x22,4],
:gateway=>[0x26,4],
:dns=>[0x2a,4],
:tftp=>[0x2e,4],
:tftp=>[0x32,4],
:drive=>[0x36,1]
}
@progname=File.basename($0)
@ -79,6 +81,8 @@ end
end
end
packed_option=mac.pack("cccccc")
elsif option_length==1 then #it must be drive letter
packed_option=[value.to_i].pack("c")
else #it must be an IP
split_values=value.split(".")
if (split_values.length!=4) || (split_values[3].nil?) then

View File

@ -4,8 +4,8 @@ MEMORY {
ZP: start = $02, size = $1A, type = rw ;
IP65ZP: start = $20, size = $13, type = rw, define = yes; #this cart replaces BASIC so ok to use that space
HEADER: start = $8000, size = $18, file = %O;
DEFAULTS: start = $8018, size = $1E, file = %O;
ROM: start = $8036, size = $3FCA, define = yes, file = %O;
DEFAULTS: start = $8018, size = $1F, file = %O;
ROM: start = $8037, size = $3FC9, define = yes, file = %O;
RAM: start = $C010, size = $0fE0, define = yes;
RAM2: start = $0334, size = $CB, define = yes; #extra scratch area - Tape I/O buffer
RAM3: start = $0200, size = $58, define = yes; #extra scratch area - Tape I/O buffer

View File

@ -4,8 +4,8 @@
MEMORY {
IP65ZP: start = $A3, size = $0E, type = rw, define = yes;
HEADER: start = $8000, size = $09, file = %O;
DEFAULTS: start = $8009, size = $1E, file = %O;
ROM: start = $8027, size = $1FCA, define = yes, file = %O;
DEFAULTS: start = $8009, size = $1F, file = %O;
ROM: start = $8028, size = $1FC9, define = yes, file = %O;
RAM: start = $C010, size = $0fE0, define = yes;

View File

@ -11,6 +11,7 @@
.export cfg_tftp_server
.export cfg_get_configuration_ptr
.export cfg_init
.export cfg_default_drive
.export dhcp_server
.import copymem
.importzp copy_src
@ -50,6 +51,7 @@ cfg_gateway_default: .byte 192, 168, 1, 1 ;ip address of router on local network
cfg_dns_default: .byte 0, 0, 0, 0; ip address of dns server to use (will be overwritten if dhcp_init is called)
dhcp_server_default: .res 4 ;will be set address of dhcp server that configuration was obtained from
cfg_tftp_server_default: .byte $ff,$ff,$ff,$ff ; ip address of server to send tftp requests to (can be a broadcast address)
cfg_default_drive_default: .byte 8
cfg_end_defaults:
cfg_size=cfg_end_defaults-cfg_mac_default+1
@ -63,6 +65,7 @@ cfg_gateway: .res 4 ;ip address of router on local network (will be overwritten
cfg_dns: .res 4; ip address of dns server to use (will be overwritten if dhcp_init is called)
dhcp_server: .res 4 ;will be set address of dhcp server that configuration was obtained from
cfg_tftp_server: .res 4 ; ip address of server to send tftp requests to (can be a broadcast address)
cfg_default_drive: .res 0