Kernel version 0.9 : Migrating CP/MV commands, and shorter A2OSX.STARTUP file for debug

This commit is contained in:
Rémy GIBERT 2017-02-20 18:16:23 +01:00
parent a190169a07
commit 0ca506566b
6 changed files with 140 additions and 125 deletions

Binary file not shown.

Binary file not shown.

View File

@ -12,15 +12,15 @@ INSDRV CONSOLE.DRV
STARTPROC GETTY CON ${A2OSX}SBIN/LOGIN STARTPROC GETTY CON ${A2OSX}SBIN/LOGIN
# Serial Login # Serial Login
#INSDRV SSC.DRV 9600,N,8,1,X #INSDRV SSC.DRV 9600,N,8,1,X
INSDRV SSC.I.DRV 9600,N,8,1,X #INSDRV SSC.I.DRV 9600,N,8,1,X
STARTPROC GETTY COM2 ${A2OSX}SBIN/LOGIN #STARTPROC GETTY COM2 ${A2OSX}SBIN/LOGIN
#INSDRV PIC.DRV #INSDRV PIC.DRV
# Network Section # Network Section
INSDRV UTHERNET.DRV 000E3A123456 #INSDRV UTHERNET.DRV 000E3A123456
INSDRV UTHERNET2.DRV 0008DC123456 #INSDRV UTHERNET2.DRV 0008DC123456
#INSDRV UTHER2.AI.DRV 0008DC123456 #INSDRV UTHER2.AI.DRV 0008DC123456
#INSDRV LANCEGS.DRV #INSDRV LANCEGS.DRV
STARTPROC TCPIP #STARTPROC TCPIP
#STARTPROC DHCPCLNT #STARTPROC DHCPCLNT
#STARTPROC HTTPD #STARTPROC HTTPD
#TELNETD #TELNETD

View File

@ -44,8 +44,9 @@ oDIRENTs .BS X.MAX.RECURSE*2
hSrcBasePath .BS 1 hSrcBasePath .BS 1
hDstBasePath .BS 1 hDstBasePath .BS 1
hFilter .BS 1 hFilter .BS 1
bCANCEL .BS 1 hSrcFile .BS 1
bSTOP .BS 1 hDstFile .BS 1
bPause .BS 1
bContinue .BS 1 bContinue .BS 1
bRecurse .BS 1 bRecurse .BS 1
bNoConfirm .BS 1 bNoConfirm .BS 1

View File

@ -32,6 +32,7 @@ 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
@ -43,8 +44,7 @@ oDIRENTs .BS X.MAX.RECURSE*2
hSrcBasePath .BS 1 hSrcBasePath .BS 1
hDstBasePath .BS 1 hDstBasePath .BS 1
hFilter .BS 1 hFilter .BS 1
bCANCEL .BS 1 bPause .BS 1
bSTOP .BS 1
bContinue .BS 1 bContinue .BS 1
bRecurse .BS 1 bRecurse .BS 1
bNoConfirm .BS 1 bNoConfirm .BS 1

View File

@ -118,15 +118,22 @@ CS.INIT >SYSCALL GetArgC
clc clc
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN ldy #bCANCEL CS.RUN >SYSCALL GetC
lda (pData),y bcs .1 no char
bmi .99
ldy #bSTOP cmp #$03 Ctrl-C
lda (pData),y beq .99 Abort....
bmi .8
jsr GetNextEntry cmp #$13 Ctrl-S
bne .1
ldy #bPause
lda (pData),y
eor #$ff
sta (pData),y
bne .8
.1 jsr GetNextEntry
bcs .9 bcs .9
ldy #hFilter ldy #hFilter
@ -146,11 +153,13 @@ CS.RUN ldy #bCANCEL
ldy #S.STAT.P.TYPE ldy #S.STAT.P.TYPE
lda (ZPPtr2),y lda (ZPPtr2),y
cmp #$0F Directory ? cmp #$0F Directory ?
bne .6 beq .6
jmp CS.RUN.FILE
jmp CS.RUN.DIR
.5 jmp CS.RUN.DEV .5 jmp CS.RUN.DEV
.6 jmp CS.RUN.FILE
.6 jmp CS.RUN.DIR
.9 jsr LeaveSubDir .9 jsr LeaveSubDir
bcs .99 bcs .99
@ -183,12 +192,12 @@ CS.RUN.DEV >PUSHW ZPPtr1
lda (pData),y lda (pData),y
bpl .8 bpl .8
jsr CS.RUN.PRINT.FILE jsr CS.RUN.PrintFile
bcs .9 bcs .9
lda #0 lda #0
clc clc
jsr CS.RUN.PRINT.RC jsr CS.RUN.PrintErr
>LDYA ZPPtr1 >LDYA ZPPtr1
jmp EnterSubDirYA jmp EnterSubDirYA
@ -205,45 +214,51 @@ CS.RUN.DIR ldy #bRecurse
cmp #'.' cmp #'.'
beq .8 beq .8
jsr CS.RUN.PRINT.DIR jsr CS.RUN.PrintDir
bcs .9 bcs .9
jsr CS.RUN.COPY.DIR jsr CS.RUN.CopyDir
jsr CS.RUN.PRINT.RC
bcs .9 bcs .9
>LDYA ZPPtr1 >LDYA ZPPtr1
jmp EnterSubDirYA jmp EnterSubDirYA
.8 clc .8 clc
.9 rts rts
.9 jsr CS.RUN.PrintErr
rts
*-------------------------------------- *--------------------------------------
CS.RUN.FILE jsr CS.RUN.PRINT.FILE CS.RUN.FILE jsr CS.RUN.PrintFile
bcs .9 bcs .9
jsr CS.RUN.COPY.FILE jsr CS.RUN.CopyFile
jsr CS.RUN.PRINT.RC
bcs .9 bcs .9
.DO X.DELETE.SOURCE=1 .DO X.DELETE.SOURCE=1
jsr CS.RUN.DELETE.FILE jsr CS.RUN.DelFile
jsr CS.RUN.PRINT.RC
bcs .9 bcs .9
.FIN .FIN
.9 rts .9 jsr CS.RUN.PrintErr
*--------------------------------------
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 rts
*--------------------------------------
CS.RUN.PrintDir ldy #hDstBasePath
lda (pData),y
>SYSCALL GetMemPtrA
>PUSHYA
CS.RUN.GET.SRC.DST >PUSHW ZPPtr1
ldy #hSrcBasePath
lda (pData),y
>SYSCALL GetMemPtrA
>PUSHYA
>LDYA L.MSG.DIR
>SYSCALL CPrintFYA
rts
*--------------------------------------
CS.RUN.PrintFile
ldy #hDstBasePath ldy #hDstBasePath
lda (pData),y lda (pData),y
>SYSCALL GetMemPtrA >SYSCALL GetMemPtrA
@ -255,72 +270,106 @@ CS.RUN.GET.SRC.DST
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 CS.RUN.CopyDir ldy #hDstBasePath
lda (pData),y jsr CS.RUN.GetFilePath
>SYSCALL GetMemPtrA
>PUSHYA
>PUSHWI UsrBuf256
>SYSCALL PStrCpy
>PUSHW ZPPtr1
>PUSHWI UsrBuf256
>SYSCALL PStrCat
>LDYAI UsrBuf256 >LDYAI UsrBuf256
>SYSCALL MKDirYA >SYSCALL MKDirYA
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN.COPY.FILE CS.RUN.CopyFile ldy #S.STAT.P.AUXTYPE
jsr CS.RUN.MAKE.SRC >PUSHB (ZPPtr2),y
iny
>PUSHB (ZPPtr2),y
ldy #S.STAT.P.TYPE
>PUSHB (ZPPtr2),y
>PUSHBI SYS.FOpen.R
ldy #hSrcBasePath
jsr CS.RUN.GetFilePath
>PUSHWI UsrBuf256
>SYSCALL FOpen
bcs .9
ldy #hSrcFile
sta (pData),y
ldy #S.STAT.P.AUXTYPE
>PUSHB (ZPPtr2),y
iny
>PUSHB (ZPPtr2),y
ldy #S.STAT.P.TYPE
>PUSHB (ZPPtr2),y
>PUSHBI SYS.FOpen.W+SYS.FOpen.X
ldy #hDstBasePath
jsr CS.RUN.GetFilePath
>PUSHWI UsrBuf256
>SYSCALL FOpen
bcs .9
ldy #hDstFile
sta (pData),y
ldy #hDstFile
sta (pData),y
>SYSCALL FCloseA
ldy #hSrcFile
sta (pData),y
>SYSCALL FCloseA
clc clc
rts .9 rts
*-------------------------------------- *--------------------------------------
.DO X.DELETE.SOURCE=1 .DO X.DELETE.SOURCE=1
*-------------------------------------- *--------------------------------------
CS.RUN.DELETE.DIR CS.RUN.DelDir ldy #hSrcBasePath
jsr CS.RUN.GET.BASE.PATH jsr CS.RUN.GetBasePath
bra CS.RUN.DELETE >SYSCALL RemoveYA
rts
*-------------------------------------- *--------------------------------------
CS.RUN.DELETE.FILE CS.RUN.DelFile ldy #hSrcBasePath
jsr CS.RUN.GET.BASE.PATH jsr CS.RUN.GetFilePath
>PUSHW ZPPtr1 >SYSCALL RemoveYA
>PUSHWI UsrBuf256
>SYSCALL PStrCat
CS.RUN.DELETE >LDYAI UsrBuf256
* >SYSCALL RemoveYA
clc
rts rts
*-------------------------------------- *--------------------------------------
.FIN .FIN
*-------------------------------------- *--------------------------------------
CS.RUN.GET.BASE.PATH CS.RUN.GetFilePath
ldy #hSrcBasePath jsr CS.RUN.GetBasePath
lda (pData),y
>SYSCALL GetMemPtrA
>PUSHYA
>PUSHWI UsrBuf256
>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 >PUSHW ZPPtr1
>PUSHWI UsrBuf256 >PUSHWI UsrBuf256
>SYSCALL PStrCat >SYSCALL PStrCat
>LDYAI UsrBuf256
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN.PRINT.RC pha CS.RUN.GetBasePath
lda (pData),y
>SYSCALL GetMemPtrA
>PUSHYA
>PUSHWI UsrBuf256
>SYSCALL PStrCpy
rts
*--------------------------------------
CS.RUN.PrintErr pha
php php
bcs .1 bcs .1
>LDYA L.MSG.OK >LDYA L.MSG.OK
@ -344,42 +393,7 @@ CS.RUN.PRINT.RC pha
plx plx
rts rts
*-------------------------------------- *--------------------------------------
CS.DOEVENT ldy #S.EVT.hDEV is Event from active IN device? CS.DOEVENT sec
lda (pEvent),y
ldy #S.PS.hStdIn
cmp (pPs),y
bne .9
lda (pEvent)
and #S.EVT.F.KEY is it a KEY event?
beq .9
ldy #S.EVT.DATAHI is it an O or SAPPLE key ?
lda (pEvent),y
bne .9
ldy #S.EVT.DATALO
lda (pEvent),y
cmp #$03 Ctrl-C
bne .1
lda #$FF
ldy #bCANCEL
sta (pData),y
bra .8
.1 cmp #$13 Ctrl-S
bne .8
ldy #bSTOP
lda (pData),y
eor #$FF
sta (pData),y
.8 clc
rts
.9 sec
rts rts
*-------------------------------------- *--------------------------------------
CS.QUIT jsr LeaveSubDir CS.QUIT jsr LeaveSubDir
@ -387,10 +401,10 @@ CS.QUIT jsr LeaveSubDir
ldy #hFilter ldy #hFilter
lda (pData),y lda (pData),y
beq .3 beq .8
>SYSCALL FreeMemA >SYSCALL FreeMemA
.3 clc .8 clc
rts rts
*-------------------------------------- *--------------------------------------
MAN MAN