Skip to content

Commit

Permalink
Kernel 0.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
burniouf committed Aug 8, 2018
1 parent ea14453 commit 45cd7d0
Show file tree
Hide file tree
Showing 67 changed files with 817 additions and 793 deletions.
55 changes: 31 additions & 24 deletions .Docs/KERNEL.md
Expand Up @@ -39,19 +39,20 @@ A = DevID
**Out:**
CC = OK, CS = ERROR
Y,A = FD
X = hFD

# GetDevByName
**In:**
Y,A = Ptr to device name (C-String)
**Out:**
CC = OK, CS = ERROR
X = DEVID
Y,A = FD
CC = OK, CS = ERROR
Y,A = FD
X = DevID

# GetDevStatus

## C
`int getdevstatus ( int devid, S.DIB * dstat );`
`int getdevstatus ( short int hFD, S.DIB * dstat );`

## ASM
**In:**
Expand Down Expand Up @@ -221,13 +222,13 @@ note : if file is created on ProDOS : T=TXT,X=$0000
# IOCTL

## C
`int ioctl(int devid, int request, void * param );`
`int ioctl(short int hFD, int request, void * param );`

## ASM
**In:**
`PUSHWI param`
`PUSHBI request`
`lda devid`
`lda hFD`
`>SYSCALL IOCTL`
**Out:**
Y,A = ...
Expand Down Expand Up @@ -504,7 +505,7 @@ return a hFILE to a new FIFO
Print A (char) to hFILE

## C
`int fputc ( int character, hFILE stream );`
`int fputc ( hFILE stream , int character );`

## ASM
**In:**
Expand Down Expand Up @@ -667,7 +668,10 @@ Read formatted data from string

## ASM
**In:**
`>PUSHBI Argument Byte count`
`>PUSHW ptr`
`...`
`>PUSHBI bytecount`
`>PUSHWI format`
+ %i : short int
+ %d : byte
+ %I : int
Expand All @@ -678,13 +682,10 @@ Read formatted data from string
+ %H : HEX word
+ %s : string

`>PUSHW ptr`
`...`
`>PUSHBI bytecount`
`>PUSHWI format`
TODO : %10s
`>LDYA s`
**Out:**
Y,A = Number of arguments filled.
A = Number of arguments filled.

# FOpen
Open a file
Expand Down Expand Up @@ -750,8 +751,7 @@ Write bytes to file
`>PUSHW ptr`
`lda hFILE`
`>SYSCALL fwrite`

# Out:
**Out:**
Y,A = Bytes Written

# FFlush
Expand All @@ -767,13 +767,14 @@ int fflush(hFILE stream);
Set the file-position indicator for hFILE

## C
`int fseek(hFILE stream, long offset, int whence);`
`int fseek(hFILE stream, long offset, short int whence);`

## ASM
**In:**
PUSHW = Ptr to Offset (DWORD)
PUSHB = From
PUSHB = hFILE
`>PUSHBI whence`
`>PUSHL offset`
`lda stream`
`>SYSCALL fseek`

# FEOF
Test the end-of-file indicator for hFILE
Expand All @@ -793,18 +794,24 @@ Return the current value of the file-position indicator

## ASM
**In:**
PUSHW = Ptr to Offset (DWORD)
PUSHB = hFILE
`lda stream`
`>SYSCALL ftell`
**Out:**
Offset = Offset
On stack (long)

# Remove

# Rename
Rename a file

## C
`int rename(const char *oldpath, const char *newpath);`

## ASM
**In:**
PUSHW = New Name
PUSHW = Old Name
`>PUSHW newpath`
`>LDYA oldpath`
`>SYSCALL rename`
**Out:**

# strtof
Expand Down
Binary file modified .Floppies/A2OSX.BUILD.po
Binary file not shown.
Binary file modified .Floppies/A2OSX.SRC.po
Binary file not shown.
6 changes: 2 additions & 4 deletions A2osX.S.QC.txt
@@ -1,8 +1,6 @@
PR#3
PREFIX /A2OSX.BUILD
NEW
INC 1
AUTO 8
PREFIX /A2OSX.BUILD
AUTO 4,1
.LIST OFF
*--------------------------------------
* ****** START OF MLI QUIT CODE ******
Expand Down
6 changes: 2 additions & 4 deletions A2osX.S.txt
@@ -1,8 +1,6 @@
PR#3
PREFIX /A2OSX.BUILD
NEW
INC 1
AUTO 8
PREFIX /A2OSX.BUILD
AUTO 4,1
.LIST OFF
.OP 65C02
.OR $2000
Expand Down
6 changes: 2 additions & 4 deletions A2osX.STARTUP.txt
@@ -1,8 +1,6 @@
PR#3
PREFIX /A2OSX.BUILD
NEW
INC 1
AUTO 6
PREFIX /A2OSX.BUILD
AUTO 4,1
ECHO *** A2osX Startup Script ***
SET PS1='$PWD'
# Main Screen
Expand Down
7 changes: 4 additions & 3 deletions BIN/DNSINFO.S.txt
Expand Up @@ -43,9 +43,9 @@ CS.INIT >LDYA L.LIBTCPIP
>SYSCALL LoadLib
sta hLIBTCPIP

.8 lda (pPs)
ora #S.PS.F.EVENT Now accept events
sta (pPs)
* lda (pPs)
* ora #S.PS.F.EVENT Now accept events
* sta (pPs)
clc
rts
*--------------------------------------
Expand All @@ -62,6 +62,7 @@ CS.RUN.ADD cmp #2
>PUSHEA.G DST.IP+2
>PUSHEA.G DST.IP+1
>PUSHEA.G DST.IP
>PUSHBI 8 4 PTRs
>PUSHW L.SSCANF.IP
lda #1
>SYSCALL GetArg
Expand Down
49 changes: 25 additions & 24 deletions BIN/IPCONFIG.S.txt
Expand Up @@ -12,8 +12,9 @@ AUTO 4,1
.INB INC/ETH.I
.INB INC/LIBTCPIP.I
*--------------------------------------
ZPIPCfgPtr .EQ ZPBIN
ZPDevPtr .EQ ZPBIN+2
pIPCFG .EQ ZPBIN
pFD .EQ ZPBIN+2
pDEV .EQ ZPBIN+4
*--------------------------------------
* File Header (16 Bytes)
*--------------------------------------
Expand Down Expand Up @@ -68,22 +69,22 @@ CS.RUN >LDYA L.MSG0
>SYSCALL printf

>LIBCALL hLIBTCPIP,LIBTCPIP.GET.IPCFG
>STYA ZPIPCfgPtr
>STYA pIPCFG

ldy #S.IPCFG.HDEV
lda (ZPIPCfgPtr),y
ldy #S.IPCFG.hFD
lda (pIPCFG),y
bne .1

>LDYA L.MSG0.NL
>SYSCALL printf
jmp CS.RUN.DONE

.1 >STA.G DevID
>SYSCALL GetDevByID
>STYA ZPDevPtr S.FD
.1 >STA.G FD.ETH
>SYSCALL GetMemPtr
>STYA pFD

>PUSHEA.G DIB
>LDA.G DevID
>LDA.G FD.ETH
>SYSCALL GetDevStatus

>LEA.G DCB.NIC
Expand All @@ -93,7 +94,7 @@ CS.RUN >LDYA L.MSG0

>PUSHEA.G IOCTL
>PUSHBI IOCTL.STATUS
>LDA.G DevID
>LDA.G FD.ETH
>SYSCALL IOCTL

CS.RUN.DUMP >LDYA L.MSG0.L
Expand All @@ -112,14 +113,14 @@ CS.RUN.DUMP >LDYA L.MSG0.L

lda #S.FD.DEV.NAME
clc
adc ZPDevPtr
adc pFD
tay
lda /S.FD.DEV.NAME
adc ZPDevPtr+1
adc pFD+1

>PUSHYA

>PUSHB.G DevID
>PUSHB.G FD.ETH

>LDYA L.MSG1.DEV
>SYSCALL printf
Expand Down Expand Up @@ -185,7 +186,7 @@ CS.RUN.LINK >LDYA L.MSG1.LINK.OK

CS.RUN.DUMPIP >LDYA L.MSG2
>SYSCALL printf
lda (ZPIPCfgPtr)
lda (pIPCFG)
and #S.IPCFG.STATUS.OK
beq .11

Expand All @@ -198,7 +199,7 @@ CS.RUN.DUMPIP >LDYA L.MSG2

ldy #S.IPCFG.DHCPSRVR+3
ldx #4
.2 >PUSHB (ZPIPCfgPtr),y
.2 >PUSHB (pIPCFG),y
dey
dex
bne .2
Expand All @@ -207,7 +208,7 @@ CS.RUN.DUMPIP >LDYA L.MSG2

ldy #S.IPCFG.IP+7 IP/MASK
ldx #8
.3 >PUSHB (ZPIPCfgPtr),y
.3 >PUSHB (pIPCFG),y
dey
dex
bne .3
Expand All @@ -216,7 +217,7 @@ CS.RUN.DUMPIP >LDYA L.MSG2

ldy #S.IPCFG.GW+3
ldx #4
.4 >PUSHB (ZPIPCfgPtr),y
.4 >PUSHB (pIPCFG),y
dey
dex
bne .4
Expand All @@ -225,26 +226,26 @@ CS.RUN.DUMPIP >LDYA L.MSG2

ldy #S.IPCFG.DNS1+7
ldx #8
.5 >PUSHB (ZPIPCfgPtr),y
.5 >PUSHB (pIPCFG),y
dey
dex
bne .5
>LDYA L.MSG2.DNS
>SYSCALL printf

lda ZPIPCfgPtr
lda pIPCFG
clc
adc #S.IPCFG.DOMAIN
tay
lda ZPIPCfgPtr+1
lda pIPCFG+1
adc #0
>PUSHYA

lda ZPIPCfgPtr
lda pIPCFG
clc
adc #S.IPCFG.HOSTNAME
tay
lda ZPIPCfgPtr+1
lda pIPCFG+1
adc #0
>PUSHYA

Expand Down Expand Up @@ -273,7 +274,7 @@ MSG0.L .AZ "Loaded\r\n"
MSG0.NL .AZ "Not Loaded\r\n"
*--------------------------------------
MSG1.DEV .AS "\r\nDevice Configuration :\r\n"
.AS " DevID : $%h\r\n"
.AS " FD.ETH : $%h\r\n"
.AS " Device Name : %s\r\n"
.AS " Device Type : %S\r\n"
.AZ " HW Address : %02h:%02h:%02h:%02h:%02h:%02h\r\n"
Expand All @@ -299,7 +300,7 @@ hLIBTCPIP .BS 1
.DUMMY
.OR 0
DS.START
DevID .BS 1
FD.ETH .BS 1
IOCTL .BS S.IOCTL
DIB .BS S.DIB
DCB.NIC .BS S.DCB.NIC
Expand Down
9 changes: 6 additions & 3 deletions BIN/LSDEV.S.txt
Expand Up @@ -50,13 +50,15 @@ CS.RUN >LDYA L.MSG0
bcs .7

>STYA ZPPTR1 S.FD

txa
>STA.G DEV.FD

jsr DumpFD

bcs .9

>PUSHEA.G DEV.DIB
>LDA.G DEV.ID
>LDA.G DEV.FD
>SYSCALL GetDevStatus
bcs .6

Expand Down Expand Up @@ -167,6 +169,7 @@ MSG.SFLAGS .AS "BWRLNEIO"
.OR 0
DS.START
DEV.ID .BS 1
DEV.FD .BS 1
DEV.DIB .BS S.DIB
DEV.SFLAGS .BS 9
DS.END
Expand Down
6 changes: 2 additions & 4 deletions BIN/NFSMOUNT.S.txt
@@ -1,8 +1,6 @@
PR#3
PREFIX /A2OSX.BUILD
NEW
INC 1
AUTO 6
PREFIX /A2OSX.BUILD
AUTO 4,1
.LIST OFF
.OP 65C02
.OR $2000
Expand Down
2 changes: 0 additions & 2 deletions BIN/X.CPMVRM.S.txt
Expand Up @@ -541,8 +541,6 @@ CS.RUN.Rename ldy #hDstFullPath
ldy #hSrcFullPath
jsr CS.RUN.GetPathY

>PUSHYA

>SYSCALL Rename
rts

Expand Down

0 comments on commit 45cd7d0

Please sign in to comment.