Kernel 0.9.2

This commit is contained in:
Rémy GIBERT 2018-07-20 13:51:08 +02:00
parent 2ecedf2c3c
commit a9b2c41a33
33 changed files with 140 additions and 91 deletions

View File

@ -67,8 +67,14 @@ Y,A = FD
A = DEVID
# OpenDir
## C
`int hDIR opendir (const char * dirpath);`
## ASM
**In:**
Y,A = PATH (C-String)
`>LDYA dirpath`
`>SYSCALL opendir`
**Out:**
CC : success
A = hDIR
@ -76,8 +82,15 @@ Y,A = FD
A = EC
# ReadDir
**In:**
A = hDIR
## C
`int readdir (int hDIR, S.DIRENT * dirent);`
## ASM
**In:**
`>PUSHW dirent`
`lda hDIR`
`>SYSCALL readdir`
**Out:**
CC : success
X = hDIRENT
@ -87,8 +100,14 @@ Y,A = FD
note : A = 0 means no more entry
# CloseDir
## C
`void closedir(hDIR);`
## ASM
**In:**
A = hDIR
`lda hDIR`
`>SYSCALL closedir`
**Out:**
none, always succeed.
@ -445,9 +464,15 @@ Load a file in AUX memory (Stock Objects)
# Stat
Return information about a file
## C
`int stat(const char *pathname, struct stat *statbuf);`
## ASM
**In:**
PUSHW = PTR to S.STAT buffer
PUSHW = PTR to Filename (C-String)
`>PUSHW statbuf`
`>LDYA pathname`
`>SYSCALL stat`
**Out:**
# MKDir

Binary file not shown.

Binary file not shown.

View File

@ -324,7 +324,7 @@ FIO.FileClose ldy #SRC.COUNT
adc #SRC.hFILES-1
tay
lda (pData),y
>SYSCALL FClose.A
>SYSCALL fclose
ldy #SRC.COUNT
lda (pData),y

View File

@ -8,7 +8,7 @@ MAC.Init >SYSCALL SListNew
>STA.G MAC.hMacroList
>LDYAI 256
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs .9
>STYA ZPMacroBuf
@ -21,7 +21,7 @@ MAC.Init >SYSCALL SListNew
>STA.G MAC.hCtxList
>LDYAI 256
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs .9
>STYA ZPCtxBuf

View File

@ -21,7 +21,7 @@ SYM.Init >SYSCALL SListNew
>STA.G SYM.hGlobalList
>LDYAI 256
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs .9
>STYA ZPNameBuf
@ -29,7 +29,7 @@ SYM.Init >SYSCALL SListNew
>STA.G SYM.hNameBuf
>LDYAI 256
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs .9
>STYA ZPGlobalBuf
@ -37,7 +37,7 @@ SYM.Init >SYSCALL SListNew
>STA.G SYM.hGlobalBuf
>LDYAI 256
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs .9
>STYA ZPLookupBuf

View File

@ -219,14 +219,14 @@ CS.INIT ldy #S.PS.ARGC
jsr OUT.Init
>LDYAI 256
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs .9
>STYA ZPLineBuf
txa
>STA.G SRC.hLineBuf
>LDYAI 256
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs .9
>STYA ZPTmpBuf
txa

View File

@ -78,7 +78,7 @@ CS.RUN >STZ.G P.GetInfo Sync
>LDYAI 1024
>STYA.G P.LookupName+$10 BufLen
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs .99
>STYA.G P.LookupName+$12 BufPtr

View File

@ -102,7 +102,7 @@ CS.INIT
beq .99 we also have a TYPE
>LDYAI 256
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs .99
>STYA ZPFullPath
txa

View File

@ -4,11 +4,11 @@ AUTO 4,1
.LIST OFF
.OP 65C02
.OR $2000
.TF /A2OSX.BUILD/BIN/LS
.TF BIN/LS
*--------------------------------------
.INB /A2OSX.BUILD/INC/MACROS.I
.INB /A2OSX.BUILD/INC/A2OSX.I
.INB /A2OSX.BUILD/INC/MLI.ERR.I
.INB INC/MACROS.I
.INB INC/A2OSX.I
.INB INC/MLI.ERR.I
*--------------------------------------
X.COPY.TO.DEST .EQ 0
X.DELETE.SOURCE .EQ 0

View File

@ -132,7 +132,7 @@ CS.RUN.FILE >LDA.G Arg
>STA.G hFullPath
>LDYAI FILEBUF.SIZE
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs .9
>STYA ZPDataBufPtr
txa
@ -204,7 +204,7 @@ CS.QUIT >LDA.G hFullPath
.2 >LDA.G hFile
beq .3
>SYSCALL FClose.A
>SYSCALL fclose
.3
.7 lda hLIBCRYPT

View File

@ -123,7 +123,7 @@ CS.INIT
.FIN
.8 >LDYAI 256
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs .9
txa
>STA.G hSrcFullPath
@ -131,7 +131,7 @@ CS.INIT
.DO X.COPY.TO.DEST=1
>LDYAI 256
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs .9
txa
>STA.G hDstFullPath
@ -217,7 +217,7 @@ CS.RUN >SYSCALL GetChar
ldy #hSrcFullPath
jsr CS.RUN.GetPathY
>SYSCALL Remove.YA
>SYSCALL remove
bcs .22
jsr CS.RUN.CheckErr Success!!!
jsr CS.RUN.IncCount
@ -295,7 +295,7 @@ CS.RUN.LEAVE jsr LeaveSubDir exit this sub dir....
bcs CS.RUN.LEAVE.RTS
>LDYA ZPPtr1
>SYSCALL Remove.YA
>SYSCALL remove
jsr CS.RUN.CheckErr
bcs .99
.FIN
@ -330,8 +330,6 @@ CS.RUN.DIR jsr CS.RUN.DIR.MSG
ldy #hDstFullPath
jsr CS.RUN.GetPathY
>PUSHYA
>SYSCALL Stat
bcs .3 File Not exists...go create
@ -370,7 +368,7 @@ CS.RUN.DIR jsr CS.RUN.DIR.MSG
.3 ldy #hDstFullPath
jsr CS.RUN.GetPathY
>SYSCALL MKDir.YA
>SYSCALL mkdir
.4 jsr CS.RUN.CheckErr
bcs CS.RUN.DIR.RTS
@ -394,8 +392,6 @@ CS.RUN.FILE jsr CS.RUN.FILE.MSG
ldy #hDstFullPath
jsr CS.RUN.GetPathY
>PUSHYA
>SYSCALL Stat
bcs .2 File Not exists...go create
@ -587,7 +583,7 @@ CS.RUN.CopyStart
.9 pha
ldy #hSrcFile
lda (pData),y
>SYSCALL FClose.A
>SYSCALL fclose
pla
ldy #CopyRC
@ -618,7 +614,7 @@ CS.RUN.Open phy Save Filename
*--------------------------------------
CS.RUN.Copy stz .90+1
>LDYAI X.COPY.BUF.SIZE
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs .9
>STYA ZPPtr1
@ -667,11 +663,11 @@ CS.RUN.Copy stz .90+1
*--------------------------------------
CS.RUN.CopyEnd ldy #hSrcFile
lda (pData),y
>SYSCALL FClose.A
>SYSCALL fclose
ldy #hDstFile
lda (pData),y
>SYSCALL FClose.A
>SYSCALL fclose
ldy #bCopy
lda #$0
@ -725,7 +721,6 @@ CS.RUN.BuildFilePath
jsr CS.RUN.GetPathY
>STYA ZPPtr1
>PUSHYA
>SYSCALL StrCpy
>PUSHW ZPFileName
@ -742,7 +737,6 @@ CS.RUN.BuildFilePath
jsr CS.RUN.GetPathY
>STYA ZPPtr1
>PUSHYA
>SYSCALL StrCpy
ldy #hDstFileName
@ -791,10 +785,10 @@ CS.QUIT jsr LeaveSubDir
ldy #hSrcFile
lda (pData),y
>SYSCALL FClose.A
>SYSCALL fclose
ldy #hDstFile
lda (pData),y
>SYSCALL FClose.A
>SYSCALL fclose
.1 ldy #hDstFullPath
jsr CS.QUIT.FREE

View File

@ -28,7 +28,7 @@ InitSrcDirYA >SYSCALL RealPath
jmp .5
.55 >PUSHEA.G STAT
>PUSHW ZPPtr1
>LDYA ZPPtr1
>SYSCALL Stat
bcs .1 File/DIR does not exists, go extract pattern
@ -144,7 +144,7 @@ InitDstDirYA >SYSCALL RealPath
>STA.G hFullPath
>PUSHEA.G STAT
>PUSHW ZPPtr1
>LDYA ZPPtr1
>SYSCALL Stat
bcs .1 File/DIR does not exists, go extract DstFileName
@ -384,7 +384,7 @@ GetEntry.ReadDir
adc #hDIRs-1
tay
lda (pData),y
>SYSCALL ReadDir
bcs .9
>STYA ZPFileName
@ -563,3 +563,5 @@ BasePath..1 lda (pData),y
*--------------------------------------
MAN
SAVE /A2OSX.SRC/BIN/X.FILEENUM.S
LOAD /A2OSX.SRC/BIN/LS.S
ASM

View File

@ -94,7 +94,7 @@ CS.INIT
beq .99
>LDYAI 256
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs CS.INIT.RTS
>STYA ZPBufPtr
@ -316,7 +316,7 @@ CS.QUIT >LDA.G hBuf
.1 >LDA.G hOutputFile
beq .8
>SYSCALL FClose.A
>SYSCALL fclose
.8 clc
rts

View File

@ -195,7 +195,7 @@ READBLOCK.RxOK lda #L91C96.2.PTR.RCVD+L91C96.2.PTR.AUTOI+L91C96.2.PTR.READ
bne .11
inc
.11 >SYSCALL GetMem.YA
.11 >SYSCALL getmem
bcs .99
>STYA ZPTmpPTR
stx .8+1

View File

@ -206,7 +206,7 @@ READBLOCK.RxOK >AR.SELECT S0.RX.RD
adc /S.IP
ply
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs READBLOCK.RTS
>STYA ZPTmpPTR

View File

@ -226,7 +226,7 @@ READBLOCK php
lda Size+1
adc #0
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs .9
>STYA ZPTmpPTR

View File

@ -192,7 +192,7 @@ READBLOCK.RxOK >AR.SELECT S0.RX.RD
ldy W5100.DR,x get RX.Size LO
sty RXTX.Size
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs .99
>STYA ZPTmpPTR
stx .8+1

View File

@ -97,7 +97,7 @@ CS.INIT
beq .99
>LDYAI 8192 max 256x256 pixels
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs CS.INIT.RTS
>STYA ZPCharBufPtr
@ -180,7 +180,7 @@ CS.INIT.CREATEOUTPUT
>STA.G hOutputFile
>LDYAI 256
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs .9
>STYA ZPOutPutBufPtr
@ -228,7 +228,7 @@ CS.RUN ldy #S.FNT.dfBreakChar
sta (pData),y
ply
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs .9
>STYA ZPOutPutTblPtr
txa
@ -789,7 +789,7 @@ CS.QUIT >LDA.G hOutPutBuf
.1 >LDA.G hOutputFile
beq .2
>SYSCALL FClose.A
>SYSCALL fclose
.2 >LDA.G hInputBuf
beq .3

View File

@ -153,7 +153,7 @@ MD5 >STYA ZPDataPtr
* A = hMem To S.MD5
*\--------------------------------------
MD5Init >LDYAI S.MD5
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs .9
>STYA ZPCtxPtr

View File

@ -55,7 +55,7 @@ WND.Quit
rts
*--------------------------------------
WND.New >STYA ZPPtr1
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs .9
>STYA ZPWNDPtr

View File

@ -43,7 +43,7 @@ FRM.NewIP stx .8+1
txa
adc #0
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs .9
stx hFrameOut

View File

@ -1162,7 +1162,7 @@ SKT.NewTCB >LDYAI S.TCB
bpl .2
>LDYAI K.TCP.WSIZE
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs .9
txa
@ -1170,7 +1170,7 @@ SKT.NewTCB >LDYAI S.TCB
sta (ZPTmpPtr3),y
>LDYAI K.TCP.WSIZE
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs .9
txa

View File

@ -304,23 +304,24 @@ note : '$VAR' does NOT expand Variable
| LSDEV | Working | | 0.92 |
| PS | Working | | 0.92 |
| MD | Working | | 0.92 |
| LS | Working | -A : Do Not Print . & .. | 0.9.1 |
| LS | Working | -A : Do Not Print . & .. | 0.92 |
| | | -L : long listing with size/date... | |
| | | -R : Recurse subdirectories | |
| RM | Working | -C : Continue On Error | 0.9.1 |
| RM | Working | -C : Continue On Error | 0.92 |
| | | -Q : Quiet | |
| | | -R : Recurse subdirectories | |
| CP | Working | -C : Continue On Error | 0.9.1 |
| CP | Working | -C : Continue On Error | 0.92 |
| | | -Q : Quiet | |
| | | -R : Recurse subdirectories | |
| | | -Y : Dont't Prompt For Override | |
| MV | Working | -C : Continue On Error | 0.9.1 |
| MV | Working | -C : Continue On Error | 0.92 |
| | | -Q : Quiet | |
| | | -R : Recurse subdirectories | |
| | | -Y : Dont't Prompt For Override | |
| CAT | Working | -A : Show All non printable caracters | 0.92 |
| | | -N : Number all output lines | |
| | | -S : Suppress repeated empty output lines | |
| EDIT | Working | still missing : find/replace | 0.92 |
| CHTYP | Working | -C : Continue On Error | 0.9.1 |
| | | -R : Recurse subdirectories | |
| CHMOD | In Progress | -C : Continue On Error | 0.9 |
@ -332,8 +333,10 @@ note : '$VAR' does NOT expand Variable
| FORMAT | In Progress | -L : Low-Level Format | 0.9.1 |
| | | -1..9 : Catalog Size (block count) | |
| MD5 | In Progress | -D : String Input | 0.9.1 |
| EDIT | Working | still missing : find/replace | 0.92 |
| NSCUTIL | Working | Tool for setting time in NSC/DL1216E | 0.9 |
## Network (TCPIP) tools:
| Name | Status | Comment | K.Ver |
| ---- | ------ | ------- | ----- |
| ARP | Working | dump ARP cache, setup a static ARP entry | 0.9.1 |
| PING | Working | | 0.9.1 |
@ -341,7 +344,7 @@ note : '$VAR' does NOT expand Variable
| IPCONFIG | Working | renamed from NETINFO | 0.9.1 |
| NETSTAT | Working | | 0.9.1 |
## BIN,External DEV Shell commands:
## DEV tools:
| Name | Status | Comment | K.Ver |
| ---- | ------ | ------- | ----- |
| ASM | In Progress | S-C MASM based multi CPU assembler | 0.9.1 |

View File

@ -106,7 +106,7 @@ CS.RUN.INIT ldx #3
sta (pData),y
>LDYAI 256
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs CS.RUN.RTS
>STYA ZPLinePtr

View File

@ -74,9 +74,10 @@ Cmd.Parse.NextC lda (ZPPtr1)
Cmd.Exec lda #0
>STA.G CMD.bStartProc
>STA.G CMD.hFullpath
>LDYA ZPCMDBuf
>SYSCALL puts
* SET +X
* >LDYA ZPCMDBuf
* >SYSCALL puts
>LDYA ZPCMDBuf
>SYSCALL ExpandStr
@ -155,7 +156,7 @@ Cmd.Exec.EXT jsr Cmd.Exec.Split
bne .1
>PUSHEA.G CMD.Stat
>PUSHW ZPPtr1
>LDYA ZPPtr1
>SYSCALL STAT
bcs Cmd.Exec.Done
@ -315,7 +316,7 @@ Cmd.Exec.CD lda (ZPPTR2)
beq .8 we have '/'
>PUSHEA.G CMD.Stat
>PUSHW ZPPTR2
>LDYA ZPPTR2
>SYSCALL STAT
bcs .9

View File

@ -197,7 +197,7 @@ BIN.Load >STYA BIN.CmdLine
bne .1
*--------------------------------------
BIN.Load.1 >PUSHWI K.S.STAT
>PUSHW BIN.CmdLine
>LDYA BIN.CmdLine
>SYSCALL STAT BANK1!!! Look for AUXTYPE
bcs .9

View File

@ -3,8 +3,12 @@ PREFIX /A2OSX.BUILD
AUTO 4,1
*/--------------------------------------
* # OpenDir
* ## C
* `int hDIR opendir (const char * dirpath);`
* ## ASM
* **In:**
* Y,A = PATH (C-String)
* `>LDYA dirpath`
* `>SYSCALL opendir`
* **Out:**
* CC : success
* A = hDIR
@ -59,8 +63,13 @@ K.OpenDir jsr PFT.CheckPathYA
.99 rts
*/--------------------------------------
* # ReadDir
* **In:**
* A = hDIR
* ## C
* `int readdir (int hDIR, S.DIRENT * dirent);`
* ## ASM
* **In:**
* `>PUSHW dirent`
* `lda hDIR`
* `>SYSCALL readdir`
* **Out:**
* CC : success
* X = hDIRENT
@ -599,8 +608,12 @@ K.ReadDir.ConvertTime
rts
*/-------------------------------------
* # CloseDir
* ## C
* `void closedir(hDIR);`
* ## ASM
* **In:**
* A = hDIR
* `lda hDIR`
* `>SYSCALL closedir`
* **Out:**
* none, always succeed.
*\-------------------------------------

View File

@ -203,7 +203,7 @@ K.FileSearch.YA >STYA .4+1
bra .4
.5 >PUSHWI K.S.STAT
>PUSHWI K.Buf256
>LDYAI K.Buf256
>SYSCALL STAT -> BNK1
bcs .1 Failed...retry next path...

View File

@ -993,16 +993,16 @@ MSG.Init2.OK .AZ "A2osX[Stage2]:Complete.\n"
*--------------------------------------
SYSSCREEN.TOP .AZ "A2osX 0.92 System Screen"
MSG.Init3 .AZ "A2osX[Stage3]:Init\r\nPress Ctrl-D for Mantenance Mode.\r\n"
MSG.DEV .AZ "-Device Manager...\r\n"
MSG.BLKDEV .AZ " /DEV/%s\r\n"
MSG.IRQ .AZ "-Interrupt Manager..."
MSG.IRQ.VBL .AZ "Mouse VBL IRQ Activated.\r\n"
MSG.IRQ.CLOCK .AZ "Clock Card IRQ Activated.\r\n"
MSG.IRQ.POLL .AZ "Polling Mode.\r\n"
MSG.EVT .AZ "-Event Manager...\r\n"
MSG.FLT .AZ "-Path Filter...\r\n"
MSG.TSK .AZ "-Task Manager...\r\n"
MSG.Prefix .AZ "Prefix:%s\r\n"
MSG.DEV .AZ "Device Manager...\r\n"
MSG.BLKDEV .AZ " Adding : /DEV/%s\r\n"
MSG.IRQ .AZ "Interrupt Manager...\r\n"
MSG.IRQ.VBL .AZ " Mouse VBL IRQ Activated.\r\n"
MSG.IRQ.CLOCK .AZ " Clock Card IRQ Activated.\r\n"
MSG.IRQ.POLL .AZ " Polling Mode.\r\n"
MSG.EVT .AZ "Event Manager...\r\n"
MSG.FLT .AZ "Path Filter...\r\n"
MSG.TSK .AZ "Task Manager...\r\n"
MSG.Prefix .AZ "Root:%s\r\n"
MSG.MMode .AZ "Ctrl-D Pressed, entering Maintenance mode...\r\n"
MSG.Startup .AZ "Executing Kernel Startup Script...\r\nCmd:%s\r\n"
MSG.StartupErr .AZ "Failed : [$%h]\r\n"

View File

@ -87,7 +87,9 @@ PFT.CheckNodeA sta .9+1 save hFILE
jsr K.GetMemPtr X = unmodified
>STYA ZPPtr1
lda (ZPPtr1)
ldy #S.FD.HANDLER
lda (ZPPtr1),y
beq .9 Handler is 0, back to kernel....
jsr K.GetMemPtr

View File

@ -4,6 +4,9 @@ AUTO 4,1
*--------------------------------------
* # FStat
* Return information about a hfile
* ## ASM
* `int fstat(int fd, struct stat *statbuf);`
* ## ASM
* **In:**
* PUSHW = PTR to S.STAT buffer
* PUSHB = hFile
@ -14,14 +17,20 @@ AUTO 4,1
*/--------------------------------------
* # Stat
* Return information about a file
* ## C
* `int stat(const char *pathname, struct stat *statbuf);`
* ## ASM
* **In:**
* PUSHW = PTR to S.STAT buffer
* PUSHW = PTR to Filename (C-String)
* `>PUSHW statbuf`
* `>LDYA pathname`
* `>SYSCALL stat`
* **Out:**
*\--------------------------------------
K.Stat jsr PFT.CheckPathSTK
jsr STDIO.PullMLIPath
K.Stat jsr PFT.CheckPathYA
jsr STDIO.SetMLIPathYA
>PULLW K.Stat.StoreY+1
>MLICALL MLIGETFILEINFO
bcs .9

View File

@ -91,7 +91,7 @@ CS.RUN.Pak >PUSHWI 0 Aux type
>STA.G PAK.hFileBuf
>LDYA.G PAK.FileSize
>SYSCALL GetMem.YA
>SYSCALL getmem
bcs .9
>STYA ZPPakSrcPtr
txa