mirror of
https://github.com/A2osX/A2osX.git
synced 2025-01-12 01:30:36 +00:00
Kernel 0.94
This commit is contained in:
parent
2094cef35c
commit
b7d38d547d
Binary file not shown.
@ -97,13 +97,15 @@ K.PutGR >PULLW TXTPTR
|
||||
|
||||
jsr K.SYSCALL.JMPX
|
||||
bcc PWD.FlushFiles
|
||||
rts
|
||||
|
||||
K.PutGR.RTS rts
|
||||
*--------------------------------------
|
||||
PWD.FlushFiles
|
||||
>LDYA PWD.UsrDBSize
|
||||
ldx PWD.hUsrDB
|
||||
clc
|
||||
jsr PWD.Flush
|
||||
bcs K.PutGR.RTS
|
||||
|
||||
>LDYA PWD.GrpDBSize
|
||||
ldx PWD.hGrpDB
|
||||
@ -118,6 +120,7 @@ PWD.Flush >STYA PWD.FileSize
|
||||
.10 >STYA PWD.FileName
|
||||
|
||||
>LDYA PWD.FileSize
|
||||
|
||||
jsr MEM.CopyToMain X = src Aux hMem
|
||||
bcs .9
|
||||
|
||||
@ -127,6 +130,7 @@ PWD.Flush >STYA PWD.FileSize
|
||||
>PUSHBI O.WRONLY+O.CREATE
|
||||
>PUSHBI S.FI.T.TXT
|
||||
>PUSHWZ Aux type
|
||||
>DEBUG
|
||||
>SYSCALL2 FOpen
|
||||
bcc .1
|
||||
|
||||
|
@ -10,52 +10,52 @@ NEW
|
||||
* \0
|
||||
*--------------------------------------
|
||||
PWDX.GetPWUID lda PWD.hUsrDB
|
||||
beq PWD.GetPW.9
|
||||
beq PWDX.GetPW.9
|
||||
|
||||
jsr K.GetmemPtr
|
||||
>STYA ZPPtr3
|
||||
|
||||
.1 lda (ZPPtr3)
|
||||
beq PWD.GetPW.99 EOF
|
||||
beq PWDX.GetPW.99 EOF
|
||||
|
||||
ldy #0
|
||||
jsr PWD.NextString skip USERNAME
|
||||
jsr PWDX.NextString skip USERNAME
|
||||
|
||||
jsr PWD.NextString skip PASSWORD
|
||||
jsr PWDX.NextString skip PASSWORD
|
||||
|
||||
jsr PWD.GetByte get UID
|
||||
jsr PWDX.GetByte get UID
|
||||
cmp ZPPtr1+1
|
||||
beq PWD.GetPW.8
|
||||
beq PWDX.GetPW.8
|
||||
|
||||
jsr PWD.NextLine
|
||||
jsr PWDX.NextLine
|
||||
bra .1
|
||||
|
||||
PWD.GetPW.8 ldx FORPNT+1
|
||||
PWDX.GetPW.8 ldx FORPNT+1
|
||||
beq .8 Dry run, no output
|
||||
jmp PWD.Record2PW
|
||||
jmp PWDX.Record2PW
|
||||
|
||||
.8 clc a = UID
|
||||
rts
|
||||
|
||||
PWD.GetPW.9 lda #E.IPWDDB
|
||||
PWDX.GetPW.9 lda #E.IPWDDB
|
||||
.HS 2C BIT ABS
|
||||
|
||||
PWD.GetPW.99 lda #E.IUSR
|
||||
PWDX.GetPW.99 lda #E.IUSR
|
||||
sec
|
||||
PWD.GetPW.RTS rts
|
||||
PWDX.GetPW.RTS rts
|
||||
*--------------------------------------
|
||||
PWDX.GetPWName lda PWD.hUsrDB
|
||||
beq PWD.GetPW.9
|
||||
beq PWDX.GetPW.9
|
||||
|
||||
jsr K.GetmemPtr
|
||||
>STYA ZPPtr3
|
||||
|
||||
ldy #0
|
||||
jsr SHARED.TXTPTR.GetY
|
||||
beq PWD.GetPW.99
|
||||
beq PWDX.GetPW.99
|
||||
|
||||
.1 lda (ZPPtr3)
|
||||
beq PWD.GetPW.99
|
||||
beq PWDX.GetPW.99
|
||||
|
||||
ldy #$ff
|
||||
.2 iny
|
||||
@ -65,7 +65,7 @@ PWDX.GetPWName lda PWD.hUsrDB
|
||||
cmp (ZPPtr3),y
|
||||
beq .2
|
||||
|
||||
.3 jsr PWD.NextLine
|
||||
.3 jsr PWDX.NextLine
|
||||
bra .1
|
||||
|
||||
.4 lda (ZPPtr3),y
|
||||
@ -75,11 +75,11 @@ PWDX.GetPWName lda PWD.hUsrDB
|
||||
ldx FORPNT+1
|
||||
beq .8
|
||||
|
||||
jmp PWD.Record2PW
|
||||
jmp PWDX.Record2PW
|
||||
|
||||
.8 iny
|
||||
jsr PWD.NextString skip PASSWORD
|
||||
jmp PWD.GetByte get UID
|
||||
jsr PWDX.NextString skip PASSWORD
|
||||
jmp PWDX.GetByte get UID
|
||||
*--------------------------------------
|
||||
* TXTPTR : pPW (Input)
|
||||
* ZPPtr3 : pDB
|
||||
@ -89,15 +89,20 @@ PWDX.PutPW lda PWD.hUsrDB
|
||||
|
||||
ldy #S.PW.UID
|
||||
jsr SHARED.TXTPTR.GetY
|
||||
bne PWD.GetPW.RTS Must be ROOT user
|
||||
bne PWDX.GetPW.RTS Must be ROOT user
|
||||
|
||||
jsr PWD.GetRecordLen
|
||||
jsr PWDX.GetRecordLen
|
||||
tay
|
||||
lda #0
|
||||
>STYA PWD.UsrDBSize
|
||||
iny
|
||||
bne .1
|
||||
|
||||
inc
|
||||
|
||||
.1 >STYA PWD.UsrDBSize
|
||||
|
||||
jsr K.getmem
|
||||
bcs PWD.GetPW.RTS
|
||||
bcs PWDX.GetPW.RTS
|
||||
|
||||
>STYA ZPPtr3
|
||||
stx PWD.hUsrDB
|
||||
@ -105,7 +110,7 @@ PWDX.PutPW lda PWD.hUsrDB
|
||||
lda #0
|
||||
sta (ZPPtr3)
|
||||
|
||||
jsr PWD.AppendRecord
|
||||
jsr PWDX.AppendRecord
|
||||
|
||||
lda PWD.hGrpDB
|
||||
beq .2
|
||||
@ -137,18 +142,18 @@ PWDX.PutPW.1 jsr K.GetmemPtr
|
||||
jsr SHARED.TXTPTR.GetY
|
||||
bne .12
|
||||
|
||||
jsr PWD.FindRecord
|
||||
jsr PWDX.FindRecord
|
||||
bcs .99
|
||||
jmp PWD.DeleteRecord
|
||||
jmp PWDX.DeleteRecord
|
||||
*--------------------------------------
|
||||
.12 jsr PWD.FindRecord
|
||||
.12 jsr PWDX.FindRecord
|
||||
bcs .11
|
||||
|
||||
jsr PWD.DeleteRecord
|
||||
jsr PWDX.DeleteRecord
|
||||
bcs .99
|
||||
bra .13
|
||||
*--------------------------------------
|
||||
.11 jsr PWD.GetUID new user, get UID
|
||||
.11 jsr PWDX.GetUID new user, get UID
|
||||
bcs .99
|
||||
|
||||
ldy #S.PW.UID
|
||||
@ -156,7 +161,7 @@ PWDX.PutPW.1 jsr K.GetmemPtr
|
||||
sta (TXTPTR),y
|
||||
sta SETWRITEAUX
|
||||
|
||||
.13 jsr PWD.GetRecordLen
|
||||
.13 jsr PWDX.GetRecordLen
|
||||
|
||||
clc
|
||||
adc PWD.UsrDBSize
|
||||
@ -196,7 +201,7 @@ PWDX.PutPW.1 jsr K.GetmemPtr
|
||||
jsr K.GetMemPtr
|
||||
>STYA ZPPtr3
|
||||
|
||||
jsr PWD.AppendRecord
|
||||
jsr PWDX.AppendRecord
|
||||
|
||||
lda #0
|
||||
jsr PWDX.StoreChar
|
||||
@ -209,50 +214,50 @@ PWDX.PutPW.1 jsr K.GetmemPtr
|
||||
.99 rts
|
||||
*--------------------------------------
|
||||
PWDX.GetGRGID lda PWD.hGrpDB
|
||||
beq PWD.GetGR.9
|
||||
beq PWDX.GetGR.9
|
||||
|
||||
jsr K.GetmemPtr
|
||||
>STYA ZPPtr3
|
||||
|
||||
.1 lda (ZPPtr3)
|
||||
beq PWD.GetGR.99 EOF
|
||||
beq PWDX.GetGR.99 EOF
|
||||
|
||||
ldy #0
|
||||
jsr PWD.NextString skip USERNAME
|
||||
jsr PWDX.NextString skip USERNAME
|
||||
|
||||
jsr PWD.GetByte get UID
|
||||
jsr PWDX.GetByte get UID
|
||||
cmp ZPPtr1+1
|
||||
beq PWD.GetGR.8
|
||||
beq PWDX.GetGR.8
|
||||
|
||||
jsr PWD.NextLine
|
||||
jsr PWDX.NextLine
|
||||
bra .1
|
||||
|
||||
PWD.GetGR.8 ldx FORPNT+1
|
||||
PWDX.GetGR.8 ldx FORPNT+1
|
||||
beq .8 Dry run, no output
|
||||
jmp PWD.Record2GR
|
||||
jmp PWDX.Record2GR
|
||||
|
||||
.8 clc a = UID
|
||||
rts
|
||||
|
||||
PWD.GetGR.9 lda #E.IPWDDB
|
||||
PWDX.GetGR.9 lda #E.IPWDDB
|
||||
.HS 2C BIT ABS
|
||||
|
||||
PWD.GetGR.99 lda #E.IUSR
|
||||
PWDX.GetGR.99 lda #E.IUSR
|
||||
sec
|
||||
PWD.GetGR.RTS rts
|
||||
PWDX.GetGR.RTS rts
|
||||
*--------------------------------------
|
||||
PWDX.GetGRName lda PWD.hGrpDB
|
||||
beq PWD.GetGR.9
|
||||
beq PWDX.GetGR.9
|
||||
|
||||
jsr K.GetmemPtr
|
||||
>STYA ZPPtr3
|
||||
|
||||
ldy #0
|
||||
jsr SHARED.TXTPTR.GetY
|
||||
beq PWD.GetGR.99
|
||||
beq PWDX.GetGR.99
|
||||
|
||||
.1 lda (ZPPtr3)
|
||||
beq PWD.GetGR.99
|
||||
beq PWDX.GetGR.99
|
||||
|
||||
ldy #$ff
|
||||
.2 iny
|
||||
@ -262,7 +267,7 @@ PWDX.GetGRName lda PWD.hGrpDB
|
||||
cmp (ZPPtr3),y
|
||||
beq .2
|
||||
|
||||
.3 jsr PWD.NextLine
|
||||
.3 jsr PWDX.NextLine
|
||||
bra .1
|
||||
|
||||
.4 lda (ZPPtr3),y
|
||||
@ -272,13 +277,13 @@ PWDX.GetGRName lda PWD.hGrpDB
|
||||
ldx FORPNT+1
|
||||
beq .8
|
||||
|
||||
jmp PWD.Record2GR
|
||||
jmp PWDX.Record2GR
|
||||
|
||||
.8 iny
|
||||
jmp PWD.GetByte get GID
|
||||
jmp PWDX.GetByte get GID
|
||||
*--------------------------------------
|
||||
PWDX.PutGR lda PWD.hGrpDB
|
||||
beq PWD.GetGR.9
|
||||
beq PWDX.GetGR.9
|
||||
|
||||
jsr K.GetmemPtr
|
||||
>STYA ZPPtr3
|
||||
@ -312,7 +317,7 @@ PWDX.OpenSession
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
.3 jsr PWD.FindRecord
|
||||
.3 jsr PWDX.FindRecord
|
||||
bcs .9
|
||||
|
||||
tya Y = Name length +1
|
||||
@ -353,7 +358,7 @@ PWDX.CloseSession
|
||||
*--------------------------------------
|
||||
* PRIVATE
|
||||
*--------------------------------------
|
||||
PWD.GetUID lda PWD.hUsrDB
|
||||
PWDX.GetUID lda PWD.hUsrDB
|
||||
|
||||
jsr K.GetmemPtr
|
||||
>STYA ZPPtr3
|
||||
@ -363,15 +368,15 @@ PWD.GetUID lda PWD.hUsrDB
|
||||
beq .8 End of DB
|
||||
|
||||
ldy #0
|
||||
jsr PWD.NextString skip name
|
||||
jsr PWD.NextString skip password
|
||||
jsr PWD.GetByte
|
||||
jsr PWDX.NextString skip name
|
||||
jsr PWDX.NextString skip password
|
||||
jsr PWDX.GetByte
|
||||
cmp .8+1
|
||||
bcc .4
|
||||
|
||||
sta .8+1
|
||||
|
||||
.4 jsr PWD.NextLine
|
||||
.4 jsr PWDX.NextLine
|
||||
bra .1
|
||||
|
||||
.8 lda #$ff SELF MODIFIED
|
||||
@ -385,7 +390,7 @@ PWD.GetUID lda PWD.hUsrDB
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
PWD.DeleteRecord
|
||||
PWDX.DeleteRecord
|
||||
.1 iny
|
||||
lda (ZPPtr3),y
|
||||
cmp #C.CR
|
||||
@ -419,7 +424,7 @@ PWD.DeleteRecord
|
||||
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
PWD.FindRecord lda PWD.hUsrDB
|
||||
PWDX.FindRecord lda PWD.hUsrDB
|
||||
jsr K.GetmemPtr
|
||||
|
||||
>STYA ZPPtr3
|
||||
@ -436,7 +441,7 @@ PWD.FindRecord lda PWD.hUsrDB
|
||||
cmp (ZPPtr3),y
|
||||
beq .3
|
||||
|
||||
.5 jsr PWD.NextLine
|
||||
.5 jsr PWDX.NextLine
|
||||
bra .2
|
||||
|
||||
.4 lda (ZPPtr3),y
|
||||
@ -454,7 +459,7 @@ PWD.FindRecord lda PWD.hUsrDB
|
||||
*--------------------------------------
|
||||
* Record : USERNAME:PASSWORD:UID:GID:GECOS:HOME:SHELL\CR
|
||||
*--------------------------------------
|
||||
PWD.Record2PW ldy #0
|
||||
PWDX.Record2PW ldy #0
|
||||
|
||||
ldx #0 NAME
|
||||
|
||||
@ -488,12 +493,12 @@ PWD.Record2PW ldy #0
|
||||
cpx #S.PW.UID
|
||||
bne .4
|
||||
|
||||
jsr PWD.GetByte UID
|
||||
jsr PWDX.GetByte UID
|
||||
jsr SHARED.FORPNT.PutNext
|
||||
|
||||
iny
|
||||
|
||||
jsr PWD.GetByte GID
|
||||
jsr PWDX.GetByte GID
|
||||
jsr SHARED.FORPNT.PutNext
|
||||
|
||||
iny
|
||||
@ -539,7 +544,7 @@ PWD.Record2PW ldy #0
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
PWD.Record2GR ldy #0
|
||||
PWDX.Record2GR ldy #0
|
||||
|
||||
ldx #0 NAME
|
||||
|
||||
@ -555,7 +560,7 @@ PWD.Record2GR ldy #0
|
||||
.2 lda #0
|
||||
jsr SHARED.FORPNT.PutNext
|
||||
|
||||
jsr PWD.GetByte UID
|
||||
jsr PWDX.GetByte UID
|
||||
jsr SHARED.FORPNT.PutNext
|
||||
|
||||
clc
|
||||
@ -566,15 +571,15 @@ PWD.Record2GR ldy #0
|
||||
PWDX.GetSessionLen
|
||||
ldy #0
|
||||
|
||||
jsr PWD.NextString USERNAME
|
||||
jsr PWDX.NextString USERNAME
|
||||
tya
|
||||
clc
|
||||
adc #S.SESSION.NAME
|
||||
tax
|
||||
|
||||
jsr PWD.NextString skip PASSWORD
|
||||
jsr PWD.NextString skip UID
|
||||
jsr PWD.NextString skip GID
|
||||
jsr PWDX.NextString skip PASSWORD
|
||||
jsr PWDX.NextString skip UID
|
||||
jsr PWDX.NextString skip GID
|
||||
|
||||
.1 inx
|
||||
iny
|
||||
@ -591,14 +596,14 @@ PWDX.GetSessionLen
|
||||
PWDX.Record2Session
|
||||
ldy #0
|
||||
|
||||
jsr PWD.NextString skip USERNAME
|
||||
jsr PWD.NextString skip PASSWORD
|
||||
jsr PWD.GetByte get UID
|
||||
jsr PWDX.NextString skip USERNAME
|
||||
jsr PWDX.NextString skip PASSWORD
|
||||
jsr PWDX.GetByte get UID
|
||||
sta ZPPtr1
|
||||
|
||||
iny
|
||||
|
||||
jsr PWD.GetByte get GID
|
||||
jsr PWDX.GetByte get GID
|
||||
sta ZPPtr1+1
|
||||
|
||||
iny
|
||||
@ -655,20 +660,20 @@ PWDX.Record2Session
|
||||
.8 lda #0
|
||||
jmp SHARED.PutCharPtr2
|
||||
*--------------------------------------
|
||||
PWD.NextString lda (ZPPtr3),y
|
||||
PWDX.NextString lda (ZPPtr3),y
|
||||
beq .8
|
||||
|
||||
iny
|
||||
cmp #':'
|
||||
bne PWD.NextString
|
||||
bne PWDX.NextString
|
||||
.8 rts
|
||||
*--------------------------------------
|
||||
PWD.NextLine lda (ZPPtr3),y
|
||||
PWDX.NextLine lda (ZPPtr3),y
|
||||
beq .8
|
||||
|
||||
iny
|
||||
cmp #C.CR
|
||||
bne PWD.NextLine
|
||||
bne PWDX.NextLine
|
||||
|
||||
tya
|
||||
clc
|
||||
@ -678,7 +683,7 @@ PWD.NextLine lda (ZPPtr3),y
|
||||
inc ZPPtr3+1
|
||||
.8 rts
|
||||
*--------------------------------------
|
||||
PWD.GetByte stz .8+1
|
||||
PWDX.GetByte stz .8+1
|
||||
|
||||
.1 lda (ZPPtr3),y
|
||||
beq .8
|
||||
@ -712,7 +717,7 @@ PWD.GetByte stz .8+1
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
PWD.AppendRecord
|
||||
PWDX.AppendRecord
|
||||
.1 lda (ZPPtr3)
|
||||
beq .8
|
||||
|
||||
@ -724,17 +729,17 @@ PWD.AppendRecord
|
||||
.8 sec
|
||||
.HS 90 BCC
|
||||
*--------------------------------------
|
||||
PWD.GetRecordLen
|
||||
PWDX.GetRecordLen
|
||||
clc
|
||||
ldx #0
|
||||
ldy #S.PW.NAME
|
||||
|
||||
jsr PWD.StoreString
|
||||
jsr PWDX.StoreString
|
||||
lda #':'
|
||||
jsr PWDX.StoreChar
|
||||
ldy #S.PW.PASSWD
|
||||
|
||||
jsr PWD.StoreString
|
||||
jsr PWDX.StoreString
|
||||
|
||||
lda #':'
|
||||
jsr PWDX.StoreChar
|
||||
@ -754,31 +759,32 @@ PWD.GetRecordLen
|
||||
|
||||
ldy #S.PW.GECOS
|
||||
|
||||
jsr PWD.StoreString
|
||||
jsr PWDX.StoreString
|
||||
lda #':'
|
||||
jsr PWDX.StoreChar
|
||||
|
||||
ldy #S.PW.DIR
|
||||
|
||||
jsr PWD.StoreString
|
||||
jsr PWDX.StoreString
|
||||
lda #':'
|
||||
jsr PWDX.StoreChar
|
||||
|
||||
ldy #S.PW.SHELL
|
||||
|
||||
jsr PWD.StoreString
|
||||
jsr PWDX.StoreString
|
||||
lda #C.CR
|
||||
jsr PWDX.StoreChar
|
||||
|
||||
txa
|
||||
PWD.GetRecordLen.RTS
|
||||
PWDX.GetRecordLen.RTS
|
||||
rts
|
||||
*--------------------------------------
|
||||
PWD.StoreString jsr SHARED.TXTPTR.GetY
|
||||
beq PWD.GetRecordLen.RTS
|
||||
PWDX.StoreString
|
||||
jsr SHARED.TXTPTR.GetY
|
||||
beq PWDX.GetRecordLen.RTS
|
||||
jsr PWDX.StoreChar
|
||||
iny
|
||||
bra PWD.StoreString
|
||||
bra PWDX.StoreString
|
||||
*--------------------------------------
|
||||
PWDX.StoreByte php
|
||||
phx
|
||||
@ -789,7 +795,7 @@ PWDX.StoreByte php
|
||||
ldy #0
|
||||
|
||||
.1 lda A2osX.NumStrBuf,y
|
||||
beq PWD.GetRecordLen.RTS
|
||||
beq PWDX.GetRecordLen.RTS
|
||||
iny
|
||||
jsr PWDX.StoreChar
|
||||
bra .1
|
||||
|
Loading…
x
Reference in New Issue
Block a user