Kernel 0.94

This commit is contained in:
Rémy GIBERT 2020-05-21 14:55:49 +02:00
parent a21709572d
commit 27d1615e95
11 changed files with 210 additions and 163 deletions

Binary file not shown.

View File

@ -204,8 +204,7 @@ CS.RUN.DIR >LDA.G bRecurse
jsr CS.RUN.CheckErr
>LDYA ZPFileName
jsr EnterSubDirYA
rts
jmp EnterSubDirYA
.8 clc
.9 rts
@ -262,6 +261,7 @@ CS.RUN.Str2Mode >SYSCALL ArgV
clc
rts
.9 sec
rts
*--------------------------------------

View File

@ -5,10 +5,10 @@ NEW
.OR $2000
.TF bin/chtyp
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
.INB INC/MLI.I
.INB INC/MLI.E.I
.INB inc/macros.i
.INB inc/a2osx.i
.INB inc/mli.i
.INB inc/mli.e.i
*--------------------------------------
X.ENTER.SUBDIR .EQ 0
X.COPY.TO.DEST .EQ 0
@ -46,8 +46,10 @@ L.MSG.ERR .DA MSG.ERR
L.PRODOS.FT.TXT .DA PRODOS.FT.TXT
.DA 0
*--------------------------------------
CS.INIT
.1 >INC.G ArgCount
CS.INIT clc
rts
*--------------------------------------
CS.RUN >INC.G ArgCount
>SYSCALL ArgV
bcs .7
@ -74,14 +76,14 @@ CS.INIT
.3 ldy OptionVars,x
lda #$80
sta (pData),y
bra .1
bra CS.RUN
*--------------------------------------
.4 >LDA.G HexFileType
bne .5
jsr GetHexFileType
bcs .99
bra .1
bra CS.RUN
.5 >LDA.G hSrcBasePath
bne .99
@ -89,7 +91,7 @@ CS.INIT
>LDYA ZPPtr1
jsr InitSrcDirYA
bcs .99
bra .1
bra CS.RUN
*--------------------------------------
.7 >LDA.G hSrcBasePath
beq .99 no src ? ERROR
@ -103,59 +105,103 @@ CS.INIT
>STYA ZPFullPath
txa
>STA.G hSrcFullPath
clc
rts
*--------------------------------------
CS.RUN ldy #S.PS.hStdIn
CS.RUN.LOOP ldy #S.PS.hStdIn
lda (pPS),y
>SYSCALL feof
bcs .99
tay
bne .10
bne .1
>SYSCALL GetChar
bcs .99
cmp #$03 Ctrl-C
beq .92 Abort....
beq .99 Abort....
cmp #$13 Ctrl-S
bne .10
bne .1
>LDA.G bPause
eor #$ff
sta (pData),y
bne .80
.10 >LDA.G bPause
bne .80 Pause...
bne CS.RUN.LOOP
.1 >LDA.G bPause
bne CS.RUN.LOOP Pause...
*--------------------------------------
jsr GetEntry
bcs .9
bcs CS.RUN.LEAVE
jsr FilterMatch
bcs .8 no match, skip....
ldy #S.STAT.P.DRIVE
lda (ZPFileStat),y ProDOS Device ?
bne CS.RUN.DEV
ldy #S.STAT.P.TYPE
bcs CS.RUN.NEXT no match, skip....
ldy #S.STAT.MODE+1
lda (ZPFileStat),y
cmp #$0F Directory ?
bne CS.RUN.FILE
and #$70
bne .5 REG file ?
jmp CS.RUN.DIR
.9 jsr LeaveSubDir
bcs .92
jsr BasePath..
.8 jsr GetNextEntry
.80 clc
jsr CS.RUN.FILE
bcc CS.RUN.NEXT
rts
.92 lda #0
.5 cmp /S.STAT.MODE.DIR DIR ?
bne .6
jsr CS.RUN.DIR
bcc CS.RUN.NEXT
rts
.6 lda #MLI.E.UNSUPST
sec
.99 rts
*--------------------------------------
CS.RUN.DIR
CS.RUN.DEV
.8 jsr GetNextEntry
clc
CS.RUN.NEXT jsr GetNextEntry
bcc CS.RUN.LOOP
CS.RUN.LEAVE jsr LeaveSubDir
bcs .90
jsr BasePath..
jmp CS.RUN.NEXT
.90 lda #0
sec
.99 rts
*--------------------------------------
CS.RUN.DIR >LDA.G bRecurse
bpl .8
lda (ZPFileName)
cmp #'.'
bne .1
ldy #1
lda (ZPFileName),y
beq .8
cmp #'.'
bne .1
iny
lda (ZPFileName),y
beq .8
.1 jsr CS.RUN.GetFilePath
>LDYA ZPFileName
jmp EnterSubDirYA
.8 clc
rts
*--------------------------------------
CS.RUN.FILE jsr CS.RUN.GetFilePath
CS.RUN.FILE jsr FilterMatch
bcs .8 no match, skip....
jsr CS.RUN.GetFilePath
>PUSHW L.MSG.FILE
>PUSHW ZPFullPath
>PUSHBI 2
@ -169,22 +215,15 @@ CS.RUN.FILE jsr CS.RUN.GetFilePath
>SYSCALL ChTyp
jsr CS.RUN.CheckErr
>LDA.G bRecurse
bpl .8
lda (ZPFileName)
cmp #'.'
beq .8
>LDYA ZPFileName
jsr EnterSubDirYA
rts
.8 jsr GetNextEntry
clc
.8 clc
.9 rts
*--------------------------------------
CS.RUN.CheckErr bcs .1
>LDYA L.MSG.OK
>SYSCALL PutS
rts
.1 pha
>PUSHW L.MSG.ERR
pla
@ -307,7 +346,7 @@ IsDigit16 cmp #'0'
.9 sec
rts
*--------------------------------------
.INB USR/SRC/BIN/X.FILEENUM.S
.INB usr/src/bin/x.fileenum.s
*--------------------------------------
CS.END
*--------------------------------------
@ -342,11 +381,11 @@ bContinue .BS 1
bRecurse .BS 1
HexFileType .BS 1
.INB USR/SRC/BIN/X.FILEENUM.G
.INB usr/src/bin/x.fileenum.g
DS.END
.ED
*--------------------------------------
MAN
SAVE USR/SRC/BIN/CHTYP.S
SAVE usr/src/bin/chtyp.s
ASM

View File

@ -5,17 +5,17 @@ NEW
.OR $2000
.TF bin/cp
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
.INB INC/MLI.I
.INB INC/MLI.E.I
.INB inc/macros.i
.INB inc/a2osx.i
.INB inc/mli.i
.INB inc/mli.e.i
*--------------------------------------
X.ENTER.SUBDIR .EQ 0
X.COPY.TO.DEST .EQ 1
X.DELETE.SOURCE .EQ 0
*--------------------------------------
.INB USR/SRC/BIN/X.CPMVRM.S
.INB USR/SRC/BIN/X.FILEENUM.S
.INB usr/src/bin/x.cpmvrm.s
.INB usr/src/bin/x.fileenum.s
*--------------------------------------
CS.END
*--------------------------------------
@ -42,11 +42,11 @@ bContinue .BS 1
bRecurse .BS 1
bNoConfirm .BS 1
bQuiet .BS 1
.INB USR/SRC/BIN/X.CPMVRM.G
.INB USR/SRC/BIN/X.FILEENUM.G
.INB usr/src/bin/x.cpmvrm.g
.INB usr/src/bin/x.fileenum.g
DS.END
.ED
*--------------------------------------
MAN
SAVE USR/SRC/BIN/CP.S
SAVE usr/src/bin/cp.s
ASM

View File

@ -5,17 +5,17 @@ NEW
.OR $2000
.TF bin/mv
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
.INB INC/MLI.I
.INB INC/MLI.E.I
.INB inc/macros.i
.INB inc/a2osx.i
.INB inc/mli.i
.INB inc/mli.e.i
*--------------------------------------
X.ENTER.SUBDIR .EQ 0
X.COPY.TO.DEST .EQ 1
X.DELETE.SOURCE .EQ 1
*--------------------------------------
.INB USR/SRC/BIN/X.CPMVRM.S
.INB USR/SRC/BIN/X.FILEENUM.S
.INB usr/src/bin/x.cpmvrm.s
.INB usr/src/bin/x.fileenum.s
*--------------------------------------
CS.END
*--------------------------------------
@ -42,11 +42,11 @@ bContinue .BS 1
bRecurse .BS 1
bNoConfirm .BS 1
bQuiet .BS 1
.INB USR/SRC/BIN/X.CPMVRM.G
.INB USR/SRC/BIN/X.FILEENUM.G
.INB usr/src/bin/x.cpmvrm.g
.INB usr/src/bin/x.fileenum.g
DS.END
.ED
*--------------------------------------
MAN
SAVE USR/SRC/BIN/MV.S
SAVE usr/src/bin/mv.s
ASM

View File

@ -5,17 +5,17 @@ NEW
.OR $2000
.TF bin/rm
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
.INB INC/MLI.I
.INB INC/MLI.E.I
.INB inc/macros.i
.INB inc/a2osx.i
.INB inc/mli.i
.INB inc/mli.e.i
*--------------------------------------
X.ENTER.SUBDIR .EQ 0
X.COPY.TO.DEST .EQ 0
X.DELETE.SOURCE .EQ 1
*--------------------------------------
.INB USR/SRC/BIN/X.CPMVRM.S
.INB USR/SRC/BIN/X.FILEENUM.S
.INB usr/src/bin/x.cpmvrm.s
.INB usr/src/bin/x.fileenum.s
*--------------------------------------
CS.END
*--------------------------------------
@ -39,11 +39,11 @@ DS.START
bContinue .BS 1
bRecurse .BS 1
bQuiet .BS 1
.INB USR/SRC/BIN/X.CPMVRM.G
.INB USR/SRC/BIN/X.FILEENUM.G
.INB usr/src/bin/x.cpmvrm.g
.INB usr/src/bin/x.fileenum.g
DS.END
.ED
*--------------------------------------
MAN
SAVE USR/SRC/BIN/RM.S
SAVE usr/src/bin/rm.s
ASM

View File

@ -8,8 +8,8 @@ NEW
USER.MAX .EQ 16
PASS.MAX .EQ 64
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
.INB inc/macros.i
.INB inc/a2osx.i
*--------------------------------------
* Zero Page Segment, up to 32 bytes
*--------------------------------------
@ -114,8 +114,8 @@ CS.RUN >LDYAI S.PW
sec
rts
.9 >PUSHBI 0
>LDYA L.MSG.USAGE
.9 >PUSHW L.MSG.USAGE
>PUSHBI 0
>SYSCALL PrintF
lda #E.SYN
sec
@ -134,8 +134,8 @@ CS.RUN.ROOT ldy #0
lda #127
sta ZPStrMax
>PUSHW L.MSG.ROOTPWD1
>PUSHBI 0
>LDYA L.MSG.ROOTPWD1
>SYSCALL PrintF
bcs .90
jsr CS.RUN.GetStr
@ -144,8 +144,9 @@ CS.RUN.ROOT ldy #0
>PUSHW ZPStrPtr
>PUSHEA.G PW+S.PW.PASSWD
>SYSCALL MD5
>PUSHW L.MSG.ROOTPWD2
>PUSHBI 0
>LDYA L.MSG.ROOTPWD2
>SYSCALL PrintF
bcs .9
jsr CS.RUN.GetStr
@ -166,8 +167,9 @@ CS.RUN.ROOT ldy #0
lda #0
sec
.9 rts
.99 >PUSHBI 0
>LDYA L.MSG.MISMATCH
.99 >PUSHW L.MSG.MISMATCH
>PUSHBI 0
>SYSCALL PrintF
lda #E.SYN
sec
@ -202,15 +204,17 @@ CS.RUN.GetStr stz ZPStrLen
dec ZPStrLen
bit ZPbStrSecret
bmi .1
>PUSHW L.MSG.BS
>PUSHBI 0
>LDYA L.MSG.BS
>SYSCALL PrintF
bra .1
.8 ldy ZPStrLen
lda #0
sta (ZPStrPtr),y
>PUSHW L.MSG.CRLF
>PUSHBI 0
>LDYA L.MSG.CRLF
>SYSCALL PrintF
.9 rts
*--------------------------------------
@ -275,8 +279,9 @@ CS.RUN.CheckArg inc ArgIndex
beq CS.RUN.CheckArg.9
clc
rts
.9 >PUSHBI 0
>LDYA L.MSG.DUP
.9 >PUSHW L.MSG.DUP
>PUSHBI 0
>SYSCALL PrintF
CS.RUN.CheckArg.9
lda #E.SYN
@ -410,5 +415,5 @@ DS.END
.ED
*--------------------------------------
MAN
SAVE USR/SRC/BIN/USERADD.S
SAVE usr/src/bin/useradd.s
ASM

View File

@ -497,30 +497,90 @@ CS.RUN.Rename ldy #hSrcFullPath
CS.RUN.CopyStart
>STZ.G hSrcFile
>STA.G hDstFile
>STA.G hCopyBuf
>STA.G CopyRC Reset RC
>LDYAI X.COPY.BUF.SIZE
>SYSCALL GetMem
bcs .9
>STYA ZPPtr1
txa
>STA.G hCopyBuf
ldy #hSrcFullPath
lda #O.RDONLY
jsr CS.RUN.Open
bcs .9
bcs CS.RUN.CopyEnd
>STA.G hSrcFile
ldy #hDstFullPath
lda #O.WRONLY+O.CREATE
jsr CS.RUN.Open
bcs .9
.9 bcs CS.RUN.CopyEnd
>STA.G hDstFile
lda #$ff
>STA.G bCopy
inc
>STA.G CopyRC Reset RC
clc
* clc
rts
*--------------------------------------
CS.RUN.Copy >PUSHWI X.COPY.BUF.SIZE Bytes To Read
>PUSHW ZPPtr1 Dst Ptr
>LDA.G hSrcFile
>SYSCALL FRead
bcc .1
cmp #MLI.E.EOF
bne .9
lda #0
clc
bra .9
.1 >PUSHYA Bytes To Write
>PUSHW ZPPtr1 Src Ptr
>LDA.G hDstFile
>SYSCALL FWrite
bcs .9
ldy #bQuiet
lda (pData),y
bmi .8
lda #'.'
>SYSCALL PutChar
.8 rts
.9 >STA.G CopyRC
jmp CS.RUN.CopyEnd
*--------------------------------------
CS.RUN.CopyEnd php
pha
>STA.G CopyRC
>LDA.G hDstFile
beq .1
>SYSCALL FClose
.1 >LDA.G hSrcFile
beq .2
>SYSCALL FClose
.2 >LDA.G hCopyBuf
beq .3
>SYSCALL FreeMem
.3 >STZ.G bCopy
pla
plp
rts
.FIN
*--------------------------------------
CS.RUN.Open pha Save open mode
jsr CS.RUN.GetPathY
@ -540,65 +600,6 @@ CS.RUN.Open pha Save open mode
>SYSCALL FOpen
rts
*--------------------------------------
CS.RUN.Copy >STZ.G hCopyBuf
>LDYAI X.COPY.BUF.SIZE
>SYSCALL GetMem
bcs .9
>STYA ZPPtr1
txa
>STA.G hCopyBuf
>PUSHWI X.COPY.BUF.SIZE Bytes To Read
>PUSHW ZPPtr1 Dst Ptr
>LDA.G hSrcFile
>SYSCALL FRead
bcc .1
cmp #MLI.E.EOF
bne .9
lda #0
bra .9
.1 >PUSHYA Bytes To Write
>PUSHW ZPPtr1 Src Ptr
>LDA.G hDstFile
>SYSCALL FWrite
bcs .9
>LDA.G hCopyBuf
>SYSCALL FreeMem
ldy #bQuiet
lda (pData),y
bmi .8
lda #'.'
>SYSCALL PutChar
.8 rts
.9 ldy #CopyRC
sta (pData),y
>LDA.G hCopyBuf
beq CS.RUN.CopyEnd
>SYSCALL FreeMem
*--------------------------------------
CS.RUN.CopyEnd php
pha
>LDA.G hSrcFile
>SYSCALL FClose
>LDA.G hDstFile
>SYSCALL FClose
>STZ.G bCopy
pla
plp
rts
.FIN
*--------------------------------------
CS.RUN.CheckErr bcs .1
>LDA.G bQuiet
@ -704,6 +705,6 @@ CS.QUIT jsr LeaveSubDir
rts
*--------------------------------------
MAN
SAVE USR/SRC/BIN/X.CPMVRM.S
LOAD USR/SRC/BIN/RM.S
SAVE usr/src/bin/x.cpmvrm.s
LOAD usr/src/bin/cp.s
ASM

View File

@ -32,7 +32,7 @@ MLI.E.BADDIR .EQ $51 Directory Structure Damaged
MLI.E.NOTPRODOS .EQ $52 Not a ProDOS disk
MLI.E.INVPARAM .EQ $53 Invalid Parameter
MLI.E.VCBFULL .EQ $55 Too Many Volumes
* .EQ $56 Bad Buffer Address
MLI.E.BADBUF .EQ $56 Bad Buffer Address
MLI.E.DUPVOL .EQ $57 Duplicate Volume
* .EQ $5A File Structure Damaged
*--------------------------------------

View File

@ -489,7 +489,7 @@ L4DFE dex set proper bits to 1
clc (entnums start at 1, not 0)
rts
L4E1E lda #$56 buffer is in use or not legal
L4E1E lda #MLI.E.BADBUF buffer is in use or not legal
sec
rts

View File

@ -71,6 +71,7 @@ ERRORX.Codes .DA #MLI.E.IO
.DA #MLI.E.EOF
.DA #MLI.E.LOCKED
.DA #MLI.E.OPEN
.DA #MLI.E.BADBUF
*--------------------------------------KERNEL
.DA #E.OOM
.DA #E.OOH
@ -114,6 +115,7 @@ ERRORX.Messages .AT "I/O Error"
.AT "End Of File"
.AT "File Locked"
.AT "File Opened"
.AT "Bad Buffer"
*--------------------------------------
.AT "Out Of Memory"
.AT "Out Of Handle"