mirror of
https://github.com/A2osX/A2osX.git
synced 2025-01-11 10:29:46 +00:00
Kernel 0.9.2
This commit is contained in:
parent
aad4c9a8b8
commit
2095b673f1
@ -181,9 +181,17 @@ Load a file in memory
|
||||
X = hMem of Loaded File
|
||||
|
||||
# ChTyp
|
||||
Change The type of a ProDOS File
|
||||
|
||||
## C
|
||||
`int chtyp(const char *filepath, const char filetype);`
|
||||
|
||||
## ASM
|
||||
**In:**
|
||||
PUSHB = TYPE
|
||||
PUSHW = PATH
|
||||
`>PUSHBI filetype`
|
||||
`>LDYA filepath`
|
||||
`>SYSCALL chtyp`
|
||||
**Out:**
|
||||
|
||||
# ChMod
|
||||
**In:**
|
||||
@ -192,7 +200,7 @@ Load a file in memory
|
||||
|
||||
# ChOwn
|
||||
**In:**
|
||||
PUSHW = UID
|
||||
PUSHW = mod
|
||||
PUSHW = PATH
|
||||
|
||||
# ChGrp
|
||||
@ -757,7 +765,7 @@ TODO: mode="w+t=TYP,x=AUXTYPE"
|
||||
Close a file
|
||||
|
||||
## C
|
||||
int fclose ( hFILE streamm );
|
||||
int fclose ( hFILE stream );
|
||||
|
||||
## ASM
|
||||
**In:**
|
||||
@ -1019,7 +1027,7 @@ Compare 2 strings
|
||||
Get System Time in Buffer
|
||||
|
||||
## C
|
||||
`time_t time (time_t* timer);`
|
||||
`time_t time (S.TIME* timer);`
|
||||
|
||||
##ASM
|
||||
**In:**
|
||||
@ -1031,19 +1039,27 @@ S.TIME filled with System date/time
|
||||
Convert ProDOS Time To S.TIME
|
||||
|
||||
## C
|
||||
`time_t time (long ptime, time_t* timer);`
|
||||
`int PTime2Time (long* ptime, S.TIME* timer);`
|
||||
|
||||
##ASM
|
||||
**In :**
|
||||
PUSHW = Dst PTR To S.TIME
|
||||
PUSHW = Src PTR to ProDOS DATE/TIME (DWORD)
|
||||
`>PUSHW timer`
|
||||
`>LDYA ptime`
|
||||
`>SYSCALL PTime2Time`
|
||||
**Out:**
|
||||
|
||||
# CTime2Time
|
||||
Convert CTIME to S.TIME
|
||||
**In:**
|
||||
PUSHW = Dst PTR To S.TIME
|
||||
PUSHW = Src CTIME DWORD
|
||||
Convert CTime Time To S.TIME
|
||||
|
||||
## C
|
||||
`int CTime2Time (long* ctime, S.TIME* timer);`
|
||||
|
||||
##ASM
|
||||
**In :**
|
||||
`>PUSHW timer`
|
||||
`>LDYA ctime`
|
||||
`>SYSCALL CTime2Time`
|
||||
**Out:**
|
||||
|
||||
# StrFTime
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -183,7 +183,7 @@ CS.RUN.FILE jsr CS.RUN.GetFilePath
|
||||
ldy #HexFileType
|
||||
>PUSHB (pData),y
|
||||
|
||||
>PUSHW ZPFullPath
|
||||
>LDYA ZPFullPath
|
||||
>SYSCALL ChTyp
|
||||
jsr CS.RUN.CheckErr
|
||||
|
||||
|
@ -597,7 +597,6 @@ K.ReadDir.ConvertTime
|
||||
tay
|
||||
lda ZPPtr3+1
|
||||
adc #0
|
||||
>PUSHYA
|
||||
>SYSCALL PTime2Time
|
||||
rts
|
||||
*/-------------------------------------
|
||||
|
@ -113,12 +113,18 @@ FIO.hFile .BS 1
|
||||
FIO.Mem .BS 2
|
||||
*/--------------------------------------
|
||||
* # ChTyp
|
||||
* Change The type of a ProDOS File
|
||||
* ## C
|
||||
* `int chtyp(const char *filepath, const char filetype);`
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* PUSHB = TYPE
|
||||
* PUSHW = PATH
|
||||
* `>PUSHBI filetype`
|
||||
* `>LDYA filepath`
|
||||
* `>SYSCALL chtyp`
|
||||
* **Out:**
|
||||
*\--------------------------------------
|
||||
K.ChTyp jsr PFT.CheckPathSTK
|
||||
jsr STDIO.PullMLIPath
|
||||
K.ChTyp jsr PFT.CheckPathYA
|
||||
jsr STDIO.SetMLIPathYA
|
||||
>PULLB .1+1
|
||||
>MLICALL MLIGETFILEINFO
|
||||
bcs .9
|
||||
@ -137,7 +143,7 @@ K.ChMod
|
||||
*/--------------------------------------
|
||||
* # ChOwn
|
||||
* **In:**
|
||||
* PUSHW = UID
|
||||
* PUSHW = mod
|
||||
* PUSHW = PATH
|
||||
*\--------------------------------------
|
||||
K.ChOwn
|
||||
|
@ -16,8 +16,9 @@ AUTO 4,1
|
||||
*\--------------------------------------
|
||||
K.Open jsr PFT.CheckPathYA check if not /mnt
|
||||
|
||||
K.Open.I jsr IO.SetMLIPathYA local pathname...
|
||||
|
||||
K.Open.I jsr STDIO.SetMLIPathYA local pathname...
|
||||
>PULLB K.FOpen.MODE
|
||||
|
||||
ldx #5 $/DEV/
|
||||
cpx K.MLI.PATH
|
||||
bcs K.Open.REG
|
||||
@ -27,7 +28,7 @@ K.Open.I jsr IO.SetMLIPathYA local pathname...
|
||||
bne K.Open.REG
|
||||
dex
|
||||
bne .1
|
||||
|
||||
*--------------------------------------
|
||||
K.Open.DEV >LDYAI K.MLI.PATH+6 skip $/DEV/
|
||||
|
||||
jsr K.GetDevByName
|
||||
@ -43,26 +44,20 @@ K.Open.DEV >LDYAI K.MLI.PATH+6 skip $/DEV/
|
||||
lda (pFD),y
|
||||
sta .2+2
|
||||
|
||||
>PULLA get flags
|
||||
|
||||
.1 lda #$ff SELF MODIFIED pass A=DEVID To Driver
|
||||
ldx #IOCTL.OPEN
|
||||
.2 jsr $ffff SELF MODIFIED pDRV
|
||||
bcs .99
|
||||
bcs .9
|
||||
|
||||
ldx .1+1
|
||||
lda Dev.Table.hFD,x
|
||||
.99 rts
|
||||
|
||||
.9 >RET 1 discard flags
|
||||
|
||||
K.Open.REG >LDYAI K.MLI.PATH
|
||||
>STYA K.MLI.PARAMS+1
|
||||
bra *
|
||||
lda (pStack)
|
||||
* sta K.S.IOCTL
|
||||
|
||||
>RET 1
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
K.Open.REG lda #S.FI.T.TXT
|
||||
sta K.FOpen.TYPE
|
||||
stz K.FOpen.AUXTYPE
|
||||
stz K.FOpen.AUXTYPE+1
|
||||
jmp K.FOpen.I
|
||||
*/--------------------------------------
|
||||
* # close
|
||||
* ## C
|
||||
@ -307,24 +302,6 @@ K.Pipe
|
||||
.9 sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
IO.PullMLIPath >PULLYA
|
||||
IO.SetMLIPathYA >STYA .1+1
|
||||
|
||||
ldx #0
|
||||
|
||||
.1 lda $ffff,x Self Modified
|
||||
beq .8
|
||||
inx
|
||||
sta K.MLI.PATH,x
|
||||
cpx #MLI.MAXPATH
|
||||
bne .1
|
||||
|
||||
.8 stx K.MLI.PATH
|
||||
inx
|
||||
stz K.MLI.PATH,x
|
||||
|
||||
rts
|
||||
*--------------------------------------
|
||||
IO.DEVDIR >PSTR "/DEV/"
|
||||
*--------------------------------------
|
||||
MAN
|
||||
|
@ -18,19 +18,12 @@ K.PFTRemove
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
* PFT.CheckPath___
|
||||
* PFT.CheckPathYA
|
||||
* In :
|
||||
* PULLW/Y,A = PATH (C-String)
|
||||
* Y,A = PATH (C-String)
|
||||
* Out :
|
||||
*--------------------------------------
|
||||
PFT.CheckPathSTK
|
||||
lda (pStack) read PTR.LO on top of stack
|
||||
pha
|
||||
ldy #1
|
||||
lda (pStack),y read PTR.HI on top of stack
|
||||
ply
|
||||
PFT.CheckPathYA
|
||||
>STYA ZPPtr1
|
||||
PFT.CheckPathYA >STYA ZPPtr1
|
||||
|
||||
>LDYAI Flt.Table
|
||||
>STYA ZPPtr2
|
||||
@ -76,13 +69,11 @@ PFT.CheckPathYA
|
||||
.9 >LDYA ZPPtr1 restore passed params
|
||||
rts
|
||||
*--------------------------------------
|
||||
* PFT.Check___
|
||||
* PFT.CheckNodeA
|
||||
* In :
|
||||
* PULLB/A = hFILE/hDIR
|
||||
* Out :
|
||||
*--------------------------------------
|
||||
PFT.CheckNodeSTK
|
||||
lda (pStack) read hFILE on top of stack
|
||||
PFT.CheckNodeA sta .9+1 save hFILE
|
||||
|
||||
jsr K.GetMemPtr X = unmodified
|
||||
|
@ -985,7 +985,7 @@ K.FOpen jsr PFT.CheckPathYA
|
||||
>PULLB K.FOpen.TYPE
|
||||
>PULLW K.FOpen.AUXTYPE
|
||||
|
||||
>MLICALL MLIGETFILEINFO
|
||||
K.FOpen.I >MLICALL MLIGETFILEINFO
|
||||
bcc K.FOpen.10 Already Exists
|
||||
|
||||
bit K.FOpen.MODE Create if not exists ?
|
||||
@ -1099,7 +1099,7 @@ K.FOpen.AUXTYPE .BS 2
|
||||
* # FClose
|
||||
* Close a file
|
||||
* ## C
|
||||
* int fclose ( hFILE streamm );
|
||||
* int fclose ( hFILE stream );
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* A = hFILE
|
||||
@ -1353,21 +1353,22 @@ K.Rename jsr PFT.CheckPathYA
|
||||
>MLICALL MLIRENAME
|
||||
rts
|
||||
*--------------------------------------
|
||||
STDIO.PullMLIPath
|
||||
>PULLYA
|
||||
STDIO.SetMLIPathYA
|
||||
>STYA .1+1
|
||||
|
||||
ldy #0
|
||||
ldx #0
|
||||
|
||||
.1 lda $ffff,y Self Modified
|
||||
.1 lda $ffff,x Self Modified
|
||||
beq .8
|
||||
iny
|
||||
sta K.MLI.PATH,y
|
||||
cpy #MLI.MAXPATH
|
||||
inx
|
||||
sta K.MLI.PATH,x
|
||||
cpx #MLI.MAXPATH
|
||||
bne .1
|
||||
|
||||
.8 sty K.MLI.PATH
|
||||
.8 stx K.MLI.PATH
|
||||
inx
|
||||
stz K.MLI.PATH,x Make ending 0 for /dev/xxx path
|
||||
|
||||
>LDYAI K.MLI.PATH
|
||||
>STYA K.MLI.PARAMS+1
|
||||
rts
|
||||
|
@ -12,7 +12,7 @@ DAY0 .EQ 4 day 0 was a thursday
|
||||
* # Time
|
||||
* Get System Time in Buffer
|
||||
* ## C
|
||||
* `time_t time (time_t* timer);`
|
||||
* `time_t time (S.TIME* timer);`
|
||||
* ##ASM
|
||||
* **In:**
|
||||
* Y,A = PTR to S.TIME
|
||||
@ -28,14 +28,16 @@ K.Time >STYA ZPPtr2
|
||||
* # PTime2Time
|
||||
* Convert ProDOS Time To S.TIME
|
||||
* ## C
|
||||
* `time_t time (long ptime, time_t* timer);`
|
||||
* `int PTime2Time (long* ptime, S.TIME* timer);`
|
||||
* ##ASM
|
||||
* **In :**
|
||||
* PUSHW = Dst PTR To S.TIME
|
||||
* PUSHW = Src PTR to ProDOS DATE/TIME (DWORD)
|
||||
* `>PUSHW timer`
|
||||
* `>LDYA ptime`
|
||||
* `>SYSCALL PTime2Time`
|
||||
* **Out:**
|
||||
*\--------------------------------------
|
||||
K.PTime2Time jsr MEM.PullP1P2
|
||||
K.PTime2Time >STYA ZPPtr1
|
||||
>PULLW ZPPtr2
|
||||
TIME.PTime2TimeP1P2
|
||||
ldy #1
|
||||
lda (ZPPtr1),y Get Year
|
||||
@ -159,12 +161,18 @@ K.ComputeWDAY lda #3 Thursday : 4 (-1 for mod 7)
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* # CTime2Time
|
||||
* Convert CTIME to S.TIME
|
||||
* **In:**
|
||||
* PUSHW = Dst PTR To S.TIME
|
||||
* PUSHW = Src CTIME DWORD
|
||||
* Convert CTime Time To S.TIME
|
||||
* ## C
|
||||
* `int CTime2Time (long* ctime, S.TIME* timer);`
|
||||
* ##ASM
|
||||
* **In :**
|
||||
* `>PUSHW timer`
|
||||
* `>LDYA ctime`
|
||||
* `>SYSCALL CTime2Time`
|
||||
* **Out:**
|
||||
*\--------------------------------------
|
||||
K.CTime2Time jsr MEM.PullP1P2
|
||||
K.CTime2Time >STYA ZPPtr1
|
||||
>PULLW ZPPtr2
|
||||
|
||||
ldy #3
|
||||
|
||||
|
@ -52,8 +52,8 @@ A2osX.E0 .PH $E000
|
||||
.INB /A2OSX.SRC/SYS/KERNEL.S.JMP
|
||||
.INB /A2OSX.SRC/SYS/KERNEL.S.IRQ
|
||||
.INB /A2OSX.SRC/SYS/KERNEL.S.MEM
|
||||
.INB /A2OSX.SRC/SYS/KERNEL.S.IO
|
||||
********* TMP ***** go to A2osX.D1
|
||||
.INB /A2OSX.SRC/SYS/KERNEL.S.IO
|
||||
.INB /A2OSX.SRC/SYS/KERNEL.S.FIO
|
||||
DevMgr.FreeMem .EQ *
|
||||
.EP
|
||||
|
Loading…
x
Reference in New Issue
Block a user