Kernel version 0.9 : DevMgr & Device drivers

This commit is contained in:
Rémy GIBERT 2017-01-25 22:46:40 +01:00
parent 748e80b376
commit f06d8b92f2
11 changed files with 90 additions and 24 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -17,7 +17,7 @@ STARTPROC GETTY CON ${A2OSX}SBIN/LOGIN
#STARTPROC GETTY COM2 ${A2OSX}SBIN/LOGIN #STARTPROC GETTY COM2 ${A2OSX}SBIN/LOGIN
#INSDRV PIC.DRV #INSDRV PIC.DRV
# Network Section # Network Section
#INSDRV UTHERNET.DRV 000E3A123456 INSDRV UTHERNET.DRV 000E3A123456
#INSDRV UTHERNET2.DRV 0008DC123456 #INSDRV UTHERNET2.DRV 0008DC123456
#INSDRV UTHER2.AI.DRV 0008DC123456 #INSDRV UTHER2.AI.DRV 0008DC123456
#INSDRV LANCEGS.DRV #INSDRV LANCEGS.DRV

View File

@ -35,6 +35,7 @@ CS.START cld
.DA CS.QUIT .DA CS.QUIT
L.MSG0 .DA MSG0 L.MSG0 .DA MSG0
L.MSG1 .DA MSG1 L.MSG1 .DA MSG1
L.MSG2 .DA MSG2
L.DEV.NAME .DA DEV.NAME L.DEV.NAME .DA DEV.NAME
.DA 0 .DA 0
*-------------------------------------- *--------------------------------------
@ -46,18 +47,22 @@ CS.RUN >LDYA L.MSG0
>LDYAI DevMgr.Table >LDYAI DevMgr.Table
>STYA ZPPTR1 >STYA ZPPTR1
stz DEV.ID stz DEV.ID
.1 lda DEV.ID .1 lda DEV.ID
>SYSCALL GetDevByIDA >SYSCALL GetDevByIDA
bcs .8 bcc .10
>STYA ZPPTR1 jmp .8
.10 >STYA ZPPTR1
ldy #S.DEV.JMP+1 ldy #S.DEV.JMP+1
>PUSHB (ZPPTR1),y >PUSHB (ZPPTR1),y
sta GetDevStatusJmp+2
dey dey
>PUSHB (ZPPTR1),y >PUSHB (ZPPTR1),y
sta GetDevStatusJmp+1
ldy #S.DEV.F ldy #S.DEV.F
lda (ZPPTR1),y lda (ZPPTR1),y
@ -84,16 +89,46 @@ CS.RUN >LDYA L.MSG0
>LDYA L.MSG1 >LDYA L.MSG1
>SYSCALL CPrintFYA >SYSCALL CPrintFYA
bcs .9
jsr GetDevStatus
bcs .7
>STYA ZPPTR2
ldy #S.DEVSTAT.VERSION+1
>PUSHB (ZPPTR2),y
dey
>PUSHB (ZPPTR2),y
lda ZPPTR2
clc
adc #S.DEVSTAT.IDSTRING
tay
lda ZPPTR2+1
adc #0
>PUSHYA
ldy #S.DEVSTAT.SUBTYPE
>PUSHB (ZPPTR2),y
dey
>PUSHB (ZPPTR2),y
>LDYA L.MSG2
>SYSCALL CPrintFYA
bcs .9
.7 lda #13
>SYSCALL PutCA
inc DEV.ID inc DEV.ID
lda ZPPTR1 lda ZPPTR1
clc clc
adc #S.DEV adc #S.DEV
sta ZPPTR1 sta ZPPTR1
bcc .1 bcc .3
inc ZPPTR1+1 inc ZPPTR1+1
bra .1 .3 jmp .1
.8 lda #0 tell TSKMGR that all done ok, but .8 lda #0 tell TSKMGR that all done ok, but
@ -106,9 +141,13 @@ CS.EVENT sec
CS.QUIT clc CS.QUIT clc
rts rts
*-------------------------------------- *--------------------------------------
GetDevStatus ldx #DEVMGR.STATUS
GetDevStatusJmp jmp $ffff
*--------------------------------------
CS.END CS.END
MSG0 >CSTR "ID Status Flags Name Address\n" MSG0 >CSTR "ID Status Flags Name Addr. Typ/Sub IDString Version\n"
MSG1 >CSTR "%03d %b %b %4S $%H\n" MSG1 >CSTR "%03d %b %b %4S $%H "
MSG2 >CSTR "$%h/$%h %16S %03d.%03d"
*-------------------------------------- *--------------------------------------
DEV.ID .BS 1 DEV.ID .BS 1
DEV.NAME .BS 5 DEV.NAME .BS 5

View File

@ -1,6 +1,6 @@
PR#3 PR#3
PREFIX /A2OSX.SRC PREFIX /A2OSX.SRC
NEW LOMEM $A00
INC 1 INC 1
AUTO 6 AUTO 6
.LIST OFF .LIST OFF
@ -800,7 +800,7 @@ STAT .DA #S.DEVSTAT.S.WRITE+S.DEVSTAT.S.READ
>PSTR "ANSI 80c Console" >PSTR "ANSI 80c Console"
.DA #0 .DA #0
.DA #0 .DA #0
.DA 0900 .DA $0900
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE DRV/CONSOLE.DRV.S SAVE DRV/CONSOLE.DRV.S

View File

@ -44,11 +44,12 @@ Dev.Detect >STYA ARGS
ldx #$70 ldx #$70
.1 txa IO based detection, avoid scanning in Disk Controller IO!!!! .1 txa IO based detection, avoid scanning in Disk Controller IO!!!!
asl lsr
asl lsr
asl lsr
asl lsr
tay tay
lda A2osX.SLOTS,y lda A2osX.SLOTS,y
bne .2 bne .2
@ -75,6 +76,14 @@ Dev.Detect >STYA ARGS
rts rts
.3 stx DEVSLOTx0 .3 stx DEVSLOTx0
txa
lsr
lsr
lsr
lsr
tay
lda #A2osX.SLOTS.NET
sta A2osX.SLOTS,y
>LDYAI PP.ID+2 Get Revision# of ths chip... >LDYAI PP.ID+2 Get Revision# of ths chip...
>STYA PacketPagePTR,x >STYA PacketPagePTR,x
@ -130,7 +139,9 @@ DEV.HEADER.NAME .DA #4
*-------------------------------------- *--------------------------------------
* Driver Code * Driver Code
*-------------------------------------- *--------------------------------------
DRV.CS.START .DA STATUS DRV.CS.START cld
jmp (.1,x)
.1 .DA STATUS
.DA READBLOCK .DA READBLOCK
.DA WRITEBLOCK .DA WRITEBLOCK
.DA BADCALL .DA BADCALL
@ -372,11 +383,11 @@ DRV.CS.END
DEVSLOTx0 .BS 1 DEVSLOTx0 .BS 1
Size .BS 2 Size .BS 2
Counter .BS 2 Counter .BS 2
*--------------------------------------
DEVSTAT .DA #S.DEV.S.BLOCK+S.DEV.S.WRITE+S.DEV.S.READ DEVSTAT .DA #S.DEV.S.BLOCK+S.DEV.S.WRITE+S.DEV.S.READ
.BS 3 size .BS 3 size
>PSTR "Uthernet/CS8900A" >PSTR "Uthernet/CS8900A"
.DA #S.DEVSTAT.TYPE.NET .DA #S.DEVSTAT.TYPE.NET
*--------------------------------------
.BS 1 Subtype .BS 1 Subtype
.BS 2 Version .BS 2 Version
*-------------------------------------- *--------------------------------------

View File

@ -137,6 +137,9 @@ A2osX.SLOTS.ATCARD .EQ $82
A2osX.SLOTS.DII .EQ $C0 A2osX.SLOTS.DII .EQ $C0
A2osX.SLOTS.BLK .EQ $C1 A2osX.SLOTS.BLK .EQ $C1
A2osX.SLOTS.SP .EQ $C2 A2osX.SLOTS.SP .EQ $C2
A2osX.SLOTS.COM .EQ $E0
A2osX.SLOTS.XY .EQ $E1
A2osX.SLOTS.NET .EQ $E2
A2osX.SLOTS.DISABLE .EQ $FF A2osX.SLOTS.DISABLE .EQ $FF
*-------------------------------------- *--------------------------------------
H.BIN.HEADER .EQ 0 H.BIN.HEADER .EQ 0

View File

@ -118,7 +118,7 @@ note : '$VAR' does NOT expand Variable
| Mouse.DRV | Working | | 0.8 | | Mouse.DRV | Working | | 0.8 |
| DHGR.DRV | In Progress | except bitblt... | 0.8 | | DHGR.DRV | In Progress | except bitblt... | 0.8 |
| LanCeGS.DRV | Working | | 0.8 | | LanCeGS.DRV | Working | | 0.8 |
| Uthernet.DRV | Working | | 0.8 | | Uthernet.DRV | Working | | 0.9 |
| Uthernet2.DRV | Working | | 0.8 | | Uthernet2.DRV | Working | | 0.8 |
| Uther2.AI.DRV | In Progress | With ARP/IP Offloading | 0.8 | | Uther2.AI.DRV | In Progress | With ARP/IP Offloading | 0.8 |

View File

@ -1,6 +1,6 @@
PR#3 PR#3
PREFIX /A2OSX.SRC PREFIX /A2OSX.SRC
NEW LOMEM $A00
INC 1 INC 1
AUTO 6 AUTO 6
.LIST OFF .LIST OFF
@ -470,6 +470,7 @@ PrintF.SS ldy #$00 PSTR
cpy PADLEN cpy PADLEN
bne .1 bne .1
clc
rts rts
.2 lda PADLEN .2 lda PADLEN

View File

@ -1,6 +1,6 @@
PR#3 PR#3
PREFIX /A2OSX.SRC PREFIX /A2OSX.SRC
NEW LOMEM $A00
INC 1 INC 1
AUTO 6 AUTO 6
.LIST OFF .LIST OFF
@ -9,7 +9,7 @@ DevMgr.SYS.BASL0 .EQ $800
*-------------------------------------- *--------------------------------------
DevMgr.NUL.Code cld DevMgr.NUL.Code cld
jmp (.1,x) jmp (.1,x)
.1 .DA DevMgr.BADCALL STATUS .1 .DA DevMgr.NUL.Status
.DA DevMgr.BADCALL READBLOCK .DA DevMgr.BADCALL READBLOCK
.DA DevMgr.BADCALL WRITEBLOCK .DA DevMgr.BADCALL WRITEBLOCK
.DA DevMgr.BADCALL FORMAT .DA DevMgr.BADCALL FORMAT
@ -22,6 +22,18 @@ DevMgr.NUL.Code cld
.8 clc .8 clc
rts rts
*-------------------------------------- *--------------------------------------
DevMgr.NUL.Status
>LDYAI DevMgr.NUL.Stat
clc
rts
*--------------------------------------
DevMgr.NUL.Stat .DA #S.DEV.S.WRITE+S.DEV.S.READ
.DA #0,#0,#0
>PSTR "NUL DEVICE "
.DA #0
.DA #0
.DA $0900
*--------------------------------------
DevMgr.SYS.Code cld DevMgr.SYS.Code cld
jmp (.1,x) jmp (.1,x)
.1 .DA DevMgr.SYS.Status .1 .DA DevMgr.SYS.Status
@ -40,7 +52,7 @@ DevMgr.BADCALL lda #MLI.ERR.BADCALL
rts rts
*-------------------------------------- *--------------------------------------
DevMgr.SYS.Status DevMgr.SYS.Status
>LDYA DevMgr.SYS.Stat >LDYAI DevMgr.SYS.Stat
clc clc
rts rts
*-------------------------------------- *--------------------------------------
@ -49,7 +61,7 @@ DevMgr.SYS.Stat .DA #S.DEV.S.WRITE+S.DEV.S.READ
>PSTR "A2osX SYS Screen" >PSTR "A2osX SYS Screen"
.DA #0 .DA #0
.DA #0 .DA #0
.DA 0900 .DA $0900
*-------------------------------------- *--------------------------------------
DevMgr.SYS.Open stz DevMgr.SYS.CPULOADI DevMgr.SYS.Open stz DevMgr.SYS.CPULOADI
stz DevMgr.SYS.CH stz DevMgr.SYS.CH