Kernel version 0.8 : BUGFIX #16 , CTIME not set properly when creating FILEs & DIRs

This commit is contained in:
Rémy GIBERT 2016-11-13 22:03:31 +01:00
parent 0a08b4c0b7
commit 6322233cb8
11 changed files with 167 additions and 76 deletions

Binary file not shown.

Binary file not shown.

View File

@ -25,13 +25,14 @@ OptionList >PSTR "CRY"
OptionVars .DA #bContinue,#bRecurse,#bNoConfirm
*--------------------------------------
MSG.USAGE >CSTR "Usage : CP [Src File/Dir, *,? wildcards allowed]\n -C : Continue on error\n -R : Recurse subdirectories\n -Y : Dont't prompt for override\n"
MSG.DIR >CSTR "CP Dir :%S to %S..."
MSG.DIR >CSTR "CP Dir :%S%S to %S..."
MSG.FILE >CSTR "CP File:%S%S to %S..."
MSG.OK >CSTR "[OK]\n"
MSG.ERR >CSTR "[%h]\n"
*--------------------------------------
STAT .BS S.STAT
ArgCount .BS 1
ArgIndex .BS 1
*--------------------------------------
.DUMMY
.OR 0

View File

@ -132,7 +132,7 @@ CS.INIT lda #$ff
*--------------------------------------
CS.RUN ldy #bCancel
lda (pData),y
bne .9
bne .99
ldy #bInit
lda (pData),y
@ -144,7 +144,7 @@ CS.RUN ldy #bCancel
.1 ldy #bCancel
lda (pData),y
bne .9
bne .99
>SYSCALL Sleep
@ -162,6 +162,7 @@ CS.RUN ldy #bCancel
.8 clc
rts
.99 lda #0
.9 sec
rts
*--------------------------------------

View File

@ -37,12 +37,15 @@ L.STAT .DA STAT
CS.INIT >SYSCALL GetArgC
sta ArgCount
cmp #1
beq .99
beq .99
stz ArgIndex
.1 dec ArgCount
beq .7
lda ArgCount
inc ArgIndex
lda ArgIndex
>SYSCALL GetArgA
>STYA ZPPtr1
@ -64,7 +67,9 @@ CS.INIT >SYSCALL GetArgC
beq .3
dex
bne .2
.99 >LDYA L.MSG.USAGE
>SYSCALL CPrintFYA
lda #SYSMGR.ERRSYN
sec
rts
@ -112,12 +117,6 @@ CS.INIT >SYSCALL GetArgC
clc
rts
.99 >LDYA L.MSG.USAGE
>SYSCALL CPrintFYA
lda #SYSMGR.ERRSYN
sec
.9 rts
*--------------------------------------
CS.RUN ldy #bCANCEL
lda (pData),y
@ -160,16 +159,12 @@ CS.RUN ldy #bCANCEL
lda (pData),y
bpl .8
ldy #hSrcBasePath
lda (pData),y
>SYSCALL GetMemPtrA
>PUSHYA
>LDYA L.MSG.DIR
>SYSCALL CPrintFYA
.DO X.DELETE.SOURCE=1
jsr CS.RUN.DELETE.DIR
jsr CS.RUN.PRINT.RC
bcs .99
.FIN
jsr BasePath..
.8 clc
@ -210,6 +205,13 @@ CS.RUN.DIR ldy #bRecurse
cmp #'.'
beq .8
jsr CS.RUN.PRINT.DIR
bcs .9
jsr CS.RUN.COPY.DIR
jsr CS.RUN.PRINT.RC
bcs .9
>LDYA ZPPtr1
jmp EnterSubDirYA
@ -218,11 +220,30 @@ CS.RUN.DIR ldy #bRecurse
*--------------------------------------
CS.RUN.FILE jsr CS.RUN.PRINT.FILE
bcs .9
jsr CS.RUN.COPY.FILE
jsr CS.RUN.PRINT.RC
bcs .9
.DO X.DELETE.SOURCE=1
jsr CS.RUN.DELETE.FILE
jsr CS.RUN.PRINT.RC
bcs .9
.FIN
.9 rts
*--------------------------------------
CS.RUN.PRINT.DIR
jsr CS.RUN.GET.SRC.DST
>LDYA L.MSG.DIR
bra CS.RUN.PRINT
CS.RUN.PRINT.FILE
jsr CS.RUN.GET.SRC.DST
>LDYA L.MSG.FILE
CS.RUN.PRINT >SYSCALL CPrintFYA
rts
CS.RUN.GET.SRC.DST
ldy #hDstBasePath
lda (pData),y
>SYSCALL GetMemPtrA
@ -234,11 +255,30 @@ CS.RUN.PRINT.FILE
lda (pData),y
>SYSCALL GetMemPtrA
>PUSHYA
>LDYA L.MSG.FILE
>SYSCALL CPrintFYA
rts
*--------------------------------------
CS.RUN.COPY.DIR ldy #hDstBasePath
lda (pData),y
>SYSCALL GetMemPtrA
>PUSHYA
>PUSHWI UsrBuf256
>SYSCALL PStrCpy
>PUSHW ZPPtr1
>PUSHWI UsrBuf256
>SYSCALL PStrCat
>LDYAI UsrBuf256
>SYSCALL MKDirYA
rts
*--------------------------------------
CS.RUN.COPY.FILE
jsr CS.RUN.MAKE.SRC
clc
rts
*--------------------------------------
.DO X.DELETE.SOURCE=1
*--------------------------------------
CS.RUN.DELETE.DIR
jsr CS.RUN.GET.BASE.PATH
bra CS.RUN.DELETE
@ -253,6 +293,8 @@ CS.RUN.DELETE >LDYAI UsrBuf256
* >SYSCALL RemoveYA
clc
rts
*--------------------------------------
.FIN
*--------------------------------------
CS.RUN.GET.BASE.PATH
ldy #hSrcBasePath
@ -263,6 +305,21 @@ CS.RUN.GET.BASE.PATH
>SYSCALL PStrCpy
rts
*--------------------------------------
CS.RUN.MAKE.SRC ldy #hSrcBasePath
.HS 2C bit abs
CS.RUN.MAKE.DST ldy #hDstBasePath
lda (pData),y
>SYSCALL GetMemPtrA
>PUSHYA
>PUSHWI UsrBuf256
>SYSCALL PStrCpy
>PUSHW ZPPtr1
>PUSHWI UsrBuf256
>SYSCALL PStrCat
>LDYAI UsrBuf256
rts
*--------------------------------------
CS.RUN.PRINT.RC pha
php
bcs .1
@ -275,11 +332,12 @@ CS.RUN.PRINT.RC pha
.8 >SYSCALL CPrintFYA
bcs .9
plp
bcc .81
ldy #bContinue
lda (pData),y
eor #$80
asl
pla
.81 pla
rts
.9 plx

View File

@ -37,7 +37,18 @@ InitDstDirYA >SYSCALL GetFullPathYA
dey
bne .6
jsr .9 Cleanup
lda (ZPPtr2)
tay
lda #'/'
cmp (ZPPtr2),y
beq .7
iny
sta (ZPPtr2),y
tya
sta (ZPPtr2)
.7 jsr .9 Cleanup
clc
.99 rts
@ -274,21 +285,7 @@ EnterSubDirYA >STYA ZPPtr2 save SUBDIR for StrCat
beq .9
ldy #hSrcBasePath
lda (pData),y
>SYSCALL GetMemPtrA
>STYA ZPPtr1 save full path
>PUSHW ZPPtr2
>PUSHW ZPPtr1
>SYSCALL PStrCat
lda (ZPPtr1)
inc
tay
sta (ZPPtr1)
lda #'/'
sta (ZPPtr1),y
jsr EnterSubDirYA.1
>LDYA ZPPtr1
>SYSCALL OpenDirYA
@ -313,7 +310,30 @@ EnterSubDirYA >STYA ZPPtr2 save SUBDIR for StrCat
lda #0
sta (pData),y
.DO X.DST.BASE.PATH=1
ldy #hDstBasePath
jsr EnterSubDirYA.1
.FIN
.9 rts
EnterSubDirYA.1 lda (pData),y
>SYSCALL GetMemPtrA
>STYA ZPPtr1 save full path
>PUSHW ZPPtr2
>PUSHW ZPPtr1
>SYSCALL PStrCat
lda (ZPPtr1)
inc
tay
sta (ZPPtr1)
lda #'/'
sta (ZPPtr1),y
rts
*--------------------------------------
LeaveSubDir ldy #index
lda (pData),y
@ -343,8 +363,13 @@ LeaveSubDir ldy #index
.8 clc
rts
*--------------------------------------
BasePath.. ldy #hSrcBasePath
lda (pData),y
BasePath.. .DO X.DST.BASE.PATH=1
ldy #hDstBasePath
jsr BasePath..1
.FIN
ldy #hSrcBasePath
BasePath..1 lda (pData),y
>SYSCALL GetMemPtrA
>STYA ZPPtr1 save full path
@ -360,7 +385,6 @@ BasePath.. ldy #hSrcBasePath
tya
sta (ZPPtr1) cut DIR2/ from /dir1/DIR2/
clc
rts
*--------------------------------------
MAN

View File

@ -53,9 +53,14 @@ DevMgr.SYS.Open stz DevMgr.SYS.CPULOADI
jsr DevMgr.SYS.Home
lda #1
sta A2osX.SCRNDEVS+1
jsr DevMgr.SYS.Select
sta A2osX.SCRNDEVS+1 fall in SELECT
*--------------------------------------
DevMgr.SYS.Select
sta SETTEXT
sta SETALTCHAR
sta SET80DISP
sta CLR80STORE
sta SETPAGE2
clc
rts
*--------------------------------------
@ -125,15 +130,6 @@ DevMgr.SYS.COut phx
clc
rts
*--------------------------------------
DevMgr.SYS.Select
sta SETTEXT
sta SETALTCHAR
sta SET80DISP
sta CLR80STORE
sta SETPAGE2
clc
rts
*--------------------------------------
DevMgr.SYS.FSOut
lda DevMgr.SYS.CH
cmp #79

View File

@ -613,7 +613,16 @@ K.MKDirYA jsr PFT.CheckPathYA
lda #S.FILEINFO.TYPE.DIR
sta MLICALL.PARAMS+S.FILEINFO.TYPE
lda #S.FILEINFO.STORETYPE.DIR
sta MLICALL.PARAMS+S.FILEINFO.STORETYPE
sta MLICALL.PARAMS+S.FILEINFO.STORETYPE
* jsr DATETIME
ldx #3
.1 lda DATELO,x
sta MLICALL.PARAMS+8,x
dex
bpl .1
>MLICALL MLICREATE
rts
*--------------------------------------

View File

@ -44,7 +44,16 @@ K.FOPEN jsr PFT.CheckPathSTK
>LDYA K.FOPEN.AUXTYPE
>STYA MLICALL.PARAMS+5 Aux type
lda #S.FILEINFO.STORETYPE.STD
sta MLICALL.PARAMS+7
sta MLICALL.PARAMS+7
* jsr DATETIME
ldx #3
.1 lda DATELO,x
sta MLICALL.PARAMS+8,x
dex
bpl .1
>MLICALL MLICREATE
bcc K.FOPEN.10
K.FOPEN.9 rts

View File

@ -306,8 +306,8 @@ K.FreeMemA phy
bit RRAMWRAMBNK2
bit RRAMWRAMBNK2
jsr DevMgr.SYS.Select
jsr PS.Select0
jsr DevMgr.SYS.Select
pla Get PC and sub 2 for calling address
sec

View File

@ -55,14 +55,13 @@ K.CreateProcess.CPSID .BS 1
* ##Out :
* Y,A = PTR to TSKSLOT
*\--------------------------------------
K.GetPSByIDA sta K.GetPSByIDA.PS
K.GetPSByIDA pha
>LDYAI TskMgr.Table
>STYA ZPQuickPtr1
lda K.GetPSByIDA.PS
pla
beq .8
sta .20+1
ldx #0
.1 inx
@ -78,7 +77,7 @@ K.GetPSByIDA sta K.GetPSByIDA.PS
ldy #S.PS.PID
lda (ZPQuickPtr1),y
cmp K.GetPSByIDA.PS
.20 cmp #$ff Self Modified
beq .8
.3 cpx TSKMGR.SIZE
@ -91,8 +90,6 @@ K.GetPSByIDA sta K.GetPSByIDA.PS
.8 >LDYA ZPQuickPtr1
clc
rts
*--------------------------------------
K.GetPSByIDA.PS .BS 1
*/--------------------------------------
* #Sleep
* Make current process suspend until next RUN
@ -285,7 +282,7 @@ PS.Init >LDYA K.CreateProcess.CmdLine
*--------------------------------------
PS.FreeA jsr K.GetPSByIDA
bcs *
>STYA ZPQuickPtr1
* >STYA ZPQuickPtr1 Already in ZPQuickPtr1
ldy #S.PS.hCMDLINE
lda (ZPQuickPtr1),y
@ -329,30 +326,26 @@ PS.FreeA jsr K.GetPSByIDA
* PS.SelectA
* In : A=PSID
*--------------------------------------
PS.SelectA tay
bne PS.SelectN
PS.Select0
>LDYAI TskMgr.Table Make PS #0 as current process
>STYA pPs
bra PS.SelectDev
PS.SelectN jsr K.GetPSByIDA
PS.Select0 lda #0
PS.SelectA jsr K.GetPSByIDA
bcs *
>STYA pPs
PS.Select ldy #S.PS.hCS
lda (pPs),y
beq .1 PS=0 (kernel) has no CS/DS
jsr K.GetMemPtrA
>STYA pCode
ldy #S.PS.hDS
lda (pPs),y
beq PS.SelectDev
beq .1
jsr K.GetMemPtrA
>STYA pData
PS.SelectDev ldy #S.PS.hOUTDEV
.1 ldy #S.PS.hOUTDEV
lda (pPs),y
beq .8