mirror of
https://github.com/A2osX/A2osX.git
synced 2024-06-16 00:29:35 +00:00
Kernel version 0.8 : Fixed offset computation in JMP "table" relocation
This commit is contained in:
parent
728278c196
commit
f76268fe93
BIN
A2OSX.BOOT.po
BIN
A2OSX.BOOT.po
Binary file not shown.
BIN
A2OSX.SRC.po
BIN
A2OSX.SRC.po
Binary file not shown.
|
@ -10,13 +10,13 @@ echo Env:
|
||||||
SET
|
SET
|
||||||
# Main Screen
|
# Main Screen
|
||||||
INSDRV CONSOLE.DRV
|
INSDRV CONSOLE.DRV
|
||||||
STARTPROC GETTY CON ${A2OSX}SBIN/LOGIN
|
#STARTPROC GETTY CON ${A2OSX}SBIN/LOGIN
|
||||||
# Serial Login
|
# Serial Login
|
||||||
#INSDRV SSC.I.DRV 9600 N 8 1 X
|
#INSDRV SSC.I.DRV 9600 N 8 1 X
|
||||||
#STARTPROC GETTY COM2 LOGIN
|
#STARTPROC GETTY COM2 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
|
||||||
|
|
|
@ -111,7 +111,7 @@ GETEVENT lda A2osX.TIMER16
|
||||||
|
|
||||||
.1 jsr Char.Out.Get
|
.1 jsr Char.Out.Get
|
||||||
bcc .7
|
bcc .7
|
||||||
|
>DEBUG
|
||||||
>SYSCALL SYS.GetKeyboardEvent
|
>SYSCALL SYS.GetKeyboardEvent
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
|
|
|
@ -240,9 +240,9 @@ SYS.GetStockObjectA .EQ $8C
|
||||||
SYS.FreeStockObject .EQ $8E
|
SYS.FreeStockObject .EQ $8E
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
SYS.GetDevByIDA .EQ $90
|
SYS.GetDevByIDA .EQ $90
|
||||||
SYS.GetDevByNameYA .EQ $94
|
SYS.GetDevByNameYA .EQ $92
|
||||||
SYS.GetDevInfoA .EQ $96
|
SYS.GetDevInfoA .EQ $94
|
||||||
SYS.GetKeyboardEvent .EQ $98
|
SYS.GetKeyboardEvent .EQ $96
|
||||||
|
|
||||||
SYS.MKNOD .EQ $FF
|
SYS.MKNOD .EQ $FF
|
||||||
SYS.MKFIFO .EQ $FF
|
SYS.MKFIFO .EQ $FF
|
||||||
|
|
|
@ -114,7 +114,18 @@ K.LoadEXEYA.hMem .BS 1
|
||||||
* Already setup correctly pDrv,
|
* Already setup correctly pDrv,
|
||||||
* BIN.Relocate.Start,End
|
* BIN.Relocate.Start,End
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
BIN.InstallDRV lda DevMgr.Free Offset = Target DRV address-AUXTYPE
|
BIN.InstallDRV ldy #H.BIN.DRV.CODE.O
|
||||||
|
lda (pDrv),y
|
||||||
|
clc
|
||||||
|
adc BIN.Relocate.Start Advance start From AUXTYPE to AUXTYPE+DRV code offset
|
||||||
|
sta BIN.Relocate.Start
|
||||||
|
|
||||||
|
iny
|
||||||
|
lda (pDrv),y
|
||||||
|
adc BIN.Relocate.Start+1
|
||||||
|
sta BIN.Relocate.Start+1
|
||||||
|
|
||||||
|
lda DevMgr.Free Offset = Target DRV address-(AUXTYPE+DRV OFFSET)
|
||||||
sec
|
sec
|
||||||
sbc BIN.Relocate.Start
|
sbc BIN.Relocate.Start
|
||||||
sta BIN.Relocate.Offset
|
sta BIN.Relocate.Offset
|
||||||
|
@ -123,17 +134,6 @@ BIN.InstallDRV lda DevMgr.Free Offset = Target DRV address-AUXTYPE
|
||||||
sbc BIN.Relocate.Start+1
|
sbc BIN.Relocate.Start+1
|
||||||
sta BIN.Relocate.Offset+1
|
sta BIN.Relocate.Offset+1
|
||||||
|
|
||||||
ldy #H.BIN.DRV.CODE.O
|
|
||||||
lda (pDrv),y
|
|
||||||
clc
|
|
||||||
adc BIN.Relocate.Start Advance start From Bin code to DRV code
|
|
||||||
sta BIN.Relocate.Start
|
|
||||||
|
|
||||||
iny
|
|
||||||
lda (pDrv),y
|
|
||||||
adc BIN.Relocate.Start+1
|
|
||||||
sta BIN.Relocate.Start+1
|
|
||||||
|
|
||||||
lda BIN.Relocate.End Compute DRVLen=End-start
|
lda BIN.Relocate.End Compute DRVLen=End-start
|
||||||
sec
|
sec
|
||||||
sbc BIN.Relocate.Start
|
sbc BIN.Relocate.Start
|
||||||
|
|
|
@ -50,7 +50,6 @@ K.LoadDrvYA >STYA K.LoadDrv.CmdArray
|
||||||
jsr BIN.InstallDRV
|
jsr BIN.InstallDRV
|
||||||
|
|
||||||
bcs .97
|
bcs .97
|
||||||
|
|
||||||
ldy #S.DEV.F
|
ldy #S.DEV.F
|
||||||
lda (pDev),y
|
lda (pDev),y
|
||||||
ora #S.DEV.F.INUSE
|
ora #S.DEV.F.INUSE
|
||||||
|
|
|
@ -27,9 +27,8 @@ K.GetKeyboardEvent
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.9 inc A2osX.RANDOM16
|
.9 inc A2osX.RANDOM16
|
||||||
bne .99
|
sta A2osX.RANDOM16+1
|
||||||
dec A2osX.RANDOM16+1
|
sec no event
|
||||||
.99 sec no event
|
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* EVT.GetEvents :
|
* EVT.GetEvents :
|
||||||
|
@ -39,8 +38,8 @@ K.GetKeyboardEvent
|
||||||
* CC * event in YA
|
* CC * event in YA
|
||||||
* (pEvent)
|
* (pEvent)
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
EVT.GetEvents stz pEvent
|
EVT.GetEvents stz pEvent point to start of event list
|
||||||
stz EVTMGR.COUNT
|
stz EVTMGR.COUNT reset Size
|
||||||
|
|
||||||
lda VBL get VLINE status
|
lda VBL get VLINE status
|
||||||
tax
|
tax
|
||||||
|
@ -74,12 +73,7 @@ EVT.GetEvents stz pEvent
|
||||||
ora #S.EVT.F.T1SEC
|
ora #S.EVT.F.T1SEC
|
||||||
|
|
||||||
.2 sta (pEvent)
|
.2 sta (pEvent)
|
||||||
|
jsr EVT.GetEvents.Add
|
||||||
lda pEvent
|
|
||||||
clc
|
|
||||||
adc #S.EVT
|
|
||||||
sta pEvent
|
|
||||||
inc EVTMGR.COUNT
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
EVT.GetEvents.DEV
|
EVT.GetEvents.DEV
|
||||||
>LDYAI DevMgr.Table
|
>LDYAI DevMgr.Table
|
||||||
|
@ -91,26 +85,23 @@ EVT.GetEvents.DEV
|
||||||
lda (pDev),y get S.DEV.F
|
lda (pDev),y get S.DEV.F
|
||||||
bit #S.DEV.F.EVENT
|
bit #S.DEV.F.EVENT
|
||||||
beq .2 EVENT enabled ?
|
beq .2 EVENT enabled ?
|
||||||
|
|
||||||
lda (pDev)
|
lda (pDev)
|
||||||
cmp #H.BIN.HEADER.DRV65
|
cmp #H.BIN.HEADER.DRV65
|
||||||
bne *
|
bne *
|
||||||
|
|
||||||
ldx #DEVMGR.GETEVENT
|
ldx #DEVMGR.GETEVENT
|
||||||
|
|
||||||
jsr pDevJmp Call DRV GetEvent function
|
jsr pDevJmp Call DRV GetEvent function
|
||||||
bcs .2 no event
|
bcs .2 no event
|
||||||
|
|
||||||
inc EVTMGR.COUNT
|
|
||||||
|
|
||||||
ldy #S.EVT.hDEV
|
ldy #S.EVT.hDEV
|
||||||
lda DevMgr.DevID
|
lda DevMgr.DevID
|
||||||
sta (pEvent),y
|
sta (pEvent),y
|
||||||
|
|
||||||
lda pEvent
|
jsr EVT.GetEvents.Add
|
||||||
adc #S.EVT cc
|
|
||||||
sta pEvent
|
|
||||||
|
|
||||||
bcs .8 Event Q is full!
|
bcc .9 Event Q is full, exit now with CC
|
||||||
|
|
||||||
.2 lda pDev
|
.2 lda pDev
|
||||||
clc
|
clc
|
||||||
|
@ -124,15 +115,20 @@ EVT.GetEvents.DEV
|
||||||
cmp DevMgr.LastDevID
|
cmp DevMgr.LastDevID
|
||||||
bne .1
|
bne .1
|
||||||
|
|
||||||
.8 lda EVTMGR.COUNT
|
lda EVTMGR.COUNT if 0, exit with CS=no event (from cmp)
|
||||||
sta EVTMGR.SIZE
|
|
||||||
beq .9
|
beq .9
|
||||||
|
|
||||||
clc
|
clc
|
||||||
rts
|
.9 rts
|
||||||
|
*--------------------------------------
|
||||||
.9 sec error code=0,CS=no event
|
EVT.GetEvents.Add
|
||||||
rts
|
inc EVTMGR.COUNT Add one event to Queue
|
||||||
|
|
||||||
|
lda pEvent
|
||||||
|
clc
|
||||||
|
adc #S.EVT
|
||||||
|
sta pEvent
|
||||||
|
rts if CS, EVT queue full!!! ($100)
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
EVT.DestroyEvent
|
EVT.DestroyEvent
|
||||||
lda (pEvent)
|
lda (pEvent)
|
||||||
|
@ -163,7 +159,6 @@ EVTMGR.VBLSTATE .BS 1
|
||||||
EVTMGR.10TH.CNT .BS 1
|
EVTMGR.10TH.CNT .BS 1
|
||||||
EVTMGR.HZ.CNT .BS 1
|
EVTMGR.HZ.CNT .BS 1
|
||||||
EVTMGR.COUNT .BS 1
|
EVTMGR.COUNT .BS 1
|
||||||
EVTMGR.SIZE .BS 1
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
MAN
|
MAN
|
||||||
SAVE SYS/KERNEL.S.EVT
|
SAVE SYS/KERNEL.S.EVT
|
||||||
|
|
|
@ -86,7 +86,7 @@ K.DevMgrInit ldx #S.DEV*DevMgr.Count
|
||||||
dex
|
dex
|
||||||
bne .1
|
bne .1
|
||||||
|
|
||||||
stz DevMgr.Table+S.DEV*DevMgr.Count+1
|
stz DevMgr.Table+S.DEV*DevMgr.Count
|
||||||
|
|
||||||
lda #DevMgr.Count-1
|
lda #DevMgr.Count-1
|
||||||
sta DevMgr.LastDevID
|
sta DevMgr.LastDevID
|
||||||
|
|
|
@ -96,11 +96,15 @@ TSK.TskMgrRun >LDYAI TskMgr.Table+S.PS skip PS 0
|
||||||
* CC: Event Cleared
|
* CC: Event Cleared
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
TSK.DispatchEvents
|
TSK.DispatchEvents
|
||||||
|
|
||||||
|
lda EVTMGR.COUNT
|
||||||
|
beq *
|
||||||
|
|
||||||
>LDYAI TskMgr.Table+S.PS
|
>LDYAI TskMgr.Table+S.PS
|
||||||
>STYA pPs
|
>STYA pPs
|
||||||
|
|
||||||
lda TSKMGR.SIZE
|
lda TSKMGR.SIZE Number of actual processes...
|
||||||
sta TSKMGR.COUNT
|
sta TSKMGR.COUNT ...to give event list
|
||||||
|
|
||||||
.1 dec TSKMGR.COUNT skip PS 0
|
.1 dec TSKMGR.COUNT skip PS 0
|
||||||
beq .9
|
beq .9
|
||||||
|
@ -109,7 +113,7 @@ TSK.DispatchEvents
|
||||||
bit #S.PS.F.INUSE In use ?
|
bit #S.PS.F.INUSE In use ?
|
||||||
beq .4
|
beq .4
|
||||||
|
|
||||||
bit #S.PS.F.HOLD Waiting for Another Task to Terminate?
|
bit #S.PS.F.INIT+S.PS.F.SLEEP+S.PS.F.HOLD Init,Sleep or Waiting for Another Task to Terminate?
|
||||||
bne .4
|
bne .4
|
||||||
|
|
||||||
bit #S.PS.F.EVENT Accept Events ?
|
bit #S.PS.F.EVENT Accept Events ?
|
||||||
|
@ -117,12 +121,12 @@ TSK.DispatchEvents
|
||||||
|
|
||||||
jsr PS.Select
|
jsr PS.Select
|
||||||
|
|
||||||
stz pEvent
|
stz pEvent Select first event in list
|
||||||
|
|
||||||
lda EVTMGR.SIZE
|
lda EVTMGR.COUNT
|
||||||
sta TSKMGR.EVENTCNT
|
sta TSKMGR.EVENTCNT
|
||||||
|
|
||||||
.2 lda (pEvent)
|
.2 lda (pEvent) Empty event, select next
|
||||||
beq .3
|
beq .3
|
||||||
|
|
||||||
lda (pCode)
|
lda (pCode)
|
||||||
|
@ -131,20 +135,22 @@ TSK.DispatchEvents
|
||||||
|
|
||||||
ldx #TSKMGR.DOEVENT
|
ldx #TSKMGR.DOEVENT
|
||||||
jsr pCodeJmp Call DOEVENT function
|
jsr pCodeJmp Call DOEVENT function
|
||||||
bcs .3
|
bcs .3 not for this PS, try next event in list
|
||||||
jsr EVT.DestroyEvent
|
|
||||||
|
jsr EVT.DestroyEvent this PS handled the EVT, destroy it...
|
||||||
lda EVTMGR.COUNT
|
lda EVTMGR.COUNT
|
||||||
beq .8
|
beq .8 no more event, exit
|
||||||
|
|
||||||
.3 dec TSKMGR.EVENTCNT
|
.3 dec TSKMGR.EVENTCNT
|
||||||
beq .4
|
beq .4 all EVT submitted to this PS, try other PS
|
||||||
lda pEvent
|
|
||||||
|
lda pEvent try next EVT to this PS
|
||||||
clc
|
clc
|
||||||
adc #S.EVT
|
adc #S.EVT
|
||||||
sta pEvent
|
sta pEvent
|
||||||
bra .2
|
bra .2
|
||||||
|
|
||||||
.4 lda pPs
|
.4 lda pPs go to next PS in PS list
|
||||||
clc
|
clc
|
||||||
adc #S.PS
|
adc #S.PS
|
||||||
sta pPs
|
sta pPs
|
||||||
|
|
Loading…
Reference in New Issue
Block a user