Kernel 0.9.2

This commit is contained in:
Rémy GIBERT 2018-08-11 12:57:57 +02:00
parent 45cd7d04fa
commit 41338d85f7
15 changed files with 77 additions and 101 deletions

Binary file not shown.

Binary file not shown.

View File

@ -12,6 +12,7 @@ AUTO 4,1
*--------------------------------------
ZPPtr1 .EQ ZPBIN
ZPPtr2 .EQ ZPBIN+2
ZPPtrFD .EQ ZPBIN+4
*--------------------------------------
* File Header (16 Bytes)
*--------------------------------------
@ -23,7 +24,7 @@ CS.START cld
.DA CS.END-CS.START CS
.DA DS.END-DS.START DS
.DA #16 SS
.DA #4 ZP
.DA #6 ZP
.DA 0
*--------------------------------------
* Relocation Table
@ -81,14 +82,17 @@ CS.INIT ldy #S.PS.ARGC
sta (pData),y
bra .1
.4 >LDA.G hDev
bne .5 Already have a dev name...go get VolName
.4 >LDA.G hDevFD
bne .5 Already have a dev...go get VolName
>LDYA ZPPtr1
>SYSCALL GetDevByName
>SYSCALL GetDevByName
bcs .99
>STYA ZPPtrFD
txa
>STA.G hDev
>SYSCALL GetDevByID
txa
>STA.G hDevFD
bra .1
.5 ldy #$ff
@ -201,19 +205,15 @@ CS.RUN.InitCat >LDA.G CatSize
rts
*--------------------------------------
CS.RUN.BuildCat >PUSHEA.G DIB
>LDA.G hDev
>LDA.G hDevFD
>SYSCALL GetDevStatus
bcs .99
>LDA.G hDev
>SYSCALL GetDevByID
bcs .99
pha
tya
lda ZPPtrFD
* clc
adc #S.FD.DEV.NAME
sta ZPPtr2
pla
lda ZPPtrFD+1
adc /S.FD.DEV.NAME
sta ZPPtr2+1
@ -259,8 +259,7 @@ CS.RUN.BuildCat >PUSHEA.G DIB
*--------------------------------------
CS.RUN.WriteCat >PUSHEA.G IOCTL
>PUSHBI IOCTL.WRITEBLOCK
>LDA.G hDev
>LDA.G hDevFD
>SYSCALL IOCTL
bcs .9
@ -335,7 +334,7 @@ DS.START
ArgIndex .BS 1
bLL .BS 1
VolName .BS 16
hDev .BS 5
hDevFD .BS 5
CatSize .BS 1
CatOptions .BS 1
BlkCnt .BS 1

View File

@ -411,11 +411,10 @@ CS.DOEVENT sec
CS.QUIT jsr LeaveSubDir
bcc CS.QUIT
ldy #hFilter
lda (pData),y
>LDA.G hFilter
beq .3
>SYSCALL FreeMem
.3 clc
rts
*--------------------------------------

View File

@ -68,26 +68,21 @@ CS.RUN >SYSCALL GetChar
cmp #19 Ctrl-S ?
bne .12
ldy #bSTOP
lda (pData),y
>LDA.G bSTOP
eor #$ff
sta (pData),y
bra .13
.12 ldy #bSTOP
lda #0
sta (pData),y
.12 >STZ.G bSTOP
.13 ldy #bSTOP
lda (pData),y
.13 >LDA.G bSTOP
bne .8
>LDA.G MEM.COUNT
>CMP.G MemStat+S.MSTAT.MLast
beq .10
ldy #LINE.COUNT
lda (pData),y
>LDA.G LINE.COUNT
bne .1
>LDYA L.MSG0
@ -111,20 +106,17 @@ CS.RUN >SYSCALL GetChar
.9 sec
rts
.10 ldy #LINE.COUNT
lda (pData),y
.10 >LDA.G LINE.COUNT
clc
adc #FOOTERLEN
cmp #PAGELEN
bcc .11
lda #$FF
ldy #bSTOP
sta (pData),y
>STA.G bSTOP
lda #0
ldy #LINE.COUNT
sta (pData),y
inc
>STA.G LINE.COUNT
clc
rts
@ -157,6 +149,7 @@ CS.RUN >SYSCALL GetChar
>PUSHYA
>LDYA L.MSG.FREE
>SYSCALL printf
lda #0
sec
rts
*--------------------------------------
@ -294,7 +287,7 @@ MSG3 .AZ "High Memory: $%H\r\n"
MSG4 .AZ "Free ULimit: $%H\r\n"
MSG5 .AZ "Low Memory: $%H\r\n"
MSG.FREE .AZ "\r\nFree Memory: %D Bytes.\r\n"
MSG.FLAGS .AS "UZCNA--"
MSG.FLAGS .AS "UZNAfcds"
*--------------------------------------
.DUMMY
.OR 0

View File

@ -19,7 +19,7 @@ CS.START cld
.DA 0
.DA CS.END-CS.START CS
.DA DS.END-DS.START DS
.DA #16 SS
.DA #64 SS
.DA #8 ZP
.DA 0
*--------------------------------------
@ -52,15 +52,10 @@ CS.INIT
>STYA ZPPtr1
lda (ZPPtr1)
cmp #2
bne .4
ldy #1
lda (ZPPtr1),y
cmp #'-'
bne .4
iny
ldy #1
lda (ZPPtr1),y
ldx OptionList
@ -81,9 +76,7 @@ CS.INIT
sta (pData),y
bra .1
.4 tax Save len
>LDA.G index
.4 >LDA.G index
.DO X.COPY.TO.DEST=1
bne .5 Already have a Src dir...
@ -199,9 +192,7 @@ CS.RUN >SYSCALL GetChar
bcc .21
rts
.21 ldy #hToDelete
lda #0
sta (pData),y Cancel delete if any
.21 >STZ.G hToDelete Cancel delete if any
jmp CS.RUN.NEXT
.FIN
.FIN
@ -231,8 +222,7 @@ CS.RUN >SYSCALL GetChar
.3 jsr GetEntry
bcs CS.RUN.LEAVE
ldy #hFilter
lda (pData),y
>LDA.G hFilter
beq .4 No filter....
>SYSCALL GetMemPtr
@ -470,8 +460,7 @@ CS.RUN.DIR.MSG sec
.HS 90 bcc opcode
CS.RUN.FILE.MSG clc
ldy #bQuiet
lda (pData),y
>LDA.G bQuiet
bmi .8
php
@ -503,8 +492,7 @@ CS.RUN.FILE.MSG clc
.DO X.COPY.TO.DEST=1
CS.RUN.OVERWRITE.MSG
ldy #bQuiet
lda (pData),y
>LDA.G bQuiet
bmi .1
jsr CS.RUN.CR
@ -557,8 +545,7 @@ CS.RUN.CopyStart
jsr CS.RUN.Open
bcs .99
ldy #hSrcFile
sta (pData),y
>STA.G hSrcFile
ldy #hDstFullPath
lda #SYS.FOpen.W+SYS.FOpen.X
@ -579,8 +566,7 @@ CS.RUN.CopyStart
rts
.9 pha
ldy #hSrcFile
lda (pData),y
>LDA.G hSrcFile
>SYSCALL fclose
pla
@ -605,7 +591,6 @@ CS.RUN.Open phy Save Filename
ply
jsr CS.RUN.GetPathY
>SYSCALL FOpen
rts
*--------------------------------------
@ -656,8 +641,7 @@ CS.RUN.Copy stz .90+1
beq CS.RUN.CopyEnd
>SYSCALL FreeMem
*--------------------------------------
CS.RUN.CopyEnd ldy #hSrcFile
lda (pData),y
CS.RUN.CopyEnd >LDA.G hSrcFile
>SYSCALL fclose
ldy #hDstFile
@ -774,15 +758,13 @@ CS.QUIT jsr LeaveSubDir
.DO X.COPY.TO.DEST=1
ldy #bCopy
lda (pData),y
>LDA.G bCopy
bpl .1
ldy #hSrcFile
lda (pData),y
>LDA.G hSrcFile
>SYSCALL fclose
ldy #hDstFile
lda (pData),y
>LDA.G hDstFile
>SYSCALL fclose
.1 ldy #hDstFullPath
@ -796,6 +778,9 @@ CS.QUIT jsr LeaveSubDir
ldy #hSrcFullPath
jsr CS.QUIT.FREE
ldy #hFilter
jsr CS.QUIT.FREE
clc
rts
*--------------------------------------
@ -806,3 +791,5 @@ CS.QUIT.FREE lda (pData),y
*--------------------------------------
MAN
SAVE /A2OSX.SRC/BIN/X.CPMVRM.S
LOAD /A2OSX.SRC/BIN/CP.S
ASM

View File

@ -259,9 +259,12 @@ K.E.FTB .EQ $CC File Too Big Error
S.MEM.F .EQ 0
S.MEM.F.INUSE .EQ %10000000 (Internal Flag)
S.MEM.F.INIT0 .EQ %01000000 Fill with "0"
S.MEM.F.CODE .EQ %00100000
S.MEM.F.NOMOVE .EQ %00010000
S.MEM.F.ALIGN .EQ %00001000
S.MEM.F.NOMOVE .EQ %00100000
S.MEM.F.ALIGN .EQ %00010000
S.MEM.F.FD .EQ %00001000
S.MEM.F.CODE .EQ %00000100
S.MEM.F.DATA .EQ %00000010
S.MEM.F.STACK .EQ %00000001
S.MEM.REFCNT .EQ 1
S.MEM.OWNERPID .EQ 2
S.MEM.BIN .EQ 3

View File

@ -220,7 +220,7 @@ CS.DOEVENT lda (pEvent)
*--------------------------------------
CS.QUIT >LDA.G hBinName
beq .1
>SYSCALL FreeMem
* >SYSCALL FreeMem
.1 >LDA.G hDEV
beq .8

View File

@ -147,7 +147,7 @@ Cmd.Exec.Done php
>LDA.G CMD.hFullpath
beq .1
>SYSCALL FreeMem
>STZ.G CMD.hFullpath
.1 pla
plp
rts
@ -280,7 +280,7 @@ Cmd.Exec.PWD ldy #S.PS.hPREFIX
*--------------------------------------
Cmd.Exec.CD lda (ZPPTR2)
bne .1
>LDYA L.ENV.HOME
>SYSCALL GetEnv
bcs Cmd.Exec.PWD

View File

@ -123,7 +123,8 @@ K.MKDev >STYA .1+1
beq .9
>LDYAI S.FD.DEV
jsr K.GetMem
ldx #S.MEM.F.FD
jsr MEM.GetMem.YAX
>STYA .2+1
phx

View File

@ -23,12 +23,12 @@ K.OpenDir jsr PFT.CheckPathYA
jsr K.GetMem0
bcs .99
>STYA ZPPtr1
>STYA pFD
stx .8+1
ldy #S.FD.T Done by GetMem0
ldy #S.FD.T
lda #S.FD.T.DIR
sta (ZPPtr1),y
sta (pFD),y
ldy #1
lda (ZPPtr2),y One char ?
@ -49,7 +49,7 @@ K.OpenDir jsr PFT.CheckPathYA
lda K.MLI.PARAMS+5 get ref_num
ldy #S.FD.DIR.REF
sta (ZPPtr1),y
sta (pFD),y
.8 lda #$ff Self Modified
clc
@ -78,7 +78,6 @@ K.OpenDir jsr PFT.CheckPathYA
* A = EC
* note : A = 0 means no more entry
*\--------------------------------------
K.ReadDir.hDir .BS 1
K.ReadDir.hMem .BS 1
K.ReadDir.BufSize .BS 2
K.ReadDir.ECIB .BS 1
@ -88,12 +87,11 @@ K.ReadDir.EPB .BS 1
K.ReadDir.EC .BS 2
*--------------------------------------
K.ReadDir jsr PFT.CheckNodeA
sta K.ReadDir.hDir
jsr K.GetMemPtr
>STYA ZPPtr1
>STYA pFD
ldy #S.FD.DIR.REF
lda (ZPPtr1),y
lda (pFD),y
beq K.ReadDir.ROOT
jmp K.ReadDir.DIR
@ -104,7 +102,7 @@ K.ReadDir.NoMore
*--------------------------------------
K.ReadDir.ROOT
ldy #S.FD.DIR.FC did we already returned something ?
lda (ZPPtr1),y
lda (pFD),y
bne K.ReadDir.NoMore
stz K.MLI.PARAMS+1 All Volumes
@ -218,7 +216,7 @@ K.ReadDir.ROOT
.5 ldy #S.FD.DIR.FC
lda #16
sta (ZPPtr1),y Flag that we returned somthing for next time
sta (pFD),y Flag that we returned somthing for next time
jmp K.ReadDir.EXIT
*--------------------------------------
@ -249,7 +247,7 @@ K.ReadDir.DIR sta K.MLI.PARAMS+1 A=#S.DIR.PRODOS.REF
bcs .98
ldy #S.FD.DIR.EL Check if first run....
lda (ZPPtr1),y
lda (pFD),y
bne .2 no, we have all we need....
ldy #$1f+3
@ -273,7 +271,7 @@ K.ReadDir.DIR sta K.MLI.PARAMS+1 A=#S.DIR.PRODOS.REF
.2 ldy #S.FD.DIR.EL+3
ldx #3
.3 lda (ZPPtr1),y get this session parameters from S.DIR
.3 lda (pFD),y get this session parameters from S.DIR
sta K.ReadDir.EL,x
dey
dex
@ -408,15 +406,11 @@ K.ReadDir.DIR2 jsr K.ReadDir.GetBuf
* lda #0 S.MEM.F.INIT0 already did this
* sta (ZPPtr4) Ending 0
lda K.ReadDir.hDir Restore ZPPtr1 trashed by STR API calls
jsr K.GetMemPtr
>STYA ZPPtr1
ldx #3
ldy #S.FD.DIR.EL+3
.81 lda K.ReadDir.EL,x Store back this session prameters to S.DIR
sta (ZPPtr1),y
sta (pFD),y
dey
dex
bpl .81

View File

@ -175,7 +175,7 @@ Mem.ReqFlags .BS 1 store requested Flags
* Out:
*--------------------------------------
Mem.AddSlot >STYA ZPMemMgrTmp1 save req size
ldx Mem.LastSlot
ldx Mem.LastSlot
inx
beq .99 > 255 ERR:OUT OF SLOT
@ -197,7 +197,7 @@ Mem.AddSlot >STYA ZPMemMgrTmp1 save req size
ldy #S.MEM.PTR
sta Mem.Free set as system Mem.Free value
sta (ZPMemMgrSPtr),y store is as base address of new slot
sta (ZPMemMgrSPtr),y store it as base address of new slot
iny
pla get back Mem.Free HI
sta Mem.Free+1

View File

@ -282,7 +282,8 @@ PS.Load jsr BIN.Load Y,A=filename full path
lda (ZPPtr4),y
tay
txa Y,A = DS.SIZE
jsr K.GetMem0
ldx #S.MEM.F.INIT0+S.MEM.F.DATA
jsr MEM.GetMem.YAX
bcs .9
phy
@ -311,7 +312,7 @@ PS.Load jsr BIN.Load Y,A=filename full path
.HS 2C bit abs
.3 lda #0
ldx #S.MEM.F.ALIGN
ldx #S.MEM.F.ALIGN+S.MEM.F.STACK
jsr MEM.GetMem.YAX
bcs .9

View File

@ -948,8 +948,8 @@ K.FOpen.10 lda #S.FD.REG
adc K.MLI.PATH
tay
lda #0
jsr K.GetMem0
ldx #S.MEM.F.INIT0+S.MEM.F.FD
jsr MEM.GetMem.YAX
bcs K.FOpen.9
>STYA pFD
@ -1039,7 +1039,6 @@ K.FOpen.AUXTYPE .BS 2
*\--------------------------------------
K.FClose jsr PFT.CheckNodeA
sta .8+1
jsr K.GetMemPtr
>STYA pFD

View File

@ -278,7 +278,7 @@ STDLIB.32.Clear ldx #3
bpl .1
rts
*/--------------------------------------
* # realpath
* # RealPath
* Return the canonicalized absolute pathname
* ## C
* `unsigned short int realpath (const char* str);`