From 6d95c5b31eadd5a500975af1d5508ff80db3e6d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20GIBERT?= Date: Tue, 26 Feb 2019 07:00:37 +0000 Subject: [PATCH] Kernel 0.92+ --- INC/A2osX.I.txt | 1 - SYS/KERNEL.S.IO.txt | 44 ++++++++++++++++++++++++++++++------------- SYS/KERNEL.S.STAT.txt | 2 +- 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/INC/A2osX.I.txt b/INC/A2osX.I.txt index 57c0d464..79711f6f 100644 --- a/INC/A2osX.I.txt +++ b/INC/A2osX.I.txt @@ -471,7 +471,6 @@ S.FD.SSOCK.STATUS .EQ 7 S.FD.SSOCK .EQ 8 *-------------------------------------- S.FD.PIPE.S .EQ 2 -S.FD.PIPE.S.Opened .EQ %10000000 S.FD.PIPE.hMem .EQ 3 S.FD.PIPE.Tail .EQ 4 S.FD.PIPE.Head .EQ 5 diff --git a/SYS/KERNEL.S.IO.txt b/SYS/KERNEL.S.IO.txt index f8f1592c..d56a7ef1 100644 --- a/SYS/KERNEL.S.IO.txt +++ b/SYS/KERNEL.S.IO.txt @@ -183,7 +183,12 @@ IO.OPEN.DSOCK *-------------------------------------- IO.OPEN.SSOCK *-------------------------------------- -IO.OPEN.PIPE +IO.OPEN.PIPE + +* ldy #S.FD.PIPE.S +* lda (pFD),y +* inc +* sta (pFD),y clc rts *-------------------------------------- @@ -241,10 +246,21 @@ IO.CLOSE.CDEV IO.CLOSE.BDEV *-------------------------------------- IO.CLOSE.DSOCK -IO.CLOSE.SSOCK clc +IO.CLOSE.SSOCK + + clc rts *-------------------------------------- -IO.CLOSE.PIPE jsr IO.CLOSE.NOD +IO.CLOSE.PIPE ldy #S.FD.PIPE.S + lda (pFD),y + bmi .1 remote PS closed its end + + lda #$80 + sta (pFD),y + clc + rts + +.1 jsr IO.CLOSE.NOD ldy #S.FD.PIPE.hMem @@ -400,19 +416,20 @@ IO.READ.SSOCK ldy #S.FD.SSOCK.READ * (pStack)+2 count * (pStack)+0 buf *-------------------------------------- -IO.READ.PIPE ldy #S.FD.PIPE.S - lda (pFD),y - bne .11 - jmp IO.READ.PIPE.99 Remote PS closed the Pipe +IO.READ.PIPE ldy #S.FD.PIPE.Used+1 -.11 ldy #S.FD.PIPE.Used+1 - - lda (pFD),y + lda (pFD),y Data ? dey ora (pFD),y - bne .10 + bne .10 yes... -* lda #0 BLOCKING I/O + ldy #S.FD.PIPE.S + lda (pFD),y + bpl .11 + + jmp IO.READ.PIPE.99 Remote PS closed the Pipe + +.11 lda #0 BLOCKING I/O sec rts @@ -503,7 +520,8 @@ IO.READ.PIPE.99 lda #MLI.E.EOF *-------------------------------------- IO.WRITE.PIPE ldy #S.FD.PIPE.S lda (pFD),y - beq IO.READ.PIPE.99 Remote PS closed the Pipe + + bmi IO.READ.PIPE.99 Remote PS closed the Pipe sec ldy #S.FD.PIPE.Free diff --git a/SYS/KERNEL.S.STAT.txt b/SYS/KERNEL.S.STAT.txt index deb8ca50..ed579ed1 100644 --- a/SYS/KERNEL.S.STAT.txt +++ b/SYS/KERNEL.S.STAT.txt @@ -306,7 +306,7 @@ K.Pipe >LDYAI K.PIPE.SIZE sta (pFD),y ldy #S.FD.PIPE.S - lda #S.FD.PIPE.S.Opened + lda #1 sta (pFD),y iny S.FD.PIPE.hMem