From e040a2a11e237ecad09879e7a8ca207b659ef43f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20GIBERT?= Date: Thu, 20 Sep 2018 17:33:05 +0200 Subject: [PATCH] Kernel 0.9.2 --- .Docs/KERNEL.md | 49 +++++++++++---- .Docs/LIBTCPIP.md | 6 +- .Floppies/A2OSX.BUILD.po | Bin 819200 -> 819200 bytes .Floppies/A2OSX.SRC.po | Bin 819200 -> 819200 bytes INC/A2osX.I.txt | 19 +++--- INC/KERNEL.I.txt | 5 ++ SYS/KERNEL.S.CORE.txt | 2 +- SYS/KERNEL.S.STAT.txt | 130 ++++++++++++++++++++++++--------------- 8 files changed, 136 insertions(+), 75 deletions(-) diff --git a/.Docs/KERNEL.md b/.Docs/KERNEL.md index e7abd569..67dcd59e 100644 --- a/.Docs/KERNEL.md +++ b/.Docs/KERNEL.md @@ -505,7 +505,7 @@ Load a file in AUX memory (Stock Objects) Y,A = File Length X = hMem of Loaded Object in AUX mem -# ExecPSNewEnv. +# ExecPSNewEnv # ExecPS (Blocking Parent PID) @@ -549,29 +549,52 @@ Return information about a file **Out:** # MKDir +create a directory + +## C +`int mkdir(const char *pathname, int mode);` + +## ASM **In:** - Y,A = DIR name +`>PUSHW mode` +`>LDYA pathname` +`>SYSCALL mkdir` **Out:** - CC : success - CS : error - A = EC +CC : success +CS : error +A = EC # MkNod -int mknod(const char *pathname, mode_t mode, dev_t dev); -return a hFile for a given Device Name +return a hFile for a given file descriptor. +(CDEV, BDEV, DSOCKS, SSOCK, PIPE) + +## C +`hFILE mknod(const char *pathname, int mode, hFD fd);` + +## ASM **In:** - Y,A=DevName +`>PUSHB fd` +`>PUSHW mode` +`>LDYA pathname` +`>SYSCALL mknod` **Out:** - CC = OK, CS = ERROR - A = hFILE +CC = OK, CS = ERROR +A = hFILE # MKFIFO -int mkfifo(const char *pathname, mode_t mode); return a hFILE to a new FIFO + +## C +`hFILE mkfifo(const char *pathname, int mode);` + +## ASM **In:** +`>PUSHW mode` +`>LDYA pathname` +`>SYSCALL mkfifo` **Out:** - CC = OK, CS = ERROR - A = hFILE +CC = OK, CS = ERROR +A = hFILE # FPutC Print A (char) to hFILE diff --git a/.Docs/LIBTCPIP.md b/.Docs/LIBTCPIP.md index e5105d17..f99ebf4c 100644 --- a/.Docs/LIBTCPIP.md +++ b/.Docs/LIBTCPIP.md @@ -60,7 +60,7 @@ Create a new socket ## ASM **In:** -`>LDYA template` +`>PUSHW template` `>LIBCALL hLIBTCPIP,LIBTCPIP.SKT.New` **Out:** CC: A = hSOCKET @@ -95,11 +95,11 @@ CS: A = EC # SKT.MkNod ## C -`hFD skt.mknod(hSOCKET *s);` +`hFD skt.mknod(hSOCKET s);` ## ASM **In:** -`>LDYA s` +`lda s` `>LIBCALL hLIBTCPIP,LIBTCPIP.SKT.MkNod` **Out:** CC: A = hFD diff --git a/.Floppies/A2OSX.BUILD.po b/.Floppies/A2OSX.BUILD.po index b48cf778daeac33ae491cd38438b8b19ff4242a7..cfb34b58dc2f45327ddae40a040d67123851ba94 100644 GIT binary patch delta 9196 zcmZWvd3;;NwVsjVL{8#((=K_Jv)JKUl4V&2N|3IuY}MMVD>+Um5GNMI#IcR71VRgr zgOjimaKo^*?1A<{3#DakA>9{R;bIzHW zGb8Wc@7urM_vC!}GJl)2YT>%_%i%xkRz3YedFn9^J)Qo{o3ZLkJml&Y-@`J(mogRP0kF@^~F=+P<$>O z>QhKd!@|?=HQO3d$k{}=h@@^&#)_fe&Oa*?urfA+R(o6!m0JN zW8w8vJ@l*v=V=F(76PX|vmT*#YtW;{Q`y7Zw_!yIl4kD`Dy=AyLps+xzd4nOkg6`y zey5IwNmI9w&&Co;#v3TAl2N=lAoxru8A&C)0ZpF;=AbAFN*H_4*!97M_fD^?=*8CB zvyXPrHhRv{L29Ds9=(Ki(hnWIgKnhf9sMe8r<;!cjappi3*D+Tq((BaAq=8B=p~L2 zYogR{3l}9Ku^48I>>*Z}4N_{cMvAPO7Nn0@6?P4fgV7>6yah?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Np+F-`YVyw!>v)PLED;uLivjI=L0T1JL10JR+{z5_w3`z{L%36HN438Ot z7*%;iw_l59(wd=mnIR*SazA?3ZV{ZG#()NwD?Hk*+Z|r?LIJv}_W`Z?uU%HMXnvu`7s7Tw8fkT~1 v>wuarL)!+9whf%yHgE~*O&5H}@j-wU4j331nV486Gcvtzd%(5q0rvs`{?I!V diff --git a/INC/A2osX.I.txt b/INC/A2osX.I.txt index 1fa59b88..6fb09ca9 100644 --- a/INC/A2osX.I.txt +++ b/INC/A2osX.I.txt @@ -7,6 +7,7 @@ K.ENV.SIZE .EQ 256 K.FLT.MAX .EQ 4 K.EVT.MAX .EQ 4 K.DEV.MAX .EQ 32 +K.NOD.MAX .EQ 64 K.PS.MAX .EQ 32 *-------------------------------------- ZPDRV .EQ $20 32 bytes @@ -431,13 +432,13 @@ S.FD.SSOCK.STATUS .EQ 7 S.FD.SSOCK .EQ 8 *-------------------------------------- S.FD.FIFO.S .EQ 2 -S.FD.FIFO.S.Opened .EQ 1 -S.FD.FIFO.S.Closed .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 5 +S.FD.FIFO.Head .EQ 6 * -S.FD.FIFO .EQ 6 +S.FD.FIFO .EQ 8 *-------------------------------------- * PS STRUCT *-------------------------------------- @@ -548,12 +549,12 @@ S.STAT.MODE.RU .EQ $0100 S.STAT.MODE.REG .EQ $0000 S.STAT.MODE.DIR .EQ $1000 -*S.STAT.MODE.CDEV .EQ $2000 -*S.STAT.MODE.BDEV .EQ $3000 +S.STAT.MODE.CDEV .EQ $2000 +S.STAT.MODE.BDEV .EQ $3000 *S.STAT.MODE.LNK .EQ $4000 -*S.STAT.MODE.DSOCK .EQ $5000 -*S.STAT.MODE.SSOCK .EQ $6000 -*S.STAT.MODE.FIFO .EQ $7000 +S.STAT.MODE.DSOCK .EQ $5000 +S.STAT.MODE.SSOCK .EQ $6000 +S.STAT.MODE.FIFO .EQ $7000 S.STAT.DEV .EQ 2 WORD S.STAT.UID .EQ 4 WORD diff --git a/INC/KERNEL.I.txt b/INC/KERNEL.I.txt index e2201860..9afedb70 100644 --- a/INC/KERNEL.I.txt +++ b/INC/KERNEL.I.txt @@ -104,6 +104,11 @@ Dev.Table.F .EQ $0C20 K.Dev.MAX Dev.Table.pFDLO .EQ $0C40 K.Dev.MAX Dev.Table.pFDHI .EQ $0C60 K.Dev.MAX *-------------------------------------- +* /dev/ +*-------------------------------------- +Nod.Table.hFD .EQ $0C80 K.NOD.MAX +Nod.Table.hPath .EQ $0CC0 K.NOD.MAX +*-------------------------------------- PS.Table.hMem .EQ $0D00 K.PS.MAX PS.Table.PID .EQ $0D20 K.PS.MAX PS.Table.Stat .EQ $0D40 K.PS.MAX diff --git a/SYS/KERNEL.S.CORE.txt b/SYS/KERNEL.S.CORE.txt index 2092b457..dcb7caad 100644 --- a/SYS/KERNEL.S.CORE.txt +++ b/SYS/KERNEL.S.CORE.txt @@ -531,7 +531,7 @@ DevMgr.Stat .DA DevMgr.FreeMem DevMgr.Free .DA DevMgr.FreeMem .DA DevMgr.HiMem DevMgr.DevCnt .DA #0 - .BS 1 +DevMgr.NodCnt .DA #0 *-------------------------------------- CORE.VBLState .BS 1 CORE.IRQMode .BS 1 diff --git a/SYS/KERNEL.S.STAT.txt b/SYS/KERNEL.S.STAT.txt index e427bc48..a23390a3 100644 --- a/SYS/KERNEL.S.STAT.txt +++ b/SYS/KERNEL.S.STAT.txt @@ -123,15 +123,22 @@ K.Stat.DST .DA #S.STAT.P.TYPE .DA #S.STAT.BLOCKS,#S.STAT.BLOCKS+1 */------------------------------------- * # MKDir +* create a directory +* ## C +* `int mkdir(const char *pathname, int mode);` +* ## ASM * **In:** -* Y,A = DIR name +* `>PUSHW mode` +* `>LDYA pathname` +* `>SYSCALL mkdir` * **Out:** -* CC : success -* CS : error -* A = EC +* CC : success +* CS : error +* A = EC *\------------------------------------- K.MKDir jsr PFT.CheckPathYA jsr STDIO.SetMLIPathYA + lda #S.FI.A.FULL sta K.MLI.PARAMS+S.FI.A lda #S.FI.T.DIR @@ -151,66 +158,91 @@ K.MKDir jsr PFT.CheckPathYA rts */-------------------------------------- * # MkNod -* int mknod(const char *pathname, mode_t mode, dev_t dev); -* return a hFile for a given Device Name +* return a hFile for a given file descriptor. +* (CDEV, BDEV, DSOCKS, SSOCK, PIPE) +* ## C +* `hFILE mknod(const char *pathname, int mode, hFD fd);` +* ## ASM * **In:** -* Y,A=DevName +* `>PUSHB fd` +* `>PUSHW mode` +* `>LDYA pathname` +* `>SYSCALL mknod` * **Out:** -* CC = OK, CS = ERROR -* A = hFILE +* CC = OK, CS = ERROR +* A = hFILE *\-------------------------------------- -K.MkNod jsr K.GetDevByName Y,A=NAME - bcs .9 - >STYA .1+1 pFD - stx .2+1 devID +K.MkNod >STYA ZPPtr1 pathname - ldy #S.FD.T - lda (pFD),y - cmp #S.FD.T.CDEV - bne .99 - - txa Pass DEV.ID to OPEN - ldx #IOCTL.OPEN -.1 jsr $FFFF SELF MODIFIED - bcs .9 + >PULLW K.S.STAT+S.STAT.MODE + >PULLB K.S.STAT+S.STAT.DEV - >LDYAI S.FD.DEV - jsr K.GetMem0 - bcs .9 - - >STYA ZPPtr3 Ptr3=S.FD + jsr K.GetMemPtr + bcs .99 - ldy #S.FD.T - lda #S.FD.T.CDEV - sta (ZPPtr3),y + >STYA pFD - ldy #S.FD.DEV.DEVID + ldx DevMgr.NodCnt + cpx #K.NOD.MAX + beq .98 -.2 lda #$ff Self Modified - sta (ZPPtr3),y +.1 dex + bpl . + lda - ldy #S.FD.DEV.DRVPTR - lda .1+1 - sta (ZPPtr3),y - - iny - lda .1+2 - sta (ZPPtr3),y - txa - clc -.9 rts - -.99 lda #MLI.E.IO + lda (pFD) #S.FD.T + + tax + jmp (.8,x) + +.8 .DA STDIO.IOERR REG + .DA STDIO.IOERR DIR + .DA STAT.MKNOD.CDEV + .DA STAT.MKNOD.BDEV + .DA STDIO.IOERR LNK + .DA STAT.MKNOD.DSOCK + .DA STAT.MKNOD.SSOCK + .DA STDIO.IOERR FIFO + +.98 lda #K.E.OOH sec - rts +.99 rts +*-------------------------------------- +STAT.MKNOD.CDEV +STAT.MKNOD.BDEV +STAT.MKNOD.DSOCK +STAT.MKNOD.SSOCK + + ldx #S.STAT + ldy #$ff + +.1 inx + iny + lda (ZPPtr1),y + bne .1 + + txa + tay + lda #0 + jsr K.GetMem + bcs .9 + >STYA ZPPtr2 + + +.9 rts */-------------------------------------- * # MKFIFO -* int mkfifo(const char *pathname, mode_t mode); * return a hFILE to a new FIFO +* ## C +* `hFILE mkfifo(const char *pathname, int mode);` +* ## ASM * **In:** +* `>PUSHW mode` +* `>LDYA pathname` +* `>SYSCALL mkfifo` * **Out:** -* CC = OK, CS = ERROR -* A = hFILE +* CC = OK, CS = ERROR +* A = hFILE *\-------------------------------------- K.MKFIFO >LDYAI 256 jsr K.GetMem