mirror of
https://github.com/A2osX/A2osX.git
synced 2025-01-03 18:30:20 +00:00
Kernel 0.92
This commit is contained in:
parent
9a68bac570
commit
140f312d12
@ -109,13 +109,10 @@ DumpDevFD ldy #S.FD.DEV.DRVPTR+1
|
||||
dey
|
||||
>PUSHB (ZPFDPtr),y
|
||||
|
||||
lda #S.FD.DEV.NAME
|
||||
clc
|
||||
adc ZPFDPtr
|
||||
tay
|
||||
|
||||
lda /S.FD.DEV.NAME
|
||||
adc ZPFDPtr+1
|
||||
>LDA.G Table.Index
|
||||
tax
|
||||
lda Dev.Table.hPath,x
|
||||
>SYSCALL GetMemPtr
|
||||
>PUSHYA
|
||||
|
||||
>PUSHB.G DEV.FD
|
||||
|
@ -29,6 +29,7 @@ CS.START cld
|
||||
L.MSG.DETECT .DA MSG.DETECT
|
||||
L.DRV.CS.START .DA DRV.CS.START
|
||||
L.FD.DEV .DA FD.DEV
|
||||
L.FD.DEV.NAME .DA FD.DEV.NAME
|
||||
.DA 0 End Of Reloc Table
|
||||
*--------------------------------------
|
||||
Dev.Detect >LDYA L.MSG.DETECT
|
||||
@ -42,6 +43,7 @@ Dev.Detect >LDYA L.MSG.DETECT
|
||||
bcs .9
|
||||
>STYA FD.DEV+S.FD.DEV.DRVPTR
|
||||
|
||||
>PUSHW L.FD.DEV.NAME
|
||||
>LDYA L.FD.DEV
|
||||
>SYSCALL MKDEV
|
||||
|
||||
@ -55,8 +57,8 @@ FD.DEV .DA #S.FD.T.CDEV
|
||||
.DA #0 DEVID
|
||||
.DA 0 BUSPTR
|
||||
.BS 2 DRVPTR
|
||||
.AZ "CON" NAME
|
||||
.HS 00000000
|
||||
.DA 0 BUFPTR
|
||||
FD.DEV.NAME .AZ "CON" NAME
|
||||
*--------------------------------------
|
||||
* Driver Code
|
||||
*--------------------------------------
|
||||
|
@ -94,6 +94,7 @@ Dev.Detect >STYA ARGS
|
||||
bcs .9
|
||||
>STYA FD.DEV+S.FD.DEV.DRVPTR
|
||||
|
||||
>PUSHW L.FD.DEV.NAME
|
||||
>LDYA L.FD.DEV
|
||||
>SYSCALL MKDEV
|
||||
|
||||
@ -143,8 +144,8 @@ FD.DEV .DA #S.FD.T.CDEV
|
||||
.DA #0 DEVID
|
||||
.DA 0 BUSPTR
|
||||
.BS 2 DRVPTR
|
||||
FD.DEV.NAME .AZ "ETH7" NAME
|
||||
.HS 000000
|
||||
.DA 0 BUFPTR
|
||||
FD.DEV.NAME .AZ "ETH7"
|
||||
*--------------------------------------
|
||||
* Driver Code
|
||||
*--------------------------------------
|
||||
@ -561,5 +562,5 @@ DCB .DA #S.DCB.T.NIC
|
||||
*--------------------------------------
|
||||
DRV.END
|
||||
MAN
|
||||
SAVE USR/SRC/BIN/DRV/LANCEGS.DRV.S
|
||||
SAVE USR/SRC/DRV/LANCEGS.DRV.S
|
||||
ASM
|
||||
|
@ -10,8 +10,8 @@ SSCIRQ .EQ 0
|
||||
.INB INC/MLI.E.I
|
||||
.INB INC/COM.I
|
||||
.INB INC/COM.6551.I
|
||||
.INB USR/SRC/BIN/DRV/X.SSC.DRV.S
|
||||
.INB USR/SRC/DRV/X.SSC.DRV.S
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE USR/SRC/BIN/DRV/SSC.DRV.S
|
||||
SAVE USR/SRC/DRV/SSC.DRV.S
|
||||
ASM
|
||||
|
@ -10,8 +10,8 @@ SSCIRQ .EQ 1
|
||||
.INB INC/MLI.E.I
|
||||
.INB INC/COM.I
|
||||
.INB INC/COM.6551.I
|
||||
.INB USR/SRC/BIN/DRV/X.SSC.DRV.S
|
||||
.INB USR/SRC/DRV/X.SSC.DRV.S
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE USR/SRC/BIN/DRV/SSC.I.DRV.S
|
||||
SAVE USR/SRC/DRV/SSC.I.DRV.S
|
||||
ASM
|
||||
|
@ -12,8 +12,8 @@ U2AI .EQ 1
|
||||
.INB INC/NIC.W5100.I
|
||||
.INB INC/ETH.I
|
||||
.INB INC/LIBTCPIP.I
|
||||
.INB USR/SRC/BIN/DRV/X.U2.DRV.S
|
||||
.INB USR/SRC/DRV/X.U2.DRV.S
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE USR/SRC/BIN/DRV/UTHER2.AI.DRV.S
|
||||
SAVE USR/SRC/DRV/UTHER2.AI.DRV.S
|
||||
ASM
|
||||
|
@ -113,6 +113,7 @@ Dev.Detect >STYA ARGS
|
||||
bcs .9
|
||||
>STYA FD.DEV+S.FD.DEV.DRVPTR
|
||||
|
||||
>PUSHW L.FD.DEV.NAME
|
||||
>LDYA L.FD.DEV
|
||||
>SYSCALL MKDEV
|
||||
|
||||
@ -162,8 +163,8 @@ FD.DEV .DA #S.FD.T.CDEV
|
||||
.DA #0 DEVID
|
||||
.DA 0 BUSPTR
|
||||
.BS 2 DRVPTR
|
||||
FD.DEV.NAME .AZ "ETH7" NAME
|
||||
.HS 000000
|
||||
.DA 0 BUFPTR
|
||||
FD.DEV.NAME .AZ "ETH7"
|
||||
*--------------------------------------
|
||||
* Driver Code
|
||||
*--------------------------------------
|
||||
@ -552,5 +553,5 @@ DCB .DA #S.DCB.T.NIC
|
||||
*--------------------------------------
|
||||
DRV.END
|
||||
MAN
|
||||
SAVE USR/SRC/BIN/DRV/UTHERNET.DRV.S
|
||||
SAVE USR/SRC/DRV/UTHERNET.DRV.S
|
||||
ASM
|
||||
|
@ -11,8 +11,8 @@ U2AI .EQ 0
|
||||
.INB INC/NIC.I
|
||||
.INB INC/NIC.W5100.I
|
||||
.INB INC/ETH.I
|
||||
.INB USR/SRC/BIN/DRV/X.U2.DRV.S
|
||||
.INB USR/SRC/DRV/X.U2.DRV.S
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE USR/SRC/BIN/DRV/UTHERNET2.DRV.S
|
||||
SAVE USR/SRC/DRV/UTHERNET2.DRV.S
|
||||
ASM
|
||||
|
@ -116,6 +116,7 @@ Dev.Detect >STYA ARGS
|
||||
bcs .9
|
||||
>STYA FD.DEV+S.FD.DEV.DRVPTR
|
||||
|
||||
>PUSHW L.FD.DEV.NAME
|
||||
>LDYA L.FD.DEV
|
||||
>SYSCALL MKDEV
|
||||
|
||||
@ -187,8 +188,8 @@ FD.DEV .DA #S.FD.T.CDEV
|
||||
.DA #0 DEVID
|
||||
.DA 0 BUSPTR
|
||||
.BS 2 DRVPTR
|
||||
FD.DEV.NAME .AZ "COM1" NAME
|
||||
.HS 000000
|
||||
.DA 0 BUFPTR
|
||||
FD.DEV.NAME .AZ "COM1"
|
||||
*--------------------------------------
|
||||
* Driver Code
|
||||
*--------------------------------------
|
||||
@ -593,6 +594,6 @@ DCB .DA #S.DCB.T.COM
|
||||
*--------------------------------------
|
||||
DRV.END
|
||||
MAN
|
||||
SAVE USR/SRC/BIN/DRV/X.SSC.DRV.S
|
||||
LOAD USR/SRC/BIN/DRV/SSC.I.DRV.S
|
||||
SAVE USR/SRC/DRV/X.SSC.DRV.S
|
||||
LOAD USR/SRC/DRV/SSC.I.DRV.S
|
||||
ASM
|
||||
|
@ -114,6 +114,7 @@ Dev.Detect >STYA ARGS
|
||||
bcs .9
|
||||
>STYA FD.DEV+S.FD.DEV.DRVPTR
|
||||
|
||||
>PUSHW L.FD.DEV.NAME
|
||||
>LDYA L.FD.DEV
|
||||
>SYSCALL MKDEV
|
||||
|
||||
@ -167,8 +168,8 @@ FD.DEV .DA #S.FD.T.CDEV
|
||||
.DA #0 DEVID
|
||||
.DA 0 BUSPTR
|
||||
.BS 2 DRVPTR
|
||||
FD.DEV.NAME .AZ "ETH7" NAME
|
||||
.HS 000000
|
||||
.DA 0 BUFPTR
|
||||
FD.DEV.NAME .AZ "ETH7"
|
||||
*--------------------------------------
|
||||
* Driver Code
|
||||
*--------------------------------------
|
||||
@ -677,6 +678,6 @@ DCB .DA #S.DCB.T.NIC
|
||||
*--------------------------------------
|
||||
DRV.END
|
||||
MAN
|
||||
SAVE USR/SRC/BIN/DRV/X.U2.DRV.S
|
||||
LOAD USR/SRC/BIN/DRV/UTHER2.AI.DRV.S
|
||||
SAVE USR/SRC/DRV/X.U2.DRV.S
|
||||
LOAD USR/SRC/DRV/UTHER2.AI.DRV.S
|
||||
ASM
|
||||
|
@ -322,9 +322,6 @@ S.MSTAT .EQ 24
|
||||
*--------------------------------------
|
||||
* IOCTL device API
|
||||
*--------------------------------------
|
||||
DEVID.NULL .EQ 0
|
||||
DEVID.SYS .EQ 1
|
||||
*--------------------------------------
|
||||
IOCTL.STATUS .EQ 0 X,Y = byte count returned
|
||||
IOCTL.READBLOCK .EQ 2
|
||||
IOCTL.WRITEBLOCK .EQ 4
|
||||
@ -434,9 +431,9 @@ S.FD.DEV.BUSID .EQ 2
|
||||
S.FD.DEV.DEVID .EQ 3
|
||||
S.FD.DEV.BUSPTR .EQ 4 word
|
||||
S.FD.DEV.DRVPTR .EQ 6 word
|
||||
S.FD.DEV.NAME .EQ 8 C-String
|
||||
S.FD.DEV.BUFPTR .EQ 8 word
|
||||
*
|
||||
S.FD.DEV .EQ 16
|
||||
S.FD.DEV .EQ 10
|
||||
*--------------------------------------
|
||||
* S.FD.LNK
|
||||
*--------------------------------------
|
||||
|
@ -10,8 +10,8 @@ ZPPtr2 .EQ ZPKERNEL+2
|
||||
ZPPtr3 .EQ ZPKERNEL+4
|
||||
ZPPtr4 .EQ ZPKERNEL+6
|
||||
|
||||
pFD .EQ ZPKERNEL+10
|
||||
pDRV .EQ ZPKERNEL+12
|
||||
pFD .EQ ZPKERNEL+8
|
||||
pDRV .EQ ZPKERNEL+10
|
||||
pIOCTL .EQ ZPKERNEL+12
|
||||
pIOBuf .EQ ZPKERNEL+14
|
||||
*--------------------------------------
|
||||
@ -140,8 +140,11 @@ H.BIN.EXE.REL.TABLE .EQ 16
|
||||
*
|
||||
H.BIN.DRV.REL.TABLE .EQ 2 Including main jmp
|
||||
*--------------------------------------
|
||||
S.TTY.DEVID .EQ 0
|
||||
S.TTY.STATUS .EQ 0
|
||||
|
||||
S.TTY.TITLE .EQ 48
|
||||
S.TTY.FRBUF .EQ 128
|
||||
S.TTY.SCRBUF .EQ 128
|
||||
*
|
||||
S.TTY .EQ 2048
|
||||
*--------------------------------------
|
||||
|
@ -31,35 +31,24 @@ K.GetDevByName >STYA ZPPtr1
|
||||
|
||||
ldx #0
|
||||
|
||||
.1 lda Dev.Table.hFD,x
|
||||
.1 lda Dev.Table.hPath,x
|
||||
beq K.GetDev.NODEV
|
||||
jsr K.GetMemPtr
|
||||
|
||||
>STYA ZPPtr2
|
||||
|
||||
lda ZPPtr2
|
||||
clc
|
||||
adc #S.FD.DEV.NAME
|
||||
sta ZPPtr3
|
||||
|
||||
lda ZPPtr2+1
|
||||
adc /S.FD.DEV.NAME
|
||||
sta ZPPtr3+1
|
||||
|
||||
|
||||
ldy #$ff
|
||||
|
||||
.2 iny
|
||||
lda (ZPPtr1),y
|
||||
cmp (ZPPtr3),y
|
||||
cmp (ZPPtr2),y
|
||||
bne .4
|
||||
|
||||
ora (ZPPtr3),y Both char are 0 ?
|
||||
ora (ZPPtr2),y Both char are 0 ?
|
||||
bne .2 no....loop
|
||||
|
||||
ldy ZPPtr2
|
||||
lda ZPPtr2+1
|
||||
clc
|
||||
rts
|
||||
lda Dev.Table.hFD,x
|
||||
jmp K.GetMemPtr
|
||||
|
||||
.4 inx
|
||||
cpx DevMgr.DevCnt
|
||||
@ -97,14 +86,15 @@ K.GetDevStatus.I
|
||||
* # MKDev
|
||||
* Create a hDEV
|
||||
* ## C
|
||||
* `hDEV mkdev (S.FD * fd)`
|
||||
* `hDEV mkdev (S.FD * fd, const char *devname)`
|
||||
* ## ASM
|
||||
* `>LDYA FD.DEV`
|
||||
* `>PUSHW devname`
|
||||
* `>LDYA fd`
|
||||
* `>SYSCALL mkdev
|
||||
* ## RETURN VALUE
|
||||
* A = hDEV
|
||||
*\--------------------------------------
|
||||
K.MKDev >STYA .1+1
|
||||
K.MKDev jsr MEM.SPtr1PPtr2 ptr1=fd, ptr2=name
|
||||
|
||||
ldx DevMgr.DevCnt
|
||||
cmp #K.DEV.MAX
|
||||
@ -122,7 +112,7 @@ K.MKDev >STYA .1+1
|
||||
|
||||
ldy #S.FD.DEV-1
|
||||
|
||||
.1 lda $ffff,y SELF MODIFIED
|
||||
.1 lda (ZPPtr1),y
|
||||
sta (pFD),y
|
||||
dey
|
||||
bpl .1
|
||||
@ -141,23 +131,33 @@ K.MKDev >STYA .1+1
|
||||
|
||||
ldx #0
|
||||
|
||||
.2 lda IRQ.Vectors+1,x
|
||||
beq .3
|
||||
.3 lda IRQ.Vectors+1,x
|
||||
beq .7
|
||||
|
||||
inx
|
||||
inx
|
||||
cpx #K.IRQDEV.MAX*2
|
||||
bne .2
|
||||
bne .3
|
||||
|
||||
.9 lda #E.OOH
|
||||
* sec
|
||||
.99 rts
|
||||
|
||||
.3 lda pFD
|
||||
.7 lda pFD
|
||||
sta IRQ.Vectors,x
|
||||
lda pFD+1
|
||||
sta IRQ.Vectors+1,x
|
||||
|
||||
.8 lda DevMgr.DevCnt
|
||||
.8 >LDYA ZPPtr2
|
||||
jsr K.NewStr
|
||||
bcs .99
|
||||
txa
|
||||
|
||||
ldx DevMgr.DevCnt
|
||||
sta Dev.Table.hPath,x
|
||||
|
||||
txa
|
||||
|
||||
inc DevMgr.DevCnt
|
||||
clc
|
||||
rts
|
||||
|
@ -103,6 +103,7 @@ Kernel.Init3 sta SETALTZP
|
||||
|
||||
jsr MemMgrInit
|
||||
|
||||
>PUSHWI FD.NULL.NAME
|
||||
>LDYAI FD.NULL
|
||||
>SYSCALL MKDev
|
||||
|
||||
@ -302,18 +303,20 @@ MemMgrInit >LDYAI Mem.MHiMem
|
||||
|
||||
rts
|
||||
*--------------------------------------
|
||||
SysScrInit >LDYAI FD.SYS
|
||||
SysScrInit >PUSHWI FD.CONSOLE.NAME
|
||||
>LDYAI FD.CONSOLE
|
||||
>SYSCALL MKDev
|
||||
|
||||
lda A2osX.TTYDEVS
|
||||
|
||||
.1 pha
|
||||
inc FD.TTY+S.FD.DEV.DEVID
|
||||
inc FD.TTY+S.FD.DEV.NAME+3
|
||||
lda FD.TTY+S.FD.DEV.BUSPTR+1
|
||||
inc FD.TTY.NAME+3
|
||||
lda FD.TTY+S.FD.DEV.BUFPTR+1
|
||||
sec
|
||||
sbc /2048
|
||||
sta FD.TTY+S.FD.DEV.BUSPTR+1
|
||||
sta FD.TTY+S.FD.DEV.BUFPTR+1
|
||||
>PUSHWI FD.TTY.NAME
|
||||
>LDYAI FD.TTY
|
||||
>SYSCALL MKDev
|
||||
|
||||
@ -380,7 +383,7 @@ PS0.Init >LDYAI CORE.S.PS0 Select Process 0 (Kernel)
|
||||
>PUSHBI S.FI.T.TXT
|
||||
>PUSHBI O.RDWR
|
||||
|
||||
>LDYAI DEV.SYS
|
||||
>LDYAI DEV.CONSOLE
|
||||
>SYSCALL fopen
|
||||
bcs .9
|
||||
|
||||
@ -950,19 +953,19 @@ DevMgrInit.AddBDev
|
||||
|
||||
lda FD.BDEV+S.FD.DEV.BUSID
|
||||
ora #$30
|
||||
sta FD.BDEV+S.FD.DEV.NAME+1 SnDy
|
||||
sta FD.BDEV.NAME+1 SnDy
|
||||
|
||||
lda FD.BDEV+S.FD.DEV.DEVID
|
||||
ora #$30
|
||||
sta FD.BDEV+S.FD.DEV.NAME+3 SxDn
|
||||
sta FD.BDEV.NAME+3 SxDn
|
||||
|
||||
>PUSHWI FD.BDEV+S.FD.DEV.NAME
|
||||
>PUSHWI FD.BDEV.NAME
|
||||
>PUSHBI 2
|
||||
>LDYAI MSG.BLKDEV
|
||||
>SYSCALL printf
|
||||
|
||||
>PUSHWI FD.BDEV.NAME
|
||||
>LDYAI FD.BDEV
|
||||
|
||||
>SYSCALL MKDev
|
||||
rts
|
||||
*--------------------------------------
|
||||
@ -1106,7 +1109,7 @@ MSG.Z80 .AZ "Checking Z80 CPU..."
|
||||
MSG.Z80.OK .AZ "Detected In Slot %d.\r\n"
|
||||
MSG.Z80.KO .AZ "Not Detected."
|
||||
*--------------------------------------
|
||||
DEV.SYS .AZ "/DEV/SYS"
|
||||
DEV.CONSOLE .AZ "/DEV/CONSOLE"
|
||||
I.ENV.ROOT .AZ "ROOT"
|
||||
I.ENV.PATH .AZ "PATH=${ROOT}SBIN/:${ROOT}BIN/"
|
||||
I.ENV.LIB .AZ "LIB=${ROOT}LIB/"
|
||||
@ -1132,29 +1135,29 @@ MLICLOSE00 .DA #1
|
||||
FD.NULL .DA #S.FD.T.CDEV
|
||||
.DA #0 HANDLER
|
||||
.DA #0 BUSID
|
||||
.DA #DEVID.NULL
|
||||
.DA #0 DEVID
|
||||
.DA 0 BUSPTR
|
||||
.DA DRV.NULL
|
||||
.AZ "NULL" NAME
|
||||
.HS 000000
|
||||
.DA 0 BUFPTR
|
||||
FD.NULL.NAME .AZ "NULL" NAME
|
||||
*--------------------------------------
|
||||
FD.SYS .DA #S.FD.T.CDEV
|
||||
FD.CONSOLE .DA #S.FD.T.CDEV
|
||||
.DA #0 HANDLER
|
||||
.DA #0 BUSID
|
||||
.DA #DEVID.SYS
|
||||
.DA $B800 BUSPTR
|
||||
.DA #1 DEVID
|
||||
.DA 0 BUSPTR
|
||||
.DA DRV.SYS
|
||||
.AZ "SYS" NAME
|
||||
.HS 00000000
|
||||
.DA $B800 BUFPTR
|
||||
FD.CONSOLE.NAME .AZ "CONSOLE"
|
||||
*--------------------------------------
|
||||
FD.TTY .DA #S.FD.T.CDEV
|
||||
.DA #0 HANDLER
|
||||
.DA #0 BUSID
|
||||
.DA #DEVID.SYS DEVID
|
||||
.DA $B800 BUSPTR
|
||||
.DA #1 DEVID
|
||||
.DA 0 BUSPTR
|
||||
.DA DRV.SYS
|
||||
.AZ "TTY0" NAME
|
||||
.HS 000000
|
||||
.DA $B800 BUFPTR
|
||||
FD.TTY.NAME .AZ "TTY0"
|
||||
*--------------------------------------
|
||||
FD.BDEV .DA #S.FD.T.BDEV
|
||||
.DA #0 HANDLER
|
||||
@ -1162,8 +1165,8 @@ FD.BDEV .DA #S.FD.T.BDEV
|
||||
.DA #0 DEVID
|
||||
.BS 2 BUSPTR
|
||||
.BS 2 DRVPTR
|
||||
.AZ "S1D1" NAME
|
||||
.HS 000000
|
||||
.DA 0 BUFPTR
|
||||
FD.BDEV.NAME .AZ "S1D1"
|
||||
*--------------------------------------
|
||||
SmartPort.OFS .HS 010305
|
||||
SmartPort.SIG .HS 200003
|
||||
|
1197
SYS/KERNEL.S.TERM.txt
Normal file
1197
SYS/KERNEL.S.TERM.txt
Normal file
File diff suppressed because it is too large
Load Diff
@ -11,6 +11,7 @@ AUTO 4,1
|
||||
.INB INC/IO.I
|
||||
.INB INC/MLI.I
|
||||
.INB INC/MLI.E.I
|
||||
.INB INC/NET.TELNET.I
|
||||
.INB INC/XY.MOUSE.I
|
||||
.INB INC/GUI.I
|
||||
|
||||
@ -52,6 +53,7 @@ A2osX.E0 .PH $E000
|
||||
.INB USR/SRC/SYS/KERNEL.S.JMP
|
||||
.INB USR/SRC/SYS/KERNEL.S.IRQ
|
||||
.INB USR/SRC/SYS/KERNEL.S.MEM
|
||||
.INB USR/SRC/SYS/KERNEL.S.TERM
|
||||
********* TMP ***** go to A2osX.D1
|
||||
.INB USR/SRC/SYS/KERNEL.S.PFT
|
||||
.INB USR/SRC/SYS/KERNEL.S.FIO
|
||||
|
Loading…
Reference in New Issue
Block a user