Kernel 0.9.2

This commit is contained in:
Rémy GIBERT 2018-09-12 17:27:00 +02:00
parent 16d0c31b3e
commit acdba1900a
7 changed files with 67 additions and 64 deletions

Binary file not shown.

Binary file not shown.

View File

@ -181,8 +181,6 @@ CS.RUN.LOOP >SLEEP
jmp CS.RUN.SKTERR
.1 >PUSHYA len
* lda #'@'
* >SYSCALL putchar
>PUSHW ZPBufPtr
ldy #S.PS.hStdOut
lda (pPs),y

View File

@ -1081,18 +1081,25 @@ KeyRemappedRGHT .HS 1B5B4300 esc[C
TelnetOpt .DA #IAC,#DO,#TELOPT.ECHO
TelnetOpt.LEN .EQ *-TelnetOpt
*--------------------------------------
TELOPS.STATUS
*--------------------------------------
WILLDO .DA #TELOPT.BINARY,#TELOPT.SGA
WILLDO.CNT .EQ *-WILLDO
WILLDONT .DA #TELOPT.TSPEED,#TELOPT.LINEMODE,#TELOPT.STATUS
WILLDONT.CNT .EQ *-WILLDONT
DOWILL .DA #TELOPT.BINARY,#TELOPT.SGA,#TELOPT.NAWS,#TELOPT.TTYPE
DOWILL .DA #TELOPT.BINARY,#TELOPT.SGA,#TELOPT.NAWS,#TELOPT.TTYPE,#TELOPT.NAWS
DOWILL.CNT .EQ *-DOWILL
DOWONT .DA #TELOPT.NEWENVIRON,#TELOPT.XDISPLOC,#TELOPT.TSPEED,#TELOPT.LFLOW,#TELOPT.NAWS
DOWONT .DA #TELOPT.NEWENVIRON,#TELOPT.XDISPLOC,#TELOPT.TSPEED,#TELOPT.LFLOW
DOWONT.CNT .EQ *-DOWONT
SB.IS.TTYPE .DA #IAC,#SB,#TELOPT.TTYPE,#SB.IS
.AS 'XTERM'
.DA #IAC,#SE
SB.IS.TTYPE.LEN .EQ *-SB.IS.TTYPE
SB.IS.NAWS .DA #IAC,#SB,#TELOPT.NAWS,#SB.IS
.DA 80
.DA 24
.DA #IAC,#SE
SB.IS.NAWS.LEN .EQ *-SB.IS.NAWS
*--------------------------------------
CH .BS 1
CV .BS 1

View File

@ -291,6 +291,7 @@ CONTROL >STYA ZPIOCTL
*--------------------------------------
OPEN php
sei
ldx DEVSLOTn08F
stz SSC.RESET-$8F,x
@ -318,14 +319,22 @@ OPEN php
lda SSC.DATA-$8F,x discard any garbage byte
lda SSC.STATUS-$8F,x clear any IRQ pending
lda #S.DIB.S.OPENED
tsb DIB+S.DIB.S
plp
clc
rts
*--------------------------------------
CLOSE php
sei
ldx DEVSLOTn08F
stz SSC.RESET-$8F,x
lda #S.DIB.S.OPENED
trb DIB+S.DIB.S
plp
clc
rts

View File

@ -150,8 +150,9 @@ TCP.IN.JMP.LISTEN
TCP.IN.JMP.SYNSENT
ldy #S.TCP.OPTIONS SYN Send, only accept SYN.ACK packet, then Send ACK
lda (ZPFrameInPtr),y
bit #S.TCP.OPTIONS.SYN+S.TCP.OPTIONS.ACK
beq .8
and #S.TCP.OPTIONS.SYN+S.TCP.OPTIONS.ACK
cmp #S.TCP.OPTIONS.SYN+S.TCP.OPTIONS.ACK
bne .9
jsr SKT.GetTCB
@ -164,7 +165,7 @@ TCP.IN.JMP.SYNSENT
adc #0
sta SKT.TCBCache+S.TCB.OUTNEXTSEQ,x
eor (ZPFrameInPtr),y
bne .8
bne .9
dey
dex
bpl .1
@ -192,8 +193,10 @@ TCP.IN.JMP.SYNSENT
jmp SKT.StoreTCB
.8 clc
.9 rts
.9 lda #S.TCP.OPTIONS.RST
jsr TCP.OUT.SendOptA
jmp SKT.Destroy
*--------------------------------------
TCP.IN.JMP.SYNRCVD
ldy #S.TCP.OPTIONS SYN Recieved, SYN.ACK Sent, only accept ACK packet

View File

@ -10,7 +10,7 @@ AUTO 4,1
.INB INC/A2OSX.I
.INB INC/NET.TELNET.I
*--------------------------------------
TIMEOUT.MAX .EQ 100 1 sec.
TIMEOUT.MAX .EQ 100 10 sec.
*--------------------------------------
* File Header (16 Bytes)
*--------------------------------------
@ -32,8 +32,8 @@ CS.START cld
.DA CS.DOEVENT
.DA CS.QUIT
L.MSG.USAGE .DA MSG.USAGE
L.MSG.TELNETOPT .DA MSG.TELNETOPT
L.MSG.GREETINGS .DA MSG.GREETINGS
L.TELNETOPTS .DA TELNETOPTS
L.ENV.TERM .DA ENV.TERM
.DA 0 End Of Reloc Table
*--------------------------------------
@ -76,54 +76,42 @@ CS.INIT ldy #S.PS.ARGC
sec
.9 rts
*--------------------------------------
CS.RUN >SLEEP
>SYSCALL GetChar
bcs CS.RUN
.11 >SLEEP
>SYSCALL GetChar
bcc .11
jsr Init.Timeout
ldy #0
.1 lda MSG.TELNETOPT,y
phy
>SYSCALL PutChar
ply
iny
cpy #MSG.TELNETOPT.LEN
bne .1
CS.RUN.LOOP
.1 >SLEEP
>SYSCALL GetChar
bcs .4
cmp #IAC
beq CS.RUN.IACMODE
.4 jsr Wait.Timeout
bcc .1
CS.RUN >PUSHWI TELNETOPTS.LEN
>PUSHW L.TELNETOPTS
ldy #S.PS.hStdOut
lda (pPs),y
>SYSCALL write
bcs CS.RUN.8
>PUSHWI K.VER
>PUSHBI 2
>LDYA L.MSG.GREETINGS
>SYSCALL printf
bcs .8 unable to send greetings...reset..
bcs CS.RUN.8 unable to send greetings...reset..
jsr Init.Timeout
CS.RUN.LOOP
* >SLEEP
*.1 >SYSCALL GetChar
* bcs .2
* cmp #IAC
* beq CS.RUN.IACMODE
*.2 jsr Wait.Timeout
* bcc .1
lda #2
>SYSCALL GetArg
>SYSCALL ExecPS
.9 rts
rts
.8 clc
CS.RUN.8 clc
rts
*--------------------------------------
CS.RUN.IACMODE >SLEEP Wait for IAC VERB (or SB)
@ -144,7 +132,7 @@ CS.RUN.IACMODE >SLEEP Wait for IAC VERB (or SB)
*--------------------------------------
CS.RUN.IACVERB
jmp CS.RUN.LOOP
jmp CS.RUN.LOOP
*--------------------------------------
CS.RUN.IACSB
.1 >SLEEP
@ -202,8 +190,7 @@ CS.RUN.IACSB
CS.DOEVENT lda (pEvent)
bpl .9 is it a TIMER event?
ldy #TimeOut
lda (pData),y
>LDA.G TimeOut
beq .9
dec
@ -220,32 +207,31 @@ CS.QUIT >LDA.G hDEV
.8 clc
rts
*--------------------------------------
Init.Timeout ldy #TimeOut
lda #TIMEOUT.MAX
sta (pData),y
Init.Timeout lda #TIMEOUT.MAX
>STA.G TimeOut
rts
*--------------------------------------
Wait.TimeOut sec
ldy #TimeOut
lda (pData),y
>LDA.G TimeOut
beq .9
clc
.9 rts
*--------------------------------------
CS.END
MSG.USAGE .AZ "Usage : GETTY <DEV> <PROGRAM>"
MSG.TELNETOPT .DA #IAC,#WILL,#TELOPT.BINARY
.DA #IAC,#DO,#TELOPT.LINEMODE
.DA #IAC,#SB,#TELOPT.LINEMODE,#SB.SEND,#0,#IAC,#SE
.DA #IAC,#DONT,#TELOPT.ECHO
MSG.GREETINGS .AZ "\r\nA2osX-GeTTY %d.%d\r\n"
*--------------------------------------
TELNETOPTS .DA #IAC,#WILL,#TELOPT.BINARY
.DA #IAC,#WILL,#TELOPT.ECHO
* .DA #IAC,#DONT,#TELOPT.ECHO
.DA #IAC,#WILL,#TELOPT.SGA
.DA #IAC,#DO,#TELOPT.SGA
* .DA #IAC,#DO,#TELOPT.NAWS
.DA #IAC,#DO,#TELOPT.NAWS
.DA #IAC,#DO,#TELOPT.TTYPE
.DA #IAC,#SB,#TELOPT.TTYPE,#SB.SEND,#IAC,#SE
MSG.TELNETOPT.LEN .EQ *-MSG.TELNETOPT
MSG.GREETINGS .AZ "\r\nA2osX-GeTTY %d.%d\r\n"
.DA #IAC,#DONT,#TELOPT.LINEMODE
* .DA #IAC,#SB,#TELOPT.LINEMODE,#SB.SEND,#0,#IAC,#SE
* .DA #IAC,#SB,#TELOPT.TTYPE,#SB.SEND,#IAC,#SE
TELNETOPTS.LEN .EQ *-TELNETOPTS
ENV.TERM .AZ "TERM"
*--------------------------------------
.DUMMY