ProDOS.FX & //c: bugfix in IRQ manager, INITD in DEBUG mode for testing

This commit is contained in:
burniouf 2021-07-26 18:46:00 +02:00
parent 222b03c048
commit ef3398214f
7 changed files with 26 additions and 12 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -71,7 +71,7 @@ buftbl .HS 0000 file #1
* at the time of the most recent interrupt are stored here along * at the time of the most recent interrupt are stored here along
* with the address interrupted. * with the address interrupted.
*-------------------------------------- *--------------------------------------
inttbl .HS 0000 int #1 GP.IRQVs .HS 0000 int #1
.HS 0000 int #2 .HS 0000 int #2
.HS 0000 int #3 .HS 0000 int #3
.HS 0000 int #4 .HS 0000 int #4

View File

@ -17,7 +17,7 @@ IRQ ldx #$FA save 6 bytes of page 0
* ldx #0 * ldx #0
.3 lda inttbl+1,x test for a valid routine. .3 lda GP.IRQVs+1,x test for a valid routine.
beq .4 branch if no routine. beq .4 branch if no routine.
phx phx
@ -28,7 +28,7 @@ IRQ ldx #$FA save 6 bytes of page 0
.4 inx .4 inx
inx inx
cpx #10 cpx #8
bne .3 bne .3
inc IRQ.Cnt allow 255 unclaimed interrupts inc IRQ.Cnt allow 255 unclaimed interrupts
@ -65,7 +65,7 @@ IRQ.Done ldx #$FA
rti rti
*-------------------------------------- *--------------------------------------
IRQ.GoX jmp (inttbl,x) interrupt routine x IRQ.GoX jmp (GP.IRQVs,x) interrupt routine x
IRQ.Reset lda /resetv-1 IRQ.Reset lda /resetv-1
pha pha

View File

@ -172,17 +172,17 @@ XDOS.intmgr sta A4L interrupt command
ldx #$03 test for a free interrupt space in tbl. ldx #$03 test for a free interrupt space in tbl.
.1 lda inttbl-2,x test high address for 0. .1 lda GP.IRQVs-2,x test high address for 0.
bne .2 branch if spot occupied. bne .2 branch if spot occupied.
ldy #$03 get address of routine. ldy #$03 get address of routine.
lda (A3L),y must not be zero page. lda (A3L),y must not be zero page.
beq badint error if it is. beq badint error if it is.
sta inttbl-2,x save high address sta GP.IRQVs-2,x save high address
dey dey
lda (A3L),y lda (A3L),y
sta inttbl-3,x and low address. sta GP.IRQVs-3,x and low address.
txa return interrupt # in range 1-4 txa return interrupt # in range 1-4
lsr lsr
dey dey
@ -210,8 +210,8 @@ dealcint ldy #$01 zero out interrupt vector
asl asl
tax tax
stz inttbl-2,x stz GP.IRQVs-2,x
stz inttbl-1,x stz GP.IRQVs-1,x
clc clc
rts rts
*-------------------------------------- *--------------------------------------

View File

@ -5,7 +5,7 @@ NEW
.OR $2000 .OR $2000
.TF sbin/initd .TF sbin/initd
*-------------------------------------- *--------------------------------------
INITDDBG .EQ 0 INITDDBG .EQ 1
*-------------------------------------- *--------------------------------------
.INB inc/macros.i .INB inc/macros.i
.INB inc/a2osx.i .INB inc/a2osx.i
@ -43,6 +43,8 @@ CS.START cld
.DA CS.QUIT .DA CS.QUIT
L.MSG.CTRLR .DA MSG.CTRLR L.MSG.CTRLR .DA MSG.CTRLR
.DO INITDDBG=1 .DO INITDDBG=1
L.MSG.ETCINIT .DA MSG.ETCINIT
L.MSG.START .DA MSG.START
L.MSG.OK .DA MSG.OK L.MSG.OK .DA MSG.OK
L.MSG.KO .DA MSG.KO L.MSG.KO .DA MSG.KO
.FIN .FIN
@ -59,7 +61,12 @@ CS.INIT
CS.QUIT clc CS.QUIT clc
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN ldy #S.PS.PID CS.RUN .DO INITDDBG=1
>LDYA L.MSG.START
>SYSCALL PutS
.FIN
ldy #S.PS.PID
lda (pPS),y lda (pPS),y
cmp #1 cmp #1
bne .9 bne .9
@ -88,7 +95,12 @@ CS.RUN ldy #S.PS.PID
>SLEEP >SLEEP
.1 jsr CS.RUN.ETCINIT .1 .DO INITDDBG=1
>LDYA L.MSG.ETCINIT
>SYSCALL PutS
.FIN
jsr CS.RUN.ETCINIT
bcs .99 bcs .99
.2 >SYSCALL GetChar .2 >SYSCALL GetChar
@ -214,8 +226,10 @@ CS.END
*-------------------------------------- *--------------------------------------
MSG.CTRLR .AZ "INITD:Entering ROOT mode..." MSG.CTRLR .AZ "INITD:Entering ROOT mode..."
.DO INITDDBG=1 .DO INITDDBG=1
MSG.START .AZ "INITD:Starting..."
MSG.OK .AZ " [OK]" MSG.OK .AZ " [OK]"
MSG.KO .AZ " [%h]\r\n" MSG.KO .AZ " [%h]\r\n"
MSG.ETCINIT .AS "INITD:Executing "
.FIN .FIN
ETCINIT .AZ "${ROOT}etc/init" ETCINIT .AZ "${ROOT}etc/init"
BINSH .AZ "${ROOT}bin/sh" BINSH .AZ "${ROOT}bin/sh"