Kernel 0.9.2

This commit is contained in:
Rémy GIBERT 2018-08-26 11:06:04 +02:00
parent b76dbeafb2
commit 2803696706
3 changed files with 131 additions and 72 deletions

View File

@ -11,6 +11,7 @@ U2AI .EQ 1
.INB INC/NIC.I .INB INC/NIC.I
.INB INC/NIC.W5100.I .INB INC/NIC.W5100.I
.INB INC/ETH.I .INB INC/ETH.I
.INB INC/LIBTCPIP.I
.INB /A2OSX.SRC/DRV/X.U2.DRV.S .INB /A2OSX.SRC/DRV/X.U2.DRV.S
*-------------------------------------- *--------------------------------------
MAN MAN

View File

@ -1,65 +0,0 @@
NEW
PREFIX /A2OSX.BUILD
AUTO 4,1
.LIST OFF
*--------------------------------------
DecodeMac ldy #0
ldx #0
.1 lda (ZPTmpPTR),y
beq .9
iny
jsr Asc2NibbleA
bcs .9
asl
asl
asl
asl
sta MAC,x
lda (ZPTmpPTR),y
beq .9
iny
jsr Asc2NibbleA
bcs .9
ora MAC,x
sta MAC,x
inx
cpx #6
bne .1
clc
rts
.9 sec
rts
*--------------------------------------
Asc2NibbleA cmp #'0'
bcc .9
cmp #'9'+1
bcs .1
and #$0F
* clc
rts
.1 cmp #'A'
bcc .9
cmp #'F'+1
bcs .99
sbc #$36
clc
rts
.9 sec
.99 rts
*--------------------------------------
MAN
SAVE /A2OSX.SRC/DRV/X.NET.DRV.S
LOAD /A2OSX.SRC/DRV/UTHERNET.DRV.S
ASM

View File

@ -295,9 +295,51 @@ OPEN jsr CLOSE
sta W5100.DR,x ...for Socket TX Buffers sta W5100.DR,x ...for Socket TX Buffers
>AR.SELECT S0.MR >AR.SELECT S0.MR
.DO U2AI=1
lda #W5100.AR.S0.MR.IPRAW+W5100.AR.S0.MR.MF
.ELSE
lda #W5100.AR.S0.MR.MACRAW+W5100.AR.S0.MR.MF lda #W5100.AR.S0.MR.MACRAW+W5100.AR.S0.MR.MF
.FIN
sta W5100.DR,x sta W5100.DR,x
.DO U2AI=1
>AR.SELECT S0.TOS
stz W5100.DR,x
* >AR.SELECT S0.TTL
lda #K.IP.TTL
sta W5100.DR,x
>AR.SELECT GAR
ldy #0
.2 lda DCB+S.DCB.NIC.GW,y
sta W5100.DR,x
iny
cpy #4
bne .2
* >AR.SELECT SUBR Implicit, next to GAR
ldy #0
.3 lda DCB+S.DCB.NIC.MASK,y
sta W5100.DR,x
iny
cpy #4
bne .3
>AR.SELECT SIPR
ldy #0
.4 lda DCB+S.DCB.NIC.IP,y
sta W5100.DR,x
iny
cpy #4
bne .4
.FIN
>AR.SELECT S0.CR >AR.SELECT S0.CR
lda #W5100.AR.S0.CR.OPEN lda #W5100.AR.S0.CR.OPEN
sta W5100.DR,x sta W5100.DR,x
@ -351,11 +393,32 @@ READ php
tya tya
sta W5100.AR+1,x sta W5100.AR+1,x
.DO U2AI=1
ldy #0
.10 lda W5100.DR,x
sta RX.IP,y
iny
cpy #4
bne .10
ldy W5100.DR,x get RX.Size HI
sty RXTX.Size+1
lda W5100.DR,x get RX.Size LO
sta RXTX.Size
clc
adc #S.IP
pha
tya
adc /S.IP
ply
.ELSE
lda W5100.DR,x get RX.Size HI lda W5100.DR,x get RX.Size HI
sta RXTX.Size+1 sta RXTX.Size+1
ldy W5100.DR,x get RX.Size LO ldy W5100.DR,x get RX.Size LO
sty RXTX.Size sty RXTX.Size
.FIN
>SYSCALL getmem >SYSCALL getmem
bcs .9 bcs .9
@ -372,9 +435,28 @@ READ php
ldy #S.IOCTL.BYTECNT 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 lda RXTX.Size
sec sec
sbc #2 Header Size sbc #2 Header Size : strip 2 bytes for MACRAW
sta (ZPIOCTL),y sta (ZPIOCTL),y
eor #$ff eor #$ff
sta Counter sta Counter
@ -386,11 +468,25 @@ READ php
sta (ZPIOCTL),y sta (ZPIOCTL),y
eor #$ff eor #$ff
sta Counter+1 sta Counter+1
.FIN
.DO U2AI=1
ldx #3
ldy #S.IP.SRC+3
.11 lda RX.IP,x
sta (ZPBufPtr),y
dey
dex
bpl .11
ldy #S.IP
.ELSE
ldy #0
.FIN
ldx DEVSLOTx0 ldx DEVSLOTx0
ldy #0
.2 inc Counter .2 inc Counter
bne .3 bne .3
inc Counter+1 inc Counter+1
@ -432,20 +528,27 @@ WRITE php
>STYA ZPIOCTL >STYA ZPIOCTL
ldx DEVSLOTx0
ldy #S.IOCTL.BYTECNT ldy #S.IOCTL.BYTECNT
lda (ZPIOCTL),y lda (ZPIOCTL),y
.DO U2AI=1
sec
sbc #S.IP
.FIN
sta RXTX.Size sta RXTX.Size
eor #$ff eor #$ff
sta Counter sta Counter
iny iny
lda (ZPIOCTL),y lda (ZPIOCTL),y
.DO U2AI=1
sbc /S.IP
.FIN
sta RXTX.Size+1 sta RXTX.Size+1
eor #$ff eor #$ff
sta Counter+1 sta Counter+1
ldx DEVSLOTx0
>AR.SELECT S0.TX.FSR >AR.SELECT S0.TX.FSR
lda W5100.DR,x get send size HI lda W5100.DR,x get send size HI
@ -467,6 +570,21 @@ WRITE.1 ldy #S.IOCTL.BUFPTR
lda (ZPIOCTL),y lda (ZPIOCTL),y
sta ZPBufPtr+1 sta ZPBufPtr+1
.DO U2AI=1
>AR.SELECT S0.DIPR
ldy #S.IP.DST
.1 lda (ZPBufPtr),y
sta W5100.DR,x
iny
cpy #S.IP.DST+4
bne .1
>AR.SELECT S0.PROTO
ldy #S.IP.PROTOCOL
lda (ZPBufPtr),y
sta W5100.DR,x
.ELSE
ldy #S.ETH.SRCMAC+5 ldy #S.ETH.SRCMAC+5
ldx #5 ldx #5
@ -477,6 +595,7 @@ WRITE.1 ldy #S.IOCTL.BUFPTR
bpl .1 bpl .1
ldx DEVSLOTx0 ldx DEVSLOTx0
.FIN
>AR.SELECT S0.TX.WR >AR.SELECT S0.TX.WR
lda W5100.DR,x Get HI lda W5100.DR,x Get HI
@ -489,7 +608,11 @@ WRITE.1 ldy #S.IOCTL.BUFPTR
sta W5100.AR+1,x Write LO sta W5100.AR+1,x Write LO
sta Offset sta Offset
.DO U2AI=1
ldy #S.IP
.ELSE
ldy #0 ldy #0
.FIN
.2 inc Counter .2 inc Counter
bne .3 bne .3