Kernel version 0.8 : DevMgr, moving to SmartPort

This commit is contained in:
Rémy GIBERT 2016-12-05 18:04:42 +01:00
parent 580fac069b
commit 36d95641a8
6 changed files with 80 additions and 39 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -116,10 +116,11 @@ pDevJmp .EQ $BD19
A2osX.ASCREEN .EQ $BEE0 Active Screen
A2osX.SCRNDEVS .EQ $BEE1 -> $BEE4 (4 screen devices)
A2osX.CPUTYPE .EQ $BEE6
A2osX.CPUSPEED .EQ $BEE7 (->255.99 Mhz)
A2osX.CPUTYPE .EQ $BEE5
A2osX.CPUSPEED .EQ $BEE6 (->255.99 Mhz)
A2osX.Z80SLOT .EQ $BEEA
A2osX.Z80SLOT .EQ $BEE7
A2osX.Z80SPEED .EQ $BEE8
A2osX.TIMER16 .EQ $BEEC
A2osX.RANDOM16 .EQ $BEEE
@ -127,6 +128,7 @@ A2osX.RANDOM16 .EQ $BEEE
* $BEF0->$BEFF : Kernel Config Block
*--------------------------------------
A2osX.HZ .EQ $BEF0
A2osX.SLOTS .EQ $BEF8 $BEF9->$BEFF, 7 slots
*--------------------------------------
H.BIN.HEADER .EQ 0
H.BIN.HEADER.DRV65 .EQ $4CD8 6502:cld,jmp abs

View File

@ -61,6 +61,8 @@ DevMgr.SYS.Select
sta SET80DISP
sta CLR80STORE
sta SETPAGE2
lda #2
sta A2osX.ASCREEN
clc
rts
*--------------------------------------

View File

@ -5,20 +5,20 @@ INC 1
AUTO 6
.LIST OFF
*--------------------------------------
Kernel.Init3 jsr K.DevMgrInit
bcs *
Kernel.Init3 ldx #S.DEV*DevMgr.Count
.1 lda DevMgr.NUL-1,x
sta DevMgr.Table-1,x
dex
bne .1
stz DevMgr.Table+S.DEV*DevMgr.Count
lda #1 SYS device
>SYSCALL GetDevByIDA
>STYA pDev
ldx #DEVMGR.OPEN
jsr pDevJmp
ldx #DEVMGR.SELECT
jsr pDevJmp
lda #2
sta A2osX.ASCREEN
>LDYAI MSG.Init3
>SYSCALL CPrintFYA
@ -33,6 +33,11 @@ Kernel.Init3 jsr K.DevMgrInit
jsr K.MemMgrInit
bcs *
>LDYAI MSG.DEV
>SYSCALL CPrintFYA
jsr K.DevMgrInit
bcs *
>LDYAI MSG.EVT
>SYSCALL CPrintFYA
jsr K.EvtMgrInit
@ -84,24 +89,6 @@ Kernel.Init3 jsr K.DevMgrInit
>SYSCALL CPrintFYA
bra * No need to discard Expanded CMDLINE
*--------------------------------------
* K.DevMgrInit
*--------------------------------------
K.DevMgrInit ldx #S.DEV*DevMgr.Count
.1 lda DevMgr.NUL-1,x
sta DevMgr.Table-1,x
dex
bne .1
stz DevMgr.Table+S.DEV*DevMgr.Count
* >LDYAI DevMgr.LoMem Hard Coded
* >STYA DevMgr.Free
* lda #DevMgr.Count-1
* sta DevMgr.LastDevID
clc
rts
*--------------------------------------
DevMgr.NUL cld
jmp (DevMgr.NUL.Code,x)
.DA #0 DevID=0
@ -168,7 +155,60 @@ K.MemMgrInit >LDYAI MemMgr.MHiMem
clc
rts
*--------------------------------------
* K.EvtMgrInit
K.DevMgrInit stz ZPQuickPtr1
lda #$C1
sta ZPQuickPtr1+1
.1 ldx #SmartPort.SIG-SmartPort.OFS-1
.2 ldy SmartPort.OFS,x Check if there is a smartport firmware
lda (ZPQuickPtr1),y
cmp SmartPort.SIG,x
bne .3 not a smartport...
dex
bpl .2
*SmartPort!!!
jsr K.DevMgrInit.AddDev
bra .7
* Disk II, or Block device ?
.3 dex if x=0, only first SIG byte failed
bpl .8
ldy #$ff
lda (ZPQuickPtr1),y
beq .4 $0, Disk II, 16sect
inc
beq .8 $ff, Disk II, 13sect
dec
.4
.7 lda ZPQuickPtr1+1
and #$0f
tax
lda #$80
sta A2osX.SLOTS,x
.8 inc ZPQuickPtr1+1
lda ZPQuickPtr1+1
cmp #$C8
bne .1
clc
rts
*--------------------------------------
K.DevMgrInit.AddCtrl
rts
*--------------------------------------
K.DevMgrInit.AddDev
rts
*--------------------------------------
SmartPort.OFS .HS 07010305
SmartPort.SIG .HS 00200003
*--------------------------------------
K.EvtMgrInit
* lda #10
@ -190,14 +230,10 @@ K.EvtMgrInit
clc
rts
*--------------------------------------
* K.FltMgrInit
*--------------------------------------
K.FltMgrInit stz FltMgr.Table
clc
rts
*--------------------------------------
* K.TskMgrInit
*--------------------------------------
K.TskMgrInit stz TSKMGR.LASTID
lda #1
sta TSKMGR.SIZE One Slot Busy (Kernel PS=0)
@ -281,11 +317,12 @@ I.ENV.DRV >PSTR "DRV=${A2OSX}DRV/"
STARTUP.CMDLINE >PSTR "${A2OSX}SBIN/SHELL ${A2OSX}A2osX.STARTUP"
*--------------------------------------
MSG.Init3 >CSTR "A2osX[Stage3]:Init\n"
MSG.IRQ >CSTR " - Interrupt Manager...\n"
MSG.MEM >CSTR " - Memory Manager...\n"
MSG.EVT >CSTR " - Event Manager...\n"
MSG.FLT >CSTR " - Path Filter...\n"
MSG.TSK >CSTR " - Task Manager...\n"
MSG.IRQ >CSTR "-Interrupt Manager...\n"
MSG.MEM >CSTR "-Memory Manager...\n"
MSG.DEV >CSTR "-Device Manager...\n"
MSG.EVT >CSTR "-Event Manager...\n"
MSG.FLT >CSTR "-Path Filter...\n"
MSG.TSK >CSTR "-Task Manager...\n"
MSG.Prefix >CSTR "Prefix:%S\n"
MSG.Startup >CSTR "Executing Kernel Startup Script...\nCmd:%S\n"
MSG.StartupErr >CSTR "Failed : [$%h]\n"