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

View File

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