CIFSD:new code

DAN2ETH.DRV:working
This commit is contained in:
burniouf 2023-01-17 07:31:23 +01:00
parent b5e7bafb21
commit eaa728fa9f
16 changed files with 1668 additions and 1858 deletions

View File

@ -137,10 +137,9 @@ Create a hDEV
# ReadDir
## C
`int readdir (int hDIR, S.DIRENT * dirent);`
`struct dirent *readdir (short int hDIR);`
## ASM
`>PUSHW dirent`
`lda hDIR`
`>SYSCALL readdir`

Binary file not shown.

Binary file not shown.

View File

@ -28,17 +28,15 @@ IO.8255.S.ByteRcvd .EQ %00100000
IO.8255.Mode .EQ $C083-$88
*--------------------------------------
.MA READBYTE
:1 inc $600+37
lda IO.8255.S,x
and #IO.8255.S.ByteRcvd
lda #IO.8255.S.ByteRcvd
:1 bit IO.8255.S,x
beq :1
lda IO.8255.Data,x
.EM
.MA WRITEBYTE
sta IO.8255.Data,x
:1 inc $600+38
bit IO.8255.S,x
:1 bit IO.8255.S,x
bpl :1
.EM
*--------------------------------------
@ -319,10 +317,6 @@ OPEN lda #S.DIB.S.OPENED
>READBYTE
beq .8
lda #"!
sta $600+30
lda #MLI.E.IO
sec
rts
@ -330,9 +324,6 @@ OPEN lda #S.DIB.S.OPENED
.8 lda #S.DIB.S.OPENED
tsb DIB+S.DIB.S
lda #"O
sta $600+30
clc
rts
@ -357,8 +348,6 @@ READ php
>STYA ZPIOCTL
jsr DEBUG.ClrR
ldx DEVSLOTx0
lda #IO.8255.Cmd.PFX
@ -370,9 +359,6 @@ READ php
lda /1514
>WRITEBYTE
lda #"R
sta $600+32
>READBYTE
ldy #S.IOCTL.BYTECNT
sta (ZPIOCTL),y
@ -408,9 +394,6 @@ READ php
ldx DEVSLOTx0
lda #"R
sta $600+33
ldy #0
.2 inc Counter
@ -443,8 +426,6 @@ WRITE php
sei
>STYA ZPIOCTL
jsr DEBUG.ClrW
ldx DEVSLOTx0
lda #IO.8255.Cmd.PFX
@ -485,16 +466,9 @@ WRITE php
inc ZPBufPtr+1
bra .1
.8
lda #"W
sta $600+35
>READBYTE
.8 >READBYTE
bne WRITE.99
lda #"W
sta $600+36
plp
clc
rts
@ -504,20 +478,6 @@ WRITE.99 lda #MLI.E.IO
sec
rts
*--------------------------------------
DEBUG.ClrR lda #"R
sta $600+31
lda #"?
sta $600+32
sta $600+33
rts
*--------------------------------------
DEBUG.ClrW lda #"W
sta $600+34
lda #"?
sta $600+35
sta $600+36
rts
*--------------------------------------
DRV.CS.END
DEVSLOTx0 .BS 1
*--------------------------------------

View File

@ -467,6 +467,7 @@ S.FD.PFT .EQ 1
*--------------------------------------
S.FD.REG.REF .EQ 2
S.FD.REG.IOBUF .EQ 3
S.FD.REG.FPOS .EQ 4 dword
*
S.FD.REG .EQ 16
*--------------------------------------

View File

@ -1,12 +0,0 @@
NEW
AUTO 3,1
.LIST OFF
*--------------------------------------
LIBCIFS.Negotiate .EQ 4
LIBCIFS.SessionSetup .EQ 6
LIBCIFS.TreeConnect .EQ 8
LIBCIFS.Mount .EQ 10
LIBCIFS.UMount .EQ 12
*--------------------------------------
MAN
SAVE inc/libcifs.i

File diff suppressed because it is too large Load Diff

351
SBIN/CIFSD.S.CORE.txt Normal file
View File

@ -0,0 +1,351 @@
NEW
AUTO 3,1
*--------------------------------------
CORE.ReqT2SetupX
ldx #S.SMB.H.CMD.TRANS2
jsr CORE.ReqSetupX
ldx #0
.1 lda SMB.Trans2.H,x
sta (ZPReqPtr),y
iny
inx
cpx #SMB.Trans2.H.Len
bne .1
rts
*--------------------------------------
CORE.ReqSetupX phx
lda hReq
>SYSCALL2 GetMemPtr
>STYA ZPReqPtr
lda hSMBContext
>SYSCALL2 GetMemPtr
>STYA ZPCtxPtr
ldy #0
.1 lda (ZPCtxPtr),y
cpy #S.NETBIOS+S.SMB.H.CMD
bne .2
pla
.2 sta (ZPReqPtr),y
iny
cpy #S.NETBIOS+S.SMB.H
bne .1
rts
*--------------------------------------
CORE.ReqSetupPtr2
sty ByteCountOfs
lda #0
sta (ZPReqPtr),y Reset ByteCount
iny
sta (ZPReqPtr),y
iny +2 for ByteCount
CORE.ReqT2SetupPtr2
sty ZPReqLen
stz ZPReqLen+1
tya
clc
adc ZPReqPtr
sta ZPPtr2
lda ZPReqPtr+1
adc #0
sta ZPPtr2+1
rts
*--------------------------------------
CORE.PutBytePtr2
sta (ZPPtr2)
inc ZPPtr2
bne .1
inc ZPPtr2+1
.1 inc ZPReqLen
bne .8
inc ZPReqLen+1
.8 rts
*--------------------------------------
CORE.AppendPathPtr2BF4
lda #$04 BufferFormat
jsr CORE.PutBytePtr2
CORE.AppendPathPtr2
ldx #0
ldy #$ff
.1 iny
lda (pPath),y
beq .4
.2 cmp #'/'
bne .3
lda #'\'
.3 sta (ZPPtr2),y
tax
bra .1
.4 cpx #'\'
bne .5
dey
.5 sta (ZPPtr2),y A = 0
rts
*--------------------------------------
CORE.AppendTypePtr2
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
lda #'.'
sta (ZPPtr2),y
iny
.6 lda PRODOS.FT.TXT,x
sta (ZPPtr2),y
beq .8
inx
iny
bra .6
.8 rts
*--------------------------------------
CORE.Add2ByteCount
ldy ByteCountOfs
clc
adc (ZPReqPtr),y
sta (ZPReqPtr),y
iny ByteCountOfs+1
lda #0
adc (ZPReqPtr),y
sta (ZPReqPtr),y
rts
*--------------------------------------
CORE.AddYReqLenPtr2
tya
sec +1 for \0
adc ZPPtr2
sta ZPPtr2
bcc CORE.AddYReqLen
inc ZPPtr2+1
*--------------------------------------
CORE.AddYReqLen tya
sec +1 for \0
adc ZPReqLen
sta ZPReqLen
bcc .8
inc ZPReqLen+1
.8 rts
*--------------------------------------
CORE.AppendPath ldx #0
.1 lda (pPath)
beq .4
inc pPath
bne .2
inc pPath+1
.2 cmp #'/'
bne .3
lda #'\'
.3 sta (ZPReqPtr),y
tax
iny
bra .1
.4 cpx #'\'
bne .5
dey
.5 rts
*--------------------------------------
CORE.SetT2ReqLenYA
sty ZPReqLen
sta ZPReqLen+1
CORE.SetT2ReqLen
lda ZPReqLen
sec
sbc #S.NETBIOS+S.SMB.H+SMB.Trans2.H.Len+7
ldy #S.NETBIOS+S.SMB.H+1
sta (ZPReqPtr),y
ldy #S.NETBIOS+S.SMB.H+19
sta (ZPReqPtr),y
inc
inc
inc
ldy #S.NETBIOS+S.SMB.H+SMB.Trans2.H.Len+2
sta (ZPReqPtr),y
*--------------------------------------
CORE.SetReqLen lda ZPReqLen
sec
sbc #S.NETBIOS
ldy #S.NETBIOS.LEN+2
sta (ZPReqPtr),y
lda ZPReqLen+1
sec
sbc /S.NETBIOS
dey
sta (ZPReqPtr),y
rts
*--------------------------------------
CORE.GetRespData
sta hResp
>SYSCALL2 GetMemPtr
pha
tya
* clc
adc #S.TCP
sta ZPRespPtr
pla
adc /S.TCP
sta ZPRespPtr+1
rts
*--------------------------------------
CORE.GetRespDataPtr1
ldy #S.NETBIOS+S.SMB.H+15 Data Offset
lda (ZPRespPtr),y
clc
adc ZPRespPtr
tax
iny
lda (ZPRespPtr),y
adc ZPRespPtr+1
pha
txa
clc
adc #S.NETBIOS
sta ZPPtr1
pla
adc /S.NETBIOS
sta ZPPtr1+1
rts
*--------------------------------------
CORE.CheckSMBStatus
ldy #S.NETBIOS+S.SMB.H.STATUS
lda (ZPRespPtr),y
clc
beq CORE.FreeRespData.RTS
stz CIFS.Status
cmp #2 SRV
bcs .9
iny
iny
lda (ZPRespPtr),y ERR CODE
ldx #MLIERR01-SMBERR01
.1 cmp SMBERR01-1,x
beq .2 CS
dex
bne .1
.9 lda #MLI.E.IO
sec
bra CORE.FreeRespData
.2 lda MLIERR01-1,x
*--------------------------------------
CORE.FreeRespData
php
pha
lda hResp
beq .8
stz hResp
>SYSCALL2 FreeMem
.8 pla
plp
CORE.FreeRespData.RTS
rts
*--------------------------------------
MAN
SAVE usr/src/sbin/cifsd.s.core
LOAD usr/src/sbin/cifsd.s
ASM

255
SBIN/CIFSD.S.INIT.txt Normal file
View File

@ -0,0 +1,255 @@
NEW
AUTO 3,1
*--------------------------------------
INIT.Setup >LDYAI 512
>SYSCALL GetMem
bcs .9
stx hReq
jsr INIT.Negotiate
bcs .9
jsr INIT.SessionSetup
bcs .9
lda #2
>SYSCALL ArgV
>STYA pPath
jsr INIT.TreeConnect
bcs .9
lda #3
>SYSCALL ArgV
>PUSHYA
>PUSHW L.IO.CallBack
>SYSCALL Mount
bcs .9
sta hMount
* clc
.9 rts
*--------------------------------------
INIT.Negotiate >PUSHB hSocket
>PUSHW L.NETBIOS.H
>PUSHWI SMB.NegReq.end-NETBIOS.H
>LIBCALL hLIBTCPIP,LIBTCPIP.Send
bcs .99
jsr INIT.ReadSocket
bcs .99
jsr CORE.GetRespData
ldy #S.NETBIOS+S.SMB.H.STATUS
lda (ZPRespPtr),y
bne .97
ldy #S.NETBIOS.LEN+2
lda (ZPRespPtr),y
clc
adc #S.NETBIOS
sta ZPPtr1
tay
lda #0
>SYSCALL GetMem
bcs .99
>STYA ZPCtxPtr
stx hSMBContext
ldy ZPPtr1
.4 dey
lda (ZPRespPtr),y
sta (ZPCtxPtr),y
tya
bne .4
ldy #S.NETBIOS+S.SMB.H.FLAGS
sta (ZPCtxPtr),y
jsr CORE.FreeRespData
clc
rts
.97 jsr CORE.FreeRespData
lda #MLI.E.INVPARAM
sec
.99 rts
*--------------------------------------
INIT.SessionSetup
ldx #S.SMB.H.CMD.SESSION.SETUP.ANDX
jsr CORE.ReqSetupX
ldx #0
.2 lda SMB.SessionSetup.H,x
sta (ZPReqPtr),y
iny
inx
cpx #SMB.SessionSetup.H.Len
bne .2
jsr CORE.ReqSetupPtr2
ldy #0
ldx #0
.3 lda SMB.SessionSetup.Guest,x
jsr CORE.PutBytePtr2
iny
inx
cpx #SMB.SessionSetup.Guest.Len
bne .3
ldx #0
.4 lda SMB.SessionSetup.T,x
jsr CORE.PutBytePtr2
iny
inx
cpx #SMB.SessionSetup.T.Len
bne .4
tya
ldy ByteCountOfs
sta (ZPReqPtr),y
jsr CORE.SetReqLen
jsr INIT.WriteSocket
bcs .99
jsr INIT.ReadSocket
bcs .99
jsr CORE.GetRespData
ldy #S.NETBIOS+S.SMB.H.STATUS
lda (ZPRespPtr),y
bne .97
ldy #S.NETBIOS+S.SMB.H.UID
lda (ZPRespPtr),y
sta (ZPCtxPtr),y
iny
lda (ZPRespPtr),y
sta (ZPCtxPtr),y
jsr CORE.FreeRespData
clc
rts
.97 jsr CORE.FreeRespData
.98 lda #MLI.E.LOCKED
sec
.99 rts
*--------------------------------------
INIT.TreeConnect
ldx #S.SMB.H.CMD.TREE.CONNECT.ANDX
jsr CORE.ReqSetupX
ldx #0
.1 lda SMB.TreeConnect.H,x
sta (ZPReqPtr),y
iny
inx
cpx #SMB.TreeConnect.H.Len
bne .1
jsr CORE.ReqSetupPtr2
lda #0
jsr CORE.PutBytePtr2 PASSWORD = "\0"
jsr CORE.AppendPathPtr2
jsr CORE.AddYReqLenPtr2
iny + \0 from password
ldx #0
.4 lda SMB.TreeConnect.T,x
jsr CORE.PutBytePtr2
iny
inx
cpx #SMB.TreeConnect.T.Len
bne .4
tya
ldy ByteCountOfs
sta (ZPReqPtr),y
jsr CORE.SetReqLen
jsr INIT.WriteSocket
bcs .99
jsr INIT.ReadSocket
bcs .99
jsr CORE.GetRespData
ldy #S.NETBIOS+S.SMB.H.STATUS
lda (ZPRespPtr),y
bne .97
ldy #S.NETBIOS+S.SMB.H.TID
lda (ZPRespPtr),y
sta (ZPCtxPtr),y
iny
lda (ZPRespPtr),y
sta (ZPCtxPtr),y
.8 jsr CORE.FreeRespData
clc
rts
.97 jsr CORE.FreeRespData
.98 lda #MLI.E.IO
sec
.99 rts
*--------------------------------------
INIT.ReadSocket lda #TIMEOUT.MAX
sta TimeOut
.1 >SLEEP
lda hSocket
>LIBCALL hLIBTCPIP,LIBTCPIP.Recv
bcc .99
cmp #E.NODATA
sec
bne .99
lda TimeOut
bne .1
lda #MLI.E.OFFLINE
.99 rts
*--------------------------------------
INIT.WriteSocket
>PUSHB hSocket
>PUSHW ZPReqPtr
>PUSHW ZPReqLen
>LIBCALL hLIBTCPIP,LIBTCPIP.Send
rts
*--------------------------------------
MAN
SAVE usr/src/sbin/cifsd.s.init
LOAD usr/src/sbin/cifsd.s
ASM

File diff suppressed because it is too large Load Diff

View File

@ -9,11 +9,12 @@ AUTH .EQ 0
*--------------------------------------
.INB inc/macros.i
.INB inc/a2osx.i
.INB inc/kernel.i
.INB inc/mli.e.i
.INB inc/eth.i
.INB inc/libtcpip.i
.INB inc/net.tcpip.i
.INB inc/net.smb.i
.INB inc/libcifs.i
.DO AUTH
.INB inc/libcrypt.i
.FIN
@ -25,11 +26,16 @@ TIMEOUT.MAX .EQ 250 25 sec.
.DUMMY
.OR ZPBIN
ZS.START
ZPIPCfgPtr .BS 2
hSocket .BS 1
TimeOut .BS 1
hSMBContext .BS 1
hMount .BS 1
ZPCtxPtr .BS 2
ZPReqPtr .BS 2
ZPReqLen .BS 2
ZPRespPtr .BS 2
ZPPtr1 .BS 2
ZPPtr2 .BS 2
pPath .BS 2
pFD .BS 2
ZS.END .ED
*--------------------------------------
* File Header (16 Bytes)
@ -53,7 +59,6 @@ CS.START cld
.DA CS.DOEVENT
.DA CS.QUIT
L.LIBTCPIP .DA LIBTCPIP
L.LIBCIFS .DA LIBCIFS
.DO AUTH
L.LIBCRYPT .DA LIBCRYPT
.FIN
@ -63,6 +68,120 @@ L.MSG.UNKNOWN .DA MSG.UNKNOWN
L.MSG.CONNECTED .DA MSG.CONNECTED
L.MSG.NOCONN .DA MSG.NOCONN
L.MSG.MOUNTED .DA MSG.MOUNTED
*--------------------------------------
L.NETBIOS.H .DA NETBIOS.H
L.IO.CallBack .DA IO.CallBack
*--------------------------------------
J.IO.Q .DA A2osX.BADCALL
.DA IO.Q.ChMod
.DA IO.Q.FStat
.DA IO.Q.Stat
.DA IO.Q.MKDir
.DA A2osX.BADCALL MKNod
.DA A2osX.BADCALL MKFIFO
.DA A2osX.BADCALL Pipe
.DA IO.Q.OpenDir
.DA IO.Q.ReadDir
.DA IO.Q.CloseDir
.DA A2osX.BADCALL Open
.DA A2osX.BADCALL Close
.DA A2osX.BADCALL Read
.DA A2osX.BADCALL Write
.DA IO.Q.ChOwn
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA IO.Q.FOpen
.DA IO.Q.FClose
.DA IO.Q.FRead
.DA IO.Q.FWrite
.DA IO.Q.FFlush
.DA IO.Q.FSeek
.DA IO.Q.FTell
.DA IO.Q.FEOF
.DA IO.Q.Remove
.DA IO.Q.Rename
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA IO.Q.ChTyp
.DA IO.Q.ChAux
.DA IO.Q.SetAttr
*--------------------------------------
J.IO.R .DA A2osX.BADCALL
.DA IO.R.ChMod
.DA IO.R.FStat
.DA IO.R.Stat
.DA IO.R.MKDir
.DA A2osX.BADCALL MKNod
.DA A2osX.BADCALL MKFIFO
.DA A2osX.BADCALL Pipe
.DA A2osX.BADCALL IO.R.OpenDir
.DA IO.R.ReadDir
.DA A2osX.BADCALL IO.R.CloseDir
.DA A2osX.BADCALL Open
.DA A2osX.BADCALL Close
.DA A2osX.BADCALL Read
.DA A2osX.BADCALL Write
.DA IO.R.ChOwn
.DA A2osX.BADCALL FPutC...
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL ...UngetC
.DA IO.R.FOpen
.DA IO.R.FClose
.DA IO.R.FRead
.DA IO.R.FWrite
.DA IO.R.FFlush
.DA A2osX.BADCALL IO.R.FSeek
.DA A2osX.BADCALL IO.R.FTell
.DA IO.R.FEOF
.DA IO.R.Remove
.DA IO.R.Rename
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA IO.R.ChTyp
.DA IO.R.ChAux
.DA IO.R.SetAttr
.DA 0
*--------------------------------------
* Called once at process creation
@ -73,12 +192,8 @@ CS.INIT >LDYA L.LIBTCPIP
bcs .9
sta hLIBTCPIP
>LDYA L.LIBCIFS
>SYSCALL LoadLib
bcs .9
sta hLIBCIFS
>SYSCALL2 GetMemPtr
>STYA pLIBTCPIP
.DO AUTH
>LDYA L.LIBCRYPT
@ -88,63 +203,26 @@ CS.INIT >LDYA L.LIBTCPIP
sta hLIBCRYPT
.FIN
* clc
.9
CS.INIT.RTS rts
.9 rts
*--------------------------------------
* Called until exit with CS
* if RUN exits with CC, RUN entered again
*--------------------------------------
CS.RUN lda hSocket
beq .1
bne .8
lda #0
clc
rts
.1 jsr CS.RUN.CheckTCPIP
bcs CS.INIT.RTS
jsr CS.RUN.CheckTCPIP
bcs .9
jsr CS.RUN.CheckArgs
bcs CS.INIT.RTS
bcs .9
jsr CS.RUN.Connect
bcs CS.INIT.RTS
>PUSHB hSocket
>PUSHBI 0
>LIBCALL hLIBCIFS,LIBCIFS.Negotiate
bcs CS.INIT.RTS
sta hSMBContext
>PUSHB hSocket
>PUSHB hSMBContext
>PUSHWZ
>PUSHWZ
>PUSHWZ
>PUSHBI 0
>LIBCALL hLIBCIFS,LIBCIFS.SessionSetup
bcs CS.INIT.RTS
>PUSHB hSocket
>PUSHB hSMBContext
lda #2
>SYSCALL ArgV
>PUSHYA
>PUSHBI 0
>LIBCALL hLIBCIFS,LIBCIFS.TreeConnect
bcs .9
>PUSHB hSocket
>PUSHB hSMBContext
lda #3
>SYSCALL ArgV
>PUSHYA
>LIBCALL hLIBCIFS,LIBCIFS.Mount
jsr INIT.Setup
bcs .9
sta hMount
>PUSHW L.MSG.MOUNTED
lda #2
@ -158,7 +236,7 @@ CS.RUN lda hSocket
>PUSHBI 4
>SYSCALL PrintF
lda #0
.8 lda #0
clc
.9 rts
*--------------------------------------
@ -166,8 +244,8 @@ CS.RUN.CheckTCPIP
>LIBCALL hLIBTCPIP,LIBTCPIP.GETCFG is TCPIP loaded ?
bcs .9
>STYA ZPIPCfgPtr
lda (ZPIPCfgPtr) Configured ?
>STYA ZPPtr1
lda (ZPPtr1) Configured ?
bmi .1
>LDYA L.MSG.TCPIPERR
@ -183,7 +261,7 @@ CS.RUN.CheckTCPIP
ldy #S.IPCFG.IP+3
.3 lda (ZPIPCfgPtr),y
.3 lda (ZPPtr1),y
pha
dey
cpy #S.IPCFG.IP-1
@ -320,13 +398,15 @@ CS.QUIT lda hMount
>LIBCALL hLIBTCPIP,LIBTCPIP.Shutdown
.2
.DO AUTH
.2 lda hSMBContext
beq .3
>SYSCALL FreeMem
.3 .DO AUTH
lda hLIBCRYPT
jsr .7
.FIN
lda hLIBCIFS
jsr .7
lda hLIBTCPIP
.7 beq .8
@ -335,6 +415,10 @@ CS.QUIT lda hMount
.8 clc
rts
*--------------------------------------
.INB usr/src/sbin/cifsd.s.init
.INB usr/src/sbin/cifsd.s.core
.INB usr/src/sbin/cifsd.s.io
*--------------------------------------
CS.END
*--------------------------------------
@ -342,8 +426,7 @@ CS.END
*--------------------------------------
LIBTCPIP .AZ "libtcpip"
hLIBTCPIP .BS 1
LIBCIFS .AZ "libcifs"
hLIBCIFS .BS 1
pLIBTCPIP .BS 2
.DO AUTH
LIBCRYPT .AZ "libcrypt"
hLIBCRYPT .BS 1
@ -355,6 +438,249 @@ MSG.UNKNOWN .CZ "CIFSD:%s: Unknown host\r\n"
MSG.NOCONN .CZ "CIFSD:No Connection To %s\r\n"
MSG.CONNECTED .CZ "CIFSD:Connected To %s\r\n"
MSG.MOUNTED .CZ "CIFSD:%s Mounted As %s\r\n"
*--------------------------------------
PRODOS.FT.HEX .HS 0406FAFCFDCBCCCFFF
PRODOS.FT.TXT .AZ "txt"
.AZ "bin"
.AZ "asm"
.AZ "bas"
.AZ "var"
.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
*--------------------------------------
NETBIOS.H .DA #0 DIRECT TCP TRANSPORT
.DA #0 24 BITS LENGTH
.DA /SMB.NegReq.end-SMB.H
.DA #SMB.NegReq.end-SMB.H
*--------------------------------------
SMB.H .DA #$FF
.AS "SMB"
.DA #S.SMB.H.CMD.NEGOTIATE
.HS 00000000
.DA #0 S.SMB.H.FLAGS
.DA S.SMB.H.FLAGS2.LONGNAMES
.DA 0 PIDHI
.HS 0000000000000000 SECFEAT
.DA 0 RSVD
.DA $FFFF TID
.DA $FFFE PIDLO
.BS 2 UID
.DA 0 MID
*--------------------------------------
SMB.NegReq .DA #0 WORD COUNT
.DA #SMB.NegReq.end-2-* ByteCount
.DA #0
* .DA #2
* .AZ "PC NETWORK PROGRAM 1.0"
* .DA #2
* .AZ "LANMAN1.0"
* .DA #2
* .AZ "Windows for Workgroups 3.1a"
* .DA #2
* .AZ "LM1.2X002"
* .DA #2
* .AZ "LANMAN2.1"
.DA #2
.AZ "NT LM 0.12"
* .DA #2
* .AZ "SMB 2.002"
* .DA #2
* .AZ "SMB 2.???"
SMB.NegReq.end .EQ *
*--------------------------------------
SMB.SessionSetup.H
.DA #13 WORD COUNT
.HS FF000000 NO MORE CMD
.DA 1280 MAX BUFFER
.DA 2 MAX MPX COUNT
.HS 0000 VC NUMBER
.HS 00000000 SESSION KEY
.BS 2 CI PASS LEN (ANSI)
.DA 0 CS PASS LEN (UNICODE)
.HS 00000000
.HS 00000000 CAPABILITIES
SMB.SessionSetup.H.Len .EQ *-SMB.SessionSetup.H
* .BS 2 ByteCount
SMB.SessionSetup.Guest
* .AZ "" Password
.AZ "Guest" Account Name
.AZ "?" Primary Domain
SMB.SessionSetup.Guest.Len .EQ *-SMB.SessionSetup.Guest
SMB.SessionSetup.T
.AZ "A2osX" Native OS
.AZ "A2osX-CIFSD" Native LANMAN
SMB.SessionSetup.T.Len .EQ *-SMB.SessionSetup.T
*--------------------------------------
SMB.TreeConnect.H
.DA #4 WORD COUNT
.HS FF000000 NO MORE CMD
.DA 0
.DA 1 PASSWORD LEN (1 for "\0")
SMB.TreeConnect.H.Len .EQ *-SMB.TreeConnect.H
* .BS 2 ByteCount
* .AZ "" PASSWORD
* .AZ "_temp" PATH
SMB.TreeConnect.T
.AZ "A:" Disk Share
SMB.TreeConnect.T.Len .EQ *-SMB.TreeConnect.T
*--------------------------------------
SMB.ComCreate.H .DA #24 WORD COUNT
.HS FF000000 NO MORE CMD
.HS 00 Reserved
.BS 2 NameLength
.HS 00000000 Flags
.HS 00000000 RootDirectoryFID
.HS 00000010 DesiredAccess = GENERIC_ALL
.HS 0000000000000000 AllocationSize
.HS 00000000 ExtFileAttributes
.HS 00000000 ShareAccess
.BS 4 CreateDisposition
.HS 00000000 CreateOptions
.HS 00000000 ImpersonationLevel
.HS 00 SecurityFlags
SMB.ComCreate.H.Len .EQ *-SMB.ComCreate.H
* .BS 2 ByteCount
* .AZ "path\file"
*--------------------------------------
SMB.ComClose.H .DA #3 WORD COUNT
.BS 2 FID
.HS 00000000 LastTimeModified
.HS 0000 ByteCount
SMB.ComClose.H.Len .EQ *-SMB.ComClose.H
*--------------------------------------
SMB.ComFlush.H .DA #1 WORD COUNT
.BS 2 FID
.HS 0000 ByteCount
SMB.ComFlush.H.Len .EQ *-SMB.ComFlush.H
*--------------------------------------
SMB.ComDelete.H .DA #1 WORD COUNT
.HS 0000 SearchAttributes
SMB.ComDelete.H.Len .EQ *-SMB.ComDelete.H
* .BS 2 ByteCount
* .HS 04 BufferFormat
* .AZ "path\file"
*--------------------------------------
SMB.ComRename.H .DA #1 WORD COUNT
.HS 0000 SearchAttributes
SMB.ComRename.H.Len .EQ *-SMB.ComRename.H
* .BS 2 ByteCount
* .HS 04 BufferFormat
* .AZ "oldpath"
* .HS 04 BufferFormat
* .AZ "newpath"
*--------------------------------------
SMB.ComRead.H .DA #10 WORD COUNT
.HS FF000000 NO MORE CMD
.BS 2 FID
.BS 4 Offset
.BS 2 MaxCountOfBytesToReturn
.HS 0000 MinCountOfBytesToReturn
.HS 00000000 Timeout
.HS 0000 Remaining
SMB.ComRead.H.Len .EQ *-SMB.ComRead.H
* .BS 2 ByteCount
*--------------------------------------
SMB.ComWrite.H .DA #12 WORD COUNT
.HS FF000000 NO MORE CMD
.BS 2 FID
.BS 4 Offset
.HS 00000000 Timeout
.HS 0000
* .HS 0100 WriteMode=WritethroughMode
.HS 0000 Remaining
.HS 0000 Reserved
.BS 2 DataLength
.DA S.SMB.H+SMB.ComWrite.H.Len+2 DataOffset (+2 skip ByteCount)
SMB.ComWrite.H.Len .EQ *-SMB.ComWrite.H
* .BS 2 ByteCount
* DATA.....
*--------------------------------------
SMB.Trans2.H .DA #15 WORD COUNT
.BS 2 TotalParamCount
.DA 0 TotalDataCount
.DA 10 MaxParameterCount
.DA 450 MaxDataCount
.DA #0 MaxSetupCount
.HS 00 Reserved1
.DA 0 Flags
.HS 00000000 Timeout
.HS 0000 Reserved2
.BS 2 ParameterCount
.DA 68 ParameterOffset
.HS 0000 DataCount
.HS 0000 DataOffset
.DA #1 SetupCount
.HS 00 Reserved3
SMB.Trans2.H.Len .EQ *-SMB.Trans2.H
*--------------------------------------
SMB.FindFirst2 .DA 1 TRANS2_FIND_FIRST2
.BS 2 PrmCnt
.HS 000000 Padding
.DA $0037 SearchAttributes
.DA 1024 SearchCount
.DA 2 Flags
.DA SMB_INFO_STANDARD InformationLevel
.HS 00000000 SearchStorageType
* .AZ "path\*"
SMB.FindFirst2.Len .EQ *-SMB.FindFirst2
*--------------------------------------
SMB.FindNext2 .DA 2 TRANS2_FIND_NEXT2
.BS 2 PrmCnt
.HS 000000 Padding
.BS 2 SID
.DA 1024 SearchCount
.DA SMB_INFO_STANDARD InformationLevel
.HS 00000000 ResumeKey
.DA 2+8 Flags
* .AZ "path\*"
SMB.FindNext2.Len .EQ *-SMB.FindNext2
*--------------------------------------
SMB.QueryPathInfo
.DA 5 TRANS2_QUERY_PATH_INFORMATION
.BS 2 PrmCnt
.HS 000000 Padding
.DA SMB_INFO_STANDARD InformationLevel
.HS 00000000 SearchStorageType
* .AZ "filename"
SMB.QueryPathInfo.Len .EQ *-SMB.QueryPathInfo
*--------------------------------------
SMB.CreateDirectory
.DA 13 TRANS2_CREATE_DIRECTORY
.BS 2 PrmCnt
.HS 000000 Padding
.HS 00000000 Reserved
* .AZ "DirName"
SMB.CreateDirectory.Len .EQ *-SMB.CreateDirectory
*--------------------------------------
CIFS.Status .BS 1
CIFS.PID .BS 1
CIFS.Cnt .BS 2
*--------------------------------------
hSocket .BS 1
hSMBContext .BS 1
hMount .BS 1
hReq .BS 1
hResp .BS 1
hBuf .BS 1
hFD .BS 1
hFILE .BS 1
TimeOut .BS 1
bFlag .BS 1
ByteCountOfs .BS 1
StatBuf .BS S.STAT
SaveYA .BS 2
SaveZP .BS ZS.END-ZS.START
*--------------------------------------
.DUMMY
.OR 0

View File

@ -73,9 +73,8 @@ CS.INIT
dex
bpl .2
.99 >PUSHW L.MSG.USAGE
>PUSHBI 0
>SYSCALL PrintF
.99 >LDYA L.MSG.USAGE
>SYSCALL PutS
lda #E.SYN
sec
rts

View File

@ -25,9 +25,8 @@ K.OpenDir jsr PFT.CheckPathYA
*/--------------------------------------
* # ReadDir
* ## C
* `int readdir (int hDIR, S.DIRENT * dirent);`
* `struct dirent *readdir (short int hDIR);`
* ## ASM
* `>PUSHW dirent`
* `lda hDIR`
* `>SYSCALL readdir`
* ## RETURN VALUE

View File

@ -465,7 +465,6 @@ CPU.Init >PUSHWI MSG.CPU
stz A2osX.CPUSPEED+1
ldx A2osX.HZ
ldy #0
php
@ -481,29 +480,31 @@ CPU.Init >PUSHWI MSG.CPU
.2 lda VBL //e : wait VBL low
bmi .2
.3 pha (3)
pla (4)
pha (3)
pla (4)
pha (3)
pla (4)
pha (3)
.3 ldx A2osX.HZ
.4 pha (3)
pla (4)
nop
nop
nop
pha (3)
pla (4)
dex
bne .4
iny
cpy #100
bne .5
ldy #0
inc A2osX.CPUSPEED+1
ldy #0
.5 eor VBL (4)
bpl .3 (2*)
.5 eor VBL
bpl .3
dex
bne .3
lda VBL
bmi .3
bra CPU.InitOK
*--------------------------------------
@ -522,14 +523,14 @@ CPU.Init2c lda RDIOUDIS
bit IO.IIC.CLRVBLIRQ clear //c IRQ
.3 lda #60
.3 ldx A2osX.HZ
.4 pha (3)
pla (4)
pha (3)
pla (4)
dec
dex
bne .4
iny
@ -544,9 +545,6 @@ CPU.Init2c lda RDIOUDIS
bit IO.IIC.CLRVBLIRQ clear //c IRQ
dex
bne .3
pla Disable VBLIRQ ?
bpl .8

View File

@ -366,14 +366,14 @@ K.FreeMem.ERR >PUSHWI .1
tya hMem n Y
>PUSHA
* >DEBUG
ldy #S.PS.PID
lda (pPS),y
>PUSHA
>PUSHBI 2
>SYSCALL2 printf
* >DEBUG
lda #E.INVH
sec
rts