mirror of
https://github.com/A2osX/A2osX.git
synced 2024-12-26 11:30:07 +00:00
Kernel 0.9.2
This commit is contained in:
parent
fd1b887584
commit
8f59dca003
Binary file not shown.
Binary file not shown.
@ -10,8 +10,8 @@ AUTO 4,1
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/IO.I
|
||||
.INB INC/MONITOR.I
|
||||
.INB INC/PRODOS.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.I
|
||||
.INB INC/MLI.E.I
|
||||
*--------------------------------------
|
||||
TmpPtr1 .EQ $0 main & aux ZP
|
||||
TmpPtr2 .EQ $2 main & aux ZP
|
||||
|
@ -59,7 +59,7 @@ FIO.LOAD.ASM.T >STYA ZPPtr2
|
||||
|
||||
>PUSHWI 0 Aux type
|
||||
>PUSHBI 6 S.FI.T.BIN
|
||||
>PUSHBI SYS.FOpen.R
|
||||
>PUSHBI O.RDONLY
|
||||
>LDYA L.ASM.T.FILENAME
|
||||
>SYSCALL LoadFile
|
||||
bcs .9
|
||||
@ -129,7 +129,7 @@ FIO.OpenFile >STYA ZPPtr1
|
||||
|
||||
>PUSHWI 0
|
||||
>PUSHBI 4
|
||||
>PUSHBI SYS.FOpen.R+SYS.FOpen.T
|
||||
>PUSHBI O.RDONLY+O.TEXT
|
||||
bra .3
|
||||
|
||||
.2 cmp #$FA S-C/BAS?
|
||||
@ -137,7 +137,7 @@ FIO.OpenFile >STYA ZPPtr1
|
||||
|
||||
>PUSHWI 0
|
||||
>PUSHBI $FA
|
||||
>PUSHBI SYS.FOpen.R
|
||||
>PUSHBI O.RDONLY
|
||||
|
||||
.3 >LDYA ZPPtr1
|
||||
>SYSCALL FOpen
|
||||
|
@ -8,8 +8,8 @@ AUTO 4,1
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/PRODOS.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.I
|
||||
.INB INC/MLI.E.I
|
||||
.INB INC/APPLETALK.I
|
||||
*--------------------------------------
|
||||
ZPPTR1 .EQ ZPBIN
|
||||
|
@ -8,8 +8,8 @@ AUTO 4,1
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/PRODOS.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.I
|
||||
.INB INC/MLI.E.I
|
||||
.INB INC/APPLETALK.I
|
||||
*--------------------------------------
|
||||
ZPPTR1 .EQ ZPBIN
|
||||
|
@ -8,7 +8,8 @@ AUTO 4,1
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.I
|
||||
.INB INC/MLI.E.I
|
||||
*--------------------------------------
|
||||
ZPPTR1 .EQ ZPBIN
|
||||
ZPBufPtr .EQ ZPBIN+2
|
||||
@ -19,7 +20,8 @@ CS.START cld
|
||||
jmp (.1,x)
|
||||
.DA #$61 6502,Level 1 (65c02)
|
||||
.DA #1 BIN Layout Version 1
|
||||
.DA 0
|
||||
.DA #S.PS.F.EVENT S.PS.F
|
||||
.DA #0
|
||||
.DA CS.END-CS.START CS
|
||||
.DA DS.END-DS.START DS
|
||||
.DA #16 SS
|
||||
@ -84,10 +86,6 @@ CS.INIT
|
||||
>STYA ZPBufPtr
|
||||
txa
|
||||
>STA.G hBuf
|
||||
.8
|
||||
* lda (pPs)
|
||||
* ora #S.PS.F.EVENT Now accept events
|
||||
* sta (pPs)
|
||||
|
||||
clc
|
||||
.9 rts
|
||||
@ -253,8 +251,8 @@ CS.RUN.OPEN >SYSCALL RealPath
|
||||
pha
|
||||
|
||||
>PUSHWI 0 Aux type
|
||||
>PUSHBI 4 S.FI.T.TXT
|
||||
>PUSHBI SYS.FOpen.R+SYS.FOpen.T
|
||||
>PUSHBI S.FI.T.TXT
|
||||
>PUSHBI O.RDONLY+O.TEXT
|
||||
|
||||
pla
|
||||
|
||||
|
@ -8,7 +8,7 @@ AUTO 4,1
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.E.I
|
||||
*--------------------------------------
|
||||
X.COPY.TO.DEST .EQ 0
|
||||
X.DELETE.SOURCE .EQ 0
|
||||
|
@ -8,7 +8,7 @@ AUTO 4,1
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.E.I
|
||||
*--------------------------------------
|
||||
X.COPY.TO.DEST .EQ 1
|
||||
X.DELETE.SOURCE .EQ 0
|
||||
|
@ -334,8 +334,8 @@ CharIn.Esc ldy #bEscMode
|
||||
rts
|
||||
*--------------------------------------
|
||||
LoadFile >PUSHWI 0 Aux type
|
||||
>PUSHBI 4 S.FI.T.TXT
|
||||
>PUSHBI SYS.FOpen.R
|
||||
>PUSHBI S.FI.T.TXT
|
||||
>PUSHBI O.RDONLY
|
||||
>LDA.G hFileName
|
||||
|
||||
>SYSCALL GetMemPtr
|
||||
@ -403,8 +403,8 @@ LoadFile >PUSHWI 0 Aux type
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
SaveFile >PUSHWI 0 Aux type
|
||||
>PUSHBI 4 S.FI.T.TXT
|
||||
>PUSHBI SYS.FOpen.X+SYS.FOpen.W
|
||||
>PUSHBI S.FI.T.TXT
|
||||
>PUSHBI O.CREATE+O.WRONLY
|
||||
>LDA.G hFileName
|
||||
>SYSCALL GetMemPtr
|
||||
|
||||
|
@ -8,7 +8,7 @@ AUTO 4,1
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.E.I
|
||||
*--------------------------------------
|
||||
X.COPY.TO.DEST .EQ 0
|
||||
X.DELETE.SOURCE .EQ 0
|
||||
|
@ -7,7 +7,7 @@ AUTO 4,1
|
||||
.TF BIN/LSDEV
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/PRODOS.I
|
||||
.INB INC/MLI.I
|
||||
.INB INC/A2OSX.I
|
||||
*--------------------------------------
|
||||
ZPPTR1 .EQ ZPBIN
|
||||
|
@ -8,7 +8,7 @@ AUTO 4,1
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.E.I
|
||||
.INB INC/LIBCRYPT.I
|
||||
*--------------------------------------
|
||||
FILEBUF.SIZE .EQ 4096
|
||||
@ -128,7 +128,7 @@ CS.RUN.FILE >LDA.G Arg
|
||||
|
||||
>PUSHWI 0 Aux type
|
||||
>PUSHBI 0
|
||||
>PUSHBI SYS.FOpen.R
|
||||
>PUSHBI O.RDONLY
|
||||
|
||||
>LDA.G hFullPath
|
||||
>SYSCALL GetMemPtr
|
||||
|
@ -8,7 +8,7 @@ AUTO 4,1
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.E.I
|
||||
*--------------------------------------
|
||||
X.COPY.TO.DEST .EQ 1
|
||||
X.DELETE.SOURCE .EQ 1
|
||||
|
@ -8,7 +8,7 @@ AUTO 4,1
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.E.I
|
||||
*--------------------------------------
|
||||
ZPPtr1 .EQ ZPBIN
|
||||
*--------------------------------------
|
||||
|
@ -8,7 +8,7 @@ AUTO 4,1
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.E.I
|
||||
*--------------------------------------
|
||||
X.COPY.TO.DEST .EQ 0
|
||||
X.DELETE.SOURCE .EQ 1
|
||||
|
@ -551,7 +551,7 @@ CS.RUN.Rename ldy #hDstFullPath
|
||||
|
||||
CS.RUN.CopyStart
|
||||
ldy #hSrcFullPath
|
||||
lda #SYS.FOpen.R
|
||||
lda #O.RDONLY
|
||||
|
||||
jsr CS.RUN.Open
|
||||
bcs .99
|
||||
@ -559,7 +559,7 @@ CS.RUN.CopyStart
|
||||
>STA.G hSrcFile
|
||||
|
||||
ldy #hDstFullPath
|
||||
lda #SYS.FOpen.W+SYS.FOpen.X
|
||||
lda #O.WRONLY+O.CREATE
|
||||
|
||||
jsr CS.RUN.Open
|
||||
bcs .9
|
||||
|
@ -107,7 +107,7 @@ CS.INIT.RTS rts
|
||||
CS.INIT.OPENINPUT
|
||||
>PUSHWI 0 Aux type
|
||||
>PUSHBI 0 Type
|
||||
>PUSHBI SYS.FOpen.R
|
||||
>PUSHBI O.RDONLY
|
||||
>LDYA ZPPtr1
|
||||
>SYSCALL LoadFile
|
||||
bcs CS.INIT.RTS
|
||||
@ -183,7 +183,7 @@ CS.INIT.OPENINPUT
|
||||
CS.INIT.CREATEOUTPUT
|
||||
>PUSHWI 0 Aux type
|
||||
>PUSHBI $CB PIX Type
|
||||
>PUSHBI SYS.FOpen.W+SYS.FOpen.X
|
||||
>PUSHBI O.WRONLY+O.CREATE
|
||||
>LDYA ZPPtr1
|
||||
>SYSCALL FOpen
|
||||
bcs .9
|
||||
|
@ -8,7 +8,7 @@ AUTO 4,1
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.E.I
|
||||
.INB INC/IO.I
|
||||
.INB INC/NET.TELNET.I
|
||||
*--------------------------------------
|
||||
|
@ -8,7 +8,7 @@ AUTO 4,1
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/PRODOS.I
|
||||
.INB INC/MLI.I
|
||||
.INB INC/IO.I
|
||||
.INB INC/GFX.I
|
||||
.INB INC/GFX.EVE.I
|
||||
|
@ -8,7 +8,7 @@ AUTO 4,1
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.E.I
|
||||
.INB INC/NIC.I
|
||||
.INB INC/NIC.91C96.I
|
||||
.INB INC/ETH.I
|
||||
|
@ -8,7 +8,7 @@ AUTO 4,1
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.E.I
|
||||
.INB INC/XY.MOUSE.I
|
||||
.INB INC/LIBGUI.I
|
||||
*--------------------------------------
|
||||
|
@ -8,7 +8,7 @@ AUTO 4,1
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.E.I
|
||||
*--------------------------------------
|
||||
ZPTmpPtr1 .EQ ZPDRV
|
||||
*--------------------------------------
|
||||
|
@ -7,7 +7,7 @@ SSCIRQ .EQ 0
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.E.I
|
||||
.INB INC/COM.I
|
||||
.INB INC/COM.6551.I
|
||||
.INB /A2OSX.SRC/DRV/X.SSC.DRV.S
|
||||
|
@ -7,7 +7,7 @@ SSCIRQ .EQ 1
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.E.I
|
||||
.INB INC/COM.I
|
||||
.INB INC/COM.6551.I
|
||||
.INB /A2OSX.SRC/DRV/X.SSC.DRV.S
|
||||
|
@ -7,7 +7,7 @@ U2AI .EQ 1
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.E.I
|
||||
.INB INC/NIC.I
|
||||
.INB INC/NIC.W5100.I
|
||||
.INB INC/ETH.I
|
||||
|
@ -8,7 +8,7 @@ AUTO 4,1
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.E.I
|
||||
.INB INC/NIC.I
|
||||
.INB INC/NIC.8900A.I
|
||||
.INB INC/ETH.I
|
||||
|
@ -7,7 +7,7 @@ U2AI .EQ 0
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.E.I
|
||||
.INB INC/NIC.I
|
||||
.INB INC/NIC.W5100.I
|
||||
.INB INC/ETH.I
|
||||
|
@ -110,7 +110,7 @@ CS.INIT.RTS rts
|
||||
CS.INIT.OPENINPUT
|
||||
>PUSHWI 0 Aux type
|
||||
>PUSHBI 0 Type
|
||||
>PUSHBI SYS.FOpen.R
|
||||
>PUSHBI O.RDONLY
|
||||
>LDYA ZPPtr1
|
||||
>SYSCALL LoadFile
|
||||
bcs CS.INIT.RTS
|
||||
@ -173,7 +173,7 @@ CS.INIT.OPENINPUT
|
||||
CS.INIT.CREATEOUTPUT
|
||||
>PUSHWI 0 Aux type
|
||||
>PUSHBI $CC FON Type
|
||||
>PUSHBI SYS.FOpen.W+SYS.FOpen.X
|
||||
>PUSHBI O.WRONLY+O.CREATE
|
||||
>LDYA ZPPtr1
|
||||
>SYSCALL FOpen
|
||||
bcs .9
|
||||
|
@ -4,6 +4,7 @@ AUTO 4,1
|
||||
*--------------------------------------
|
||||
K.VER .EQ $5C00 92.0
|
||||
K.ENV.SIZE .EQ 256
|
||||
K.PIPE.SIZE .EQ 256
|
||||
K.FLT.MAX .EQ 4
|
||||
K.EVT.MAX .EQ 4
|
||||
K.DEV.MAX .EQ 32
|
||||
@ -401,7 +402,7 @@ S.FD.T.BDEV .EQ 6
|
||||
S.FD.T.LNK .EQ 8
|
||||
S.FD.T.DSOCK .EQ 10
|
||||
S.FD.T.SSOCK .EQ 12
|
||||
S.FD.T.FIFO .EQ 14
|
||||
S.FD.T.PIPE .EQ 14
|
||||
S.FD.HANDLER .EQ 1 0=KRNL,!0=hLIB (LIBNFS,LIBTCPIP.....)
|
||||
*--------------------------------------
|
||||
S.FD.REG.REF .EQ 2
|
||||
@ -436,14 +437,16 @@ S.FD.SOCK.STATUS .EQ 7
|
||||
*
|
||||
S.FD.SOCK .EQ 8
|
||||
*--------------------------------------
|
||||
S.FD.FIFO.S .EQ 2
|
||||
S.FD.FIFO.S.ROpened .EQ 1
|
||||
S.FD.FIFO.S.WOpened .EQ 2
|
||||
S.FD.FIFO.hMem .EQ 3
|
||||
S.FD.FIFO.Tail .EQ 4
|
||||
S.FD.FIFO.Head .EQ 6
|
||||
S.FD.PIPE.S .EQ 2
|
||||
S.FD.PIPE.S.ROpened .EQ %00000001
|
||||
S.FD.PIPE.S.RClosed .EQ %00000010
|
||||
S.FD.PIPE.S.WOpened .EQ %00000100
|
||||
S.FD.PIPE.S.WClosed .EQ %00001000
|
||||
S.FD.PIPE.hMem .EQ 3
|
||||
S.FD.PIPE.Tail .EQ 4
|
||||
S.FD.PIPE.Head .EQ 6
|
||||
*
|
||||
S.FD.FIFO .EQ 8
|
||||
S.FD.PIPE .EQ 8
|
||||
*--------------------------------------
|
||||
* PS STRUCT
|
||||
*--------------------------------------
|
||||
|
@ -106,8 +106,8 @@ Dev.Table.pFDHI .EQ $0C60 K.Dev.MAX
|
||||
*--------------------------------------
|
||||
* Nod (Opened files)
|
||||
*--------------------------------------
|
||||
Nod.Table.hFD .EQ $0C80 K.NOD.MAX
|
||||
Nod.Table.hPath .EQ $0CC0 K.NOD.MAX
|
||||
Nod.Table.hPath .EQ $0C80 K.NOD.MAX
|
||||
Nod.Table.hFD .EQ $0CC0 K.NOD.MAX
|
||||
*--------------------------------------
|
||||
PS.Table.hMem .EQ $0D00 K.PS.MAX
|
||||
PS.Table.PID .EQ $0D20 K.PS.MAX
|
||||
|
@ -133,4 +133,4 @@ MACHID.CLK .EQ %00000001
|
||||
*KVERSION .EQ $BFFF
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE INC/PRODOS.I
|
||||
SAVE INC/MLI.I
|
||||
|
@ -8,7 +8,7 @@ AUTO 4,1
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/PRODOS.I
|
||||
.INB INC/MLI.I
|
||||
.INB INC/LIBBLKDEV.I
|
||||
*--------------------------------------
|
||||
* NIBBLE track len = $1A00 (6656) bytes:
|
||||
|
@ -4,7 +4,7 @@ AUTO 4,1
|
||||
*--------------------------------------
|
||||
FON.Init >PUSHWI 0 Aux type
|
||||
>PUSHBI $CC Type
|
||||
>PUSHBI SYS.FOpen.R
|
||||
>PUSHBI O.RDONLY
|
||||
>PUSHW L.SYSX7
|
||||
>SYSCALL LoadStkObj
|
||||
bcs .9
|
||||
@ -12,7 +12,7 @@ FON.Init >PUSHWI 0 Aux type
|
||||
|
||||
>PUSHWI 0 Aux type
|
||||
>PUSHBI $CC Type
|
||||
>PUSHBI SYS.FOpen.R
|
||||
>PUSHBI O.RDONLY
|
||||
>PUSHW L.SYSX7B
|
||||
>SYSCALL LoadStkObj
|
||||
bcs .9
|
||||
|
@ -378,8 +378,8 @@ CFG.Read.Open stz CFG.hCfgFile
|
||||
pha
|
||||
|
||||
>PUSHWI 0
|
||||
>PUSHBI 6 S.FI.T.TXT
|
||||
>PUSHBI SYS.FOpen.R
|
||||
>PUSHBI S.FI.T.TXT
|
||||
>PUSHBI O.RDONLY
|
||||
|
||||
pla
|
||||
>SYSCALL fopen
|
||||
|
@ -8,7 +8,7 @@ AUTO 4,1
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.E.I
|
||||
.INB INC/NIC.I
|
||||
.INB INC/ETH.I
|
||||
.INB INC/LIBTCPIP.I
|
||||
|
@ -188,7 +188,7 @@ CS.RUN.Load >PUSHEA.G StatBuf
|
||||
|
||||
>PUSHWI 0 Aux type
|
||||
>PUSHBI 6 S.FI.T.BIN
|
||||
>PUSHBI SYS.FOpen.R
|
||||
>PUSHBI O.RDONLY
|
||||
>LDA.G hFileName
|
||||
>SYSCALL GetMemPtr
|
||||
>SYSCALL LoadFile
|
||||
@ -217,7 +217,7 @@ CS.RUN.Load >PUSHEA.G StatBuf
|
||||
*--------------------------------------
|
||||
CS.RUN.Save >PUSHWI 0 AUXTYPE
|
||||
>PUSHBI 6 S.FI.T.BIN
|
||||
>PUSHBI SYS.FOpen.W+SYS.FOpen.X
|
||||
>PUSHBI O.WRONLY+O.CREATE
|
||||
|
||||
>LDA.G hFileName
|
||||
>SYSCALL GetMemPtr
|
||||
|
@ -8,7 +8,7 @@ AUTO 4,1
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.E.I
|
||||
*--------------------------------------
|
||||
ZPPtr1 .EQ ZPBIN
|
||||
ZPPtr2 .EQ ZPBIN+2
|
||||
|
@ -211,7 +211,7 @@ BIN.Load.1 >PUSHWI K.S.STAT
|
||||
|
||||
>PUSHYA Push AUXTYPE
|
||||
>PUSHBI S.FI.T.BIN
|
||||
>PUSHBI SYS.FOpen.R
|
||||
>PUSHBI O.RDONLY
|
||||
>LDYA BIN.CmdLine
|
||||
|
||||
>SYSCALL LoadFile BANK1!!!
|
||||
|
@ -12,8 +12,8 @@ AUTO 4,1
|
||||
*\--------------------------------------
|
||||
K.LoadTxtFile pha
|
||||
>PUSHWI 0 Aux type
|
||||
>PUSHBI 4 S.FI.T.TXT
|
||||
>PUSHBI SYS.FOpen.R
|
||||
>PUSHBI S.FI.T.TXT
|
||||
>PUSHBI O.RDONLY
|
||||
pla
|
||||
sec
|
||||
.HS 90 BCC
|
||||
|
@ -308,8 +308,9 @@ PS0.Init >LDYAI CORE.S.PS0 Select Process 0 (Kernel)
|
||||
clc
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
CPU.Init.6502 >LDYAI MSG.CPU
|
||||
>SYSCALL puts
|
||||
CPU.Init.6502 >PUSHBI 0
|
||||
>LDYAI MSG.CPU
|
||||
>SYSCALL printf
|
||||
|
||||
jsr Detect6502 A = CPU type
|
||||
sta A2osX.CPUTYPE
|
||||
@ -325,10 +326,13 @@ CPU.Init.6502 >LDYAI MSG.CPU
|
||||
lda MACHID
|
||||
and #MACHID.T
|
||||
cmp #MACHID.T.IIc
|
||||
beq CPU.Init.Z80
|
||||
bne .10
|
||||
|
||||
jmp CPU.Init.Z80
|
||||
|
||||
.10 >PUSHBI 0
|
||||
>LDYAI MSG.CPU.SPEED
|
||||
>SYSCALL puts
|
||||
>SYSCALL printf
|
||||
|
||||
stz A2osX.RANDOM16
|
||||
stz A2osX.RANDOM16+1
|
||||
@ -392,8 +396,9 @@ CPU.Init.6502 >LDYAI MSG.CPU
|
||||
>SYSCALL printf
|
||||
rts
|
||||
*--------------------------------------
|
||||
CPU.Init.Z80 >LDYAI MSG.Z80
|
||||
>SYSCALL puts
|
||||
CPU.Init.Z80 >PUSHBI 0
|
||||
>LDYAI MSG.Z80
|
||||
>SYSCALL printf
|
||||
|
||||
jsr DetectZ80
|
||||
bcs .9
|
||||
|
@ -78,7 +78,7 @@ K.Close jsr K.GetMemPtr
|
||||
.DA STDIO.IOERR LNK
|
||||
.DA STDIO.IOERR DSOCK
|
||||
.DA IO.CLOSE.SSOCK
|
||||
.DA IO.CLOSE.FIFO
|
||||
.DA IO.CLOSE.PIPE
|
||||
|
||||
.9 lda #MLI.E.NODEV
|
||||
sec
|
||||
@ -90,7 +90,7 @@ IO.CLOSE.CDEV
|
||||
*--------------------------------------
|
||||
IO.CLOSE.SSOCK
|
||||
*--------------------------------------
|
||||
IO.CLOSE.FIFO clc
|
||||
IO.CLOSE.PIPE clc
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* # read
|
||||
@ -125,7 +125,7 @@ IO.Read.I lda (pFD) #S.FD.T
|
||||
.DA STDIO.IOERR LNK
|
||||
.DA STDIO.IOERR DSOCK
|
||||
.DA IO.READ.SSOCK
|
||||
.DA IO.READ.FIFO
|
||||
.DA IO.READ.PIPE
|
||||
*/--------------------------------------
|
||||
* # write
|
||||
* ## C
|
||||
@ -159,7 +159,7 @@ IO.Write.I lda (pFD) #S.FD.T
|
||||
.DA STDIO.IOERR LNK
|
||||
.DA STDIO.IOERR DSOCK
|
||||
.DA IO.WRITE.SSOCK
|
||||
.DA IO.WRITE.FIFO
|
||||
.DA IO.WRITE.PIPE
|
||||
|
||||
K.Write.9 lda #MLI.E.NODEV
|
||||
>RET 4
|
||||
@ -215,28 +215,45 @@ IO.READ.SSOCK ldy #S.FD.SOCK.READ
|
||||
|
||||
.1 jmp $ffff
|
||||
*--------------------------------------
|
||||
IO.READ.FIFO
|
||||
IO.READ.PIPE ldy #S.FD.PIPE.S
|
||||
lda (pFD),y
|
||||
bit #S.FD.PIPE.S.WOpened
|
||||
beq .9 Remote PS did not opened yet the pipe
|
||||
bit #S.FD.PIPE.S.WClosed
|
||||
beq .99 Remote PS closed the Pipe
|
||||
|
||||
ldy #S.FD.PIPE.hMem
|
||||
lda (pFD),y
|
||||
jsr K.GetMemPtr
|
||||
|
||||
clc
|
||||
rts
|
||||
|
||||
.9 lda #MLI.E.VOLFULL
|
||||
sec
|
||||
rts
|
||||
.99 lda #MLI.E.EOF
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
IO.WRITE.FIFO ldy #S.FD.FIFO.S
|
||||
IO.WRITE.PIPE ldy #S.FD.PIPE.S
|
||||
lda (pFD),y
|
||||
bit #S.FD.PIPE.S.ROpened
|
||||
beq .9 Remote PS did not opened yet the pipe
|
||||
cmp #S.FD.FIFO.S.Closed
|
||||
bit #S.FD.PIPE.S.RClosed
|
||||
beq .99 Remote PS closed the Pipe
|
||||
|
||||
ldy #S.FD.FIFO.hMem
|
||||
ldy #S.FD.PIPE.hMem
|
||||
lda (pFD),y
|
||||
jsr K.GetMemPtr
|
||||
>STYA .1+2
|
||||
|
||||
ldy #S.FD.FIFO.Head
|
||||
ldy #S.FD.PIPE.Head
|
||||
lda (pFD),y
|
||||
inc
|
||||
dey #S.FD.FIFO.Tail
|
||||
dey #S.FD.PIPE.Tail
|
||||
cmp (pFD),y
|
||||
beq .9 FIFO is full
|
||||
beq .9 PIPE is full
|
||||
iny
|
||||
sta (pFD),y
|
||||
tay
|
||||
@ -246,7 +263,8 @@ IO.WRITE.FIFO ldy #S.FD.FIFO.S
|
||||
rts
|
||||
|
||||
.9 lda #MLI.E.VOLFULL
|
||||
.HS 2C bit abs
|
||||
sec
|
||||
rts
|
||||
.99 lda #MLI.E.EOF
|
||||
sec
|
||||
rts
|
||||
|
@ -158,10 +158,10 @@ K.MKDir jsr PFT.CheckPathYA
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* # MkNod
|
||||
* return a hFile for a given file descriptor.
|
||||
* Create a special or ordinary file.
|
||||
* (CDEV, BDEV, DSOCKS, SSOCK, PIPE)
|
||||
* ## C
|
||||
* `hFILE mknod(const char *pathname, int mode, hFD fd);`
|
||||
* `int mknod(const char *pathname, int mode, hFD fd);`
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* `>PUSHB fd`
|
||||
@ -182,13 +182,16 @@ K.MkNod >STYA ZPPtr1 pathname
|
||||
|
||||
>STYA pFD
|
||||
|
||||
ldx DevMgr.NodCnt
|
||||
ldx #0
|
||||
|
||||
.1 lda Nod.Table.hFD,x
|
||||
beq .2
|
||||
|
||||
inx
|
||||
cpx #K.NOD.MAX
|
||||
beq .98
|
||||
|
||||
.1 dex
|
||||
bpl .
|
||||
lda
|
||||
.2 lda K.S.STAT+S.STAT.DEV
|
||||
|
||||
lda (pFD) #S.FD.T
|
||||
|
||||
@ -202,7 +205,7 @@ K.MkNod >STYA ZPPtr1 pathname
|
||||
.DA STDIO.IOERR LNK
|
||||
.DA STAT.MKNOD.DSOCK
|
||||
.DA STAT.MKNOD.SSOCK
|
||||
.DA STDIO.IOERR FIFO
|
||||
.DA STAT.MKNOD.PIPE
|
||||
|
||||
.98 lda #K.E.OOH
|
||||
sec
|
||||
@ -212,7 +215,7 @@ STAT.MKNOD.CDEV
|
||||
STAT.MKNOD.BDEV
|
||||
STAT.MKNOD.DSOCK
|
||||
STAT.MKNOD.SSOCK
|
||||
|
||||
STAT.MKNOD.PIPE
|
||||
ldx #S.STAT
|
||||
ldy #$ff
|
||||
|
||||
@ -244,13 +247,13 @@ STAT.MKNOD.SSOCK
|
||||
* CC = OK, CS = ERROR
|
||||
* A = hFILE
|
||||
*\--------------------------------------
|
||||
K.MKFIFO >LDYAI 256
|
||||
K.MKFIFO >LDYAI K.PIPE.SIZE
|
||||
jsr K.GetMem
|
||||
bcs .99
|
||||
|
||||
stx .1+1 save FIFO buffer
|
||||
stx .1+1 save PIPE buffer
|
||||
|
||||
>LDYAI S.FD.FIFO
|
||||
>LDYAI S.FD.PIPE
|
||||
jsr K.GetMem0
|
||||
|
||||
bcs .9
|
||||
@ -258,10 +261,10 @@ K.MKFIFO >LDYAI 256
|
||||
>STYA pFD
|
||||
|
||||
ldy #S.FD.T
|
||||
lda #S.FD.T.FIFO
|
||||
lda #S.FD.T.PIPE
|
||||
sta (pFD),y
|
||||
|
||||
iny S.FD.FIFO.hMem
|
||||
iny S.FD.PIPE.hMem
|
||||
.1 lda #$ff Self Modified
|
||||
sta (pFD),y
|
||||
txa
|
||||
@ -269,7 +272,7 @@ K.MKFIFO >LDYAI 256
|
||||
rts
|
||||
|
||||
.9 pha save error code
|
||||
lda .1+1 get back FIFO buffer
|
||||
lda .1+1 get back PIPE buffer
|
||||
jsr K.FreeMem
|
||||
pla
|
||||
sec
|
||||
|
@ -963,11 +963,11 @@ K.SScanF.Fwd tya Y=char count parsed
|
||||
* `>PUSHWI auxtype`
|
||||
* `>PUSHBI ftype`
|
||||
* `>PUSHBI mode`
|
||||
* + SYS.FOpen.R : if R and !exists -> ERROR
|
||||
* + SYS.FOpen.W : if W and !exists -> CREATE
|
||||
* + SYS.FOpen.A : Append
|
||||
* + SYS.FOpen.T : Open/Append in Text mode
|
||||
* + SYS.FOpen.X : Create if not exists
|
||||
* + O.RDONLY : if R and !exists -> ERROR
|
||||
* + O.WRONLY : if W and !exists -> CREATE
|
||||
* + O.APPEND : Append
|
||||
* + O.TEXT : Open/Append in Text mode
|
||||
* + O.CREATE : Create if not exists
|
||||
* http://man7.org/linux/man-pages/man3/fopen.3.html
|
||||
* r = O_RDONLY
|
||||
* w = O_WRONLY | O_CREAT | O_TRUNC
|
||||
@ -1056,10 +1056,10 @@ K.FOpen.10 lda #S.FD.REG
|
||||
sta K.MLI.PARAMS+1 Next MLI Calls are REF_NUM based
|
||||
|
||||
lda K.FOpen.MODE
|
||||
bit #SYS.FOpen.W
|
||||
bit #O.WRONLY
|
||||
beq .20 Write mode ?
|
||||
|
||||
and #SYS.FOpen.A Append ?
|
||||
and #O.APPEND Append ?
|
||||
bne .11 yes, go to end of file
|
||||
|
||||
stz K.MLI.PARAMS+2
|
||||
@ -1075,7 +1075,7 @@ K.FOpen.10 lda #S.FD.REG
|
||||
.21 bcs .98
|
||||
|
||||
.20 lda K.FOpen.MODE
|
||||
and #SYS.FOpen.T Text Mode ?
|
||||
and #O.TEXT Text Mode ?
|
||||
beq .8
|
||||
|
||||
lda #$FF
|
||||
@ -1198,7 +1198,7 @@ K.FSeek jsr PFT.CheckNodeA
|
||||
tax
|
||||
>PULLW ZPPtr1 offset LW
|
||||
>PULLW ZPPtr2 offset HW
|
||||
cpx #SYS.FSeek.END+1
|
||||
cpx #SEEK.END+1
|
||||
bcs .98
|
||||
|
||||
jmp (.1,x)
|
||||
@ -1206,18 +1206,18 @@ K.FSeek jsr PFT.CheckNodeA
|
||||
.1 .DA .10
|
||||
.DA .20
|
||||
.DA .30
|
||||
* K.FSeek.SET
|
||||
* SEEK.SET
|
||||
.10 stz K.MLI.PARAMS+2
|
||||
stz K.MLI.PARAMS+3
|
||||
stz K.MLI.PARAMS+4
|
||||
bra .8
|
||||
|
||||
* K.FSeek.CUR
|
||||
* SEEK.CUR
|
||||
.20 >MLICALL MLIGETMARK
|
||||
bcc .8
|
||||
rts
|
||||
|
||||
* K.FSeek.END
|
||||
* SEEK.END
|
||||
.30 >MLICALL MLIGETEOF
|
||||
bcs .9
|
||||
|
||||
|
@ -10,8 +10,8 @@ AUTO 4,1
|
||||
.INB INC/KERNEL.I
|
||||
.INB INC/A2OSX.I
|
||||
.INB INC/IO.I
|
||||
.INB INC/PRODOS.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.I
|
||||
.INB INC/MLI.E.I
|
||||
.INB INC/XY.MOUSE.I
|
||||
.INB INC/GUI.I
|
||||
|
||||
|
@ -9,7 +9,7 @@ AUTO 4,1
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/IO.I
|
||||
.INB INC/MONITOR.I
|
||||
.INB INC/PRODOS.I
|
||||
.INB INC/MLI.I
|
||||
*--------------------------------------
|
||||
TmpPtr1 .EQ $0
|
||||
*--------------------------------------
|
||||
|
@ -9,7 +9,7 @@ AUTO 4,1
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/IO.I
|
||||
.INB INC/MONITOR.I
|
||||
.INB INC/PRODOS.I
|
||||
.INB INC/MLI.I
|
||||
*--------------------------------------
|
||||
TmpPtr1 .EQ $0
|
||||
TmpPtr2 .EQ $2
|
||||
|
@ -9,8 +9,8 @@ AUTO 4,1
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/IO.I
|
||||
.INB INC/MONITOR.I
|
||||
.INB INC/PRODOS.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.I
|
||||
.INB INC/MLI.E.I
|
||||
*--------------------------------------
|
||||
TmpPtr1 .EQ $0
|
||||
TmpPtr2 .EQ $2
|
||||
|
@ -9,8 +9,8 @@ AUTO 4,1
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/IO.I
|
||||
.INB INC/MONITOR.I
|
||||
.INB INC/PRODOS.I
|
||||
.INB INC/MLI.ERR.I
|
||||
.INB INC/MLI.I
|
||||
.INB INC/MLI.E.I
|
||||
.INB INC/COM.6551.I
|
||||
*--------------------------------------
|
||||
TmpPtr1 .EQ $0
|
||||
|
@ -68,7 +68,7 @@ CS.RUN ldy #S.PS.ARGC
|
||||
*--------------------------------------
|
||||
CS.RUN.Pak >PUSHWI 0 Aux type
|
||||
>PUSHBI 0
|
||||
>PUSHBI SYS.FOpen.R
|
||||
>PUSHBI O.RDONLY
|
||||
|
||||
lda #1
|
||||
>SYSCALL GetArg
|
||||
|
Loading…
Reference in New Issue
Block a user