2016-08-28 20:48:01 +00:00
|
|
|
|
PR#3
|
|
|
|
|
PREFIX /A2OSX.SRC
|
2017-03-15 16:44:15 +00:00
|
|
|
|
LOMEM $A00
|
2016-08-28 20:48:01 +00:00
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
*--------------------------------------
|
2017-03-15 16:44:15 +00:00
|
|
|
|
Kernel.Init3 sta SETALTZP
|
|
|
|
|
bit RRAMWRAMBNK1
|
|
|
|
|
bit RRAMWRAMBNK1
|
|
|
|
|
|
|
|
|
|
jsr MemMgrInit
|
2017-01-12 17:43:45 +00:00
|
|
|
|
jsr PS0Init
|
|
|
|
|
bcs *
|
2016-08-28 20:48:01 +00:00
|
|
|
|
>LDYAI MSG.Init3
|
2016-11-03 16:23:16 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2016-08-28 20:48:01 +00:00
|
|
|
|
|
2017-03-02 22:14:04 +00:00
|
|
|
|
>LDYAI MSG.DEV
|
2016-11-03 16:23:16 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2017-03-02 22:14:04 +00:00
|
|
|
|
jsr DevMgrInit
|
2016-09-29 15:30:15 +00:00
|
|
|
|
bcs *
|
|
|
|
|
|
2017-03-02 22:14:04 +00:00
|
|
|
|
>LDYAI MSG.IRQ
|
2016-12-05 17:04:42 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2017-03-02 22:14:04 +00:00
|
|
|
|
jsr IrqMgrInit
|
2016-12-05 17:04:42 +00:00
|
|
|
|
bcs *
|
|
|
|
|
|
2016-09-29 15:30:15 +00:00
|
|
|
|
>LDYAI MSG.EVT
|
2016-11-03 16:23:16 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2017-01-12 17:43:45 +00:00
|
|
|
|
jsr EvtMgrInit
|
2016-09-29 15:30:15 +00:00
|
|
|
|
bcs *
|
|
|
|
|
|
|
|
|
|
>LDYAI MSG.FLT
|
2016-11-03 16:23:16 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2017-01-12 17:43:45 +00:00
|
|
|
|
jsr FltMgrInit
|
2016-09-29 15:30:15 +00:00
|
|
|
|
bcs *
|
|
|
|
|
|
|
|
|
|
>LDYAI MSG.TSK
|
2016-11-03 16:23:16 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2017-01-12 17:43:45 +00:00
|
|
|
|
jsr TskMgrInit
|
2016-09-29 15:30:15 +00:00
|
|
|
|
bcs *
|
|
|
|
|
|
2016-08-28 20:48:01 +00:00
|
|
|
|
ldy #S.PS.hPREFIX
|
|
|
|
|
lda (pPs),y
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL GetMemPtrA
|
2016-08-28 20:48:01 +00:00
|
|
|
|
|
|
|
|
|
>PUSHYA
|
|
|
|
|
>LDYAI MSG.Prefix
|
2016-11-03 16:23:16 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2016-08-28 20:48:01 +00:00
|
|
|
|
|
|
|
|
|
>PUSHWI STARTUP.CMDLINE
|
|
|
|
|
>LDYAI MSG.Startup
|
2016-11-03 16:23:16 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2016-08-28 20:48:01 +00:00
|
|
|
|
|
|
|
|
|
>LDYAI STARTUP.CMDLINE
|
2016-11-01 17:18:04 +00:00
|
|
|
|
>SYSCALL ExpandPStrYA
|
|
|
|
|
phx Save Expanded CMDLINE for discard
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL CreateProcessYA
|
2016-08-28 20:48:01 +00:00
|
|
|
|
bcs .9
|
2016-11-01 17:18:04 +00:00
|
|
|
|
pla
|
|
|
|
|
>SYSCALL FreeMemA ...discard...
|
2016-08-28 20:48:01 +00:00
|
|
|
|
|
|
|
|
|
>LDYAI MSG.Init3.OK
|
2016-11-03 16:23:16 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2016-08-28 20:48:01 +00:00
|
|
|
|
|
|
|
|
|
>LDYAI TskMgr.Table
|
|
|
|
|
>STYA pPs
|
|
|
|
|
|
2016-09-29 06:26:54 +00:00
|
|
|
|
>DEBUGOA
|
2017-01-12 17:43:45 +00:00
|
|
|
|
|
2016-10-07 15:28:17 +00:00
|
|
|
|
bit RRAMWRAMBNK2
|
|
|
|
|
bit RRAMWRAMBNK2
|
2016-09-29 06:26:54 +00:00
|
|
|
|
jmp K.KernelRun
|
2016-08-29 15:12:04 +00:00
|
|
|
|
|
2016-08-28 20:48:01 +00:00
|
|
|
|
.9 >PUSHA
|
|
|
|
|
>LDYAI MSG.StartupErr
|
2016-11-03 16:23:16 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2016-11-01 17:18:04 +00:00
|
|
|
|
bra * No need to discard Expanded CMDLINE
|
2016-08-28 20:48:01 +00:00
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
MemMgrInit >LDYAI MemMgr.MHiMem
|
|
|
|
|
>STYA MemMgr.HiMem
|
|
|
|
|
>STYA MemMgr.Free
|
|
|
|
|
>LDYAI MemMgr.MLoMem
|
|
|
|
|
>STYA MemMgr.LoMem
|
|
|
|
|
stz MemMgr.LastSlot Reserve Slot #0
|
|
|
|
|
|
|
|
|
|
sta SETWRITEAUX
|
|
|
|
|
|
|
|
|
|
>LDYAI MemMgr.XHiMem
|
|
|
|
|
>STYA MemMgr.HiMem
|
|
|
|
|
>STYA MemMgr.Free
|
|
|
|
|
>LDYAI MemMgr.XLoMem
|
|
|
|
|
>STYA MemMgr.LoMem
|
|
|
|
|
stz MemMgr.LastSlot Reserve Slot #0
|
|
|
|
|
|
|
|
|
|
sta CLRWRITEAUX
|
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
PS0Init ldx #S.DEV*2 NUL,SYS
|
|
|
|
|
|
|
|
|
|
.1 lda DevMgr.NUL-1,x
|
|
|
|
|
sta DevMgr.Table-1,x
|
|
|
|
|
dex
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
lda #2
|
|
|
|
|
sta DevMgr.Count
|
|
|
|
|
|
|
|
|
|
>LDYAI TskMgr.Table Select Process 0 (Kernel)
|
|
|
|
|
>STYA pPs
|
|
|
|
|
|
|
|
|
|
ldy #S.PS-1
|
|
|
|
|
lda #0
|
|
|
|
|
|
|
|
|
|
.2 sta (pPs),y Blank PS0
|
|
|
|
|
dey
|
|
|
|
|
bpl .2
|
|
|
|
|
|
|
|
|
|
>LDYAI DEV.SYS
|
|
|
|
|
>SYSCALL MkNodYA
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
ldy #S.PS.hStdIn
|
|
|
|
|
sta (pPs),y
|
|
|
|
|
ldy #S.PS.hStdOut
|
|
|
|
|
sta (pPs),y
|
|
|
|
|
ldy #S.PS.hStdErr
|
|
|
|
|
sta (pPs),y
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2017-03-15 16:44:15 +00:00
|
|
|
|
DevMgr.NUL cld
|
|
|
|
|
jmp (DevMgr.NUL.Code,x)
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.DA #S.DEV.S.WRITE+S.DEV.S.READ+S.DEV.S.OPENED
|
2017-03-15 16:44:15 +00:00
|
|
|
|
.BS 6
|
2017-03-21 16:29:15 +00:00
|
|
|
|
>PSTR "NUL" NAME
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.HS 00 NAME must Be 4 bytes long
|
2016-09-29 15:30:15 +00:00
|
|
|
|
*--------------------------------------
|
2017-03-15 16:44:15 +00:00
|
|
|
|
DevMgr.SYS cld
|
|
|
|
|
jmp (DevMgr.SYS.Code,x)
|
2017-02-02 17:30:07 +00:00
|
|
|
|
.DA #S.DEV.S.WRITE+S.DEV.S.READ
|
2017-03-15 16:44:15 +00:00
|
|
|
|
.BS 6
|
2017-03-21 16:29:15 +00:00
|
|
|
|
>PSTR "SYS" NAME
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.HS 00 NAME must Be 4 bytes long
|
2016-09-29 15:30:15 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Setup AuxLC $FFFE->Kernel IRQ Handler
|
|
|
|
|
* if irq not handled, jmp (S.IrqMgrOldFFFE)
|
|
|
|
|
*--------------------------------------
|
2017-02-06 17:04:03 +00:00
|
|
|
|
SETMOUSE .EQ $12 Sets mouse mode
|
|
|
|
|
SERVEMOUSE .EQ $13 Services mouse interrupt
|
2017-02-07 07:27:27 +00:00
|
|
|
|
READMOUSE .EQ $14 Reads mouse position
|
2017-01-27 16:26:09 +00:00
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
IrqMgrInit php
|
2016-09-29 15:30:15 +00:00
|
|
|
|
sei
|
|
|
|
|
>LDYA $FFFE
|
2017-01-25 16:18:35 +00:00
|
|
|
|
>STYA K.IrqMgrOldFFFE
|
2016-09-29 15:30:15 +00:00
|
|
|
|
>LDYAI K.IrqHandlerAuxLC
|
|
|
|
|
>STYA $FFFE
|
2017-01-27 16:26:09 +00:00
|
|
|
|
|
2017-01-25 16:18:35 +00:00
|
|
|
|
>LDYAI IrqHandler
|
2017-03-28 15:46:12 +00:00
|
|
|
|
>STYA K.MLI.PARAMS+2
|
2017-01-25 16:18:35 +00:00
|
|
|
|
>MLICALL MLIALLOCIRQ
|
|
|
|
|
bcs .9
|
2016-09-29 15:30:15 +00:00
|
|
|
|
|
2017-03-28 15:46:12 +00:00
|
|
|
|
lda K.MLI.PARAMS+1
|
2017-01-25 16:18:35 +00:00
|
|
|
|
sta ProDOS.INTNUM
|
2017-01-27 16:26:09 +00:00
|
|
|
|
|
|
|
|
|
stz ZPPtr1 Try finding a Mouse Card...
|
|
|
|
|
lda #$C1
|
|
|
|
|
sta ZPPtr1+1
|
|
|
|
|
|
|
|
|
|
.1 ldx #DEVSIG.Value-DEVSIG.Offset-1
|
2017-01-25 16:18:35 +00:00
|
|
|
|
|
2017-01-27 16:26:09 +00:00
|
|
|
|
.2 ldy DEVSIG.Offset,x
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
cmp DEVSIG.Value,x
|
|
|
|
|
bne .3
|
|
|
|
|
dex
|
|
|
|
|
bpl .2
|
|
|
|
|
bra .4
|
|
|
|
|
|
|
|
|
|
.3 inc ZPPtr1+1 no match, try next slot....
|
|
|
|
|
lda ZPPtr1+1
|
|
|
|
|
cmp #$C8
|
|
|
|
|
bne .1
|
|
|
|
|
|
2017-02-06 17:04:03 +00:00
|
|
|
|
plp
|
2017-01-27 16:26:09 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 plp
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.4 lda ZPPtr1+1
|
2017-02-06 17:04:03 +00:00
|
|
|
|
sta GOMOUSE.JMP+2 DEVSLOTCn
|
2017-02-07 07:27:27 +00:00
|
|
|
|
sta K.IrqMgrVBL.MSM+2
|
|
|
|
|
sta K.IrqMgrVBL.MRM+2
|
|
|
|
|
|
2017-03-02 22:14:04 +00:00
|
|
|
|
and #$0f
|
|
|
|
|
sta K.IrqMgrVBL.0n
|
2017-01-27 16:26:09 +00:00
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
asl
|
2017-02-06 17:04:03 +00:00
|
|
|
|
sta GOMOUSE.n0+1
|
2017-02-07 07:27:27 +00:00
|
|
|
|
sta K.IrqMgrVBL.n0
|
2017-01-27 16:26:09 +00:00
|
|
|
|
|
2017-02-06 17:04:03 +00:00
|
|
|
|
ldy #SERVEMOUSE
|
|
|
|
|
lda (ZPPtr1),y
|
2017-02-07 07:27:27 +00:00
|
|
|
|
sta K.IrqMgrVBL.MSM+1
|
|
|
|
|
|
|
|
|
|
ldy #READMOUSE
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
sta K.IrqMgrVBL.MRM+1
|
2017-01-27 16:26:09 +00:00
|
|
|
|
|
2017-02-06 17:04:03 +00:00
|
|
|
|
bit RROMBNK2 Renable ROM to allow MOUSE II firmware works properly
|
2017-03-02 22:14:04 +00:00
|
|
|
|
|
|
|
|
|
ldx K.IrqMgrVBL.0n
|
|
|
|
|
lda $7F8,x
|
|
|
|
|
and #$0F
|
|
|
|
|
ora #9
|
2017-02-21 07:52:27 +00:00
|
|
|
|
ldy #SETMOUSE
|
2017-02-06 17:04:03 +00:00
|
|
|
|
jsr GOMOUSE
|
|
|
|
|
bcs *
|
2017-01-27 16:26:09 +00:00
|
|
|
|
|
|
|
|
|
bit RRAMWRAMBNK1 Back To LC Ram
|
|
|
|
|
bit RRAMWRAMBNK1
|
|
|
|
|
|
2017-02-07 07:27:27 +00:00
|
|
|
|
inc K.IrkMgr.VBL set=1 awaiting IrqMgr confirmation
|
2017-01-27 16:26:09 +00:00
|
|
|
|
|
2017-02-06 17:04:03 +00:00
|
|
|
|
plp
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-01-27 16:26:09 +00:00
|
|
|
|
GOMOUSE pha
|
|
|
|
|
stz ZPPtr1
|
2017-02-06 17:04:03 +00:00
|
|
|
|
ldx GOMOUSE.JMP+2 DEVSLOTCn
|
2017-01-27 16:26:09 +00:00
|
|
|
|
stx ZPPtr1+1
|
|
|
|
|
lda (ZPPtr1),y
|
2017-02-06 17:04:03 +00:00
|
|
|
|
sta GOMOUSE.JMP+1
|
|
|
|
|
GOMOUSE.n0 ldy #$ff
|
2017-01-27 16:26:09 +00:00
|
|
|
|
pla
|
2017-02-06 17:04:03 +00:00
|
|
|
|
GOMOUSE.JMP jmp $ffff Self Modified
|
2017-01-27 16:26:09 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
DEVSIG.Offset .HS 05070B0CFB
|
|
|
|
|
DEVSIG.Value .HS 38180120D6
|
2016-09-29 15:30:15 +00:00
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
DevMgrInit stz ZPPtr1
|
2016-12-05 17:04:42 +00:00
|
|
|
|
lda #$C1
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta ZPPtr1+1
|
2017-03-20 16:54:27 +00:00
|
|
|
|
lda #1
|
|
|
|
|
sta DEV.HEADER+S.DEV.BUSID
|
2016-12-05 17:04:42 +00:00
|
|
|
|
|
2017-03-20 16:54:27 +00:00
|
|
|
|
.1 lda #1
|
|
|
|
|
sta DEV.HEADER+S.DEV.DEVID
|
|
|
|
|
|
|
|
|
|
ldx #SmartPort.SIG-SmartPort.OFS-1
|
2016-12-05 17:04:42 +00:00
|
|
|
|
|
|
|
|
|
.2 ldy SmartPort.OFS,x Check if there is a smartport firmware
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda (ZPPtr1),y
|
2016-12-05 17:04:42 +00:00
|
|
|
|
cmp SmartPort.SIG,x
|
2017-03-21 16:29:15 +00:00
|
|
|
|
bne .8 not a Disk Controller...
|
2016-12-05 17:04:42 +00:00
|
|
|
|
dex
|
|
|
|
|
bpl .2
|
2017-03-21 16:29:15 +00:00
|
|
|
|
|
2016-12-05 17:04:42 +00:00
|
|
|
|
ldy #$ff
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda (ZPPtr1),y
|
2017-03-21 16:29:15 +00:00
|
|
|
|
bne .3 $0, Disk II, 16sect
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
jsr DevMgrInit.DII
|
2017-01-25 16:18:35 +00:00
|
|
|
|
ldy #A2osX.SLOTS.DII
|
2017-01-12 17:43:45 +00:00
|
|
|
|
bra .7
|
2017-03-21 16:29:15 +00:00
|
|
|
|
|
|
|
|
|
.3 inc
|
|
|
|
|
beq .7 $ff, Disk II 13 Sect, ingnore
|
|
|
|
|
|
|
|
|
|
ldy #7
|
|
|
|
|
lda (ZPPtr1),y
|
2017-03-21 21:53:17 +00:00
|
|
|
|
bne .4 $Cn07=00 : SmartPort
|
2017-03-21 16:29:15 +00:00
|
|
|
|
|
|
|
|
|
jsr DevMgrInit.SP
|
|
|
|
|
ldy #A2osX.SLOTS.SP
|
|
|
|
|
bra .7
|
|
|
|
|
|
|
|
|
|
.4 jsr DevMgrInit.BLK
|
2017-01-25 16:18:35 +00:00
|
|
|
|
ldy #A2osX.SLOTS.BLK
|
2016-12-05 17:04:42 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.7 lda ZPPtr1+1
|
2016-12-05 17:04:42 +00:00
|
|
|
|
and #$0f
|
|
|
|
|
tax
|
2017-01-25 16:18:35 +00:00
|
|
|
|
tya
|
2016-12-05 17:04:42 +00:00
|
|
|
|
sta A2osX.SLOTS,x
|
|
|
|
|
|
2017-03-20 16:54:27 +00:00
|
|
|
|
.8 inc DEV.HEADER+S.DEV.BUSID
|
2017-01-12 17:43:45 +00:00
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
lda ZPPtr1+1
|
2016-12-05 17:04:42 +00:00
|
|
|
|
cmp #$C8
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-03-20 16:54:27 +00:00
|
|
|
|
DevMgrInit.DII >LDYAI A2osX.DIIDrv
|
|
|
|
|
>STYA DEV.HEADER+S.DEV.DRV.JMP
|
|
|
|
|
jsr DevMgrInit.AddDev
|
|
|
|
|
inc DEV.HEADER+S.DEV.DEVID
|
|
|
|
|
jsr DevMgrInit.AddDev
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-03-21 21:53:17 +00:00
|
|
|
|
DevMgrInit.BLK ldy #$ff
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
sta DEV.HEADER+S.DEV.ROM.JMP
|
2017-03-20 16:54:27 +00:00
|
|
|
|
lda ZPPtr1+1
|
|
|
|
|
sta DEV.HEADER+S.DEV.ROM.JMP+1
|
|
|
|
|
|
|
|
|
|
>LDYAI A2osX.BlkDrv
|
|
|
|
|
>STYA DEV.HEADER+S.DEV.DRV.JMP
|
|
|
|
|
|
|
|
|
|
jsr DevMgrInit.AddDev
|
|
|
|
|
inc DEV.HEADER+S.DEV.DEVID
|
|
|
|
|
jsr DevMgrInit.AddDev
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
DevMgrInit.BLK.JMP
|
|
|
|
|
jmp (DEV.HEADER+S.DEV.ROM.JMP)
|
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
DevMgrInit.SP ldy #$ff
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
clc
|
|
|
|
|
adc #3 Compute smartport entry point
|
|
|
|
|
sta .1+1
|
|
|
|
|
sta .3+1
|
2017-03-15 16:44:15 +00:00
|
|
|
|
sta DEV.HEADER+S.DEV.ROM.JMP
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda ZPPtr1+1
|
|
|
|
|
sta .1+2
|
|
|
|
|
sta .3+2
|
2017-03-15 16:44:15 +00:00
|
|
|
|
sta DEV.HEADER+S.DEV.ROM.JMP+1
|
2017-01-12 17:43:45 +00:00
|
|
|
|
|
|
|
|
|
.1 jsr $ffff Self Modified
|
|
|
|
|
.DA #0 Status
|
|
|
|
|
.DA SP.CTRL.STATUS
|
|
|
|
|
bcs .9
|
2017-03-21 16:29:15 +00:00
|
|
|
|
lda SP.CTRL.STATUS.DATA
|
2017-01-12 17:43:45 +00:00
|
|
|
|
beq .9 no device
|
|
|
|
|
|
2017-03-15 16:44:15 +00:00
|
|
|
|
.2 lda #'1'
|
2017-03-21 16:29:15 +00:00
|
|
|
|
sta DEV.HEADER+S.DEV.DEVID
|
|
|
|
|
sta SP.DEV.STATUS.DEVID
|
2017-01-12 17:43:45 +00:00
|
|
|
|
|
|
|
|
|
.3 jsr $ffff Self Modified
|
|
|
|
|
.DA #0 Status
|
2017-03-21 16:29:15 +00:00
|
|
|
|
.DA SP.DEV.STATUS
|
2017-01-12 17:43:45 +00:00
|
|
|
|
bcs .7
|
2017-03-21 16:29:15 +00:00
|
|
|
|
lda SP.DEV.STATUS.DATA+S.DEVSTAT.S
|
2017-03-14 16:47:02 +00:00
|
|
|
|
sta DEV.HEADER+S.DEV.S
|
2017-01-12 17:43:45 +00:00
|
|
|
|
|
2017-03-21 16:29:15 +00:00
|
|
|
|
jsr DevMgrInit.AddDev
|
2017-01-12 17:43:45 +00:00
|
|
|
|
|
2017-03-21 16:29:15 +00:00
|
|
|
|
.7 inc DEV.HEADER+S.DEV.DEVID
|
|
|
|
|
dec SP.CTRL.STATUS.DATA
|
2017-01-12 17:43:45 +00:00
|
|
|
|
bne .3
|
|
|
|
|
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DevMgrInit.AddDev
|
|
|
|
|
lda DevMgr.Count
|
2017-03-14 16:47:02 +00:00
|
|
|
|
cmp #K.DEV.MAX
|
|
|
|
|
beq .9
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
inc DevMgr.Count
|
2017-03-20 16:54:27 +00:00
|
|
|
|
>SYSCALL GetDevByIDA
|
|
|
|
|
>STYA ZPPtr2
|
2017-03-13 16:55:43 +00:00
|
|
|
|
|
2017-03-20 16:54:27 +00:00
|
|
|
|
lda DEV.HEADER+S.DEV.BUSID
|
|
|
|
|
ora #$30
|
|
|
|
|
sta DEV.HEADER+S.DEV.NAME+2 SnDy
|
|
|
|
|
|
|
|
|
|
lda DEV.HEADER+S.DEV.DEVID
|
|
|
|
|
ora #$30
|
|
|
|
|
sta DEV.HEADER+S.DEV.NAME+4 SxDn
|
|
|
|
|
|
2017-03-13 16:55:43 +00:00
|
|
|
|
ldy #S.DEV-1
|
|
|
|
|
|
2017-03-14 16:47:02 +00:00
|
|
|
|
.1 lda DEV.HEADER,y
|
2017-03-20 16:54:27 +00:00
|
|
|
|
sta (ZPPtr2),y
|
2017-03-13 16:55:43 +00:00
|
|
|
|
dey
|
2017-03-20 16:54:27 +00:00
|
|
|
|
bpl .1
|
|
|
|
|
|
2017-03-14 16:47:02 +00:00
|
|
|
|
clc
|
2016-12-05 17:04:42 +00:00
|
|
|
|
rts
|
2017-03-14 16:47:02 +00:00
|
|
|
|
|
|
|
|
|
.9 lda #DEVMGR.ERROOH
|
|
|
|
|
sec
|
|
|
|
|
rts
|
2016-12-05 17:04:42 +00:00
|
|
|
|
*--------------------------------------
|
2017-03-15 16:44:15 +00:00
|
|
|
|
DEV.HEADER clc
|
|
|
|
|
jmp ($ffff,x)
|
|
|
|
|
.DA #S.DEV.S.BLOCK S
|
|
|
|
|
.BS 1 F
|
|
|
|
|
.BS 1 BUS.ID
|
|
|
|
|
.BS 1 DEV.ID
|
|
|
|
|
.BS 2 ROM.JMP
|
|
|
|
|
.BS 1
|
2017-03-13 16:55:43 +00:00
|
|
|
|
>PSTR "S1D1" 5 bytes
|
|
|
|
|
*--------------------------------------
|
2017-03-21 16:29:15 +00:00
|
|
|
|
SmartPort.OFS .HS 010305
|
|
|
|
|
SmartPort.SIG .HS 200003
|
2016-09-29 15:30:15 +00:00
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
SP.CTRL.STATUS .DA #3
|
|
|
|
|
.DA #0
|
2017-03-21 16:29:15 +00:00
|
|
|
|
.DA SP.CTRL.STATUS.DATA
|
|
|
|
|
.DA #0
|
|
|
|
|
SP.CTRL.STATUS.DATA
|
|
|
|
|
.BS 8 DevCnt
|
2017-01-12 17:43:45 +00:00
|
|
|
|
SP.DEV.STATUS .DA #3
|
2017-03-21 16:29:15 +00:00
|
|
|
|
SP.DEV.STATUS.DEVID
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.BS 1
|
2017-03-21 16:29:15 +00:00
|
|
|
|
.DA SP.DEV.STATUS.DATA
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.DA #3 return DIB
|
2017-03-21 16:29:15 +00:00
|
|
|
|
SP.DEV.STATUS.DATA
|
|
|
|
|
.BS S.DEVSTAT
|
2017-01-12 17:43:45 +00:00
|
|
|
|
*--------------------------------------
|
2017-03-09 07:11:44 +00:00
|
|
|
|
EvtMgrInit lda #$A5
|
|
|
|
|
sta A2osX.TIMER16
|
|
|
|
|
lda #$9B
|
|
|
|
|
sta A2osX.TIMER16+1
|
2016-09-29 15:30:15 +00:00
|
|
|
|
|
2017-03-09 07:11:44 +00:00
|
|
|
|
lda /EvtMgr.Table
|
2016-09-29 15:30:15 +00:00
|
|
|
|
sta pEvent+1
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
FltMgrInit stz FltMgr.Table
|
2016-09-29 15:30:15 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
TskMgrInit >LDYAI TskMgr.Table+S.PS Clear whole process table except PS0
|
|
|
|
|
>STYA .2+1
|
2016-09-29 15:30:15 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
ldx #K.PS.MAX-1
|
2016-09-29 15:30:15 +00:00
|
|
|
|
|
|
|
|
|
.1 lda #0
|
2016-10-03 15:59:36 +00:00
|
|
|
|
ldy #S.PS-1
|
2016-09-29 15:30:15 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.2 sta $ffff,y Self Modified
|
2016-09-29 15:30:15 +00:00
|
|
|
|
dey
|
|
|
|
|
bpl .2
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda .2+1
|
2016-09-29 15:30:15 +00:00
|
|
|
|
clc
|
2016-10-03 15:59:36 +00:00
|
|
|
|
adc #S.PS
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta .2+1
|
2016-09-29 15:30:15 +00:00
|
|
|
|
bcc .3
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
inc .2+2
|
2016-09-29 15:30:15 +00:00
|
|
|
|
.3 dex
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
>PUSHWI K.ENV.SIZE get a buffer for ENV
|
|
|
|
|
>PUSHBI S.MEM.F.INIT0 make sure blank
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>SYSCALL GetMem create it...
|
2016-09-29 15:30:15 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
ldy #S.PS.hENV
|
|
|
|
|
sta (pPs),y
|
|
|
|
|
|
|
|
|
|
>LDYAI UsrBuf256
|
2017-03-28 15:46:12 +00:00
|
|
|
|
>STYA K.MLI.PARAMS+1
|
2016-09-29 15:30:15 +00:00
|
|
|
|
>MLICALL MLIGETPREFIX
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>LDYAI UsrBuf256
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL NewPStrYA
|
2016-09-29 15:30:15 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
ldy #S.PS.hPREFIX
|
|
|
|
|
sta (pPs),y
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>PUSHWI UsrBuf256 push ENV value
|
2016-09-29 15:30:15 +00:00
|
|
|
|
>PUSHWI I.ENV.A2osX push ENV name
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL SetEnv
|
2016-09-29 15:30:15 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>LDYAI I.ENV.PATH
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL PutEnvYA
|
2016-09-29 15:30:15 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>LDYAI I.ENV.LIB
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL PutEnvYA
|
2016-09-29 15:30:15 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>LDYAI I.ENV.DRV
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL PutEnvYA
|
2016-09-29 15:30:15 +00:00
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
DEV.SYS >PSTR "SYS"
|
2016-10-24 15:54:43 +00:00
|
|
|
|
I.ENV.A2osX >PSTR "A2OSX"
|
|
|
|
|
I.ENV.PATH >PSTR "PATH=${A2OSX}SBIN/;${A2OSX}BIN/"
|
|
|
|
|
I.ENV.LIB >PSTR "LIB=${A2OSX}LIB/"
|
|
|
|
|
I.ENV.DRV >PSTR "DRV=${A2OSX}DRV/"
|
|
|
|
|
STARTUP.CMDLINE >PSTR "${A2OSX}SBIN/SHELL ${A2OSX}A2osX.STARTUP"
|
2016-08-28 20:48:01 +00:00
|
|
|
|
*--------------------------------------
|
2017-02-28 16:58:36 +00:00
|
|
|
|
MSG.Init3 >CSTR "A2osX[Stage3]:Init\r\n"
|
|
|
|
|
MSG.DEV >CSTR "-Device Manager...\r\n"
|
2017-03-02 22:14:04 +00:00
|
|
|
|
MSG.IRQ >CSTR "-Interrupt Manager...\r\n"
|
2017-02-28 16:58:36 +00:00
|
|
|
|
MSG.EVT >CSTR "-Event Manager...\r\n"
|
|
|
|
|
MSG.FLT >CSTR "-Path Filter...\r\n"
|
|
|
|
|
MSG.TSK >CSTR "-Task Manager...\r\n"
|
|
|
|
|
MSG.Prefix >CSTR "Prefix:%S\r\n"
|
|
|
|
|
MSG.Startup >CSTR "Executing Kernel Startup Script...\r\nCmd:%S\r\n"
|
|
|
|
|
MSG.StartupErr >CSTR "Failed : [$%h]\r\n"
|
|
|
|
|
MSG.Init3.OK >CSTR "A2osX[Stage3]:Complete.\r\n"
|
2016-10-13 06:21:16 +00:00
|
|
|
|
*--------------------------------------
|
2016-08-28 20:48:01 +00:00
|
|
|
|
MAN
|
|
|
|
|
SAVE SYS/KERNEL.S.INIT3
|
|
|
|
|
LOAD SYS/KERNEL.S
|
|
|
|
|
ASM
|