Kernel 0.9.2

This commit is contained in:
Rémy GIBERT 2018-06-19 07:55:12 +02:00
parent c179b37d98
commit b7a46da3a6
3 changed files with 79 additions and 82 deletions

View File

@ -3,7 +3,7 @@ PREFIX /A2OSX.BUILD
AUTO 4,1
*--------------------------------------
* A2osX.DIIDrv
* X = DEVMGR.cmd
* X = IOCTL
* Y,A = PTR to Params
* pDev -> Dev Header AUX!!!
* $42 Command Number
@ -63,7 +63,7 @@ A2osx.DII.Stat .DA #S.DSTAT.S.BLOCK+S.DSTAT.S.WRITE+S.DSTAT.S.READ
.DA #0,#91
*--------------------------------------
* A2osX.RamDrv
* X = DEVMGR.cmd
* X = IOCTL
* Y,A = PTR to Params
* pDev -> Dev Header AUX!!!
* $42 Command Number
@ -110,7 +110,7 @@ A2osx.RamDrv.Stat
.DA #0,#91
*--------------------------------------
* A2osX.BlkDrv
* X = DEVMGR.cmd
* X = IOCTL
* Y,A = PTR to Params
* pDev -> Dev Header
* $42 Command Number

View File

@ -2,8 +2,82 @@ NEW
PREFIX /A2OSX.BUILD
AUTO 4,1
*--------------------------------------
IO.COut ldy #S.NODE.T
lda (pNode),y
asl
tax
*--------------------------------------
jmp (.1,x)
.1 .DA STDIO.Out.REG
.DA STDIO.IOERR DIR
.DA STDIO.Out.CDEV
.DA STDIO.IOERR BDEV
.DA STDIO.IOERR LNK
.DA STDIO.IOERR DSOCK
.DA STDIO.Out.SSOCK
.DA STDIO.Out.FIFO
*--------------------------------------
IO.COut.REG >PUSHW pIOBuf
>PUSHW STDIO.Out.Cnt
ldy #S.NODE.REG.REF
>PUSHB (pNode),y
jmp K.FWrite
*--------------------------------------
IO.COut.CDEV ldy #S.NODE.DEV.JMP
lda (pNode),y
sta .1+1
iny
lda (pNode),y
sta .1+2
lda K.IOBuf
ldx #IOCTL.WRITE
.1 jmp $ffff
*--------------------------------------
IO.COut.SSOCK lda (pNode) #S.NODE.HANDLER
jsr K.GetMemPtr.A
>STYA .1
ldy #S.NODE.SSOCK.HSKT
>PUSHB (pNode),y
>PUSHB K.IOBuf
ldy #S.NODE.SSOCK.WRITE
lda (pNode),y
tax Function Offset for write
.1 jmp $ffff
*--------------------------------------
IO.COut.FIFO ldy #S.NODE.FIFO.S
lda (pNode),y
beq .9 Remote PS did not opened yet the pipe
cmp #S.NODE.FIFO.S.Closed
beq .99 Remote PS closed the Pipe
ldy #S.NODE.FIFO.hMem
lda (pNode),y
jsr K.GetMemPtr.A
>STYA .1+2
ldy #S.NODE.FIFO.Head
lda (pNode),y
inc
dey #S.NODE.FIFO.Tail
cmp (pNode),y
beq .9 FIFO is full
iny
sta (pNode),y
tay
lda K.IOBuf
.1 sta $ffff,y
clc
rts
.9 lda #MLI.E.VOLFULL
.HS 2C bit abs
.99 lda #MLI.E.EOF
sec
rts
*--------------------------------------
MAN
SAVE /A2OSX.SRC/SYS/KERNEL.S.IO

View File

@ -54,6 +54,7 @@ K.PutChar.1 jsr K.GetMemPtr.A
* CC = success
*\--------------------------------------
K.PutS >STYA pIOBuf
ldy #S.PS.hStdOut
lda (pPs),y
jsr K.FPutS.1
@ -575,84 +576,6 @@ PrintF.COut phy
.8 ply
clc
rts
*--------------------------------------
*--------------------------------------
STDIO.Out ldy #S.NODE.T
lda (pNode),y
asl
tax
*--------------------------------------
jmp (.1,x)
.1 .DA STDIO.Out.REG
.DA STDIO.IOERR DIR
.DA STDIO.Out.CDEV
.DA STDIO.IOERR BDEV
.DA STDIO.IOERR LNK
.DA STDIO.IOERR DSOCK
.DA STDIO.Out.SSOCK
.DA STDIO.Out.FIFO
*--------------------------------------
STDIO.Out.REG >PUSHW pIOBuf
>PUSHW STDIO.Out.Cnt
ldy #S.NODE.REG.REF
>PUSHB (pNode),y
jmp K.FWrite
*--------------------------------------
STDIO.Out.CDEV ldy #S.NODE.DEV.JMP
lda (pNode),y
sta .1+1
iny
lda (pNode),y
sta .1+2
lda K.IOBuf
ldx #IOCTL.WRITE
.1 jmp $ffff
*--------------------------------------
STDIO.Out.SSOCK lda (pNode) #S.NODE.HANDLER
jsr K.GetMemPtr.A
>STYA .1
ldy #S.NODE.SSOCK.HSKT
>PUSHB (pNode),y
>PUSHB K.IOBuf
ldy #S.NODE.SSOCK.WRITE
lda (pNode),y
tax Function Offset for write
.1 jmp $ffff
*--------------------------------------
STDIO.Out.FIFO ldy #S.NODE.FIFO.S
lda (pNode),y
beq .9 Remote PS did not opened yet the pipe
cmp #S.NODE.FIFO.S.Closed
beq .99 Remote PS closed the Pipe
ldy #S.NODE.FIFO.hMem
lda (pNode),y
jsr K.GetMemPtr.A
>STYA .1+2
ldy #S.NODE.FIFO.Head
lda (pNode),y
inc
dey #S.NODE.FIFO.Tail
cmp (pNode),y
beq .9 FIFO is full
iny
sta (pNode),y
tay
lda K.IOBuf
.1 sta $ffff,y
clc
rts
.9 lda #MLI.E.VOLFULL
.HS 2C bit abs
.99 lda #MLI.E.EOF
sec
rts
*/--------------------------------------
* # GetChar
* Get char from StdIn