Kernel 0.94

This commit is contained in:
Rémy GIBERT 2020-07-30 15:59:04 +02:00
parent 74633bd4f5
commit 36ea2592c1
9 changed files with 66 additions and 72 deletions

Binary file not shown.

View File

@ -5,9 +5,9 @@ NEW
.OR $2000
.TF bin/ps
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
.INB INC/KERNEL.I
.INB inc/macros.i
.INB inc/a2osx.i
.INB inc/kernel.i
*--------------------------------------
.DUMMY
.OR ZPBIN
@ -16,6 +16,7 @@ ZPPSPtr .BS 2
ZPSessionPtr .BS 2
ZPArgV .BS 2
Index .BS 1
hSession .BS 1
ZS.END
.ED
*--------------------------------------
@ -102,13 +103,7 @@ CS.RUN lda #1
*--------------------------------------
CS.RUN.DUMP >SYSCALL GetMemPtr
>STYA ZPPSPtr
ldy #S.PS.hSession
lda (ZPPSPtr),y
tax
lda S.Table.hSID-1,x
>SYSCALL GetMemPtr
>STYA ZPSessionPtr
>PUSHW L.MSG1
ldx Index
@ -135,14 +130,27 @@ CS.RUN.DUMP >SYSCALL GetMemPtr
jsr CS.RUN.DecodeFlags
>PUSHEA.G PS.FLAGS
ldy #S.PS.hSession
lda (ZPPSPtr),y
tax
lda S.Table.hSID-1,x
>SYSCALL GetStkObj
bcs .9
>STYA ZPSessionPtr
stx hSession
ldy #S.SESSION.UID
lda (ZPSessionPtr),y
>PUSHA
>PUSHBI 10
>PUSHBI 10
>SYSCALL PrintF
bcs .9
lda hSession
>SYSCALL freemem
jmp CS.RUN.PrintArgs
.9 rts
*--------------------------------------
@ -217,5 +225,5 @@ DS.END
.ED
*--------------------------------------
MAN
SAVE USR/SRC/BIN/PS.S
SAVE usr/src/bin/ps.s
ASM

View File

@ -5,10 +5,10 @@ NEW
.OR $2000
.TF bin/stat
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
.INB INC/MLI.I
.INB INC/MLI.E.I
.INB inc/macros.i
.INB inc/a2osx.i
.INB inc/mli.i
.INB inc/mli.e.i
*--------------------------------------
.DUMMY
.OR ZPBIN
@ -47,7 +47,7 @@ L.MSG.Access .DA MSG.Access
L.MSG.Mod .DA MSG.Mod
L.MSG.UIDGIDSIZE .DA MSG.UIDGIDSIZE
L.FMT.DateTime .DA FMT.DateTime
L.MSG.AMCTimes .DA MSG.AMCTimes
L.MSG.CMATimes .DA MSG.CMATimes
.DA 0
*--------------------------------------
CS.INIT clc
@ -240,7 +240,7 @@ CS.RUN.PrintAMCTime
>PUSHEA.G StatBuf+S.STAT.CTIME
>SYSCALL StrFTime
.8 >PUSHW L.MSG.AMCTimes
.8 >PUSHW L.MSG.CMATimes
>PUSHEA.G TIME.Create
>PUSHEA.G TIME.Mod
>PUSHEA.G TIME.Access
@ -305,7 +305,7 @@ MSG.UIDGIDSIZE .AS "UID : %10D\r\n"
.AS "GID : %10D\r\n"
.AS "Size : %10u\r\n"
.AZ "Blocks : %10u\r\n"
MSG.AMCTimes .AS "Created : %s\r\n"
MSG.CMATimes .AS "Created : %s\r\n"
.AS "Modified : %s\r\n"
.AZ "Accessed : %s\r\n"
*--------------------------------------
@ -322,5 +322,5 @@ DS.END
.ED
*--------------------------------------
MAN
SAVE USR/SRC/BIN/STAT.S
SAVE usr/src/bin/stat.s
ASM

View File

@ -15,8 +15,8 @@ NEW
.OR ZPBIN
ZS.START
SessionID .BS 1
hSession .BS 1
ZPSessionPtr .BS 2
ZPCODE .BS 9
ZS.END .ED
*--------------------------------------
* File Header (16 Bytes)
@ -45,14 +45,7 @@ L.MSG1 .DA MSG1
CS.INIT clc
rts
*--------------------------------------
CS.RUN ldy #8
.10 lda ZPCODE.START,y
sta ZPCODE,y
dey
bpl .10
>LDYA L.MSG0
CS.RUN >LDYA L.MSG0
>SYSCALL PutS
ldx #1
@ -61,7 +54,9 @@ CS.RUN ldy #8
.1 lda S.Table.hSID-1,x
beq .7
jsr CS.RUN.GetSession
>SYSCALL GetStkObj
>STYA ZPSessionPtr
stx hSession
>PUSHW L.MSG1 format
>PUSHB SessionID 1 byte SID
@ -70,19 +65,19 @@ CS.RUN ldy #8
lda S.Table.hSID-1,x
>PUSHA 1 byte hSession
>PUSHB (pData) 1 byte PRIVILEGE
>PUSHB (ZPSessionPtr) 1 byte PRIVILEGE
ldy #S.SESSION.UID
>PUSHB (pData),y 1 byte UID
>PUSHB (ZPSessionPtr),y 1 byte UID
iny #S.SESSION.UID
>PUSHB (pData),y 1 byte GID
>PUSHB (ZPSessionPtr),y 1 byte GID
lda pData
lda ZPSessionPtr
clc
adc #S.SESSION.NAME
tay
lda pData+1
lda ZPSessionPtr+1
adc /S.SESSION.NAME
>PUSHYA 2 bytes NAME
@ -95,37 +90,21 @@ CS.RUN ldy #8
>PUSHBI 9 total = 9 ... bytes
>SYSCALL PrintF
bcs .9
lda hSession
>SYSCALL freemem
.7 inc SessionID
ldx SessionID
cpx #K.USR.MAX+1
bne .1
beq .8
jmp .1
.8 lda #0 tell TSKMGR that all done ok, but
sec we do not want to stay in memory
.9 rts
*--------------------------------------
CS.RUN.GetSession
>SYSCALL GetStkObjPtr
>STYA ZPSessionPtr
ldy #0
.1 jsr ZPCODE
sta (pData),y
iny
cpy #S.SESSION.NAME
bne .1
.2 jsr ZPCODE
sta (pData),y
iny
tax
bne .2
rts
*--------------------------------------
CS.RUN.GetDevName
lda OF.Table.hPath-1,x
bne .1
@ -154,18 +133,12 @@ CS.QUIT clc
rts
*--------------------------------------
CS.END
ZPCODE.START sta SETREADAUX
lda (ZPSessionPtr),y
sta CLRREADAUX
rts
MSG0 .AZ "SID hSD Privilege UID GID Name Dev"
MSG1 .AZ "%3d $%0h %b %3d %3d %16s %s\r\n"
*--------------------------------------
.DUMMY
.OR 0
DS.START
BUF .BS 240
DS.END
.ED
*--------------------------------------

View File

@ -242,13 +242,13 @@ SYS.SetAttr .EQ $5E
SYS.Mount .EQ $60
SYS.UMount .EQ $62
SYS.Online .EQ $64
* ERROR
SYS.GetErrorMessage .EQ $66
SYS.GetStkObj .EQ $66
* ARG
SYS.Shift .EQ $68
SYS.ArgV .EQ $6A
SYS.ArgVDup .EQ $6C
* .EQ $6E
* ERROR
SYS.GetErrorMessage .EQ $6E
* STDLIB
SYS.AToF .EQ $70
SYS.AToI .EQ $72

View File

@ -64,11 +64,11 @@ K.SYSCALL .DA K.ChTyp $00 : STAT
.DA K.Mount $60
.DA K.UMount
.DA K.Online
.DA K.GetErrorMessage
.DA K.GetStkObj
.DA K.Shift $68 : ARG
.DA K.ArgV
.DA K.ArgVDup
.DA 0
.DA K.GetErrorMessage
.DA K.AToF $70 : STDLIB
.DA K.AToI

View File

@ -343,7 +343,7 @@ K.FreeMem.ERR >PUSHWI K.FreeMem.MSG
>PUSHBI 2
.1 >SYSCALL2 printf
>DEBUGOA
lda #E.INVH
sec
rts

View File

@ -20,6 +20,19 @@ K.Online >PULLW K.MLI.PARAMS+2
>MLICALL MLIONLINE
rts
*--------------------------------------
K.GetStkObj tax hMem for CopyToMain
jsr MEM.GetMemByID
ldy #S.MEM.LEN
lda (ZPMemMgrSPtr),y
pha
iny
lda (ZPMemMgrSPtr),y
ply YA = Len
jmp MEM.CopyToMain
*--------------------------------------
MAN
SAVE usr/src/sys/kernel.s.mount
LOAD usr/src/sys/kernel.s

View File

@ -92,8 +92,8 @@ A2osX.D2 .DA #0
A2osX.D2.B .PH $D000
.DA #RRAMWRAMBNK2
.INB usr/src/sys/kernel.s.mount
.INB usr/src/sys/kernel.s.error
.INB usr/src/sys/kernel.s.arg
.INB usr/src/sys/kernel.s.error
.INB usr/src/sys/kernel.s.stdlib
.INB usr/src/sys/kernel.s.string
.INB usr/src/sys/kernel.s.bin