Kernel 0.93

This commit is contained in:
Rémy GIBERT 2019-04-23 17:47:40 +02:00
parent d4ef30ab1f
commit 80ef6ced5c
4 changed files with 117 additions and 30 deletions

View File

@ -95,12 +95,13 @@ CS.RUN >LDYAI S.PW
jmp CS.RUN.ROOT jmp CS.RUN.ROOT
.1 ldy #S.PW-1 .1 ldy #S.PW
.2 lda PW.DEFAULT,y .2 dey
lda PW.DEFAULT,y
sta (pData),y sta (pData),y
dey tya
bpl .2 bne .2
jsr CS.RUN.CheckArg jsr CS.RUN.CheckArg
bcs .9 bcs .9
@ -274,7 +275,7 @@ CS.RUN.CheckArg inc ArgCount
ldy #0 ldy #0
.5 lda (ZPStrPtr),y .5 lda (ZPStrPtr),y
sta (PW),y sta (pData),y
sta (ZPPWPtr),y sta (ZPPWPtr),y
beq .6 beq .6
iny iny
@ -368,7 +369,7 @@ PW.ROOT .AS "ROOT"
PW.DEFAULT .BS 17 NAME PW.DEFAULT .BS 17 NAME
.HS D41D8CD98F00B204E9800998ECF8427E00 .HS D41D8CD98F00B204E9800998ECF8427E00
.DA #0 UID .DA #0 UID
.DA #0 GID .DA #1 GID
.BS 65 GECOS .BS 65 GECOS
.AS "${ROOT}USR/" .AS "${ROOT}USR/"
.BS 65-11 .BS 65-11

View File

@ -638,8 +638,7 @@ S.SESSION.P.ROOT .EQ %10000000
S.SESSION.P.SYSADMIN .EQ %01000000 S.SESSION.P.SYSADMIN .EQ %01000000
S.SESSION.UID .EQ 1 S.SESSION.UID .EQ 1
S.SESSION.GID .EQ 2 S.SESSION.GID .EQ 2
S.SESSION.PASSWD .EQ 3 S.SESSION.NAME .EQ 3
S.SESSION.NAME .EQ 20
*S.SESSION.GECOS .EQ 0 *S.SESSION.GECOS .EQ 0
*S.SESSION.DIR .EQ 0 *S.SESSION.DIR .EQ 0
*S.SESSION.SHELL .EQ 0 *S.SESSION.SHELL .EQ 0

View File

@ -231,7 +231,7 @@ CS.RUN.SetRootSession
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
CS.RUN.SetUserSession CS.RUN.SetUserSession
ldx #S.SESSION.NAME P+UID+GID+PASSWD ldx #S.SESSION.NAME P+UID+GID
ldy #S.PW.NAME-1 ldy #S.PW.NAME-1
@ -481,7 +481,6 @@ SHELL .AZ "${SHELL}"
SESSION.ROOT .DA #S.SESSION.P.ROOT SESSION.ROOT .DA #S.SESSION.P.ROOT
.DA #0 UID .DA #0 UID
.DA #0 GID .DA #0 GID
.BS 17 PASSWD
.AZ "ROOT" NAME .AZ "ROOT" NAME
.AZ "Root User" GECOS .AZ "Root User" GECOS
.AZ "${ROOT}ROOT/" DIR .AZ "${ROOT}ROOT/" DIR

View File

@ -51,7 +51,7 @@ PWD.GetPWUID lda PWD.hDB
inc ZPPtr3+1 inc ZPPtr3+1
bra .1 bra .1
.8 jmp PWD.Record2PM .8 jmp PWD.Record2PW
.9 lda #E.IPWDDB .9 lda #E.IPWDDB
sec sec
@ -103,8 +103,7 @@ PWD.GetPWName lda PWD.hDB
cmp #':' cmp #':'
bne .3 bne .3
jmp PWD.Record2PM jmp PWD.Record2PW
.9 lda #E.IPWDDB .9 lda #E.IPWDDB
sec sec
@ -126,24 +125,62 @@ PWD.PutPW >LDYA ZPPtr2
jmp PWD.InitDB jmp PWD.InitDB
.1 jsr PWD. .1 jsr K.GetmemPtr
>STYA PWD.DBPtr
jsr PWD.DeleteRecord
jsr PWD.GetRecordLen jsr PWD.GetRecordLen
pha
tya
clc clc
adc PWD.DBSize adc PWD.DBSize
tay sta PWD.DBSize
pla bcc .2
adc PWD.DBSize+1 Y,A = new DB Size inc PWD.DBSize+1
.2 >LDYA PWD.DBPtr
>STYA ZPPtr4
>LDYA PWD.DBSize
jsr K.Getmem
bcs .99
>STYA ZPPtr3
>STYA PWD.DBPtr
ldy #0
.3 lda (ZPPtr4),y
sta (ZPPtr3),y
beq .4
iny
bne .3
inc ZPPtr4
inc ZPPtr3
bra .3
.4 tya
clc
adc ZPPtr3
sta ZPPtr3
bcc .5
inc ZPPtr3+1
.5 jsr PWD.StoreRecord
inc PWD.bDirty
clc
rts
.9 lda #E.IPWDDB .9 lda #E.IPWDDB
sec sec
rts .99 rts
*-------------------------------------- *--------------------------------------
PWD.InitDB jsr PWD.GetRecordLen PWD.InitDB jsr PWD.GetRecordLen
tay
lda #0
>STYA PWD.DBSize >STYA PWD.DBSize
jsr K.getmem jsr K.getmem
@ -161,10 +198,45 @@ PWD.InitDB jsr PWD.GetRecordLen
* ZPPtr2 = pPW * ZPPtr2 = pPW
*-------------------------------------- *--------------------------------------
PWD.DeleteRecord PWD.DeleteRecord
>LDYA PWD.DBPtr jsr PWD.FindRecord
bcs .9
.1 iny
lda (ZPPtr3),y
cmp #C.CR
bne .1
sty .8+1
tya
sec
adc ZPPtr3
sta ZPPtr4
lda ZPPtr3+1
adc #0
sta ZPPtr4+1
ldy #$ff
.2 iny
lda (ZPPtr4),y
sta (ZPPtr3),y
bne .2
lda PWD.DBSize
sec
.8 sbc #$ff SELF MODIFIED
sta PWD.DBSize
bcs .9
dec PWD.DBSize+1
.9 rts
*--------------------------------------
PWD.FindRecord >LDYA PWD.DBPtr
>STYA ZPPtr3 >STYA ZPPtr3
.1 >LDYA ZPPtr2 >LDYA ZPPtr2
>STYA TXTPTR >STYA TXTPTR
.2 lda (ZPPtr3) .2 lda (ZPPtr3)
@ -173,18 +245,36 @@ PWD.DeleteRecord
ldy #$ff ldy #$ff
.3 iny .3 iny
jsr MEM.TXTPTR.GetNext jsr MEM.TXTPTR.GetY
beq .4
cmp (ZPPtr3),y cmp (ZPPtr3),y
bne beq .3
bra .5
and #$ff
.4 lda (ZPPtr3),y
beq .8
.5 iny
lda (ZPPtr3),y
cmp #C.CR
bne .5
tya
sec
adc ZPPtr3
sta ZPPtr3
bcc .2
inc ZPPtr3+1
bra .2
.8 clc
rts
.9 sec .9 sec
rts rts
*-------------------------------------- *--------------------------------------
PWD.Record2PM sta CLRWRITEAUX PWD.Record2PW sta CLRWRITEAUX
ldy #0 ldy #0
@ -359,8 +449,6 @@ PWD.GetRecordLen
jsr PWD.StoreChar jsr PWD.StoreChar
txa txa
tay
lda #0
rts rts
*-------------------------------------- *--------------------------------------