A2osX/SYS/KERNEL.S.PWD.txt

124 lines
2.1 KiB
Plaintext
Raw Normal View History

2019-03-12 14:41:55 +00:00
NEW
PREFIX
AUTO 4,1
*/--------------------------------------
* # GetPWUID
* ## C
* `int getpwuid(short int uid, S.PW* passwd );`
* ## ASM
* `>PUSHW passwd`
* `lda uid`
* `>SYSCALL getpwuid`
* ## RETURN VALUE
*\--------------------------------------
K.GetPWUID
*/--------------------------------------
* # GetPWName
* ## C
* `int getpwname(const char* name, S.PW* passwd );`
* ## ASM
* `>PUSHW passwd`
* `>LDYA name`
* `>SYSCALL getpwname`
* ## RETURN VALUE
*\--------------------------------------
K.GetPWName jsr MEM.SPtr1PPtr2
2019-04-09 15:47:33 +00:00
bra K.PutPW.1
2019-03-12 14:41:55 +00:00
*/--------------------------------------
* # PutPW
* ## C
* `int putpw( S.PW* passwd );`
* ## ASM
* `>LDYA passwd`
* `>SYSCALL putpw`
* ## RETURN VALUE
*\--------------------------------------
2019-04-11 15:59:57 +00:00
K.PutPW >STYA ZPPtr2
2019-04-09 15:47:33 +00:00
K.PutPW.1 sta SETREADAUX
sta SETWRITEAUX
jsr X.PWD
sta CLRREADAUX
sta CLRWRITEAUX
2019-04-11 15:59:57 +00:00
bcs .9
lda PWD.bDirty
bne PWD.Store
.9 rts
*--------------------------------------
2019-04-12 15:41:05 +00:00
PWD.Store lda PWD.DBPtr
2019-04-12 06:24:30 +00:00
sta A1L
clc
2019-04-11 15:59:57 +00:00
adc PWD.DBSize
sta A2L
2019-04-12 06:24:30 +00:00
lda PWD.DBPtr+1
sta A1L+1
2019-04-11 15:59:57 +00:00
adc PWD.DBSize+1
sta A2L+1
2019-04-12 06:24:30 +00:00
>LDYA PWD.DBSize
jsr K.getmem
bcs .9
stx .8+1
>STYA A4L Save Destination Address in MAIN
2019-04-11 15:59:57 +00:00
clc Aux To Main
jsr AuxMove
>PUSHWI 0 Aux type
>PUSHBI S.FI.T.TXT
2019-04-12 06:24:30 +00:00
>PUSHBI O.WRONLY+O.CREATE
2019-04-11 15:59:57 +00:00
>LDYAI PWD.FILE
>SYSCALL FOpen
bcc .1
pha
jsr .8
pla
sec
.9 rts
.1 sta .7+1
>PUSHW PWD.DBSize
lda .8+1
jsr K.getmemptr
>PUSHYA
lda .7+1
>SYSCALL FWrite
bcs .2
jsr .7
stz PWD.bDirty
rts
.2 pha
jsr .7
pla
sec
rts
.7 lda #$ff
>SYSCALL fclose
.8 lda #$ff
jsr K.freemem
* clc
2019-03-12 14:41:55 +00:00
rts
*--------------------------------------
2019-04-11 15:59:57 +00:00
PWD.bDirty .BS 1
2019-04-09 15:47:33 +00:00
PWD.hDB .BS 1
2019-04-12 06:24:30 +00:00
PWD.DBPtr .BS 2
2019-04-11 15:59:57 +00:00
PWD.DBSize .BS 2
PWD.FILE .AZ "${ROOT}ETC/PASSWD"
2019-04-09 15:47:33 +00:00
*--------------------------------------
2019-03-12 14:41:55 +00:00
MAN
SAVE USR/SRC/SYS/KERNEL.S.PWD
LOAD USR/SRC/SYS/KERNEL.S
ASM