A2osX/SYS/KERNEL.S.PWD.txt

126 lines
2.2 KiB
Plaintext
Raw Normal View History

2019-03-12 14:41:55 +00:00
NEW
2019-05-25 19:24:07 +00:00
AUTO 3,1
2019-03-12 14:41:55 +00:00
*/--------------------------------------
* # 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
2019-06-07 15:02:51 +00:00
>PUSHWZ Aux type
2019-04-11 15:59:57 +00:00
>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
2019-05-04 21:13:50 +00:00
ldx #SYS.FOpen
2019-05-12 20:45:11 +00:00
jsr K.SYSCALL2.BANK
2019-04-11 15:59:57 +00:00
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
2019-05-04 21:13:50 +00:00
ldx #SYS.FWrite
2019-05-12 20:45:11 +00:00
jsr K.SYSCALL2.BANK
2019-04-11 15:59:57 +00:00
bcs .2
jsr .7
stz PWD.bDirty
rts
.2 pha
jsr .7
pla
sec
rts
.7 lda #$ff
2019-05-04 21:13:50 +00:00
ldx #SYS.fclose
2019-05-12 20:45:11 +00:00
jsr K.SYSCALL2.BANK
2019-04-11 15:59:57 +00:00
.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