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 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.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.FILE >CSTR "CP File:%S%S to %S..."
MSG.OK >CSTR "[OK]\n" MSG.OK >CSTR "[OK]\n"
MSG.ERR >CSTR "[%h]\n" MSG.ERR >CSTR "[%h]\n"
*-------------------------------------- *--------------------------------------
STAT .BS S.STAT STAT .BS S.STAT
ArgCount .BS 1 ArgCount .BS 1
ArgIndex .BS 1
*-------------------------------------- *--------------------------------------
.DUMMY .DUMMY
.OR 0 .OR 0

View File

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

View File

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

View File

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

View File

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

View File

@ -614,6 +614,15 @@ K.MKDirYA jsr PFT.CheckPathYA
sta MLICALL.PARAMS+S.FILEINFO.TYPE sta MLICALL.PARAMS+S.FILEINFO.TYPE
lda #S.FILEINFO.STORETYPE.DIR 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 >MLICALL MLICREATE
rts rts
*-------------------------------------- *--------------------------------------

View File

@ -45,6 +45,15 @@ K.FOPEN jsr PFT.CheckPathSTK
>STYA MLICALL.PARAMS+5 Aux type >STYA MLICALL.PARAMS+5 Aux type
lda #S.FILEINFO.STORETYPE.STD 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 >MLICALL MLICREATE
bcc K.FOPEN.10 bcc K.FOPEN.10
K.FOPEN.9 rts K.FOPEN.9 rts

View File

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

View File

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