BugFix: IPCONFIG, STAT, EDIT, CIFS

This commit is contained in:
burniouf 2021-06-30 21:09:07 +02:00
parent a8f84a6e88
commit 45d654382a
13 changed files with 477 additions and 286 deletions

Binary file not shown.

View File

@ -39,7 +39,7 @@ A2osX.QC.Start1 sei
lda #$8C Reset 80 col screen ($0C=FF=HOME)
jsr $C300
ldx $280
ldx $280 some /PATH/.SYSTEM file passed ?
beq A2osX.QC.Start2
.2 dex
@ -47,20 +47,34 @@ A2osX.QC.Start1 sei
cmp #'/'
bne .2
stx A2osX.QC.BOOT
stx A2osX.QC.BOOT get /PATH/ in QC.BOOT...
.3 lda $280,x
sta A2osX.QC.BOOT,x
dex
bne .3
jsr A2osX.QC.SetPFX
jsr A2osX.QC.SetPFX cd to QC.BOOT...
bcs A2osX.QC.Start2
jsr A2osX.QC.Load
bcs A2osX.QC.Start2
jmp $2000
lda $2000
cmp #$4C
bne .8
lda #$EE
cmp $2003
bne .8
cmp $2004
bne .8
.8 jmp $2000
A2osX.QC.Start2 sec
>LDYAI MSG.INIT1

View File

@ -129,6 +129,7 @@ BUF.InsertClipboard
sta (BufPtr),y
iny
bne .1
inc ClipboardPtr+1
inc BufPtr+1
bra .1
@ -277,6 +278,7 @@ BUF.CopyAddY tya
adc BufPtr
sta BufPtr
bcc .2
inc BufPtr+1
.2 rts
*--------------------------------------
@ -403,6 +405,7 @@ BUF.GetLineAX sta BUF.TmpLine1 Requested Line
cmp #C.CR
beq .3
iny
bne .2
@ -419,6 +422,7 @@ BUF.GetLineAX sta BUF.TmpLine1 Requested Line
adc BufPtr
sta BufPtr
bcc .5
inc BufPtr+1
.5 tya
@ -426,10 +430,12 @@ BUF.GetLineAX sta BUF.TmpLine1 Requested Line
adc BUF.LOffset
sta BUF.LOffset
bcc .6
inc BUF.LOffset+1
.6 inc BUF.TmpLine2
bne .1
inc BUF.TmpLine2+1
bra .1

View File

@ -89,32 +89,29 @@ FILE.Load.TXT stz FileLen
ldx #S.FI.T.TXT
jsr FILE.OpenTypeX
bcs .99
bcs .9
>PUSHA
>PUSHEA.G STATBUF
>SYSCALL FStat
bcs .99
bcs .9
jsr FILE.GetBuffer
.99 bcs .9
bcs .9
.1 ldy #254
jsr FILE.ReadY
.1 ldy #0
jsr FILE.ReadY read 256
bcs .7
lda #0
sta (ZPPTR1),y Y = line len
sty TmpCount Count read
ldx #0
ldy #0
lda (ZPPTR1)
beq .8
.2 lda (ZPPTR1),y
eor #C.LF
bne .2
cmp #C.LF
bne .3
phy
@ -122,29 +119,27 @@ FILE.Load.TXT stz FileLen
>STA.G FileType
ply
iny
bra .5
.2 lda (ZPPTR1),y
beq .4
sta (BufPtr)
.3 sta (BufPtr)
inc BufPtr
bne .3
bne .4
inc BufPtr+1
.3 inx
iny
bra .2
.4 cmp #C.CR
beq .5
.4 txa
clc
adc FileLen
sta FileLen
bcc .1
inc FileLen
bne .5
inc FileLen+1
bra .1
.5 dec TmpCount
beq .1
iny
bra .2
.7 cmp #MLI.E.EOF
bne .9
@ -153,7 +148,8 @@ FILE.Load.TXT stz FileLen
sta (BufPtr)
clc
.HS B0 BCS
rts
.9 sec
rts
*--------------------------------------
@ -194,7 +190,8 @@ FILE.Load.ASM stz FileLen
sta (BufPtr)
clc
.HS B0 BCS
rts
.9 sec
.99 rts
*--------------------------------------
@ -249,13 +246,16 @@ FILE.Load.ASM.Decode
FILE.Load.ASM.2Buf
phy
phx
sta (BufPtr)
inc BufPtr
bne .1
inc BufPtr+1
.1 inc FileLen
bne .8
inc FileLen+1
lda FileLen+1
@ -275,6 +275,7 @@ FILE.Load.ASM.2Buf
sta BufPtr+1
.8 clc
.9 plx
ply
rts
@ -501,9 +502,13 @@ FILE.ReadY phy
>PUSHB TmpIndex
>PUSHW ZPPTR1
ply
lda #0
>PUSHYA
ply
bne .1
inc
.1 >PUSHYA
>SYSCALL FRead
rts
*--------------------------------------

View File

@ -29,7 +29,6 @@ DHCP.INIT lda IPCFG+S.NETCFG.STATUS
.99 >LDYA L.MSG.DHCP.NA
>SYSCALL PutS
lda #0
sec
rts
*--------------------------------------
@ -83,6 +82,7 @@ DHCP.RUN.ROFFER jsr DHCP.RUN.SKT.RECV
.1 jsr CheckDHCPOffer
bcs DHCP.RUN.ROFFER
lda #S.IPCFG.STATUS.ROFFER
sta IPCFG
@ -193,20 +193,6 @@ DHCP.QUIT lda hSocket
CheckDHCPOffer jsr CheckDHCPXID
bcs .9
lda ZPFrameBase
clc
adc #S.DHCP.OPTIONS
sta ZPFramePtr
lda ZPFrameBase+1
adc /S.DHCP.OPTIONS
sta ZPFramePtr+1
lda (ZPFramePtr)
cmp #S.DHCP.OPTIONS.MSGTYPE
bne .9
ldy #2
lda (ZPFramePtr),y
cmp #S.DHCP.OPTIONS.DHCPOffer
bne .9
@ -263,12 +249,13 @@ CheckDHCPOffer jsr CheckDHCPXID
jsr GetDHCPOption May override SVRIP
bra .5
.8 jsr CS.RUN.DISCARD
clc
rts
.9 jsr CS.RUN.DISCARD
sec
.8 clc
.HS B0 BCS
.9 sec
php
lda hFrame
>SYSCALL FreeMem
plp
rts
*--------------------------------------
GetDHCPOption cmp #S.DHCP.OPTIONS.MASK
@ -349,33 +336,16 @@ GetDHCPOption.CopyIP
CheckDHCPAck jsr CheckDHCPXID
bcs .9
lda ZPFrameBase
clc
adc #S.DHCP.OPTIONS
sta ZPFramePtr
lda ZPFrameBase+1
adc /S.DHCP.OPTIONS
sta ZPFramePtr+1
lda (ZPFramePtr)
cmp #S.DHCP.OPTIONS.MSGTYPE
bne .9
ldy #2
lda (ZPFramePtr),y
cmp #S.DHCP.OPTIONS.DHCPAck
bne .9
jsr CS.RUN.DISCARD
clc
rts
.9 jsr CS.RUN.DISCARD
sec
rts
*--------------------------------------
CS.RUN.DISCARD lda hFrame
.8 clc
.HS B0 BCS
.9 sec
php
lda hFrame
>SYSCALL FreeMem
plp
rts
*--------------------------------------
CheckDHCPXID ldy #S.DHCP.XID+3
@ -389,6 +359,22 @@ CheckDHCPXID ldy #S.DHCP.XID+3
dex
bpl .1
lda ZPFrameBase
clc
adc #S.DHCP.OPTIONS
sta ZPFramePtr
lda ZPFrameBase+1
adc /S.DHCP.OPTIONS
sta ZPFramePtr+1
lda (ZPFramePtr)
cmp #S.DHCP.OPTIONS.MSGTYPE
bne .9
ldy #2
lda (ZPFramePtr),y
clc
rts

View File

@ -4,9 +4,12 @@ NEW
ETC.ReadFiles >LDYAI 256
>SYSCALL GetMem
bcc .1
rts
.1 >STYA ZPTmpPtr1
stx CFG.hBuf1
>LDYA L.HOSTNAME
jsr CFG.Read.PrintF
jsr CFG.Read.HOSTNAME
@ -55,23 +58,24 @@ CFG.Read.HOSTNAME
jsr CFG.Read.Open
jsr CFG.Read.Result
bcs .9
.1 jsr CFG.Read.GetS
bcs .8
lda (ZPTmpPtr1)
beq .1 empty line...
cmp #'#
beq .1 comment...
ldy #0
.2 lda (ZPTmpPtr1),y
sta IPCFG+S.IPCFG.HOSTNAME,y
beq .8 end of name
iny
cpy #15
bne .2
.8 clc
.HS B0 BCS
.9 sec
jmp CFG.Read.Close
*--------------------------------------
CFG.Read.TCPIP.CONF
@ -83,12 +87,6 @@ CFG.Read.TCPIP.CONF
.1 jsr CFG.Read.GetS
bcs .8
lda (ZPTmpPtr1)
beq .1 empty line...
cmp #'#'
beq .1 comment...
ldy #$ff
.2 iny
@ -143,6 +141,7 @@ CFG.Read.TCPIP.CONF
.8 clc
.HS B0 BCS
.9 sec
jmp CFG.Read.Close
.80 jmp (J.CFG.Keywords,x)
@ -202,21 +201,27 @@ CFG.Read.dnsdomain
adc ZPTmpPtr1
sta ZPTmpPtr1
bcc .1
inc ZPTmpPtr1+1
.1 ldy #$ff
.2 iny
lda (ZPTmpPtr1),y
sta IPCFG+S.IPCFG.DOMAIN,y
beq .8
cpy #K.DNS.MAXLEN
bne .2
lda #0
sta IPCFG+S.IPCFG.DOMAIN,y
.8 rts
*--------------------------------------
CFG.Read.HOSTS stz CFG.hBuf2
stz CFG.hBuf3
>LDYA L.HOSTS
jsr CFG.Read.Open
jsr CFG.Read.Result
@ -239,12 +244,6 @@ CFG.Read.HOSTS stz CFG.hBuf2
.1 jsr CFG.Read.GetS
bcs .8
lda (ZPTmpPtr1)
beq .1 empty line...
cmp #'#
beq .1 comment...
jsr CFG.Read.HOSTS.Scan
bcs .1
@ -267,8 +266,10 @@ CFG.Read.HOSTS stz CFG.hBuf2
pha
lda CFG.hBuf3
beq .90
>SYSCALL FreeMem
.90 lda CFG.hBuf2
beq .91
>SYSCALL FreeMem
@ -350,7 +351,17 @@ CFG.Read.GetS >PUSHB CFG.hCfgFile
>PUSHW ZPTmpPtr1
>PUSHWI 255
>SYSCALL FGetS
rts
bcs .9
lda (ZPTmpPtr1)
beq CFG.Read.GetS empty line...
cmp #'#'
beq CFG.Read.GetS comment...
clc
.9 rts
*--------------------------------------
MAN
SAVE usr/src/bin/ipconfig.s.etc

View File

@ -127,6 +127,7 @@ CS.RUN >LIBCALL hLIBTCPIP,LIBTCPIP.GETCFG
>STYA pIPCFG
ldy #S.IPCFG-1
.1 lda (pIPCFG),y
sta IPCFG,y
dey
@ -134,11 +135,14 @@ CS.RUN >LIBCALL hLIBTCPIP,LIBTCPIP.GETCFG
lda IPCFG+S.NETCFG.DevID
bne CS.RUN.SETUP
>LDYA L.MSG.NODEV
>SYSCALL PutS
lda #MLI.E.NODEV
sec
rts
*--------------------------------------
CS.RUN.SETUP
.1 inc ArgIndex
lda ArgIndex
@ -189,6 +193,7 @@ CS.RUN.SETUP
lda bETC
bpl .6
jsr ETC.ReadFiles
.6 lda bDHCP
@ -237,6 +242,7 @@ CS.RUN.DUMPNIC >PUSHW L.MSG1.DEV
ldy #DCB.NIC+S.DCB.NIC.MAC
ldx #6
.1 lda (pData),y
>PUSHA
iny
@ -252,7 +258,9 @@ CS.RUN.DUMPNIC >PUSHW L.MSG1.DEV
>LDA.G DCB.NIC+S.DCB.NIC.FLAGS
and #S.DCB.NIC.FLAGS.ARPOFFLOAD
beq .2
lda #1
.2 >PUSHA
>PUSHBI 1
@ -266,8 +274,8 @@ CS.RUN.DUMPNIC >PUSHW L.MSG1.DEV
beq .3
lda #1
.3
>PUSHA
.3 >PUSHA
>PUSHBI 1
>SYSCALL PrintF
@ -275,10 +283,11 @@ CS.RUN.DUMPNIC >PUSHW L.MSG1.DEV
>LDA.G DCB.NIC+S.DCB.NIC.LINK
and #S.DCB.NIC.LINK.OK
bne CS.RUN.LINK
>LDYA L.MSG1.LINK.KO
>SYSCALL PutS
bra CS.RUN.DUMPIP
*--------------------------------------
CS.RUN.LINK >LDYA L.MSG1.LINK.OK
>SYSCALL PutS
@ -289,18 +298,23 @@ CS.RUN.LINK >LDYA L.MSG1.LINK.OK
>LDA.G DCB.NIC+S.DCB.NIC.SPEED
and #$0F
tax
.4 phx
lda #'0'
>SYSCALL PutChar
plx
dex
bne .4
>LDA.G DCB.NIC+S.DCB.NIC.LINK
and #S.DCB.NIC.LINK.FD
bne .5
>LDYA L.MSG1.DPLX.HD
bra .6
.5 >LDYA L.MSG1.DPLX.FD
.6 >SYSCALL PutS
CS.RUN.DUMPIP >PUSHW L.MSG2
@ -310,14 +324,18 @@ CS.RUN.DUMPIP >PUSHW L.MSG2
lda IPCFG+S.NETCFG.STATUS
and #S.IPCFG.STATUS.OK
beq .11
>LDYA L.MSG2.C
bra .10
.11 >LDYA L.MSG2.U
.10 >SYSCALL PutS
>PUSHW L.MSG2.DHCPSRVR
ldx #0
.2 >PUSHB IPCFG+S.IPCFG.DHCPSRVR,x
inx
cpx #4
@ -330,10 +348,12 @@ CS.RUN.DUMPIP >PUSHW L.MSG2
>PUSHW L.MSG2.IPMASK
ldx #0 IP/MASK
.3 >PUSHB IPCFG+S.IPCFG.IP,x
inx
cpx #8
bne .3
>PUSHBI 8
>SYSCALL PrintF
@ -341,20 +361,24 @@ CS.RUN.DUMPIP >PUSHW L.MSG2
>PUSHW L.MSG2.GW
ldx #0
.4 >PUSHB IPCFG+S.IPCFG.GW,x
inx
cpx #4
bne .4
>PUSHBI 4
>SYSCALL PrintF
>PUSHW L.MSG2.DNS
ldx #0
.5 >PUSHB IPCFG+S.IPCFG.DNS1,x
inx
cpx #8
bne .5
>PUSHBI 8
>SYSCALL PrintF
@ -365,6 +389,7 @@ CS.RUN.DUMPIP >PUSHW L.MSG2
>PUSHBI 4
>SYSCALL PrintF
lda #0 tell TSKMGR that all done ok, but
sec we do not want to stay in memory
rts

View File

@ -70,6 +70,7 @@ CS.RUN dec bAll
lda ArgIndex
>SYSCALL ArgV
bcs .3
>STYA ZPPtr1
lda (ZPPtr1)
@ -123,14 +124,14 @@ CS.RUN.RTS rts
CS.RUN.PRINT bit bAccess
bpl .1
>LDYA.G ATTR
>LEA.G AttrBuf
>SYSCALL PutS
bcs CS.RUN.RTS
.1 bit bMod
bpl .2
>LDYA.G MOD
>LEA.G MOD
>SYSCALL PutS
bcs CS.RUN.RTS
@ -211,7 +212,7 @@ CS.RUN.DUMP lda ArgFile
>SYSCALL FreeMem
>PUSHW L.MSG.Access
>PUSHEA.G ATTR
>PUSHEA.G AttrBuf
>PUSHBI 2
>SYSCALL PrintF
@ -244,7 +245,7 @@ CS.RUN.CONVERT jsr Access2CSTR
Access2CSTR ldy #S.STAT.P.ACCESS
lda (pData),y
ldy #ATTR+15
ldy #AttrBuf+15
ldx #15
.1 lsr
@ -431,13 +432,12 @@ MSG.U .AZ "%u\r\n"
.OR 0
DS.START
StatBuf .BS S.STAT
ATTR .BS 17
AttrBuf .BS 17
MOD .BS 11 drwxrwxrwx + \0
TIME.Access .BS 20
TIME.Mod .BS 20
TIME.Create .BS 20
DS.END
.ED
DS.END .ED
*--------------------------------------
MAN
SAVE usr/src/bin/stat.s

View File

@ -15,6 +15,7 @@ S.SMB.H.CMD.FLUSH .EQ $05
S.SMB.H.CMD.DELETE .EQ $06
S.SMB.H.CMD.RENAME .EQ $07
S.SMB.H.CMD.SEEK .EQ $12
S.SMB.H.CMD.OPEN.ANDX .EQ $2D
S.SMB.H.CMD.READ.ANDX .EQ $2E
S.SMB.H.CMD.WRITE.ANDX .EQ $2F
S.SMB.H.CMD.TRANS2 .EQ $32

View File

@ -327,12 +327,12 @@ CIFS2.ReadDir.GetBuf
jsr AddA2Ptr1
lda (ZPPtr1) Filename Len
sec
sec +\0
jsr AddA2Ptr2
lda (ZPPtr1) Filename Len
inc
sec
inc +1 skip Filename Len
sec +\0
jsr AddA2Ptr1
dex
@ -363,24 +363,86 @@ CIFS2.ReadDir.FillBuf
.10 lda (ZPRespPtr),y
tax
.1 jsr FileInfo2StatBuf
.1 phx
jsr FileInfo2StatBuf
lda #22
sec skip Filename Len
clc
jsr AddA2Ptr1
ldy #$ff
lda (ZPPtr1)
tax Save Filename Len
inc ZPPtr1 Skip Filename Len
bne .2
inc ZPPtr1+1
.2 ldy #$ff
.3 iny
lda (ZPPtr1),y
sta (ZPPtr2),y
bne .3
tya
txa
sec
jsr AddA2Ptr1
txa
sec
sbc #4 "x.EXT" ?
bcc .7
tay
lda (ZPPtr2),y
cmp #'.'
bne .7
ldx #0
.4 phy Y = '.' offset
phx
.5 lda PRODOS.FT.TXT,x
iny
cmp (ZPPtr2),y
bne .6
inx
txa
and #3
bne .5
pla
lsr
lsr
tax
lda PRODOS.FT.HEX,x
sta StatBuf+S.STAT.P.TYPE
ply
lda #0
sta (ZPPtr2),y
tya
tax
bra .7
.6 pla
clc
adc #4
tax
ply
cpx #PRODOS.FT.END
bne .4
.7 txa
sec +\0
jsr AddA2Ptr2
@ -388,6 +450,7 @@ CIFS2.ReadDir.FillBuf
jsr AddSTAT2Ptr2
.8 plx
dex
bne .1
@ -428,6 +491,11 @@ CIFS2.ChOwn
*--------------------------------------
CIFS.FOpen >STYA pPath resolved path
ldy #2
lda (pStack),y TYPE
jsr ProDOS2TypeLess
jsr GetCtx
ldx #S.SMB.H.CMD.NT.CREATE.ANDX
@ -457,7 +525,6 @@ CIFS.FOpen >STYA pPath resolved path
sta (ZPReqPtr),y
lda #0
ror
iny ByteCountOfs+1
sta (ZPReqPtr),y

View File

@ -557,6 +557,69 @@ CIFS.CallBack bit CIFS.Status
*--------------------------------------
.INB usr/src/lib/libcifs.io.s
*--------------------------------------
TypeLess2ProDOS
*--------------------------------------
ProDOS2TypeLess tax
beq .8
ldx #0
.1 cmp PRODOS.FT.HEX,x
beq .4
inx
cpx #PRODOS.FT.TXT-PRODOS.FT.HEX
bne .1
pha
lsr
lsr
lsr
lsr
ora #$30
cmp #'9'+1
bcc .2
adc #6
.2 sta PRODOS.FT.DFLT+1
pla
and #$0F
ora #$30
cmp #'9'+1
bcc .3
adc #6
.3 sta PRODOS.FT.DFLT+2
.4 txa
asl
asl
tax
ldy #0
.5 iny
lda (pPath),y
bne .5
lda #'.'
sta (pPath),y
iny
.6 lda PRODOS.FT.TXT,x
sta (pPath),y
beq .8
inx
iny
bra .6
.8 rts
*--------------------------------------
GetPFD tax
phx
@ -913,8 +976,6 @@ FreeRespData.RTS
rts
*--------------------------------------
FileInfo2StatBuf
phx
ldx #S.STAT-1
.1 stz StatBuf,x
@ -953,9 +1014,7 @@ FileInfo2StatBuf
lda /S.STAT.MODE.DIR
sta StatBuf+S.STAT.MODE+1
.8 plx
rts
.8 rts
*--------------------------------------
* YYYYYYYM MMM DDDDD
* HHHHHmmm mmm SSSSS
@ -1069,6 +1128,19 @@ CIFS.BADCALL lda #MLI.E.BADCALL
rts
*--------------------------------------
CS.END
PRODOS.FT.HEX .HS 0406FAFCFDE2CBCCCFFF
PRODOS.FT.TXT .AZ "txt"
.AZ "bin"
.AZ "asm"
.AZ "bas"
.AZ "var"
.AZ "atk"
.AZ "pix"
.AZ "fon"
.AZ "pak"
.AZ "sys"
PRODOS.FT.END .EQ *-PRODOS.FT.TXT
PRODOS.FT.DFLT .AZ "$ "
*--------------------------------------
SMBERR01 .DA #2,#3,#32
MLIERR01 .DA #MLI.E.FNOTFND,#MLI.E.PNOTFND,#MLI.E.OPEN

View File

@ -5,7 +5,6 @@ NEW
ArgCount .BS 1
bPause .BS 1
hSrcFile .BS 1
hSrcFullPath .BS 1
Count .BS 2
RC .BS 1
@ -13,8 +12,11 @@ RC .BS 1
.DO X.COPY.TO.DEST=1
hDstFileName .BS 1
hDstFullPath .BS 1
hDstFile .BS 1
bCopy .BS 1
hSrcFile .BS 1
hDstFile .BS 1
hCopyBuf .BS 1
CopyRC .BS 1
.FIN
@ -25,3 +27,5 @@ hToDelete .BS 1
*--------------------------------------
MAN
SAVE usr/src/shared/x.cpmvrm.g
LOAD usr/src/bin/cp.s
ASM