Kernel 0.93

This commit is contained in:
Rémy GIBERT 2019-04-30 18:08:47 +02:00
parent 888438fb0b
commit 110f37bd5f
12 changed files with 144 additions and 205 deletions

View File

@ -1,6 +1,5 @@
NEW
PREFIX
AUTO 4,1
AUTO 3,1
.LIST OFF
*--------------------------------------
* ****** START OF MLI QUIT CODE ******
@ -14,7 +13,8 @@ A2osX.QC.Start .EQ *
A2osX.QC cld
jmp A2osX.QC.Start1
A2osX.QC.Prefix .BS 64
A2osX.QC.BOOT .BS 32
A2osX.QC.ROOT .BS 32
A2osX.QC.Start1 sei
ldx #$FF
@ -41,7 +41,7 @@ A2osX.QC.Start1 sei
lda #$8C Reset 80 col screen ($0C=FF=HOME)
jsr $C300
sec
>LDYAI MSG.INIT1
jsr A2osX.QC.PrintYA
@ -52,14 +52,15 @@ A2osX.QC.Start1 sei
>LDYAI MSG.SETPREFIXKO
jsr A2osX.QC.PrintYA
>LDYAI A2osX.QC.Prefix
>LDYAI A2osX.QC.BOOT
sec
jsr A2osX.QC.PrintYA
>DEBUG
bra .3
.4 >LDYAI MSG.SETPREFIXOK
sec
jsr A2osX.QC.PrintYA
jsr A2osX.QC.KLoad
@ -70,29 +71,51 @@ A2osX.QC.Start1 sei
* bit RROMBNK1
* jsr SETPWRC
ldx A2osX.QC.BOOT
stx $280 For appending SYS/KERNEL
>DEBUG
stz $2C0,x
.5 lda A2osX.QC.BOOT,x
sta $280,x
sta $2C0-1,x BOOT sz for KERNEL
dex
bpl .5
ldx A2osX.QC.ROOT
stz $2E0,x
.6 lda A2osX.QC.ROOT,x
sta $2E0-1,x ROOT sz for KERNEL
dex
bpl .6
.8 >LDYAI MSG.INIT1OK
sec
jsr A2osX.QC.PrintYA
>DEBUGOA
jmp $2000
*--------------------------------------
A2osX.QC.KLoad >LDYAI MSG.KLOAD
clc
jsr A2osX.QC.PrintYA
ldx A2osX.QC.Prefix
>DEBUG
ldx $280
ldy #0
.2 inx
iny
lda SYSKERNEL,y
sta A2osX.QC.Prefix,x
sta $280,x
cpy SYSKERNEL
bne .2
stx A2osX.QC.Prefix
stx $280
>LDYAI A2osX.QC.Prefix
>LDYAI $280
clc
jsr A2osX.QC.PrintYA
jsr MLI
@ -121,13 +144,15 @@ A2osX.QC.KLoad >LDYAI MSG.KLOAD
.9 pha
>LDYAI MSG.KLOAD.KO
clc
jsr A2osX.QC.PrintYA
pla
jsr PRBYTE
sec
.8 rts
*--------------------------------------
A2osX.QC.PrintYA
php
>STYA TmpPtr1
lda (TmpPtr1)
tax
@ -142,14 +167,17 @@ A2osX.QC.PrintYA
dex
bne .1
.9 jsr CROUT
rts
.9 plp
bcc .99
jsr CROUT
.99 rts
*--------------------------------------
MLISETPREFIX00 .DA #1
.DA A2osX.QC.Prefix
.DA A2osX.QC.BOOT
*--------------------------------------
MLIOPENK .DA #3
.DA A2osX.QC.Prefix
.DA $280
.DA $C00
.BS 1
*--------------------------------------
@ -167,7 +195,7 @@ SYSKERNEL >PSTR "SYS/KERNEL"
MSG.INIT1 >PSTR "A2osX[Stage1]:Init"
MSG.SETPREFIXOK >PSTR "Set Prefix OK"
MSG.SETPREFIXKO >PSTR "Insert Vol:"
MSG.KLOAD >PSTR "Loading Kernel..."
MSG.KLOAD >PSTR "Loading Kernel:"
MSG.KLOAD.KO >PSTR "Error While Loading Kernel."
MSG.INIT1OK >PSTR "A2osX[Stage1]:Complete."
*--------------------------------------

View File

@ -1,5 +1,5 @@
NEW
AUTO 4,1
AUTO 3,1
.LIST OFF
.OP 65C02
.OR $2000
@ -72,7 +72,8 @@ A2osX.Init1 ldx #$FF init 6502 stack to highest
jsr PrintFYA
bra *
*--------------------------------------
.1 jsr A2osX.Prefix
.1 jsr A2osX.GetPrefix
jsr A2osX.Screen80 Reset 80 col screen ($0C:HOME)
>LDYAI MSG.INIT0
@ -158,21 +159,26 @@ A2osX.MLIQuit >LDYAI MSG.INIT0OK
.DA MLIQUIT01
bra *
*--------------------------------------
A2osX.Prefix >LDYAI MSG.BOOTPREFIX
A2osX.GetPrefix >LDYAI MSG.BOOTPREFIX
clc
jsr PrintFYA
jsr MLI
.DA #MLIGETPREFIX
.DA MLIGETPREFIX01
bcs *
>LDYAI Boot.Prefix
sec
jsr PrintFYA
ldx Boot.Prefix
stx A2osX.QC.B.Start+4
stx A2osX.QC.B.BOOT
stx A2osX.QC.B.ROOT
ldy #1
.1 lda Boot.Prefix,y
sta A2osX.QC.B.Start+4,y
iny
.1 lda Boot.Prefix,x
sta A2osX.QC.B.BOOT,x
sta A2osX.QC.B.ROOT,x
dex
bne .1
@ -180,7 +186,7 @@ A2osX.Prefix >LDYAI MSG.BOOTPREFIX
*--------------------------------------
A2osX.Screen80 lda #$8C
jsr $C300
ldx Boot.Prefix
.1 lda Boot.Prefix,x
@ -604,6 +610,8 @@ PALETTE.AUX .HS 00080109020A030B040C050D060E070F
.EP
*--------------------------------------
A2osX.QC.B.Start
A2osX.QC.B.BOOT .EQ *+4
A2osX.QC.B.ROOT .EQ *+4+32
.INB USR/SRC/A2OSX.S.QC
.LIST ON
SYSTEM.END .EQ *

View File

@ -11,6 +11,7 @@ AUTO 4,1
.INB INC/MLI.I
.INB INC/MLI.E.I
*--------------------------------------
X.ENTER.SUBDIR .EQ 0
X.COPY.TO.DEST .EQ 0
X.DELETE.SOURCE .EQ 0
*--------------------------------------
@ -209,27 +210,10 @@ CS.RUN.DIR >LDA.G bRecurse
.8 clc
.9 rts
*--------------------------------------
CS.RUN.FILE >LDA.G hFilter
beq .3 No filter....
pha
ldy #S.STAT.FSID
lda (ZPFileStat),y
bne .1 not prodos...
pla
>SYSCALL GetMemPtr
>SYSCALL strupr
bra .2
.1 pla
>SYSCALL GetMemPtr
.2 jsr StrMatch
CS.RUN.FILE jsr FilterMatch
bcs .8 no match, skip....
.3 jsr CS.RUN.GetFilePath
jsr CS.RUN.GetFilePath
>PUSHW ZPFullPath

View File

@ -11,6 +11,7 @@ AUTO 4,1
.INB INC/MLI.I
.INB INC/MLI.E.I
*--------------------------------------
X.ENTER.SUBDIR .EQ 0
X.COPY.TO.DEST .EQ 0
X.DELETE.SOURCE .EQ 0
*--------------------------------------
@ -141,27 +142,10 @@ CS.RUN ldy #S.PS.hStdIn
jsr GetEntry
bcs .9
>LDA.G hFilter
beq .4 No filter....
pha
ldy #S.STAT.FSID
lda (ZPFileStat),y
bne .11 not prodos...
pla
>SYSCALL GetMemPtr
>SYSCALL strupr
bra .12
.11 pla
>SYSCALL GetMemPtr
.12 jsr StrMatch
jsr FilterMatch
bcs .8 no match, skip....
.4 ldy #S.STAT.P.DRIVE
ldy #S.STAT.P.DRIVE
lda (ZPFileStat),y ProDOS Device ?
bne CS.RUN.DEV

View File

@ -104,10 +104,15 @@ CS.RUN
jsr InitSrcDirYA
bcs .9
*--------------------------------------
CS.RUN.LOOP bra .2
CS.RUN.LOOP ldy #S.PS.hStdIn
lda (pPS),y
>SYSCALL feof
bcs .99 I/O error
tay
beq .2 no char
>SYSCALL GetChar
bcs .2 no char
cmp #$03 Ctrl-C
bne .1 Abort....
@ -127,23 +132,7 @@ CS.RUN.LOOP bra .2
jsr GetEntry
bcs .9
>LDA.G hFilter
beq .4 No filter....
pha
ldy #S.STAT.FSID
lda (ZPFileStat),y
bne .11 not prodos...
pla
>SYSCALL GetMemPtr
>SYSCALL strupr
bra .12
.11 pla
>SYSCALL GetMemPtr
.12 jsr StrMatch
jsr FilterMatch
bcs .8 no match, skip....
.4 ldy #S.STAT.P.DRIVE

View File

@ -11,6 +11,7 @@ AUTO 4,1
.INB INC/MLI.I
.INB INC/MLI.E.I
*--------------------------------------
X.ENTER.SUBDIR .EQ 0
X.COPY.TO.DEST .EQ 0
X.DELETE.SOURCE .EQ 0
*--------------------------------------
@ -201,27 +202,10 @@ CS.RUN.DIR lda (ZPFileName)
.8 clc
.9 rts
*--------------------------------------
CS.RUN.FILE >LDA.G hFilter
beq .3 No filter....
pha
ldy #S.STAT.FSID
lda (ZPFileStat),y
bne .1 not prodos...
pla
>SYSCALL GetMemPtr
>SYSCALL strupr
bra .2
.1 pla
>SYSCALL GetMemPtr
.2 jsr StrMatch
CS.RUN.FILE jsr FilterMatch
bcs .8 no match, skip....
.3 jsr CS.RUN.GetFilePath
jsr CS.RUN.GetFilePath
>PUSHW ZPFullPath

View File

@ -175,6 +175,7 @@ CS.RUN.RmDir >LDA.G bDelete
>LDYA ZPStrPtr
>SYSCALL strcat
>PUSHBI S.PS.F.HOLD
>LDYA ZPStrPtr
>SYSCALL execl
rts

View File

@ -11,6 +11,7 @@ AUTO 4,1
.INB INC/MLI.I
.INB INC/MLI.E.I
*--------------------------------------
X.ENTER.SUBDIR .EQ 0
X.COPY.TO.DEST .EQ 0
X.DELETE.SOURCE .EQ 0
*--------------------------------------
@ -181,27 +182,10 @@ CS.RUN.DEV
clc
.9 rts
*--------------------------------------
CS.RUN.FILE >LDA.G hFilter
beq .3 No filter....
pha
ldy #S.STAT.FSID
lda (ZPFileStat),y
bne .1 not prodos...
pla
>SYSCALL GetMemPtr
>SYSCALL strupr
bra .2
.1 pla
>SYSCALL GetMemPtr
.2 jsr StrMatch
CS.RUN.FILE jsr FilterMatch
bcs .8 no match, skip....
.3 jsr CS.RUN.GetFilePath
jsr CS.RUN.GetFilePath
>PUSHW ZPFullPath

View File

@ -158,6 +158,7 @@ CS.RUN ldy #S.PS.hStdIn
.15 ldy #bPause
lda (pData),y
bpl .1
.8 clc
rts
*--------------------------------------
@ -223,28 +224,7 @@ CS.RUN ldy #S.PS.hStdIn
.3 jsr GetEntry
bcs CS.RUN.LEAVE
>LDA.G index
dec
bne .4 in a subdir, match everything
>LDA.G hFilter
beq .4 No filter....
pha
ldy #S.STAT.FSID
lda (ZPFileStat),y
bne .11 not prodos...
pla
>SYSCALL GetMemPtr
>SYSCALL strupr
bra .12
.11 pla
>SYSCALL GetMemPtr
.12 jsr StrMatch
jsr FilterMatch
bcs CS.RUN.NEXT no match, skip....
.4 ldy #S.STAT.P.DRIVE

View File

@ -12,14 +12,30 @@ X.MAX.RECURSE .EQ 8
* hSrcBasePath .BS 1
* hDstBasePath .BS 1 (optional)
* STAT .BS S.STAT
* hFilter .BS 1
*--------------------------------------
* Compare a ZPFileName against pattern in Y,A (e.g. '*test?.txt')
* Compare a ZPFileName against hFilter (e.g. '*test?.*')
* CC : match
* CS : no match
*--------------------------------------
StrMatch >STYA ZPPtr2
FilterMatch >LDA.G index
dec
bne .8 in a subdir, match everything
>LDA.G hFilter
beq .8 No filter....
>SYSCALL GetMemPtr
>STYA ZPPtr2
ldy #S.STAT.FSID
lda (ZPFileStat),y
bne .10 not prodos...
>LDYA ZPPtr2 CI compare
>SYSCALL strupr
lda (ZPPtr2) Get pattern 1st byte
.10 lda (ZPPtr2) Get pattern 1st byte
beq .8 Match always if empty
ldy #0

View File

@ -1,6 +1,5 @@
NEW
PREFIX
AUTO 4,1
AUTO 3,1
*--------------------------------------
Kernel.Init2 sei
ldx #$FF
@ -109,9 +108,6 @@ Kernel.Init3 sta SETALTZP
sta CLRPAGE2
sta SETDHIRES
lda #"M"
sta SYS.BASL0+38
jsr MemMgrInit
>LDYAI S.PS Select Process 0 (Kernel)
@ -126,9 +122,6 @@ Kernel.Init3 sta SETALTZP
>STYA pStack
sta pLocal+1
lda #"N"
sta SYS.BASL0+38
>PUSHWI FD.NULL.NAME
>LDYAI FD.NULL
>SYSCALL MKDev
@ -136,9 +129,6 @@ Kernel.Init3 sta SETALTZP
jsr SysScrInit
bcs *
lda #"P"
sta SYS.BASL0+38
>PUSHWI 0 Aux type
>PUSHBI S.FI.T.TXT
>PUSHBI O.RDWR
@ -152,9 +142,6 @@ Kernel.Init3 sta SETALTZP
sta (pPs),y
iny #S.PS.hStdErr
sta (pPs),y
lda #"I"
sta SYS.BASL0+38
*--------------------------------------
Kernel.Init3C >LDYAI MSG.Init3
>SYSCALL puts
@ -175,15 +162,7 @@ Kernel.Init3C >LDYAI MSG.Init3
jsr PwdMgrInit
ldy #S.PS.hPREFIX
lda (pPs),y
jsr K.GetMemPtr
>PUSHYA
>PUSHBI 2
>LDYAI MSG.Prefix
>SYSCALL printf
jsr CacheMgrInit
lda KBD
bpl .7
@ -342,10 +321,7 @@ MemMgrInit >LDYAI Mem.MHiMem
rts
*--------------------------------------
SysScrInit lda #"S"
sta SYS.BASL0+38
>LDYAI Mem.XHiMem
SysScrInit >LDYAI Mem.XHiMem
>STYA FD.TTY+S.FD.DEV.BUFPTR
jsr SysScrInit.TTYPtrs
@ -355,13 +331,9 @@ SysScrInit lda #"S"
>SYSCALL MKDev
bcs .9
lda #"0"
sta SYS.BASL0+38
ldx A2osX.TTYDEVS
.1 phx
inc SYS.BASL0+38
inc FD.TTY+S.FD.DEV.DEVID
inc FD.TTY.NAME+3
@ -1009,14 +981,14 @@ EvtMgrInit >LDYAI MSG.EVT
lda /Evt.Table
sta pEvent+1
clc
rts
EvtMgrInit.RTS rts
*--------------------------------------
TskMgrInit >LDYAI MSG.TSK
>SYSCALL puts
>LDYAI K.ENV.SIZE get a buffer for ENV
jsr K.GetMem
bcs .9
bcs EvtMgrInit.RTS
>STYA ZPPtr1
@ -1032,32 +1004,20 @@ TskMgrInit >LDYAI MSG.TSK
lda #0
sta (ZPPtr1) make sure blank!!
>LDYAI K.Buf256
>STYA K.MLI.PARAMS+1
>MLICALL MLIGETPREFIX
>LDYAI $2E0 Get ROOT from QC
>SYSCALL strdup
bcs .9
ldy K.Buf256
iny
lda #0
jsr K.GetMem
>STYA ZPPtr1
txa
ldy #S.PS.hPREFIX
sta (pPs),y
ldy K.Buf256
lda #0
sta (ZPPtr1),y
.4 lda K.Buf256,y
dey
sta (ZPPtr1),y
bne .4
>PUSHW ZPPtr1 push ENV value = PREFIX
>PUSHWI $2C0 Get BOOT from QC
>LDYAI I.ENV.BOOT
>SYSCALL SetEnv
bcs .9
>LDYAI I.ENV.ROOT push ENV name = ROOT
>PUSHWI $2E0 Get ROOT from QC
>LDYAI I.ENV.ROOT
>SYSCALL SetEnv
bcs .9
@ -1084,7 +1044,7 @@ PwdMgrInit >LDYAI MSG.PWD
bcs .1
stx PWD.hDB
>STYA PWD.DBSize
.9 rts
rts
*--------------------------------------
.1 >LDYAI PwdMgr.ROOT.Size
jsr K.Getmem
@ -1114,6 +1074,24 @@ PwdMgr.ROOT .DA #S.SESSION.P.ROOT
.AZ "${ROOT}BIN/SH" SHELL
PwdMgr.ROOT.Size .EQ *-PwdMgr.ROOT
*--------------------------------------
CacheMgrInit ldy #S.PS.hPREFIX
lda (pPs),y
jsr K.GetMemPtr
>STYA ZPPtr1
lda A2osX.F.CHROOT
bpl .8
.8 >PUSHW ZPPtr1
>PUSHBI 2
>LDYAI MSG.Prefix
>SYSCALL printf
rts
*--------------------------------------
* Modified CHARGET/CHARGOT for ROM CALL
* CHRGET .EQ $B1 - C8
*--------------------------------------
@ -1191,6 +1169,8 @@ MSG.Z80.OK .AZ "Detected In Slot %d.\r\n"
MSG.Z80.KO .AZ "Not Detected."
*--------------------------------------
DEV.CONSOLE .AZ "/DEV/CONSOLE"
RAMx .AZ "/RAMx"
I.ENV.BOOT .AZ "BOOT"
I.ENV.ROOT .AZ "ROOT"
I.ENV.PATH .AZ "PATH=${ROOT}SBIN/:${ROOT}BIN/"
I.ENV.LIB .AZ "LIB=${ROOT}LIB/"

View File

@ -244,7 +244,7 @@ PWD.DeleteRecord
cmp #C.CR
bne .1
sty .8+1
sty .3+1
tya
sec
@ -263,11 +263,12 @@ PWD.DeleteRecord
lda PWD.DBSize
sec
.8 sbc #$ff SELF MODIFIED
.3 sbc #$ff SELF MODIFIED
sta PWD.DBSize
bcs .9
bcs .8
dec PWD.DBSize+1
.8 clc
.9 rts
*--------------------------------------