Kernel version 0.8 : DHCP, fix when multible DNS servers in options, long domain names...

This commit is contained in:
Rémy GIBERT 2016-11-27 22:59:46 +01:00
parent 67a73ae571
commit 67a4dc18db
12 changed files with 94 additions and 73 deletions

Binary file not shown.

Binary file not shown.

View File

@ -13,7 +13,7 @@ SET
INSDRV CONSOLE.DRV INSDRV CONSOLE.DRV
STARTPROC GETTY CON ${A2OSX}SBIN/LOGIN STARTPROC GETTY CON ${A2OSX}SBIN/LOGIN
# Serial Login # Serial Login
#INSDRV SSC.I.DRV 9600 N 8 1 X #INSDRV SSC.DRV 9600 N 8 1 X
#STARTPROC GETTY COM2 LOGIN #STARTPROC GETTY COM2 LOGIN
#INSDRV PIC.DRV #INSDRV PIC.DRV
# Network Section # Network Section
@ -29,8 +29,8 @@ STARTPROC DHCPCLNT
#CIFSMOUNT 192.168.1.5:/MSSHARE /MNT/MSSHARE #CIFSMOUNT 192.168.1.5:/MSSHARE /MNT/MSSHARE
# End Network Section # End Network Section
# GUI Section # GUI Section
#INSDRV DHGR.DRV
INSDRV MOUSE.DRV INSDRV MOUSE.DRV
INSDRV DHGR.DRV
#STARTPROC DESKTOP #STARTPROC DESKTOP
# End GUI Section # End GUI Section
ECHO *** End A2osX Startup file *** ECHO *** End A2osX Startup file ***

View File

@ -263,7 +263,7 @@ MSG2.DHCPSRVR >CSTR " DHCP Server : %d.%d.%d.%d\n"
MSG2.IP >CSTR " IP/Mask : %d.%d.%d.%d/%d.%d.%d.%d\n" MSG2.IP >CSTR " IP/Mask : %d.%d.%d.%d/%d.%d.%d.%d\n"
MSG2.GW >CSTR " Gateway : %d.%d.%d.%d\n" MSG2.GW >CSTR " Gateway : %d.%d.%d.%d\n"
MSG2.DNS >CSTR " DNS : %d.%d.%d.%d,%d.%d.%d.%d\n" MSG2.DNS >CSTR " DNS : %d.%d.%d.%d,%d.%d.%d.%d\n"
MSG2.HOSTNAME >CSTR " Hostname : %s.%s\n" MSG2.HOSTNAME >CSTR " Hostname : %S.%S\n"
hLIBTCPIP .BS 1 hLIBTCPIP .BS 1
DevID .BS 1 DevID .BS 1
MAN MAN

View File

@ -130,8 +130,8 @@ MSG.DETECT >CSTR "\nApple IIe/IIc DHGR Driver.\n"
DEV.HEADER cld DEV.HEADER cld
jmp (DRV.CS.START,x) jmp (DRV.CS.START,x)
.HS 00 DevID .HS 00 DevID
.DA #0 No Flag .DA #S.DEV.F.EVENT
>PSTR "GFX" NAME >PSTR "GFX" NAME
.HS 00 NAME must Be 5 bytes long .HS 00 NAME must Be 5 bytes long
.HS 00 .HS 00
.HS 00.00.00.00 .HS 00.00.00.00
@ -208,7 +208,14 @@ OPEN ldy #S.DEV.ID
.8 clc .8 clc
rts rts
*-------------------------------------- *--------------------------------------
GETEVENT GETEVENT lda A2osX.ASCREEN
cmp #3 is HGR1 screen active?
bne .9 no....exit
.9 lda #0 Error = no event
sec
rts
*--------------------------------------
COUT COUT
IRQ sec IRQ sec
rts rts

View File

@ -122,9 +122,10 @@ hArgs .BS 1
*-------------------------------------- *--------------------------------------
DEV.HEADER cld DEV.HEADER cld
jmp (DRV.CS.START,x) jmp (DRV.CS.START,x)
.HS 00 DevID
.DA #S.DEV.F.EVENT+S.DEV.F.COUT+S.DEV.F.CHAR .DA #S.DEV.F.EVENT+S.DEV.F.COUT+S.DEV.F.CHAR
DEV.HEADER.NAME >PSTR "COM1" NAME DEV.HEADER.NAME >PSTR "COM1" NAME
.HS 00.00 .HS 00
.HS 00.00.00.00 .HS 00.00.00.00
*-------------------------------------- *--------------------------------------
* Driver Code * Driver Code

View File

@ -157,9 +157,10 @@ hArgs .BS 1
*-------------------------------------- *--------------------------------------
DEV.HEADER cld DEV.HEADER cld
jmp (DRV.CS.START,x) jmp (DRV.CS.START,x)
.HS 00 DevID
.DA #S.DEV.F.IRQ+S.DEV.F.EVENT+S.DEV.F.COUT+S.DEV.F.CHAR .DA #S.DEV.F.IRQ+S.DEV.F.EVENT+S.DEV.F.COUT+S.DEV.F.CHAR
DEV.HEADER.NAME >PSTR "COM1" NAME DEV.HEADER.NAME >PSTR "COM1" NAME
.HS 00.00 .HS 00
.HS 00.00.00.00 .HS 00.00.00.00
*-------------------------------------- *--------------------------------------
* Driver Code * Driver Code

View File

@ -105,7 +105,7 @@ S.IPCFG.GW .EQ 20
S.IPCFG.DNS1 .EQ 24 S.IPCFG.DNS1 .EQ 24
S.IPCFG.DNS2 .EQ 28 S.IPCFG.DNS2 .EQ 28
S.IPCFG.HOSTNAME .EQ 32 1+15 char PSTR S.IPCFG.HOSTNAME .EQ 32 1+15 char PSTR
S.IPCFG.DOMAIN .EQ 48 1+35 char PSTR S.IPCFG.DOMAIN .EQ 48 1+79 char PSTR
* *
S.IPCFG .EQ 128 S.IPCFG .EQ 128
*-------------------------------------- *--------------------------------------

View File

@ -105,18 +105,13 @@ CS.INIT >LDYA L.MSG.INIT
CS.RUN clc CS.RUN clc
rts rts
*-------------------------------------- *--------------------------------------
CS.DOEVENT lda KBD CS.DOEVENT ldy #S.EVT.hDEV
bpl .1
sta KBDSTROBE
jsr Destop.Paint lda hDevMouse Mouse is active ?
beq .1 go check KB
.1 lda hDevMouse Mouse is active ?
beq .99 go check KB
ldy #S.EVT.hDEV
cmp (pEvent),y Event coming from Mouse ? cmp (pEvent),y Event coming from Mouse ?
bne .1 bne .1 go check KB
lda A2osX.ASCREEN GUI screen active ? lda A2osX.ASCREEN GUI screen active ?
cmp #3 cmp #3
@ -148,9 +143,16 @@ CS.DOEVENT lda KBD
>LDYA L.SetPixel.X >LDYA L.SetPixel.X
ldx #DEVMGR.GFX.SETPIXEL ldx #DEVMGR.GFX.SETPIXEL
jsr GoDevGFX jsr GoDevGFX
.98 clc Mark event proceeded
.98 clc
rts rts
.1 lda A2osX.ASCREEN GUI screen active ?
cmp #3
bne .99 not for us...
sec
rts
.99 sec .99 sec
rts rts

View File

@ -333,57 +333,62 @@ CheckDHCPOffer jsr CheckDHCPXID
*-------------------------------------- *--------------------------------------
GetDHCPOption cmp #S.DHCP.OPTIONS.MASK GetDHCPOption cmp #S.DHCP.OPTIONS.MASK
bne .1 bne .1
ldy #S.IPCFG.MASK ldx #S.IPCFG.MASK
bra GetDHCPOption.CopyIP bra GetDHCPOption.CopyIP
.1 cmp #S.DHCP.OPTIONS.GW .1 cmp #S.DHCP.OPTIONS.GW
bne .2 bne .2
ldy #S.IPCFG.GW
ldx #S.IPCFG.GW
bra GetDHCPOption.CopyIP bra GetDHCPOption.CopyIP
.2 cmp #S.DHCP.OPTIONS.DNS .2 cmp #S.DHCP.OPTIONS.DNS
bne .3 bne .3
ldy #S.IPCFG.DNS1
ldx #S.IPCFG.DNS1
bra GetDHCPOption.CopyIP bra GetDHCPOption.CopyIP
.3 cmp #S.DHCP.OPTIONS.DOMAIN .3 cmp #S.DHCP.OPTIONS.DOMAIN
bne .9 bne .9
ldy #1 ldy #1
ldx #$FF
.4 iny lda (ZPFramePtr),y Get String len
inx cmp #80
lda (ZPFramePtr),y bcc .4
sta UsrBuf256,x lda #79
bne .4
ldy #S.IPCFG.DOMAIN-1 .4 sta IPCFG+S.IPCFG.DOMAIN store len
ldx #$FF tax
.5 iny .5 iny
inx lda (ZPFramePtr),y
lda UsrBuf256,x sta IPCFG+S.IPCFG.DOMAIN-1,y
sta IPCFG,y dex
bne .5 bne .5
.9 rts .9 rts
*--------------------------------------
GetDHCPOption.CopyIP GetDHCPOption.CopyIP
phy ldy #1
ldy #2 lda (ZPFramePtr),y Get Byte count
ldx #0 cmp #9
.1 lda (ZPFramePtr),y bcc .1
sta UsrBuf256,x lda #8 max 8 bytes (2 DNS)
.1 iny
.2 pha
lda (ZPFramePtr),y
sta IPCFG,x
iny iny
inx inx
cpx #4
bne .1 pla
ply dec
ldx #0
.2 lda UsrBuf256,x
sta IPCFG,y
iny
inx
cpx #4
bne .2 bne .2
rts rts
*-------------------------------------- *--------------------------------------
CheckDHCPAck jsr CheckDHCPXID CheckDHCPAck jsr CheckDHCPXID

View File

@ -421,25 +421,23 @@ Cmd.Exec.TIME clc
>SYSCALL PStrFTime >SYSCALL PStrFTime
>LDYAI UsrBuf256 >LDYAI UsrBuf256
>SYSCALL PPrintFYA
bcs .9 bcs .9
lda #13 lda #13
>SYSCALL COutA >SYSCALL COutA
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
Cmd.Exec.ECHO lda ARGS Cmd.Exec.ECHO lda ARGS
beq Cmd.Exec.ECHO.SYN beq .1
>LDYA L.ARGS >LDYA L.ARGS
>SYSCALL PPrintFYA >SYSCALL PPrintFYA
clc bcs .9
rts
Cmd.Exec.ECHO.SYN .1 lda #13
lda #SYSMGR.ERRSYN >SYSCALL COutA
sec
Cmd.Exec.ECHO.RTS .9 rts
rts
*-------------------------------------- *--------------------------------------
Cmd.Exec.READ Cmd.Exec.READ
clc clc

View File

@ -68,22 +68,29 @@ CFG.Read.HOSTNAME
>SYSCALL GetMemPtrA >SYSCALL GetMemPtrA
>STYA ZPIPCfgPtr >STYA ZPIPCfgPtr
lda CFG.FileLen+1 * read 15 chars MAX, until CR or EOF
bne .9
ldy CFG.FileLen
beq .9
cpy #15
bcs .9
sta IPCFG+S.IPCFG.HOSTNAME,y ldx #$15
lda CFG.FileLen+1
.1 dey bne .1 File is more than 256....?
bmi .2
lda (ZPIPCfgPtr),y
sta IPCFG+S.IPCFG.HOSTNAME,y
bra .1
.2 jsr CFG.Read.CleanUp ldx CFG.FileLen
beq .9 len is 0 !!!
.1 ldy #0
.2 lda (ZPIPCfgPtr),y
cmp #13
beq .8 A CR, end of name
iny
sta IPCFG+S.IPCFG.HOSTNAME,y
dex
bne .2
.8 sty IPCFG+S.IPCFG.HOSTNAME
jsr CFG.Read.CleanUp
clc clc
rts rts