mirror of
https://github.com/A2osX/A2osX.git
synced 2025-04-06 02:40:10 +00:00
Kernel version 0.8 : Fixing bugs in K.FileSearch with ';' search path
This commit is contained in:
parent
bbf65b74e5
commit
16deea2112
BIN
A2OSX.BOOT.po
BIN
A2OSX.BOOT.po
Binary file not shown.
BIN
A2OSX.SRC.po
BIN
A2OSX.SRC.po
Binary file not shown.
@ -122,7 +122,7 @@ GETEVENT jsr Char.Out.Get
|
||||
lda KBD
|
||||
bpl .9
|
||||
sta KBDSTROBE
|
||||
|
||||
|
||||
and #$7F
|
||||
|
||||
ldx KeyRemapped
|
||||
|
@ -242,7 +242,7 @@ SYS.FreeStockObject .EQ $8E
|
||||
SYS.GetDevByIDA .EQ $90
|
||||
SYS.GetDevByNameYA .EQ $92
|
||||
SYS.GetDevInfoA .EQ $94
|
||||
SYS.GetKeyboardEvent .EQ $96
|
||||
|
||||
|
||||
SYS.MKNOD .EQ $FF
|
||||
SYS.MKFIFO .EQ $FF
|
||||
@ -349,11 +349,11 @@ DEVMGR.GFX.BITBLT .EQ 22
|
||||
*--------------------------------------
|
||||
S.PS.F .EQ 0
|
||||
S.PS.F.INUSE .EQ %10000000
|
||||
S.PS.F.HOLD .EQ %01000000
|
||||
S.PS.F.EVENT .EQ %00100000
|
||||
S.PS.F.ENV .EQ %00010000
|
||||
S.PS.F.SLEEP .EQ %00001000
|
||||
S.PS.F.INIT .EQ %00000100
|
||||
S.PS.F.INIT .EQ %01000000
|
||||
S.PS.F.HOLD .EQ %00100000
|
||||
S.PS.F.SLEEP .EQ %00010000
|
||||
S.PS.F.EVENT .EQ %00001000
|
||||
S.PS.F.ENV .EQ %00000100
|
||||
S.PS.ID .EQ 1
|
||||
S.PS.PID .EQ 2
|
||||
S.PS.hCS .EQ 3
|
||||
@ -361,7 +361,7 @@ S.PS.hDS .EQ 4
|
||||
S.PS.hPREFIX .EQ 5
|
||||
S.PS.hENV .EQ 6
|
||||
S.PS.hCMDLINE .EQ 7
|
||||
*S.PS.hARGS .EQ 8
|
||||
S.PS.UID .EQ 8
|
||||
S.PS.hINDEV .EQ 9
|
||||
S.PS.hOUTDEV .EQ 10
|
||||
S.PS.hERRDEV .EQ 11
|
||||
|
@ -88,13 +88,15 @@ Cmd.ExecYA.1 >SYSCALL SYS.ExpandPStrYA
|
||||
Cmd.Exec.EXT ldy #1
|
||||
lda CMD,y
|
||||
cmp #'/' Command line is already full path, no search
|
||||
beq .3
|
||||
bne .10
|
||||
jmp .3
|
||||
|
||||
>LDYA L.ENV.PATH push ENVNAME=PATH for search
|
||||
.10 >LDYA L.ENV.PATH push ENVNAME=PATH for search
|
||||
>SYSCALL SYS.GetEnvYA get value for ENV=PATH
|
||||
bcs .1 No PATH, try in CD
|
||||
|
||||
>PUSHYA push search list
|
||||
|
||||
>PUSHW L.CMD
|
||||
>SYSCALL SYS.FileSearch
|
||||
bcc .2
|
||||
@ -109,6 +111,8 @@ Cmd.Exec.EXT ldy #1
|
||||
|
||||
.2 phx save X=hMem, Y,A = Filename
|
||||
>PUSHYA
|
||||
|
||||
|
||||
>PUSHW L.CMD replace CMD in TmpBuffer with full path
|
||||
>SYSCALL SYS.PStrCpy
|
||||
pla
|
||||
|
@ -193,16 +193,21 @@ BIN.InstallDRV ldy #H.BIN.DRV.CODE.O
|
||||
dey
|
||||
bpl .1
|
||||
|
||||
ldy #S.DEV.JMP Setup Main JMP
|
||||
lda DevMgr.Free
|
||||
sta (ZPQuickPtr2),y
|
||||
tax
|
||||
iny
|
||||
lda DevMgr.Free+1
|
||||
ldy #S.DEV.ID
|
||||
lda DevMgr.LastDevID
|
||||
sta (ZPQuickPtr2),y
|
||||
|
||||
stx ZPQuickPtr2 set Ptr2 to Dest CODE
|
||||
sta ZPQuickPtr2+1
|
||||
dey #S.DEV.JMP+1 Setup Main JMP
|
||||
lda DevMgr.Free+1
|
||||
sta (ZPQuickPtr2),y
|
||||
tax
|
||||
|
||||
dey #S.DEV.JMP
|
||||
lda DevMgr.Free
|
||||
sta (ZPQuickPtr2),y
|
||||
|
||||
sta ZPQuickPtr2 set Ptr2 to Dest CODE
|
||||
stx ZPQuickPtr2+1
|
||||
|
||||
ldy #H.BIN.DRV.CODE.O
|
||||
lda (pDrv),y
|
||||
|
@ -162,12 +162,28 @@ DevMgr.SYS.GetEvent
|
||||
ldx #3
|
||||
.1 stx DevMgr.SYS.CPULOADI
|
||||
|
||||
jsr K.GetKeyboardEvent
|
||||
bcc .8
|
||||
lda OPENAPPLE
|
||||
bmi .9 Open apple key, not for us...
|
||||
lda KBD
|
||||
bpl .9
|
||||
sta KBDSTROBE
|
||||
|
||||
and #$7F
|
||||
|
||||
ldy #S.EVT.DATALO
|
||||
sta (pEvent),y
|
||||
iny S.EVT.DATAHI
|
||||
lda #0
|
||||
sta (pEvent),y
|
||||
lda #S.EVT.F.KEY
|
||||
sta (pEvent)
|
||||
|
||||
clc
|
||||
rts
|
||||
|
||||
.9 lda #0 Error = no event
|
||||
sec
|
||||
.8 rts
|
||||
rts
|
||||
*--------------------------------------
|
||||
DevMgr.SYS.COut phx
|
||||
phy
|
||||
|
@ -288,6 +288,7 @@ K.GetEnvYA >STYA ZPQuickPtr2
|
||||
bcs .9
|
||||
jsr ENV.NextEnvPtr1 Skip NAME
|
||||
>LDYA ZPQuickPtr1
|
||||
clc just in case ADC in NextEnvPtr1 disturb CC
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
* K.UnsetEnvYA
|
||||
|
@ -5,32 +5,6 @@ INC 1
|
||||
AUTO 6
|
||||
.LIST OFF
|
||||
*--------------------------------------
|
||||
K.GetKeyboardEvent
|
||||
lda KBD
|
||||
bpl .9
|
||||
sta KBDSTROBE
|
||||
|
||||
and #$7F
|
||||
ldy #S.EVT.DATA
|
||||
sta (pEvent),y
|
||||
iny
|
||||
lda OPENAPPLE
|
||||
asl
|
||||
lda SOLIDAPPLE
|
||||
ror
|
||||
and #$C0
|
||||
sta (pEvent),y
|
||||
|
||||
lda #S.EVT.F.KEY
|
||||
sta (pEvent)
|
||||
clc
|
||||
rts
|
||||
|
||||
.9 inc A2osX.RANDOM16
|
||||
sta A2osX.RANDOM16+1
|
||||
sec no event
|
||||
rts
|
||||
*--------------------------------------
|
||||
* EVT.GetEvents :
|
||||
* IN :
|
||||
* OUT :
|
||||
@ -101,7 +75,7 @@ EVT.GetEvents.DEV
|
||||
|
||||
jsr EVT.GetEvents.Add
|
||||
|
||||
bcc .9 Event Q is full, exit now with CC
|
||||
bcs .8 Event Q is full, exit now with CC
|
||||
|
||||
.2 lda pDev
|
||||
clc
|
||||
@ -115,10 +89,10 @@ EVT.GetEvents.DEV
|
||||
cmp DevMgr.LastDevID
|
||||
bne .1
|
||||
|
||||
lda EVTMGR.COUNT if 0, exit with CS=no event (from cmp)
|
||||
lda EVTMGR.COUNT if 0, exit with CS (from cmp), and A=0 "no event"
|
||||
beq .9
|
||||
|
||||
clc
|
||||
.8 clc
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
EVT.GetEvents.Add
|
||||
|
@ -16,10 +16,18 @@ AUTO 6
|
||||
K.FileSearch >PULLW ZPQuickPtr4 ZPQuickPtr1 trashed by ExpandPStrYA
|
||||
>PULLYA Get Search list
|
||||
>SYSCALL SYS.ExpandPStrYA Expand it (SYSCALL to BNK1)
|
||||
bcs .99
|
||||
* bcs .99
|
||||
bcc .10
|
||||
rts
|
||||
|
||||
stx K.FileSearch.hSrch
|
||||
>STYA ZPQuickPtr2 expanded search list ;
|
||||
.98 lda K.FileSearch.hSrch Discard Expanded hSrch list
|
||||
jsr K.FreeMemA
|
||||
lda #SYSMGR.ERRFNF
|
||||
sec
|
||||
rts
|
||||
|
||||
.10 stx K.FileSearch.hSrch
|
||||
>STYA ZPQuickPtr3 ZPQuickPtr2 trashed by K.STAT !!! expanded search list ;
|
||||
|
||||
stz K.FileSearch.Index
|
||||
|
||||
@ -29,16 +37,17 @@ K.FileSearch >PULLW ZPQuickPtr4 ZPQuickPtr1 trashed by ExpandPStrYA
|
||||
ldy K.FileSearch.Index
|
||||
|
||||
.2 tya
|
||||
cmp (ZPQuickPtr2) end of src string ?
|
||||
cmp (ZPQuickPtr3) end of src string ?
|
||||
beq .3 end of string, try it....
|
||||
iny
|
||||
lda (ZPQuickPtr2),y
|
||||
lda (ZPQuickPtr3),y
|
||||
cmp #';'
|
||||
beq .3
|
||||
beq .31
|
||||
inx
|
||||
sta KrnBuf256,x
|
||||
bra .2
|
||||
|
||||
|
||||
.31 iny skip ';' for next try
|
||||
.3 txa
|
||||
beq .98 String is empty....nothing to try
|
||||
|
||||
@ -56,6 +65,12 @@ K.FileSearch >PULLW ZPQuickPtr4 ZPQuickPtr1 trashed by ExpandPStrYA
|
||||
|
||||
stx KrnBuf256 set string length
|
||||
|
||||
lda #'!'
|
||||
>SYSCALL SYS.COutA
|
||||
>LDYAI KrnBuf256
|
||||
>SYSCALL SYS.PSTROutYA
|
||||
>DEBUG
|
||||
|
||||
>PUSHWI KrnSTAT
|
||||
>PUSHWI KrnBuf256
|
||||
jsr K.STAT
|
||||
@ -63,15 +78,15 @@ K.FileSearch >PULLW ZPQuickPtr4 ZPQuickPtr1 trashed by ExpandPStrYA
|
||||
|
||||
lda K.FileSearch.hSrch Discard Expanded hSrch list
|
||||
jsr K.FreeMemA
|
||||
lda #'@'
|
||||
>SYSCALL SYS.COutA
|
||||
>LDYAI KrnBuf256
|
||||
>SYSCALL SYS.PSTROutYA
|
||||
>DEBUG
|
||||
|
||||
>LDYAI KrnBuf256
|
||||
>SYSCALL SYS.NewPStrYA
|
||||
.99 rts
|
||||
|
||||
.98 lda K.FileSearch.hSrch Discard Expanded hSrch list
|
||||
jsr K.FreeMemA
|
||||
lda #SYSMGR.ERRFNF
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
K.FileSearch.hSrch .BS 1
|
||||
K.FileSearch.Index .BS 1
|
||||
@ -99,14 +114,16 @@ K.GetFullPathYA >STYA ZPQuickPtr3 Ptr1 & 2 used by StrCpy
|
||||
jsr K.GetMemPtrA
|
||||
>PUSHYA
|
||||
>PUSHWI KrnBuf256
|
||||
jsr K.PStrCpy
|
||||
>SYSCALL SYS.PStrCpy
|
||||
|
||||
.1 >PUSHW ZPQuickPtr3
|
||||
>PUSHWI KrnBuf256
|
||||
jsr K.PStrCat
|
||||
>SYSCALL SYS.PStrCat
|
||||
|
||||
>LDYAI KrnBuf256
|
||||
jmp K.NewPStrYA
|
||||
>SYSCALL SYS.NewPStrYA
|
||||
rts
|
||||
|
||||
.9 sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
|
@ -99,7 +99,6 @@ KERNEL.SYSCALL
|
||||
.DA K.GetDevByIDA $90
|
||||
.DA K.GetDevByNameYA
|
||||
.DA K.GetDevInfoA
|
||||
.DA K.GetKeyboardEvent
|
||||
*--------------------------------------
|
||||
* LO Byte :
|
||||
* #RRAMWRAMBNK1 or #RRAMWRAMBNK2
|
||||
@ -253,23 +252,14 @@ KERNEL.SYSCALL.FLAGS
|
||||
.DA #$80
|
||||
.DA #RRAMWRAMBNK2
|
||||
*--------------------------------------
|
||||
.DA #$80 $80 :
|
||||
.DA #RRAMWRAMBNK2
|
||||
.DA #$80
|
||||
.DA #RRAMWRAMBNK2
|
||||
.DA #$80
|
||||
.DA #RRAMWRAMBNK2
|
||||
.DA #$80
|
||||
.DA #RRAMWRAMBNK2
|
||||
|
||||
.DA #$80
|
||||
.DA #RRAMWRAMBNK2
|
||||
.DA #$80
|
||||
.DA #RRAMWRAMBNK2
|
||||
.DA #$80
|
||||
.DA #RRAMWRAMBNK2
|
||||
.DA #$80
|
||||
.DA #RRAMWRAMBNK2
|
||||
.DA 0 $80 : MemMgr at $E000
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
.DA 0
|
||||
*--------------------------------------
|
||||
.DA #$80 $90 :
|
||||
.DA #RRAMWRAMBNK2
|
||||
@ -277,8 +267,6 @@ KERNEL.SYSCALL.FLAGS
|
||||
.DA #RRAMWRAMBNK2
|
||||
.DA #$80
|
||||
.DA #RRAMWRAMBNK2
|
||||
.DA #$80
|
||||
.DA #RRAMWRAMBNK2
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE SYS/KERNEL.S.JMP
|
||||
|
@ -12,72 +12,63 @@ K.KernelRun jsr TSK.TskMgrRun
|
||||
bcs K.KernelRun CS=no event
|
||||
|
||||
jsr TSK.DispatchEvents
|
||||
bcc K.KernelRun CC=All Events Dispatched
|
||||
bcc .4 CC=All Events Dispatched
|
||||
|
||||
jsr PS.Select0
|
||||
|
||||
stz pEvent
|
||||
|
||||
.1 lda (pEvent)
|
||||
beq .81
|
||||
bmi .8 Discard any timer event
|
||||
|
||||
bit #S.EVT.F.KEY any special key?
|
||||
beq .7
|
||||
beq .3
|
||||
|
||||
ldy #S.EVT.DATAHI Open-Apple?
|
||||
lda (pEvent),y
|
||||
bpl .7
|
||||
|
||||
dey S.EVT.DATALO
|
||||
lda (pEvent),y
|
||||
|
||||
cmp #'1'
|
||||
bcc .8
|
||||
cmp #'5'
|
||||
bcs .8
|
||||
and #$0F
|
||||
|
||||
cmp A2osX.ASCREEN
|
||||
beq .8
|
||||
|
||||
tax
|
||||
lda A2osX.SCRNDEVS-1,x
|
||||
beq .8
|
||||
|
||||
jsr K.GetDevByIDA
|
||||
bcs .8
|
||||
|
||||
>STYA pDev
|
||||
ldx #DEVMGR.SELECT
|
||||
jsr pDevJmp
|
||||
bcs .8
|
||||
|
||||
ldy #S.EVT.DATALO
|
||||
lda (pEvent),y
|
||||
and #$0F
|
||||
sta A2osX.ASCREEN
|
||||
bra .8
|
||||
|
||||
.7 ldy #S.EVT.DATAW2+1
|
||||
.71 >PUSHB (pEvent),y
|
||||
dey
|
||||
bpl .71
|
||||
bmi .2 Ignore & Discard any timer event
|
||||
|
||||
>LDYAI MSG.DumpEvent
|
||||
jsr K.PStrOutYA
|
||||
|
||||
.8 jsr EVT.DestroyEvent
|
||||
.2 jsr EVT.DestroyEvent
|
||||
|
||||
.81 lda pEvent
|
||||
.3 lda pEvent
|
||||
clc
|
||||
adc #S.EVT
|
||||
sta pEvent
|
||||
lda EVTMGR.COUNT
|
||||
bne .1
|
||||
|
||||
jmp K.KernelRun
|
||||
.4 bit OPENAPPLE
|
||||
bpl K.KernelRun
|
||||
|
||||
lda KBD
|
||||
inc A2osX.RANDOM16
|
||||
sta A2osX.RANDOM16+1
|
||||
|
||||
bpl K.KernelRun
|
||||
|
||||
cmp #"1"
|
||||
bcc K.KernelRun
|
||||
cmp #"5"
|
||||
bcs K.KernelRun
|
||||
|
||||
sta KBDSTROBE
|
||||
|
||||
and #$0F
|
||||
cmp A2osX.ASCREEN Same as active screen...nothing to do
|
||||
beq K.KernelRun
|
||||
|
||||
tax
|
||||
lda A2osX.SCRNDEVS-1,x No device claimed this screen
|
||||
beq K.KernelRun
|
||||
|
||||
jsr K.GetDevByIDA x unmodified.....
|
||||
bcs K.KernelRun ???
|
||||
|
||||
stx A2osX.ASCREEN
|
||||
|
||||
>STYA pDev
|
||||
ldx #DEVMGR.SELECT
|
||||
jsr pDevJmp
|
||||
bra K.KernelRun
|
||||
*--------------------------------------
|
||||
.9 jsr DevMgr.SYS.Select
|
||||
>LDYAI MSG.KRNLPANIC
|
||||
jsr K.PStrOutYA
|
||||
|
@ -96,10 +96,6 @@ TSK.TskMgrRun >LDYAI TskMgr.Table+S.PS skip PS 0
|
||||
* CC: Event Cleared
|
||||
*--------------------------------------
|
||||
TSK.DispatchEvents
|
||||
|
||||
lda EVTMGR.COUNT
|
||||
beq *
|
||||
|
||||
>LDYAI TskMgr.Table+S.PS
|
||||
>STYA pPs
|
||||
|
||||
@ -110,12 +106,14 @@ TSK.DispatchEvents
|
||||
beq .9
|
||||
|
||||
lda (pPs) get S.PS.F
|
||||
bit #S.PS.F.INUSE In use ?
|
||||
beq .4
|
||||
bpl .4
|
||||
|
||||
bit #S.PS.F.INIT+S.PS.F.SLEEP+S.PS.F.HOLD Init,Sleep or Waiting for Another Task to Terminate?
|
||||
* bit #S.PS.F.INUSE In use ?
|
||||
* beq .4
|
||||
|
||||
bit #S.PS.F.INIT+S.PS.F.HOLD Init or Waiting for Another Task to Terminate?
|
||||
bne .4
|
||||
|
||||
|
||||
bit #S.PS.F.EVENT Accept Events ?
|
||||
beq .4
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user