Kernel 0.93+

This commit is contained in:
Rémy GIBERT 2019-10-19 22:54:59 +02:00
parent 45d20f5171
commit 00bc0ccf5a
4 changed files with 41 additions and 8 deletions

Binary file not shown.

Binary file not shown.

View File

@ -37,7 +37,7 @@ CS.START cld
.DA #0
.DA CS.END-CS.START Code Size (without Constants)
.DA DS.END-DS.START Data SegmentSize
.DA #16 Stack Size
.DA #32 Stack Size
.DA #ZS.END-ZS.START Zero Page Size
.DA 0
*--------------------------------------
@ -159,9 +159,6 @@ CS.RUN.LOOP >SLEEP
lda (ZPBufPtr)
beq CS.RUN.LOOP
* >LDYA ZPBufPtr
* >SYSCALL puts
jsr CS.RUN.OUT
bcs .9
bra CS.RUN.LOOP

View File

@ -86,7 +86,7 @@ CS.RUN >LDYAI 33 Enough for HASH
>LDYA L.ETCISSUE
jsr CS.RUN.DUMPFILE
>PUSHWZ Dry Run, no output
>PUSHWZ Dry Run, no output
* lda #0 ROOT user
>SYSCALL GetPWUID
bcc CS.RUN.AUTH
@ -95,8 +95,10 @@ CS.RUN.NOAUTH >PUSHBI 0
>LDYA L.MSG.NOAUTH
>SYSCALL printf
bcs .9
jsr CS.RUN.SetRootSession
bcs .9
jmp CS.RUN.EXEC
.9 rts
*--------------------------------------
@ -142,13 +144,17 @@ CS.RUN.AUTH >LDYA L.LIBCRYPT
bcs .9
jmp CS.RUN.EXEC
.8 >PUSHBI 0
>LDYA L.MSG.BAD
>SYSCALL printf
bcs .9
dec ZPRetryCnt
beq .99
jmp .1
.99 lda #E.IUSR
sec
.9 rts
@ -236,6 +242,7 @@ CS.RUN.CHECKPWD rol ZPbValidUser
>STYA ZPPWPtr
stx ZPhPW
>PUSHYA
lda ZPUID
>SYSCALL GetPWUID
@ -244,15 +251,24 @@ CS.RUN.CHECKPWD rol ZPbValidUser
>PUSHW ZPGetlinePtr
>PUSHW ZPGetlinePtr
>LIBCALL hLIBCRYPT,LIBCRYPT.MD5
lda ZPPWPtr
clc
adc #S.PW.PASSWD
tay
lda ZPPWPtr+1
adc /S.PW.PASSWD
>PUSHYA
>LDYA ZPGetlinePtr
>SYSCALL strcmp
bcc CS.RUN.CHECK.9
lda ZPhPW
stz ZPhPW
>SYSCALL freemem
sec
CS.RUN.CHECK.9 rts
*--------------------------------------
@ -260,12 +276,15 @@ CS.RUN.EXEC ldx #1
.1 lda S.Table.hSession-1,x
beq .2
inx
cpx #K.USR.MAX+1
bne .1
lda #E.OOH
* sec
rts
.2 stx ZPUsrID
txa
ldy #S.PS.hSID
@ -284,12 +303,14 @@ CS.RUN.EXEC ldx #1
>LDYA L.SHELL
>SYSCALL ExecL
bcs .9
>SLEEP
ldx ZPUsrID
lda S.Table.hSession-1,x
stz S.Table.hSession-1,x
stz S.Table.hFILE-1,x
>SYSCALL freemem
sec
.9 rts
*--------------------------------------
@ -317,26 +338,35 @@ CS.RUN.GetLine sta ZPGetLineMax
ror ZPbGetLineSecret
stz ZPGetLineLen
stz ZPbEsc
.1 >SYSCALL getchar
bcs .9
bit ZPbEsc
bpl .11
* clc
ror ZPbEsc
cmp #'D'
bne .1
bra .3
.11 cmp #C.DEL
beq .3
cmp #C.SPACE
bcc .2
ldy ZPGetLineLen
cpy ZPGetLineMax
beq .1
sta (ZPGetLinePtr),y
inc ZPGetLineLen
bit ZPbGetLineSecret
bmi .1
>SYSCALL putchar
bra .1
@ -345,20 +375,26 @@ CS.RUN.GetLine sta ZPGetLineMax
cmp #C.CR
beq .8
cmp #C.ESC
bne .1
* sec
ror ZPbEsc
bra .1
.3 ldy ZPGetLineLen
beq .1
dec ZPGetLineLen
bit ZPbGetLineSecret
bmi .1
>PUSHBI 0
>LDYA L.MSG.BS
>SYSCALL printf
bra .1
.8 ldy ZPGetLineLen
lda #0
sta (ZPGetLinePtr),y
@ -425,10 +461,11 @@ CS.CLEANUP lda ZPhGetLine
.1 lda ZPhPW
beq .8
stz ZPhPW
>SYSCALL freemem
.8 clc
rts
*--------------------------------------
@ -459,8 +496,7 @@ SESSION.ROOT.Size .EQ *-SESSION.ROOT
.DUMMY
.OR 0
DS.START
DS.END
.ED
DS.END .ED
*--------------------------------------
MAN
SAVE USR/SRC/SBIN/LOGIN.S