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