2017-10-06 06:33:21 +00:00
|
|
|
|
NEW
|
2018-04-16 15:25:39 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
|
|
|
|
AUTO 4,1
|
2017-10-06 06:33:21 +00:00
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2018-07-23 15:28:42 +00:00
|
|
|
|
.TF SBIN/TCPIPD
|
2017-10-06 06:33:21 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-23 15:28:42 +00:00
|
|
|
|
.INB INC/MACROS.I
|
|
|
|
|
.INB INC/A2OSX.I
|
|
|
|
|
.INB INC/ETH.I
|
|
|
|
|
.INB INC/LIBTCPIP.I
|
|
|
|
|
.INB INC/MLI.ERR.I
|
2017-10-06 06:33:21 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
ZPIPCfgPtr .EQ ZPBIN
|
2018-04-16 15:25:39 +00:00
|
|
|
|
ZPDevStatusPtr .EQ ZPBIN+2
|
2017-10-06 06:33:21 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* File Header (16 Bytes)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.START cld
|
|
|
|
|
jmp (.1,x)
|
|
|
|
|
.DA #$61 6502,Level 1 (65c02)
|
|
|
|
|
.DA #1 BIN Layout Version 1
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA CS.END-CS.START CS
|
|
|
|
|
.DA DS.END-DS.START DS
|
|
|
|
|
.DA #16 SS
|
|
|
|
|
.DA #4 ZP
|
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Relocation Table
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.1 .DA CS.INIT
|
|
|
|
|
.DA CS.RUN
|
|
|
|
|
.DA CS.DOEVENT
|
|
|
|
|
.DA CS.QUIT
|
|
|
|
|
L.LIBTCPIP .DA LIBTCPIP
|
|
|
|
|
L.DEVNAME .DA DEVNAME
|
|
|
|
|
L.MSG.DEV.KO .DA MSG.DEV.KO
|
|
|
|
|
L.MSG.DEV.OK .DA MSG.DEV.OK
|
|
|
|
|
L.MSG.CFG .DA MSG.CFG
|
|
|
|
|
L.MSG.CFG.KO .DA MSG.CFG.KO
|
|
|
|
|
L.MSG.CFG.OK .DA MSG.CFG.OK
|
|
|
|
|
L.HOSTNAME .DA HOSTNAME
|
|
|
|
|
L.TCPIP.CONF .DA TCPIP.CONF
|
|
|
|
|
L.HOSTS .DA HOSTS
|
|
|
|
|
L.IPCFG .DA IPCFG
|
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.INIT >LDYA L.LIBTCPIP
|
2018-07-19 15:33:55 +00:00
|
|
|
|
>SYSCALL LoadLib
|
2017-10-06 06:33:21 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
sta hLIBTCPIP
|
|
|
|
|
|
|
|
|
|
jsr CS.INIT.DEV
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
jsr CFG.Read continue even if error opening CFG file
|
|
|
|
|
|
2018-07-23 15:28:42 +00:00
|
|
|
|
>PUSHW L.IPCFG
|
2017-10-06 06:33:21 +00:00
|
|
|
|
>LIBCALL hLIBTCPIP,LIBTCPIP.SET.IPCFG
|
|
|
|
|
|
|
|
|
|
lda (pPs)
|
|
|
|
|
ora #S.PS.F.EVENT Now accept events
|
|
|
|
|
sta (pPs)
|
2017-10-06 15:25:14 +00:00
|
|
|
|
|
2017-10-06 06:33:21 +00:00
|
|
|
|
clc
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.INIT.DEV >LDYA L.DEVNAME
|
2018-07-23 06:28:47 +00:00
|
|
|
|
>SYSCALL GetDevByName
|
2017-10-06 06:33:21 +00:00
|
|
|
|
bcc .1
|
|
|
|
|
inc DEVNAME+3
|
|
|
|
|
lda DEVNAME+3
|
|
|
|
|
cmp #'8'
|
|
|
|
|
bne CS.INIT.DEV
|
|
|
|
|
|
|
|
|
|
>LDYA L.MSG.DEV.KO
|
2018-06-21 15:12:10 +00:00
|
|
|
|
>SYSCALL printf
|
2018-07-23 15:28:42 +00:00
|
|
|
|
|
2018-04-16 15:25:39 +00:00
|
|
|
|
lda #MLI.E.NODEV
|
2017-10-06 06:33:21 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
2018-04-16 15:25:39 +00:00
|
|
|
|
.1 txa
|
|
|
|
|
>STA.G hDev
|
|
|
|
|
sta IPCFG+S.IPCFG.HDEV
|
2017-10-06 06:33:21 +00:00
|
|
|
|
|
|
|
|
|
>PUSHW L.DEVNAME
|
|
|
|
|
>LDYA L.MSG.DEV.OK
|
2018-06-21 15:12:10 +00:00
|
|
|
|
>SYSCALL printf
|
2017-10-06 06:33:21 +00:00
|
|
|
|
|
2018-04-16 15:25:39 +00:00
|
|
|
|
>PUSHWI 0
|
2018-07-23 06:28:47 +00:00
|
|
|
|
>PUSHBI IOCTL.OPEN
|
|
|
|
|
>LDA.G hDev
|
2018-04-16 15:25:39 +00:00
|
|
|
|
>SYSCALL IOCTL
|
2017-10-06 06:33:21 +00:00
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN >LIBCALL hLIBTCPIP,LIBTCPIP.POLL
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.DOEVENT lda (pEvent)
|
|
|
|
|
bpl .9
|
2018-07-23 15:28:42 +00:00
|
|
|
|
>LIBCALL hLIBTCPIP,LIBTCPIP.PULSE
|
2017-10-06 06:33:21 +00:00
|
|
|
|
|
|
|
|
|
.9 sec never discard TIME event
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2018-04-16 15:25:39 +00:00
|
|
|
|
CS.QUIT >LDA.G hDev
|
2017-10-06 06:33:21 +00:00
|
|
|
|
beq .1
|
2018-04-16 15:25:39 +00:00
|
|
|
|
|
|
|
|
|
>PUSHWI 0
|
2018-07-23 06:28:47 +00:00
|
|
|
|
>PUSHBI IOCTL.CLOSE
|
|
|
|
|
>LDA.G hDev
|
2018-04-16 15:25:39 +00:00
|
|
|
|
>SYSCALL IOCTL
|
|
|
|
|
|
2017-10-06 06:33:21 +00:00
|
|
|
|
.1 lda hLIBTCPIP
|
2018-07-20 14:10:10 +00:00
|
|
|
|
>SYSCALL UnloadLib
|
2017-10-06 06:33:21 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.INB /A2OSX.SRC/SBIN/TCPIPD.S.CFG
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.END
|
|
|
|
|
*--------------------------------------
|
2018-04-11 15:35:51 +00:00
|
|
|
|
LIBTCPIP .AZ "libtcpip.o"
|
|
|
|
|
DEVNAME .AZ "ETH1"
|
|
|
|
|
MSG.DEV.KO .AZ "TCPIPD:No Device Found, exiting.\r\n"
|
|
|
|
|
MSG.DEV.OK .AZ "TCPIPD:Bound To Device : %s\r\n"
|
|
|
|
|
MSG.CFG .AZ "TCPIPD:Reading %s..."
|
|
|
|
|
MSG.CFG.KO .AZ "Failed!!! [%h]\r\n"
|
|
|
|
|
MSG.CFG.OK .AZ "OK.\r\n"
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
HOSTNAME .AZ "${A2OSX}ETC/HOSTNAME"
|
|
|
|
|
TCPIP.CONF .AZ "${A2OSX}ETC/TCPIP.CONF"
|
|
|
|
|
HOSTS .AZ "${A2OSX}ETC/HOSTS"
|
2018-07-24 16:00:24 +00:00
|
|
|
|
DefaultHostName .AZ "a2osx-XXXX"
|
2017-10-06 06:33:21 +00:00
|
|
|
|
CFG.Keywords >PSTR "DOMAIN"
|
|
|
|
|
>PSTR "IP"
|
|
|
|
|
>PSTR "MASK"
|
|
|
|
|
>PSTR "GW"
|
|
|
|
|
>PSTR "DNS1"
|
|
|
|
|
>PSTR "DNS2"
|
|
|
|
|
CFG.Keyword.Map .DA #0 End Of Keyword table and NA Keyword
|
|
|
|
|
.DA #S.IPCFG.IP
|
|
|
|
|
.DA #S.IPCFG.MASK
|
|
|
|
|
.DA #S.IPCFG.GW
|
|
|
|
|
.DA #S.IPCFG.DNS1
|
|
|
|
|
.DA #S.IPCFG.DNS2
|
|
|
|
|
hLIBTCPIP .BS 1
|
|
|
|
|
IPCFG .BS S.IPCFG
|
|
|
|
|
CFG.hCfgFile .BS 1
|
|
|
|
|
CFG.hCfgPath .BS 1
|
|
|
|
|
CFG.FileLen .BS 2
|
|
|
|
|
CFG.Keyword .BS 1
|
|
|
|
|
CFG.StrBuf .BS 4
|
|
|
|
|
CFG.HexByte .BS 1
|
|
|
|
|
CFG.IP .BS 5
|
|
|
|
|
UsrBuf256 .BS 256
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.DUMMY
|
|
|
|
|
.OR 0
|
|
|
|
|
DS.START
|
2018-04-16 15:25:39 +00:00
|
|
|
|
hDev .BS 1
|
2017-10-06 06:33:21 +00:00
|
|
|
|
DS.END .ED
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE /A2OSX.SRC/SBIN/TCPIPD.S
|
|
|
|
|
ASM
|