mirror of
https://github.com/A2osX/A2osX.git
synced 2025-01-25 12:30:06 +00:00
Kernel 0.93+
This commit is contained in:
parent
70357a5547
commit
8737f2669d
Binary file not shown.
@ -15,7 +15,7 @@ AUTO 4,1
|
||||
.INB INC/NET.HTTP.I
|
||||
*--------------------------------------
|
||||
RESP.BUFSIZE .EQ 1024
|
||||
TIMEOUT.MAX .EQ 200 20 sec.
|
||||
TIMEOUT.MAX .EQ 50 5 sec.
|
||||
*--------------------------------------
|
||||
.DUMMY
|
||||
.OR ZPBIN
|
||||
|
@ -50,11 +50,14 @@ Dev.Detect >STYA ARGS
|
||||
>SYSCALL puts
|
||||
ldx #$70
|
||||
ldy #7
|
||||
|
||||
.1 lda A2osX.S,y IO based detection, avoid scanning in Disk Controller IO!!!!
|
||||
bne .2
|
||||
|
||||
lda L91C96.BSR+1,x
|
||||
cmp #DEVID
|
||||
beq .3
|
||||
|
||||
.2 dec FD.DEV.NAME+3
|
||||
txa
|
||||
sec
|
||||
@ -62,32 +65,38 @@ Dev.Detect >STYA ARGS
|
||||
tax
|
||||
dey
|
||||
bne .1
|
||||
|
||||
>LDYA L.MSG.DETECT.KO
|
||||
>SYSCALL puts
|
||||
|
||||
lda #MLI.E.NODEV
|
||||
sec
|
||||
rts
|
||||
|
||||
.3 stx DEVSLOTx0
|
||||
sty DEVSLOT0x
|
||||
|
||||
jsr Dev.ParseArgs
|
||||
bcs .9
|
||||
|
||||
.8 >PUSHW L.FD.DEV.NAME
|
||||
>PUSHBI 2
|
||||
>LDYA L.MSG.DETECT.OK
|
||||
>SYSCALL printf
|
||||
|
||||
>PUSHWI DRV.END
|
||||
>PUSHWI DRV.CS.END-DRV.CS.START
|
||||
>PUSHWI DRV.CS.START
|
||||
>LDYA L.DRV.CS.START
|
||||
>SYSCALL InsDrv
|
||||
bcs .9
|
||||
|
||||
>STYA FD.DEV+S.FD.DEV.DRVPTR
|
||||
>PUSHW L.FD.DEV.NAME
|
||||
>LDYA L.FD.DEV
|
||||
>SYSCALL MKDEV
|
||||
bcs .9
|
||||
|
||||
ldx DEVSLOT0x
|
||||
lda #A2osX.S.NIC
|
||||
sta A2osX.S,x
|
||||
@ -125,7 +134,7 @@ Dev.ParseArgs >LDYA ARGS
|
||||
CS.END
|
||||
ARGS .BS 2
|
||||
MSG.DETECT .AZ "LanCeGS/SMSC91C96 Driver."
|
||||
MSG.DETECT.OK .AZ "LanCeGS/SMSC91C96 Installed As Device : %S\r\n"
|
||||
MSG.DETECT.OK .AZ "LanCeGS/SMSC91C96 Installed As Device : %s\r\n"
|
||||
MSG.DETECT.KO .AZ "Hardware Not Found."
|
||||
SSCANF.MAC .AZ "%h:%h:%h:%h:%h:%h"
|
||||
*--------------------------------------
|
||||
@ -158,7 +167,6 @@ DRV.CS.START cld
|
||||
.DA CLOSE
|
||||
.DA READ
|
||||
.DA WRITE
|
||||
.DA A2osX.BADCALL IRQ
|
||||
.DA 0 end or relocation
|
||||
*--------------------------------------
|
||||
STATUS >STYA ZPIOCTL
|
||||
@ -168,6 +176,7 @@ STATUS >STYA ZPIOCTL
|
||||
beq .1
|
||||
cmp #S.IOCTL.STATCODE.GETDIB
|
||||
bne STATUS.DCB
|
||||
|
||||
ldx #S.DIB-1
|
||||
.HS 2C bit abs
|
||||
.1 ldx #3
|
||||
@ -178,12 +187,16 @@ STATUS >STYA ZPIOCTL
|
||||
iny
|
||||
lda (ZPIOCTL),y
|
||||
sta .3+2
|
||||
|
||||
.2 lda DIB,x
|
||||
|
||||
.3 sta $ffff,x SELF MODIFIED
|
||||
dex
|
||||
bpl .2
|
||||
|
||||
clc
|
||||
rts
|
||||
|
||||
STATUS.DCB cmp #S.IOCTL.STATCODE.GETDCB
|
||||
bne STATUS.9
|
||||
|
||||
@ -206,13 +219,16 @@ STATUS.DCB cmp #S.IOCTL.STATCODE.GETDCB
|
||||
|
||||
lda #S.DCB.NIC.LINK.FD
|
||||
tsb DCB+S.DCB.NIC.LINK
|
||||
|
||||
.1 ldy #S.IOCTL.BUFPTR
|
||||
lda (ZPIOCTL),y
|
||||
sta .4+1
|
||||
iny
|
||||
lda (ZPIOCTL),y
|
||||
sta .4+2
|
||||
|
||||
ldx #S.DCB.NIC-1
|
||||
|
||||
.3 lda DCB,x
|
||||
.4 sta $ffff,x SELF MODIFIED
|
||||
dex
|
||||
@ -220,6 +236,7 @@ STATUS.DCB cmp #S.IOCTL.STATCODE.GETDCB
|
||||
|
||||
clc
|
||||
rts
|
||||
|
||||
STATUS.9 lda #MLI.E.BADCTL
|
||||
sec
|
||||
rts
|
||||
@ -227,6 +244,7 @@ STATUS.9 lda #MLI.E.BADCTL
|
||||
OPEN lda #S.DIB.S.OPENED
|
||||
bit DIB+S.DIB.S
|
||||
bne .9
|
||||
|
||||
jsr CLOSE
|
||||
|
||||
* ldx DEVSLOTx0 Done by CLOSE
|
||||
@ -239,6 +257,7 @@ OPEN lda #S.DIB.S.OPENED
|
||||
sta L91C96.0.RCR,x
|
||||
lda /L91C96.0.RCR.NOCRC+L91C96.0.RCR.RXENA+L91C96.0.RCR.ALLMUL
|
||||
sta L91C96.0.RCR+1,x
|
||||
|
||||
lda #1
|
||||
sta L91C96.BSR,x
|
||||
lda #L91C96.1.CR.NOWAIT
|
||||
@ -256,6 +275,7 @@ OPEN lda #S.DIB.S.OPENED
|
||||
iny
|
||||
cpy #6
|
||||
bne .1
|
||||
|
||||
bra .3
|
||||
|
||||
.2 lda S.DCB.NIC.MAC,y
|
||||
@ -264,6 +284,7 @@ OPEN lda #S.DIB.S.OPENED
|
||||
iny
|
||||
cpy #6
|
||||
bne .2
|
||||
|
||||
.3 ldx DEVSLOTx0
|
||||
lda #L91C96.1.CTR.DEFAULT+L91C96.1.CTR.AUTOREL
|
||||
sta L91C96.1.CTR,x
|
||||
@ -277,17 +298,24 @@ OPEN lda #S.DIB.S.OPENED
|
||||
rts
|
||||
*--------------------------------------
|
||||
CLOSE ldx DEVSLOTx0
|
||||
|
||||
stz L91C96.BSR,x
|
||||
|
||||
lda #L91C96.0.RCR.RESET
|
||||
sta L91C96.0.RCR,x
|
||||
lda /L91C96.0.RCR.RESET
|
||||
sta L91C96.0.RCR+1,x
|
||||
|
||||
lda $C019 we can use VBL as we are not on //c
|
||||
|
||||
.1 eor $C019
|
||||
bpl .1
|
||||
|
||||
lda $C019
|
||||
|
||||
.2 eor $C019
|
||||
bpl .2
|
||||
|
||||
stz L91C96.0.RCR,x
|
||||
stz L91C96.0.RCR+1,x
|
||||
clc
|
||||
@ -297,17 +325,16 @@ READ php
|
||||
sei
|
||||
|
||||
>STYA ZPIOCTL
|
||||
|
||||
ldx DEVSLOTx0
|
||||
|
||||
lda #2
|
||||
sta L91C96.BSR,x
|
||||
|
||||
lda L91C96.2.IST,x
|
||||
and #L91C96.2.IST.RCV
|
||||
bne .1
|
||||
lda #E.NODATA
|
||||
.9 plp
|
||||
sec
|
||||
rts
|
||||
beq READWRITE.9
|
||||
|
||||
.1 lda #L91C96.2.PTR.RCVD+L91C96.2.PTR.AUTOI+L91C96.2.PTR.READ
|
||||
sta L91C96.2.PTR,x
|
||||
lda /L91C96.2.PTR.RCVD+L91C96.2.PTR.AUTOI+L91C96.2.PTR.READ
|
||||
@ -321,26 +348,32 @@ READ php
|
||||
asl if odd, CS
|
||||
lda L91C96.2.DATA,x get lo byte count
|
||||
sbc #5 compute Size
|
||||
sta Size
|
||||
pha
|
||||
|
||||
ldy #S.IOCTL.BYTECNT
|
||||
sta (ZPIOCTL),y
|
||||
eor #$ff
|
||||
sta Counter
|
||||
|
||||
lda L91C96.2.DATA,x get hi byte count
|
||||
sbc #0
|
||||
sta Size+1
|
||||
iny
|
||||
sta (ZPIOCTL),y
|
||||
eor #$ff
|
||||
sta Counter+1
|
||||
eor #$ff
|
||||
ply
|
||||
|
||||
ply Y,A = Size
|
||||
|
||||
>SYSCALL2 getmem
|
||||
bcs .9
|
||||
bcs READWRITE.99
|
||||
|
||||
>STYA ZPBufPtr
|
||||
|
||||
phx
|
||||
|
||||
phy
|
||||
|
||||
ldy #S.IOCTL.BUFPTR+1
|
||||
sta (ZPIOCTL),y
|
||||
dey
|
||||
@ -349,39 +382,53 @@ READ php
|
||||
ldx DEVSLOTx0
|
||||
|
||||
ldy #0
|
||||
|
||||
.2 inc Counter
|
||||
bne .21
|
||||
inc Counter+1
|
||||
beq .4
|
||||
|
||||
.21 lda L91C96.2.DATA,x
|
||||
sta (ZPBufPtr),y
|
||||
iny
|
||||
bne .3
|
||||
|
||||
inc ZPBufPtr+1
|
||||
|
||||
.3 inc Counter
|
||||
bne .31
|
||||
inc Counter+1
|
||||
beq .4
|
||||
|
||||
.31 lda L91C96.2.DATA,x
|
||||
sta (ZPBufPtr),y
|
||||
iny
|
||||
bne .2
|
||||
|
||||
inc ZPBufPtr+1
|
||||
bra .2
|
||||
|
||||
.4 lda #L91C96.2.MMUCR.REMREL
|
||||
sta L91C96.2.MMUCR,x
|
||||
|
||||
.8 pla hMem
|
||||
|
||||
plp
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
READWRITE.9 lda #E.NODATA
|
||||
|
||||
READWRITE.99 plp
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
WRITE php
|
||||
sei
|
||||
>STYA ZPIOCTL
|
||||
|
||||
ldx DEVSLOTx0
|
||||
|
||||
lda #2
|
||||
sta L91C96.BSR,x
|
||||
|
||||
@ -395,27 +442,30 @@ WRITE php
|
||||
adc #6 3 WORDs more Status, len & Control
|
||||
|
||||
bne .10
|
||||
|
||||
clc LO byte is 0, no need for an extra empty page
|
||||
|
||||
.10 iny
|
||||
lda (ZPIOCTL),y
|
||||
sta Size+1
|
||||
eor #$ff
|
||||
sta Counter+1
|
||||
eor #$ff
|
||||
|
||||
adc #0
|
||||
.1 ora #L91C96.2.MMUCR.ALLOC
|
||||
sta L91C96.2.MMUCR,x
|
||||
|
||||
ldy #0
|
||||
|
||||
.2 lda L91C96.2.IST,x
|
||||
and #L91C96.2.IST.ALLOC
|
||||
bne .3
|
||||
|
||||
dey
|
||||
bne .2
|
||||
lda #E.NODATA
|
||||
.9 plp
|
||||
sec
|
||||
rts
|
||||
|
||||
bra READWRITE.9
|
||||
|
||||
.3 lda L91C96.2.AAR,x
|
||||
sta L91C96.2.PNR,x
|
||||
@ -429,8 +479,10 @@ WRITE php
|
||||
iny
|
||||
lda (ZPIOCTL),y
|
||||
sta ZPBufPtr+1
|
||||
|
||||
ldy #S.ETH.SRCMAC+5 Add Src MAC Address
|
||||
ldx #5
|
||||
|
||||
.4 lda S.DCB.NIC.MAC,x
|
||||
sta (ZPBufPtr),y
|
||||
dey
|
||||
@ -440,29 +492,39 @@ WRITE php
|
||||
ldx DEVSLOTx0
|
||||
stz L91C96.2.DATA,x write fake status word
|
||||
stz L91C96.2.DATA,x
|
||||
|
||||
lda Size
|
||||
pha
|
||||
eor #$01
|
||||
lsr
|
||||
pla
|
||||
|
||||
adc #$05 add 5 if odd, 6 if even
|
||||
sta L91C96.2.DATA,x
|
||||
|
||||
lda Size+1
|
||||
adc #$00
|
||||
sta L91C96.2.DATA,x
|
||||
|
||||
ldy #2
|
||||
|
||||
.5 inc Counter
|
||||
bne .51
|
||||
inc Counter+1
|
||||
beq .70
|
||||
|
||||
.51 lda (ZPBufPtr),y
|
||||
iny
|
||||
bne .6
|
||||
|
||||
inc ZPBufPtr+1
|
||||
|
||||
.6 inc Counter
|
||||
bne .61
|
||||
|
||||
inc Counter+1
|
||||
beq .71
|
||||
|
||||
.61 sta L91C96.2.DATA,x
|
||||
lda (ZPBufPtr),y
|
||||
sta L91C96.2.DATA,x
|
||||
@ -470,15 +532,19 @@ WRITE php
|
||||
bne .5
|
||||
inc ZPBufPtr+1
|
||||
bra .5
|
||||
|
||||
.70 lda #0
|
||||
sta L91C96.2.DATA,x
|
||||
sta L91C96.2.DATA,x
|
||||
bra .8
|
||||
|
||||
.71 sta L91C96.2.DATA,x
|
||||
lda #%00100000 signal an extra (odd) byte
|
||||
sta L91C96.2.DATA,x
|
||||
|
||||
.8 lda #L91C96.2.MMUCR.NQPKT
|
||||
sta L91C96.2.MMUCR,x
|
||||
|
||||
plp
|
||||
clc
|
||||
rts
|
||||
|
@ -107,8 +107,8 @@ Dev.Detect >STYA ARGS
|
||||
ldx DEVSLOT0x
|
||||
lda #A2osX.S.NIC
|
||||
sta A2osX.S,x
|
||||
* clc.9
|
||||
rts
|
||||
* clc
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
Dev.ParseArgs >LDYA ARGS
|
||||
>STYA ZPArgPTR
|
||||
|
Loading…
x
Reference in New Issue
Block a user