Kernel 0.94

This commit is contained in:
Rémy GIBERT 2020-06-23 08:19:11 +02:00
parent 4608eef70a
commit 6c3cea75ae
2 changed files with 84 additions and 71 deletions

Binary file not shown.

View File

@ -7,6 +7,7 @@ NEW
*-------------------------------------- *--------------------------------------
.INB inc/macros.i .INB inc/macros.i
.INB inc/a2osx.i .INB inc/a2osx.i
.INB inc/mli.i
.INB inc/eth.i .INB inc/eth.i
.INB inc/libtcpip.i .INB inc/libtcpip.i
*-------------------------------------- *--------------------------------------
@ -21,6 +22,7 @@ ZS.START
ZPIPCfgPtr .BS 2 ZPIPCfgPtr .BS 2
hSocket .BS 1 hSocket .BS 1
hFile .BS 1
ZPUsrBufPtr .BS 2 ZPUsrBufPtr .BS 2
hUsrBuf .BS 1 hUsrBuf .BS 1
@ -35,12 +37,6 @@ bEscMode .BS 1
ZPMsgPtr .BS 2 ZPMsgPtr .BS 2
hMsg .BS 1 hMsg .BS 1
hReq .BS 1
ZPReqPtr .BS 2
hRep .BS 1
ZPRepPtr .BS 2
TimeOut .BS 1 TimeOut .BS 1
ZS.END ZS.END
.ED .ED
@ -67,6 +63,7 @@ L.LIBTCPIP .DA LIBTCPIP
L.SA.LOCAL .DA SA.LOCAL L.SA.LOCAL .DA SA.LOCAL
L.SA.REMOTE .DA SA.REMOTE L.SA.REMOTE .DA SA.REMOTE
L.SA.REMOTE.AD .DA SA.REMOTE+S.SOCKADDR.ADDR L.SA.REMOTE.AD .DA SA.REMOTE+S.SOCKADDR.ADDR
L.NOD.Template .DA NOD.Template
L.MSG.IPKO .DA MSG.IPKO L.MSG.IPKO .DA MSG.IPKO
L.MSG.USAGE .DA MSG.USAGE L.MSG.USAGE .DA MSG.USAGE
L.MSG.UNKNOWN .DA MSG.UNKNOWN L.MSG.UNKNOWN .DA MSG.UNKNOWN
@ -218,6 +215,9 @@ CS.RUN.OPENSKT >PUSHBI 0 no protocol
>PUSHBI 0 >PUSHBI 0
>SYSCALL PrintF >SYSCALL PrintF
jsr CS.RUN.MkNod
bcs .99
jsr CS.RUN.GETBUF jsr CS.RUN.GETBUF
bcs .99 bcs .99
@ -234,11 +234,14 @@ CS.RUN.OPENSKT >PUSHBI 0 no protocol
jsr CS.RUN.JOIN jsr CS.RUN.JOIN
bcs .99 bcs .99
jsr CS.RUN.SCRSETUP
bcs .99
CS.RUN.LOOP >SLEEP CS.RUN.LOOP >SLEEP
>PUSHW MSGSIZE >PUSHWI MSGSIZE
>PUSHW ZPMsgPtr >PUSHW ZPMsgPtr
lda hSocket lda hFile
>SYSCALL fgets >SYSCALL fgets
bcc .1 bcc .1
tay tay
@ -273,6 +276,30 @@ CS.RUN.ERR php
plp plp
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN.MkNod >PUSHEA.G NodBuf
>PUSHW L.NOD.Template
>PUSHB hSocket
>PUSHBI 1
>SYSCALL sprintf
bcs .9
>PUSHEA.G NodBuf
>PUSHW 0
>PUSHB hSocket
>SYSCALL mknod
bcs .9
>PUSHEA.G NodBuf
>PUSHBI O.RDWR+O.TEXT
>PUSHBI S.FI.T.TXT
>PUSHWZ Aux type
>SYSCALL FOpen
bcs .9
sta hFile
.9 rts
*--------------------------------------
CS.RUN.GETBUF >LDYAI MSGSIZE CS.RUN.GETBUF >LDYAI MSGSIZE
>SYSCALL GetMem >SYSCALL GetMem
bcs .9 bcs .9
@ -381,27 +408,21 @@ CS.RUN.TXTCLR lda #0
CS.RUN.NICK >LDYA L.MSG.NICK CS.RUN.NICK >LDYA L.MSG.NICK
>SYSCALL PutS >SYSCALL PutS
>PUSHW ZPMsgPtr >PUSHB hFile
>PUSHW L.IRC.NICK >PUSHW L.IRC.NICK
lda #3 nickname lda #3 nickname
>SYSCALL ArgV >SYSCALL ArgV
>PUSHYA >PUSHYA
>PUSHBI 2 >PUSHBI 2
>SYSCALL SPrintF >SYSCALL FPrintF
bcs .9
>PUSHW ZPMsgPtr
lda hSocket
>SYSCALL fputs
>DEBUG
bcs .9 bcs .9
.1 >SLEEP .1 >SLEEP
>PUSHW MSGSIZE >PUSHWI MSGSIZE
>PUSHW ZPMsgPtr >PUSHW ZPMsgPtr
lda hSocket lda hFile
>SYSCALL fgets >SYSCALL fgets
bcc .2 bcc .2
tay tay
@ -409,7 +430,10 @@ CS.RUN.NICK >LDYA L.MSG.NICK
.9 rts .9 rts
.2 jsr CS.RUN.SKIPPFX .2
>LDYA ZPMsgPtr
>SYSCALL puts
jsr CS.RUN.SKIPPFX
ldx #$ff ldx #$ff
dey dey
@ -419,21 +443,19 @@ CS.RUN.NICK >LDYA L.MSG.NICK
lda IRC.REP.NOIDENT,x lda IRC.REP.NOIDENT,x
beq .8 beq .8
cmp (ZPRepPtr),y cmp (ZPMsgPtr),y
beq .3 beq .3
jsr .8
bra .1 bra .1
.8 .8 clc
* clc
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN.USER >LDYA L.MSG.USER CS.RUN.USER >LDYA L.MSG.USER
>SYSCALL PutS >SYSCALL PutS
>PUSHW ZPMsgPtr >PUSHB hFile
>PUSHW L.IRC.USER >PUSHW L.IRC.USER
lda #3 nickname lda #3 nickname
@ -443,19 +465,14 @@ CS.RUN.USER >LDYA L.MSG.USER
>SYSCALL ArgV >SYSCALL ArgV
>PUSHYA >PUSHYA
>PUSHBI 4 >PUSHBI 4
>SYSCALL SPrintF >SYSCALL FPrintF
bcs .9
>PUSHW ZPMsgPtr
lda hSocket
>SYSCALL fgets
bcs .9 bcs .9
.1 >SLEEP .1 >SLEEP
>PUSHW MSGSIZE >PUSHWI MSGSIZE
>PUSHW ZPMsgPtr >PUSHW ZPMsgPtr
lda hSocket lda hFile
>SYSCALL fgets >SYSCALL fgets
bcc .2 bcc .2
tay tay
@ -463,7 +480,10 @@ CS.RUN.USER >LDYA L.MSG.USER
.9 rts .9 rts
.2 jsr CS.RUN.SKIPPFX .2
>LDYA ZPMsgPtr
>SYSCALL puts
jsr CS.RUN.SKIPPFX
ldx #$ff ldx #$ff
dey dey
@ -473,22 +493,18 @@ CS.RUN.USER >LDYA L.MSG.USER
lda IRC.REP.001,x lda IRC.REP.001,x
beq .8 beq .8
cmp (ZPRepPtr),y cmp (ZPMsgPtr),y
beq .3 beq .3
jsr .8
bra .1 bra .1
.8 lda hRep .8 clc
>SYSCALL FreeMem
* clc
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN.JOIN >LDYA L.MSG.JOIN CS.RUN.JOIN >LDYA L.MSG.JOIN
>SYSCALL PutS >SYSCALL PutS
>PUSHW ZPMsgPtr >PUSHB hFile
lda #5 key lda #5 key
>SYSCALL ArgV >SYSCALL ArgV
@ -513,18 +529,14 @@ CS.RUN.JOIN >LDYA L.MSG.JOIN
>PUSHYA >PUSHYA
>PUSHBI 2 >PUSHBI 2
.2 >SYSCALL SPrintF .2 >SYSCALL FPrintF
bcs .9
>PUSHW ZPMsgPtr
lda hSocket
>SYSCALL fputs
bcs .9 bcs .9
.3 >SLEEP .3 >SLEEP
>PUSHWI MSGSIZE
>PUSHW ZPMsgPtr >PUSHW ZPMsgPtr
lda hSocket lda hFile
>SYSCALL fgets >SYSCALL fgets
bcc .4 bcc .4
tay tay
@ -532,12 +544,8 @@ CS.RUN.JOIN >LDYA L.MSG.JOIN
.9 rts .9 rts
.4 .4 >LDYA ZPMsgPtr
>SYSCALL puts
bra .8
jsr CS.RUN.SKIPPFX jsr CS.RUN.SKIPPFX
ldx #$ff ldx #$ff
@ -548,16 +556,12 @@ CS.RUN.JOIN >LDYA L.MSG.JOIN
lda IRC.REP.JOIN,x lda IRC.REP.JOIN,x
beq .8 beq .8
cmp (ZPRepPtr),y cmp (ZPMsgPtr),y
beq .5 beq .5
jsr .8 bra .3
bra .4 .8 clc
.8 lda hRep
>SYSCALL FreeMem
* clc
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN.REQ CS.RUN.REQ
@ -565,14 +569,14 @@ CS.RUN.REQ
clc clc
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN.SKIPPFX ldy #S.TCP CS.RUN.SKIPPFX ldy #0
lda (ZPRepPtr),y lda (ZPMsgPtr)
cmp #':' cmp #':'
bne .8 bne .8
.1 iny .1 iny
lda (ZPRepPtr),y lda (ZPMsgPtr),y
cmp #C.SPACE cmp #C.SPACE
bne .1 bne .1
@ -671,17 +675,22 @@ CS.DOEVENT lda (pEvent)
.9 sec do not discard TIMER event .9 sec do not discard TIMER event
rts rts
*-------------------------------------- *--------------------------------------
CS.QUIT lda hSocket CS.QUIT lda hFile
beq .1 beq .1
>SYSCALL fclose
.1 lda hSocket
beq .2
>LIBCALL hLIBTCPIP,LIBTCPIP.Shutdown >LIBCALL hLIBTCPIP,LIBTCPIP.Shutdown
.1 lda hMsg .2 lda hMsg
beq .2 beq .3
>SYSCALL FreeMem >SYSCALL FreeMem
.2 lda hLIBTCPIP .3 lda hLIBTCPIP
beq .8 beq .8
>SYSCALL UnloadLib >SYSCALL UnloadLib
@ -718,6 +727,7 @@ IRC.NICK .AZ "NICK %s\r\n"
IRC.USER .AZ "USER %s 0 * :%s\r\n" IRC.USER .AZ "USER %s 0 * :%s\r\n"
IRC.JOIN .AZ "JOIN %s\r\n" IRC.JOIN .AZ "JOIN %s\r\n"
IRC.JOINKEY .AZ "JOIN %s %s\r\n" IRC.JOINKEY .AZ "JOIN %s %s\r\n"
IRC.PONG .AZ "PONG %s\r\n"
IRC.PRIVMSG .AZ "PRIVMSG %s :%s\r\n" IRC.PRIVMSG .AZ "PRIVMSG %s :%s\r\n"
*-------------------------------------- *--------------------------------------
SEQ.INIT .AZ "\ec\e(B\e)0\e[?7l\e[2;19r" SEQ.INIT .AZ "\ec\e(B\e)0\e[?7l\e[2;19r"
@ -735,11 +745,14 @@ SA.REMOTE .DA #AF.INET S.SOCKADDR.AF
.BS 1 .BS 1
.BS 4 S.SOCKADDR.ADDR .BS 4 S.SOCKADDR.ADDR
.BS 2 .BS 2
*--------------------------------------
NOD.Template .AZ "/dev/irc%h"
*-------------------------------------- *--------------------------------------
.DUMMY .DUMMY
.OR 0 .OR 0
DS.START DS.START
TxtBuf .BS 240 TxtBuf .BS 240
NodBuf .BS 11
DS.END DS.END
.ED .ED
*-------------------------------------- *--------------------------------------