mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-22 00:32:44 +00:00
186 lines
3.6 KiB
Plaintext
186 lines
3.6 KiB
Plaintext
NEW
|
||
AUTO 3,1
|
||
*/--------------------------------------
|
||
* # GetPWUID
|
||
* ## C
|
||
* `int getpwuid(short int uid, S.PW *passwd);`
|
||
* ## ASM
|
||
* `PUSHB uid`
|
||
* `>PUSHW passwd`
|
||
* `>SYSCALL getpwuid`
|
||
* ## RETURN VALUE
|
||
*\--------------------------------------
|
||
K.GetPWUID
|
||
*/--------------------------------------
|
||
* # GetGRGID
|
||
* ## C
|
||
* `int getgrgid(short int gid, S.GRP *group);`
|
||
* ## ASM
|
||
* `>PUSHB gid`
|
||
* `>PUSHW group`
|
||
* `>SYSCALL getpwname`
|
||
* ## RETURN VALUE
|
||
*\--------------------------------------
|
||
K.GetGRGID >PULLW FORPNT
|
||
>PULLA UID/GID
|
||
jmp K.SYSCALL.JMPX
|
||
*/--------------------------------------
|
||
* # CloseSession
|
||
* ## C
|
||
* `int closesession(short int hSID);`
|
||
* ## ASM
|
||
* `>PUSHB hSID`
|
||
* `>SYSCALL CloseSession`
|
||
* ## RETURN VALUE
|
||
*\--------------------------------------
|
||
K.CloseSession .EQ K.SYSCALL.JMPX
|
||
*/--------------------------------------
|
||
* # OpenSession
|
||
* ## C
|
||
* `short int hSID opensession(const char *name, const char *passwd);`
|
||
* ## ASM
|
||
* `>PUSHW name`
|
||
* `>PUSHW passwd`
|
||
* `>SYSCALL OpenSession`
|
||
* ## RETURN VALUE
|
||
*\--------------------------------------
|
||
K.OpenSession .EQ K.SYSCALL.JMPX2
|
||
|
||
* >PULLW FORPNT passwd
|
||
* >PULLW TXTPTR name
|
||
|
||
* jmp K.SYSCALL.JMPX
|
||
*/--------------------------------------
|
||
* # GetPWName
|
||
* ## C
|
||
* `int getpwname(const char* name, S.PW *passwd);`
|
||
* ## ASM
|
||
* `>PUSHW name`
|
||
* `>PUSHW passwd`
|
||
* `>SYSCALL getpwname`
|
||
* ## RETURN VALUE
|
||
*\--------------------------------------
|
||
K.GetPWName .EQ K.SYSCALL.JMPX2
|
||
|
||
* >PULLW FORPNT
|
||
* >PULLW TXTPTR
|
||
* jmp K.SYSCALL.JMPX
|
||
*/--------------------------------------
|
||
* # GetGRName
|
||
* ## C
|
||
* `int getgrgid(const char* name, S.GRP *group);`
|
||
* ## ASM
|
||
* `>PUSHW name`
|
||
* `>PUSHW group`
|
||
* `>SYSCALL getpwname`
|
||
* ## RETURN VALUE
|
||
*\--------------------------------------
|
||
K.GetGRName .EQ K.SYSCALL.JMPX2
|
||
|
||
* >PULLW FORPNT
|
||
* >PULLW TXTPTR
|
||
* jmp K.SYSCALL.JMPX
|
||
*/--------------------------------------
|
||
* # PutPW
|
||
* ## C
|
||
* `int putpw(S.PW* passwd);`
|
||
* ## ASM
|
||
* `>PUSHW passwd`
|
||
* `>SYSCALL putpw`
|
||
* ## RETURN VALUE
|
||
*\--------------------------------------
|
||
K.PutPW
|
||
*/--------------------------------------
|
||
* # PutGR
|
||
* ## C
|
||
* `int putgr(S.GRP *group);`
|
||
* ## ASM
|
||
* `>PUSHW group`
|
||
* `>SYSCALL putgr`
|
||
* ## RETURN VALUE
|
||
*\--------------------------------------
|
||
K.PutGR >PULLW TXTPTR
|
||
|
||
jsr K.SYSCALL.JMPX
|
||
bcc PWD.FlushFiles
|
||
|
||
rts
|
||
*--------------------------------------
|
||
PWD.FlushFiles
|
||
>LDYA PWD.UsrDBSize
|
||
ldx PWD.hUsrDB
|
||
clc
|
||
jsr PWD.Flush
|
||
bcc .1
|
||
|
||
rts
|
||
|
||
.1 >LDYA PWD.GrpDBSize
|
||
ldx PWD.hGrpDB
|
||
sec
|
||
|
||
PWD.Flush >STYA PWD.FileSize
|
||
>LDYAI PWD.ETCPASSWD
|
||
bcc .10
|
||
|
||
>LDYAI PWD.ETCGROUP
|
||
|
||
.10 >STYA PWD.FileName
|
||
|
||
>LDYA PWD.FileSize
|
||
|
||
jsr MEM.CopyToMain X = src Aux hMem
|
||
bcs .9
|
||
|
||
stx .8+1
|
||
|
||
>PUSHW PWD.FileName
|
||
>PUSHBI O.WRONLY+O.CREATE
|
||
>PUSHBI S.FI.T.TXT
|
||
>PUSHWZ Aux type
|
||
>SYSCALL2 FOpen
|
||
bcc .1
|
||
|
||
pha
|
||
jsr .8
|
||
pla
|
||
sec
|
||
.9 rts
|
||
|
||
.1 sta .7+1
|
||
|
||
>PUSHA
|
||
lda .8+1
|
||
jsr K.getmemptr
|
||
>PUSHYA
|
||
>PUSHW PWD.FileSize
|
||
>SYSCALL2 FWrite
|
||
bcc .7
|
||
|
||
pha
|
||
jsr .7
|
||
pla
|
||
|
||
sec
|
||
rts
|
||
|
||
.7 lda #$ff SELF MODIFIED
|
||
>SYSCALL2 fclose
|
||
|
||
.8 lda #$ff
|
||
jmp K.freemem SELF MODIFIED
|
||
*--------------------------------------
|
||
PWD.ETCPASSWD .AZ "${ROOT}etc/passwd"
|
||
PWD.hUsrDB .BS 1
|
||
PWD.UsrDBSize .BS 2
|
||
PWD.ETCGROUP .AZ "${ROOT}etc/group"
|
||
PWD.hGrpDB .BS 1
|
||
PWD.GrpDBSize .BS 2
|
||
PWD.FileSize .BS 2
|
||
PWD.FileName .BS 2
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE usr/src/sys/kernel.s.pwd
|
||
LOAD usr/src/sys/kernel.s
|
||
ASM
|