Kernel 0.93+

This commit is contained in:
Rémy GIBERT 2019-10-23 17:12:58 +02:00
parent 5ee518ca8d
commit fe9f2700ec
8 changed files with 124 additions and 70 deletions

Binary file not shown.

Binary file not shown.

View File

@ -109,12 +109,13 @@ Dev.ParseArgs >LDYA ARGS
beq .8 No user MAC specified beq .8 No user MAC specified
>PUSHW L.MAC5 ldx #10
>PUSHW L.MAC4
>PUSHW L.MAC3 .2 >PUSHW L.MAC0,x
>PUSHW L.MAC2 dex
>PUSHW L.MAC1 dex
>PUSHW L.MAC0 bpl .2
>PUSHBI 12 6 x byte PTRs >PUSHBI 12 6 x byte PTRs
>PUSHW L.SSCANF.MAC >PUSHW L.SSCANF.MAC
>LDYA ZPArgPtr >LDYA ZPArgPtr

View File

@ -114,6 +114,7 @@ Dev.ParseArgs >LDYA ARGS
>STYA ZPArgPTR >STYA ZPArgPTR
lda (ZPArgPTR) lda (ZPArgPTR)
bne .1 bne .1
lda A2osX.RANDOM16 lda A2osX.RANDOM16
eor A2osX.TIMER16 eor A2osX.TIMER16
sta DCB+S.DCB.NIC.MAC+3 sta DCB+S.DCB.NIC.MAC+3
@ -123,12 +124,14 @@ Dev.ParseArgs >LDYA ARGS
sta DCB+S.DCB.NIC.MAC+5 sta DCB+S.DCB.NIC.MAC+5
clc clc
rts rts
.1 >PUSHW L.MAC5
>PUSHW L.MAC4 .1 ldx #10
>PUSHW L.MAC3
>PUSHW L.MAC2 .2 >PUSHW L.MAC0,x
>PUSHW L.MAC1 dex
>PUSHW L.MAC0 dex
bpl .2
>PUSHBI 12 6 x byte PTRs >PUSHBI 12 6 x byte PTRs
>PUSHW L.SSCANF.MAC >PUSHW L.SSCANF.MAC
>LDYA ZPArgPtr >LDYA ZPArgPtr

View File

@ -142,12 +142,13 @@ Dev.ParseArgs >LDYA ARGS
clc clc
rts rts
.1 >PUSHW L.MAC5 .1 ldx #10
>PUSHW L.MAC4
>PUSHW L.MAC3 .2 >PUSHW L.MAC0,x
>PUSHW L.MAC2 dex
>PUSHW L.MAC1 dex
>PUSHW L.MAC0 bpl .2
>PUSHBI 12 6 x byte PTRs >PUSHBI 12 6 x byte PTRs
>PUSHW L.SSCANF.MAC >PUSHW L.SSCANF.MAC
>LDYA ZPArgPtr >LDYA ZPArgPtr
@ -186,8 +187,9 @@ ZPBufPtr .EQ ZPDRV+2
Counter .EQ ZPDRV+4 Counter .EQ ZPDRV+4
Offset .EQ ZPDRV+6 Offset .EQ ZPDRV+6
RXTX.Size .EQ ZPDRV+8 RXTX.Size .EQ ZPDRV+8
BUF.Size .EQ ZPDRV+10
.DO U2AI=1 .DO U2AI=1
RX.IP .EQ ZPDRV+10 RX.IP .EQ ZPDRV+12
.FIN .FIN
*-------------------------------------- *--------------------------------------
DRV.CS.START cld DRV.CS.START cld
@ -372,7 +374,7 @@ CLOSE ldx DEVSLOTx0
*-------------------------------------- *--------------------------------------
READWRITE.9 lda #E.NODATA READWRITE.9 lda #E.NODATA
READWRITE.99 plp plp
sec sec
rts rts
*-------------------------------------- *--------------------------------------
@ -403,32 +405,70 @@ READ php
.DO U2AI=1 .DO U2AI=1
ldy #0 ldy #0
.10 lda W5100.DR,x .10 lda W5100.DR,x IPRAW:Get Source IP
sta RX.IP,y sta RX.IP,y
iny iny
cpy #4 cpy #4
bne .10 bne .10
ldy W5100.DR,x get RX.Size HI lda W5100.DR,x get RX.Size HI (not including 6 bytes Header)
sty RXTX.Size+1 sta RXTX.Size+1
eor #$ff
sta Counter+1
lda W5100.DR,x get RX.Size LO lda W5100.DR,x get RX.Size LO
sta RXTX.Size sta RXTX.Size
eor #$ff
sta Counter
eor #$ff
clc clc
adc #S.IP adc #S.IP
pha sta BUF.Size
tya ldy #S.IOCTL.BYTECNT
sta (ZPIOCTL),y
iny
lda RXTX.Size+1
adc /S.IP adc /S.IP
ply sta BUF.Size+1
.ELSE
lda W5100.DR,x get RX.Size HI lda RXTX.Size
clc
adc #6 IPRAW: Add 6 bytes to Total Size
sta RXTX.Size
lda RXTX.Size+1
adc #0
sta RXTX.Size+1 sta RXTX.Size+1
ldy W5100.DR,x get RX.Size LO
sty RXTX.Size .ELSE
lda W5100.DR,x get RX.Size HI (Frame size + 2)
sta RXTX.Size+1
lda W5100.DR,x get RX.Size LO
sta RXTX.Size
ldy #S.IOCTL.BYTECNT
sec
sbc #2 MACRAW:strip 2 bytes Header from Size
sta (ZPIOCTL),y
sta BUF.Size
eor #$ff
sta Counter
iny
lda RXTX.Size+1
sbc #0
sta (ZPIOCTL),y
sta BUF.Size+1
eor #$ff
sta Counter+1
.FIN .FIN
>LDYA BUF.Size
>SYSCALL2 getmem >SYSCALL2 getmem
bcs READWRITE.99 bcs .9
>STYA ZPBufPtr >STYA ZPBufPtr
phx phx
@ -440,39 +480,6 @@ READ php
pla pla
sta (ZPIOCTL),y sta (ZPIOCTL),y
ldy #S.IOCTL.BYTECNT
.DO U2AI=1
lda RXTX.Size
sta (ZPIOCTL),y
eor #$ff
sta Counter
eor #$ff
clc
adc #6 Total Size : Add 6 bytes for IPRAW
sta RXTX.Size
iny
lda RXTX.Size+1
eor #$ff
sta Counter+1
eor #$ff
adc #0
sta RXTX.Size+1
.ELSE
lda RXTX.Size
sec
sbc #2 Header Size : strip 2 bytes for MACRAW
sta (ZPIOCTL),y
eor #$ff
sta Counter
iny
lda RXTX.Size+1
sbc #0
sta (ZPIOCTL),y
eor #$ff
sta Counter+1
.FIN
.DO U2AI=1 .DO U2AI=1
ldx #3 ldx #3
ldy #S.IP.SRC+3 ldy #S.IP.SRC+3
@ -502,7 +509,7 @@ READ php
bne .2 bne .2
inc ZPBufPtr+1 inc ZPBufPtr+1
bne .2 bra .2
.4 >AR.SELECT S0.RX.RD .4 >AR.SELECT S0.RX.RD
@ -526,6 +533,10 @@ READ php
plp plp
clc clc
rts rts
.9 plp
sec
rts
*-------------------------------------- *--------------------------------------
WRITE php WRITE php
sei sei
@ -548,6 +559,7 @@ WRITE php
sta RXTX.Size+1 sta RXTX.Size+1
eor #$ff eor #$ff
sta Counter+1 sta Counter+1
ldx DEVSLOTx0 ldx DEVSLOTx0
>AR.SELECT S0.TX.FSR >AR.SELECT S0.TX.FSR
@ -563,6 +575,7 @@ WRITE php
.DO U2AI=1 .DO U2AI=1
>AR.SELECT S0.DIPR >AR.SELECT S0.DIPR
ldy #S.IP.DST ldy #S.IP.DST
.1 lda (ZPBufPtr),y .1 lda (ZPBufPtr),y
@ -572,6 +585,7 @@ WRITE php
bne .1 bne .1
>AR.SELECT S0.PROTO >AR.SELECT S0.PROTO
ldy #S.IP.PROTOCOL ldy #S.IP.PROTOCOL
lda (ZPBufPtr),y lda (ZPBufPtr),y
sta W5100.DR,x sta W5100.DR,x

View File

@ -45,14 +45,18 @@ FRM.NewIP stx .8+1
>STYA ZPDataOutLen >STYA ZPDataOutLen
cpx #S.IP.PROTOCOL.TCP cpx #S.IP.PROTOCOL.TCP
bne .1 bne .1
lda #S.TCP lda #S.TCP
bra .4 bra .4
.1 cpx #S.IP.PROTOCOL.UDP .1 cpx #S.IP.PROTOCOL.UDP
bne .2 bne .2
lda #S.UDP lda #S.UDP
bra .4 bra .4
.2 lda #S.IP .2 lda #S.IP
bra .4
.4 sta .5+1 save Header len for reset later .4 sta .5+1 save Header len for reset later
clc clc
adc ZPDataOutLen adc ZPDataOutLen
@ -63,6 +67,7 @@ FRM.NewIP stx .8+1
sta ZPFrameOutLen+1 sta ZPFrameOutLen+1
>SYSCALL2 getmem >SYSCALL2 getmem
bcs .9 bcs .9
stx hFrameOut stx hFrameOut
>STYA ZPFrameOutPtr >STYA ZPFrameOutPtr
@ -74,6 +79,7 @@ FRM.NewIP stx .8+1
iny iny
dex dex
bne .6 bne .6
tya tya
* clc * clc
adc ZPFrameOutPtr adc ZPFrameOutPtr
@ -84,6 +90,7 @@ FRM.NewIP stx .8+1
lda IPCFG+S.NETCFG.DevFlags lda IPCFG+S.NETCFG.DevFlags
and #S.DCB.NIC.FLAGS.IPOFFLOAD and #S.DCB.NIC.FLAGS.IPOFFLOAD
bne .7 bne .7
ldy #S.ETH.EII.TYPE ldy #S.ETH.EII.TYPE
lda /S.ETH.EII.TYPE.IP lda /S.ETH.EII.TYPE.IP
sta (ZPFrameOutPtr),y sta (ZPFrameOutPtr),y
@ -107,8 +114,11 @@ FRM.NewIP stx .8+1
ldx IP.ID+1 ldx IP.ID+1
inc inc
bne .61 bne .61
inx inx
stx IP.ID+1 stx IP.ID+1
.61 sta IP.ID .61 sta IP.ID
sta (ZPFrameOutPtr),y sta (ZPFrameOutPtr),y
dey dey

View File

@ -87,11 +87,14 @@ CS.RUN >PUSHBI 0
>LDYA L.MSG.TOPBAR.KO >LDYA L.MSG.TOPBAR.KO
.2 >SYSCALL printf .2 >SYSCALL printf
>PUSHBI 0 >PUSHBI 0
>LDYA L.MSG.KCONF >LDYA L.MSG.KCONF
>SYSCALL printf >SYSCALL printf
>LDYAI A2osX.KCONFIG >LDYAI A2osX.KCONFIG
jsr CS.RUN.DumpConfYA jsr CS.RUN.DumpConfYA
>PUSHBI 0 >PUSHBI 0
>LDYA L.MSG.STATUSBAR >LDYA L.MSG.STATUSBAR
>SYSCALL printf >SYSCALL printf
@ -99,6 +102,7 @@ CS.RUN >PUSHBI 0
CS.RUN.REPaint >PUSHBI 0 CS.RUN.REPaint >PUSHBI 0
>LDYA L.MSG.FCONF >LDYA L.MSG.FCONF
>SYSCALL printf >SYSCALL printf
>LDYA ZPCfgPtr >LDYA ZPCfgPtr
jsr CS.RUN.DumpConfYA jsr CS.RUN.DumpConfYA
@ -150,6 +154,7 @@ CS.RUN.Loop >SYSCALL GetChar
inc inc
sta (ZPCfgPtr),y sta (ZPCfgPtr),y
jmp CS.RUN.REPaint jmp CS.RUN.REPaint
.5 cmp #'1' .5 cmp #'1'
bcc CS.RUN.Loop bcc CS.RUN.Loop
cmp #'8' cmp #'8'
@ -158,10 +163,12 @@ CS.RUN.Loop >SYSCALL GetChar
clc clc
adc #8 adc #8
tay tay
lda (ZPCfgPtr),y lda (ZPCfgPtr),y
eor #$FF eor #$FF
sta (ZPCfgPtr),y sta (ZPCfgPtr),y
jmp CS.RUN.REPaint jmp CS.RUN.REPaint
.8 >PUSHBI 0 .8 >PUSHBI 0
>LDYA L.MSG.QUIT >LDYA L.MSG.QUIT
.9 >SYSCALL printf .9 >SYSCALL printf
@ -200,17 +207,27 @@ CS.RUN.Load >PUSHEA.G StatBuf
>STYA ZPCfgPtr >STYA ZPCfgPtr
* clc * clc
rts rts
.99 >LDYAI 16 .99 >LDYAI 16
>SYSCALL GetMem >SYSCALL GetMem
>STYA ZPCfgPtr >STYA ZPCfgPtr
stx hFileBuf stx hFileBuf
ldy #15 ldy #0
.1 lda A2osX.KCONFIG,y .1 lda A2osX.KCONFIG,y
sta (ZPCfgPtr),y sta (ZPCfgPtr),y
dey iny
bpl .1 cpy #9
bne .1
lda #0
.2 sta (ZPCfgPtr),y
iny
cpy #16
bne .2
sec sec
rts rts
*-------------------------------------- *--------------------------------------
@ -277,6 +294,7 @@ CS.RUN.DumpConfYA
>PUSHBI 1 >PUSHBI 1
>LDYA L.MSG.TTYS >LDYA L.MSG.TTYS
>SYSCALL printf >SYSCALL printf
ldy #9 Slot 1 ldy #9 Slot 1
.1 lda (ZPTmp1),y .1 lda (ZPTmp1),y
ldx #SLOTS.MAX-1 ldx #SLOTS.MAX-1
@ -285,6 +303,7 @@ CS.RUN.DumpConfYA
beq .3 beq .3
dex dex
bne .2 bne .2
.3 phy .3 phy
txa txa
asl asl
@ -348,7 +367,7 @@ MSG.PMODE .AZ " Preemptive Mode : %s\r\n"
MSG.TTYS .AZ " #TTYs : %d\r\n" MSG.TTYS .AZ " #TTYs : %d\r\n"
MSG.ENABLED .AZ "Enabled " MSG.ENABLED .AZ "Enabled "
MSG.DISABLED .AZ "Disabled" MSG.DISABLED .AZ "Disabled"
MSG.SLOT .AZ " Slot #%d : %s\r\n" MSG.SLOT .AZ " Slot #%d : %s\e[K\r\n"
MSG.SLOT.NODEV .AZ "<Enabled>" MSG.SLOT.NODEV .AZ "<Enabled>"
MSG.SLOT.Z80 .AZ "Z80 CPU Board" MSG.SLOT.Z80 .AZ "Z80 CPU Board"
MSG.SLOT.VSD .AZ "SSC Shared Driver for VSDRIVE" MSG.SLOT.VSD .AZ "SSC Shared Driver for VSDRIVE"

View File

@ -21,16 +21,21 @@ AT.INIT >LDYAI MSG.INIT
sta TmpPtr1 sta TmpPtr1
lda #$C7 lda #$C7
sta TmpPtr1+1 sta TmpPtr1+1
.1 ldy #3 .1 ldy #3
.2 lda (TmpPtr1),y .2 lda (TmpPtr1),y
cmp SIG.ATLK,y cmp SIG.ATLK,y
bne .3 bne .3
dey dey
bpl .2 bpl .2
ldy #4 ldy #4
lda (TmpPtr1),y lda (TmpPtr1),y
ldx #0 ldx #0
cmp #1 cmp #1
beq .4 beq .4
ldx #$80 ldx #$80
@ -41,6 +46,7 @@ AT.INIT >LDYAI MSG.INIT
>LDYAI MSG.FAILED >LDYAI MSG.FAILED
jsr PrintFYA jsr PrintFYA
rts rts
.3 dec TmpPtr1+1 .3 dec TmpPtr1+1
lda TmpPtr1+1 lda TmpPtr1+1
cmp #$C0 cmp #$C0
@ -48,6 +54,7 @@ AT.INIT >LDYAI MSG.INIT
>LDYAI MSG.NOHW >LDYAI MSG.NOHW
jsr PrintFYA jsr PrintFYA
rts rts
.4 stx WC.Flag .4 stx WC.Flag
tay tay
lda TmpPtr1+1 lda TmpPtr1+1