Kernel version 0.9 : CHTYP and related API entries added to kernel....still in progress

This commit is contained in:
Rémy GIBERT 2017-04-03 23:13:46 +02:00
parent e274c5593b
commit 9099848c6a
15 changed files with 202 additions and 59 deletions

0
BIN/CHGRP.S.txt Normal file
View File

0
BIN/CHOWN.S.txt Normal file
View File

View File

@ -38,6 +38,7 @@ CS.START cld
.DA CS.DOEVENT
.DA CS.QUIT
L.MSG.USAGE .DA MSG.USAGE
L.MSG.FILE .DA MSG.FILE
L.MSG.OK .DA MSG.OK
L.MSG.ERR .DA MSG.ERR
L.STAT .DA STAT
@ -46,11 +47,16 @@ L.PRODOS.FT.TXT .DA PRODOS.FT.TXT-1
*--------------------------------------
CS.INIT >SYSCALL GetArgC
sta ArgCount
cmp #1
beq .99
.1 dec ArgCount
beq .98
stz ArgIndex
lda ArgCount
.1 dec ArgCount
beq .7
inc ArgIndex
lda ArgIndex
>SYSCALL GetArgA
>STYA ZPPtr1
@ -73,24 +79,44 @@ CS.INIT >SYSCALL GetArgC
dex
bne .2
bra .98
.99 >LDYA L.MSG.USAGE
>SYSCALL PPrintFYA
lda #SYSMGR.ERRSYN
sec
rts
.3 ldy OptionVars-1,x
lda #$80
sta (pData),y
bra .1
.4 >LDYA ZPPtr1
.4 ldy #index
lda (pData),y
bne .5
>LDYA ZPPtr1
jsr InitSrcDirYA
bcs .9
bcc .1
rts
bra .1 scan for any other args
.5 ldy #HexFileType
lda (pData),y
bne .99
.98 >LDYA L.MSG.USAGE
>SYSCALL PPrintFYA
.99 lda #SYSMGR.ERRSYN
sec
.9 rts
jsr GetHexFileType
bcs .99
bra .1
.7 ldy #index processed all args
lda (pData),y
beq .99 , no src ? ERROR
ldy #HexFileType
lda (pData),y
beq .99 we also have a TYPE
clc
rts
*--------------------------------------
CS.RUN >SYSCALL GetC
bcs .10 no char
@ -150,21 +176,70 @@ CS.RUN >SYSCALL GetC
sec
.99 rts
*--------------------------------------
CS.RUN.DEV
CS.RUN.DIR
.8 jsr GetNextEntry
clc
.9 rts
*--------------------------------------
CS.RUN.DIR
CS.RUN.DEV
.8 jsr GetNextEntry
clc
.9 rts
*--------------------------------------
CS.RUN.FILE jsr CS.RUN.GetFilePath
>PUSHWI UsrBuf256
>LDYA L.MSG.FILE
>SYSCALL PPrintFYA
bcs .9
jsr CS.RUN.CheckErr
.8 jsr GetNextEntry
clc
.9 rts
*--------------------------------------
CS.RUN.FILE
.8 jsr GetNextEntry
clc
CS.RUN.CheckErr bcs .1
>LDYA L.MSG.OK
>SYSCALL PPrintFYA
rts
.1 pha
ldy #bContinue
lda (pData),y
bpl .2
pla
>PUSHA
>LDYA L.MSG.ERR
>SYSCALL CPrintFYA
bcs .9
rts
.2 lda #13
>SYSCALL PutCA
lda #10
>SYSCALL PutCA
pla
sec
.9 rts
*--------------------------------------
CS.RUN.GetFilePath
ldy #hSrcBasePath
lda (pData),y
>SYSCALL GetMemPtrA
>PUSHYA
>PUSHWI UsrBuf256
>SYSCALL PStrCpy
>PUSHW ZPFileName
>PUSHWI UsrBuf256
>SYSCALL PStrCat
rts
*--------------------------------------
CS.DOEVENT sec
rts
*--------------------------------------
@ -179,15 +254,13 @@ CS.QUIT jsr LeaveSubDir
.3 clc
rts
*--------------------------------------
GetHexFileTypeA >SYSCALL GetMemPtrA
>STYA ZPPtr1
lda (ZPPtr1)
GetHexFileType lda (ZPPtr1)
cmp #3
bne .9
ldy #1
lda (ZPPtr1),y
cmp #'%'
cmp #'0'
bne .1
iny
@ -255,14 +328,16 @@ GetHexFileTypeA >SYSCALL GetMemPtrA
*--------------------------------------
CS.END
*--------------------------------------
OptionList >PSTR "R"
OptionVars .DA #bRecurse
OptionList >PSTR "CR"
OptionVars .DA #bContinue,#bRecurse
*--------------------------------------
MSG.USAGE >PSTR "Usage : CHTYP <-R> [File *,? wildcards allowed] [File type : %HH, SYS,TXT....]\n"
MSG.OK >PSTR " [Ok]\n"
MSG.ERR >PSTR " [%h]\n"
MSG.USAGE >PSTR "Usage : CHTYP [File *,? wildcards allowed] [File type : 0HH, SYS,TXT....]\r\n -C : Continue on error\r\n -R : Recurse subdirectories\r\n"
MSG.OK >PSTR " [Ok]\r\n"
MSG.ERR >PSTR " [%h]\r\n"
MSG.FILE >PSTR "CHTYP File:%S..."
STAT .BS S.STAT
ArgCount .BS 1
ArgIndex .BS 1
Tmp .BS 1
*--------------------------------------
PRODOS.FT.COUNT .EQ 7
@ -285,6 +360,7 @@ oDIRENTs .BS X.MAX.RECURSE*2
hSrcBasePath .BS 1
hFilter .BS 1
bPause .BS 1
bContinue .BS 1
bRecurse .BS 1
HexFileType .BS 1
DS.END

View File

@ -27,8 +27,8 @@ MSG.USAGE >CSTR "Usage : CP [Src File/Dir, *,? wildcards allowed]\r\n -C : Co
MSG.DIR >CSTR "CP Dir :%S%S to %S%S..."
MSG.FILE >CSTR "CP File:%S%S to %S%S..."
MSG.OVERWRTE >CSTR "Overwrite [Yes,No,All]?"
MSG.OK >CSTR "[OK]\r\n"
MSG.ERR >CSTR "[%h]\r\n"
MSG.OK >PSTR "[OK]\r\n"
MSG.ERR >PSTR "[%h]\r\n"
*--------------------------------------
STAT .BS S.STAT
ArgCount .BS 1

View File

@ -27,8 +27,8 @@ MSG.USAGE >CSTR "Usage : MV [Src File/Dir, *,? wildcards allowed]\r\n -C : Co
MSG.DIR >CSTR "MV Dir :%S%S to %S%S..."
MSG.FILE >CSTR "MV File:%S%S to %S%S..."
MSG.OVERWRTE >CSTR "Overwrite [Yes,No,All]?"
MSG.OK >CSTR "[OK]\r\n"
MSG.ERR >CSTR "[%h]\r\n"
MSG.OK >PSTR "[OK]\r\n"
MSG.ERR >PSTR "[%h]\r\n"
*--------------------------------------
STAT .BS S.STAT
ArgCount .BS 1

View File

@ -26,8 +26,8 @@ OptionVars .DA #bContinue,#bRecurse,#bNoConfirm
MSG.USAGE >CSTR "Usage : RM [File/Dir, *,? wildcards allowed]\r\n -C : Continue on error\r\n -R : Recurse subdirectories\r\n"
MSG.DIR >CSTR "RM Dir :%S%S..."
MSG.FILE >CSTR "RM File:%S%S..."
MSG.OK >CSTR "[OK]\r\n"
MSG.ERR >CSTR "[%h]\r\n"
MSG.OK >PSTR "[OK]\r\n"
MSG.ERR >PSTR "[%h]\r\n"
*--------------------------------------
STAT .BS S.STAT
ArgCount .BS 1

View File

@ -576,11 +576,13 @@ CS.RUN.CheckErr bcs .1
>PUSHA
>LDYA L.MSG.ERR
>SYSCALL CPrintFYA
>SYSCALL PPrintFYA
bcs .9
rts
.2 lda #13
>SYSCALL PutCA
lda #10
>SYSCALL PutCA
pla
sec

Binary file not shown.

Binary file not shown.

View File

@ -164,10 +164,10 @@ SYS.GetFullPathYA .EQ $02
SYS.LoadFile .EQ $04
SYS.SaveFile .EQ $06
* .EQ $08
* .EQ $0A
* .EQ $0C
* .EQ $0E
SYS.ChTyp .EQ $08
SYS.ChMod .EQ $0A
SYS.ChOwn .EQ $0C
SYS.ChGrp .EQ $0E
*--------------------------------------
SYS.LoadDrvYA .EQ $10
SYS.LoadLibYA .EQ $12

View File

@ -155,6 +155,14 @@ note : '$VAR' does NOT expand Variable
| CAT | Working | -A : Show All non printable caracters | 0.9 |
| | | -N : Number all output lines | |
| | | -S : Suppress repeated empty output lines | |
| CHTYP | In Progress | -C : Continue On Error | 0.9 |
| | | -R : Recurse subdirectories | |
| CHMOD | In Progress | -C : Continue On Error | 0.9 |
| | | -R : Recurse subdirectories | |
| CHOWN | In Progress | -C : Continue On Error | 0.9 |
| | | -R : Recurse subdirectories | |
| CHGRP | In Progress | -C : Continue On Error | 0.9 |
| | | -R : Recurse subdirectories | |
| FORMAT | In Progress | -L : Low-Level Format | 0.9 |
| EDIT | Working | still missing : find/replace | 0.9 |
| NSCUTIL | Working | Tool for setting time in NSC/DL1216E | 0.9 |

View File

@ -228,6 +228,49 @@ K.LoadFile.hFile .BS 1
K.LoadFile.hMem .BS 1
K.LoadFile.Mem .BS 2
K.LoadFile.Len .BS 2
*/--------------------------------------
* # ChTyp
* ## In:
* PUSHB = TYPE ...
* PUSHW = PATH ...FOpen)
*\--------------------------------------
K.ChTyp jsr PFT.CheckPathSTK
>PULLW K.MLI.PARAMS+1
>PULLB .1+1
>MLICALL MLIGETFILEINFO
bcs .9
.1 lda #$ff
sta K.MLI.PARAMS+S.FILEINFO.TYPE
>MLICALL MLIGETFILEINFO
.9 rts
*/--------------------------------------
* # ChMod
* ## In:
* PUSHW = MODE ...
* PUSHW = PATH ...FOpen)
*\--------------------------------------
K.ChMod
sec
rts
*/--------------------------------------
* # ChOwn
* ## In:
* PUSHW = UID ...
* PUSHW = PATH ...FOpen)
*\--------------------------------------
K.ChOwn
sec
rts
*/--------------------------------------
* # ChGrp
* ## In:
* PUSHW = GID ...
* PUSHW = PATH ...FOpen)
*\--------------------------------------
K.ChGrp
sec
rts
*--------------------------------------
MAN
SAVE /A2OSX.SRC/SYS/KERNEL.S.FIO

View File

@ -1,6 +1,6 @@
PR#3
PREFIX /A2OSX.BUILD
NEW
LOMEM $A00
INC 1
AUTO 6
*--------------------------------------
@ -14,10 +14,10 @@ KERNEL.SYSCALL
.DA K.GetFullPathYA
.DA K.LoadFile
.DA K.SaveFile
.DA 0
.DA 0
.DA 0
.DA 0
.DA K.ChTyp
.DA K.ChMod
.DA K.ChOwn
.DA K.ChGrp
*--------------------------------------
.DA K.LoadDrvYA $10
.DA K.LoadLibYA
@ -113,7 +113,7 @@ KERNEL.SYSCALL
.DA 0
.DA 0
*--------------------------------------
.DA K.FPutCAY
.DA K.FPutCAY $B0
.DA K.PutCA
.DA K.FGetCA
.DA K.GetC
@ -124,7 +124,6 @@ KERNEL.SYSCALL
*--------------------------------------
* LO Byte :
* #RRAMWRAMBNK1 or #RRAMWRAMBNK2
* LO Byte :
*--------------------------------------
KERNEL.SYSCALL.FLAGS
*--------------------------------------

View File

@ -6,13 +6,13 @@ AUTO 6
.LIST OFF
.OP 65C02
.OR $2000
.TF /A2OSX.BUILD/SYS/KERNEL
.TF SYS/KERNEL
*--------------------------------------
.INB /A2OSX.BUILD/INC/MACROS.I
.INB /A2OSX.BUILD/INC/A2OSX.I
.INB /A2OSX.BUILD/INC/IO.I
.INB /A2OSX.BUILD/INC/PRODOS.I
.INB /A2OSX.BUILD/INC/MLI.ERR.I
.INB INC/MACROS.I
.INB INC/A2OSX.I
.INB INC/IO.I
.INB INC/PRODOS.I
.INB INC/MLI.ERR.I
*--------------------------------------
TmpPtr1 .EQ $0 for X.PRINTF.S
ZPPtr1 .EQ ZPKERNEL
@ -38,16 +38,12 @@ ZPPtr4 .EQ ZPKERNEL+6
.INB /A2OSX.SRC/X.PRINTF.S
.INB /A2OSX.SRC/SYS/KERNEL.S.INIT2
.INB /A2OSX.SRC/SYS/KERNEL.S.INIT3
* Global Page
A2osX.GP .PH $BD00
.INB /A2OSX.SRC/SYS/KERNEL.S.GP
.EP
A2osX.GP.E .EQ *
* LC AUX $D000 BANK1 API Calls $00-$3E
A2osX.D1 .PH $D000
.DA #RRAMWRAMBNK1
.INB /A2OSX.SRC/SYS/KERNEL.S.FIO
@ -61,9 +57,7 @@ A2osX.D1 .PH $D000
.INB /A2OSX.SRC/SYS/KERNEL.S.BIN
.EP
A2osX.D1.E .EQ *
* LC AUX $D000 BANK2 API Calls $40-$8E
A2osX.D2 .PH $D000
.DA #RRAMWRAMBNK2
.INB /A2OSX.SRC/SYS/KERNEL.S.CIO
@ -78,9 +72,7 @@ A2osX.D2 .PH $D000
.INB /A2OSX.SRC/SYS/KERNEL.S.TSK
.EP
A2osX.D2.E .EQ *
* LC AUX $E000 API Calls $80-$FE
A2osX.E0 .PH $E000
.INB /A2OSX.SRC/SYS/KERNEL.S.JMP
.INB /A2OSX.SRC/SYS/KERNEL.S.DAT
@ -92,7 +84,6 @@ A2osX.E0 .PH $E000
.INB /A2OSX.SRC/SYS/KERNEL.S.D01
.EP
A2osX.E0.E .EQ *
* CONTROL SECTION :
.LIST ON
A2osX.GP.S .EQ A2osX.GP.E-A2osX.GP

View File

@ -452,6 +452,30 @@ And return, if found, the full path to it.
+ PUSHB = MODE ...
+ PUSHW = PATH ...FOpen)
# ChTyp
## In:
+ PUSHB = TYPE ...
+ PUSHW = PATH ...FOpen)
# ChMod
## In:
+ PUSHW = MODE ...
+ PUSHW = PATH ...FOpen)
# ChOwn
## In:
+ PUSHW = UID ...
+ PUSHW = PATH ...FOpen)
# ChGrp
## In:
+ PUSHW = GID ...
+ PUSHW = PATH ...FOpen)
# GetMem
## In: