Kernel 0.9.2

This commit is contained in:
Rémy GIBERT 2018-07-19 17:33:55 +02:00
parent 2199f9e651
commit 42d37dbaf2
46 changed files with 398 additions and 324 deletions

View File

@ -25,10 +25,11 @@ none
##ASM
**In:**
>PUSHW DRV.END
>PUSHW DRV.CS.END
>PUSHW DRV.CS.START
>LDYA L.SRC
`>PUSHW DRV.END`
`>PUSHW DRV.CS.END`
`>PUSHW DRV.CS.START`
`>LDYA L.SRC`
`SYSCALL insdrv`
**Out:**
Y,A = Ptr to installed driver
@ -37,7 +38,7 @@ Y,A = Ptr to installed driver
A = DevID
**Out:**
CC = OK, CS = ERROR
Y,A = DEVSLOT
Y,A = FD
# GetDevByName
**In:**
@ -48,10 +49,16 @@ Y,A = DEVSLOT
Y,A = FD
# GetDevStatus
## C
`int getdevstatus ( int devid, S.DIB * dstat );`
## ASM
**In:**
A = DevID
`>PUSHWI S.DIB`
`lda DevID`
`>SYSCALL GetDevStatus`
**Out:**
Y,A = S.DSTAT
# MKDev
**In:**
@ -187,16 +194,21 @@ Load a file in memory
A = hFD
note : if file is created on ProDOS : T=TXT,X=$0000
# read
## C
`int read(int fd, void *buf, size_t count);`
# IOCTL
## C
`int ioctl(int fd, unsigned long request, void * param );`
`int ioctl(int devid, int request, void * param );`
## ASM
**In:**
`PUSHWI param`
`lda #request`
`ldy fd`
`PUSHBI request`
`lda devid`
`>SYSCALL IOCTL`
**Out:**
Y,A = ...

Binary file not shown.

Binary file not shown.

View File

@ -42,7 +42,7 @@ L.MSG2 .DA MSG2
.DA 0
*--------------------------------------
CS.INIT >LDYA L.LIBTCPIP
>SYSCALL LoadLib.YA
>SYSCALL LoadLib
bcs .9
sta hLIBTCPIP
@ -65,7 +65,7 @@ CS.RUN ldy #S.PS.ARGC
lda #1
>SYSCALL GetArg
>SYSCALL SScanF.YA
>SYSCALL sscanf
bcs .9
ldy #S.PS.ARGC
@ -127,7 +127,7 @@ CS.RUN.ADD >PUSHEA.G DST.MAC+5
lda #2
>SYSCALL GetArg
>SYSCALL SScanF.YA
>SYSCALL sscanf
bcs .9
>PUSHEA.G DST.MAC

View File

@ -77,7 +77,7 @@ CS.INIT
beq .99
>LDYAI 256
>SYSCALL GetMem.YA
>SYSCALL GetMem
bcs .9
>STYA ZPBufPtr
@ -289,7 +289,7 @@ CS.RUN.CLOSE ldy #hFILE
lda #0
sta (pData),y
pla
>SYSCALL FClose.A
>SYSCALL FClose
.8 clc
rts

View File

@ -39,7 +39,7 @@ L.MSG1 .DA MSG1
.DA 0
*--------------------------------------
CS.INIT >LDYA L.LIBTCPIP
>SYSCALL LoadLib.YA
>SYSCALL LoadLib
sta hLIBTCPIP
.8 lda (pPs)
@ -65,7 +65,7 @@ CS.RUN.ADD cmp #2
lda #1
>SYSCALL GetArg
>SYSCALL SScanF.YA
>SYSCALL sscanf
bcs .9
>PUSHEA.G DST.IP

View File

@ -106,7 +106,7 @@ CS.INIT ldy #S.PS.ARGC
jmp .1 success, scan for any other args
.8 >LDYA L.LIBBLKDEV
>SYSCALL LoadLib.YA
>SYSCALL LoadLib
sta hLIBBLKDEV
* lda (pPs)
@ -205,10 +205,10 @@ CS.RUN.BuildCat >LDA.G hDev
bcs .99
>STYA ZPPtr1
ldy #S.DSTAT.SIZE
ldy #S.DIB.SIZE
lda (ZPPtr1),y
>STA.G SizeInBlocks
ldy #S.DSTAT.SIZE+1
ldy #S.DIB.SIZE+1
lda (ZPPtr1),y
>STA.G SizeInBlocks+1

View File

@ -58,7 +58,7 @@ L.MSG2.HOSTNAME .DA MSG2.HOSTNAME
.DA 0
*--------------------------------------
CS.INIT >LDYA L.LIBTCPIP
>SYSCALL LoadLib.YA
>SYSCALL LoadLib
bcs .9
sta hLIBTCPIP
clc
@ -89,11 +89,11 @@ CS.RUN.DUMPDEV >STA.G DevID
>LDYA L.MSG0.L
>SYSCALL printf
ldy #S.DSTAT.NIC.MAC+5
ldy #S.DIB.NIC.MAC+5
.1 >PUSHB (ZPDevStatPtr),y
dey
cpy #S.DSTAT.NIC.MAC-1
cpy #S.DIB.NIC.MAC-1
bne .1
lda #S.DEV.NAME
@ -107,10 +107,10 @@ CS.RUN.DUMPDEV >STA.G DevID
lda ZPDevStatPtr
clc
adc #S.DSTAT.IDS
adc #S.DIB.IDS
tay
lda ZPDevStatPtr+1
adc /S.DSTAT.IDS
adc /S.DIB.IDS
>PUSHYA
>PUSHB.G DevID
@ -118,27 +118,27 @@ CS.RUN.DUMPDEV >STA.G DevID
>LDYA L.MSG1.DEV
>SYSCALL printf
ldy #S.DSTAT.NIC.FLAGS
ldy #S.DIB.NIC.FLAGS
lda (ZPDevStatPtr),y
and #S.DSTAT.NIC.FLAGS.ARPOFFLOAD
and #S.DIB.NIC.FLAGS.ARPOFFLOAD
beq .2
lda #1
.2 >PUSHA
>LDYA L.MSG1.DEV.ARP
>SYSCALL printf
ldy #S.DSTAT.NIC.FLAGS
ldy #S.DIB.NIC.FLAGS
lda (ZPDevStatPtr),y
and #S.DSTAT.NIC.FLAGS.IPOFFLOAD
and #S.DIB.NIC.FLAGS.IPOFFLOAD
beq .3
lda #1
.3 >PUSHA
>LDYA L.MSG1.DEV.IP
>SYSCALL printf
ldy #S.DSTAT.NIC.STATUS
ldy #S.DIB.NIC.STATUS
lda (ZPDevStatPtr),y
and #S.DSTAT.NIC.STATUS.OK
and #S.DIB.NIC.STATUS.OK
bne CS.RUN.LINK
>PUSHW L.MSG1.LINK.KO
>LDYA L.MSG1.LINK
@ -152,7 +152,7 @@ CS.RUN.LINK >PUSHW L.MSG1.LINK.OK
>LDYA L.MSG1.LINKSPEED
>SYSCALL printf
ldy #S.DSTAT.NIC.STATUS
ldy #S.DIB.NIC.STATUS
lda (ZPDevStatPtr),y
and #$0F
tax
@ -164,9 +164,9 @@ CS.RUN.LINK >PUSHW L.MSG1.LINK.OK
dex
bne .4
ldy #S.DSTAT.NIC.STATUS
ldy #S.DIB.NIC.STATUS
lda (ZPDevStatPtr),y
and #S.DSTAT.NIC.STATUS.FD
and #S.DIB.NIC.STATUS.FD
bne .5
>LDYA L.MSG1.DPLX.HD
bra .6

View File

@ -43,25 +43,24 @@ CS.INIT clc
*--------------------------------------
CS.RUN >LDYA L.MSG0
>SYSCALL printf
>DEBUG
>LDA.G DEV.ID
.1 >SYSCALL GetDevByID
bcs .7
>STYA ZPPTR1
>STYA ZPPTR1 S.FD
jsr DumpHeader
jsr DumpFD
bcs .9
>PUSHEA.G DEV.DIB
>LDA.G DEV.ID
>SYSCALL GetDevStatus
bcs .6
>STYA ZPPTR2
jsr DumpStatus
jsr DumpDIB
bcs .9
@ -69,10 +68,8 @@ CS.RUN >LDYA L.MSG0
>SYSCALL PutChar
lda #10
>SYSCALL PutChar
>DEBUG
.7 >LDA.G DEV.ID
inc
sta (pData),y
.7 >INC.G DEV.ID
cmp #K.DEV.MAX
bne .1
@ -80,7 +77,7 @@ CS.RUN >LDYA L.MSG0
sec we do not want to stay in memory
.9 rts
*--------------------------------------
DumpHeader ldy #S.FD.DEV.DRVPTR+1
DumpFD ldy #S.FD.DEV.DRVPTR+1
>PUSHB (ZPPTR1),y
dey
@ -103,74 +100,53 @@ DumpHeader ldy #S.FD.DEV.DRVPTR+1
>SYSCALL printf
rts
*--------------------------------------
DumpStatus >LDA.G DEV.S
bpl .1
DumpDIB >LDA.G DEV.DIB+S.DIB.S
bpl .1 char device...
lda #0
>PUSHA
ldy #S.DSTAT.SIZE+2
lda (ZPPTR2),y
>PUSHA
>PUSHB.G DEV.DIB+S.DIB.SIZE+2
>PUSHB.G DEV.DIB+S.DIB.SIZE+1
>PUSHB.G DEV.DIB+S.DIB.SIZE
dey
lda (ZPPTR2),y
>PUSHA
.1 >PUSHB.G DEV.DIB+S.DIB.VERSION+1
>PUSHB.G DEV.DIB+S.DIB.VERSION
dey
lda (ZPPTR2),y
>PUSHA
>PUSHEA.G DEV.DIB+S.DIB.IDS
.1 ldy #S.DSTAT.VERSION+1
>PUSHB (ZPPTR2),y
dey
>PUSHB (ZPPTR2),y
>PUSHB.G DEV.DIB+S.DIB.ST
>PUSHB.G DEV.DIB+S.DIB.T
lda ZPPTR2
clc
adc #S.DSTAT.IDS
tay
lda ZPPTR2+1
adc #0
>PUSHYA
ldy #S.DSTAT.ST
>PUSHB (ZPPTR2),y
dey
>PUSHB (ZPPTR2),y
>LDA.G DEV.S
bpl .2
>LDYA L.MSG2.B
bra .3
.2 >LDYA L.MSG2.C
.3 >SYSCALL printf
rts
*--------------------------------------
ST ldy #S.DSTAT.S
lda (ZPPTR1),y
>STA.G DEV.S
>LDA.G DEV.DIB+S.DIB.S
ldy #DEV.SFLAGS+7
ldx #7
.1 lsr
.2 lsr
pha
lda #'-'
bcc .2
bcc .3
lda MSG.SFLAGS,x
.2 sta (pData),y
.3 sta (pData),y
pla
dey
dex
bpl .1
bpl .2
>PUSHEA.G DEV.SFLAGS
>LDA.G DEV.DIB+S.DIB.S
bpl .4
>LDYA L.MSG2.B
bra .8
.4 >LDYA L.MSG2.C
.8 >SYSCALL printf
rts
*--------------------------------------
*--------------------------------------
@ -182,16 +158,16 @@ CS.QUIT clc
*--------------------------------------
CS.END
MSG0 .AZ "ID Name Addr. Status Typ/Sub IDString Version Size (BLK)\r\n"
MSG1 .AZ "%03d %s $%H "
MSG2.B .AZ "$%h/$%h %16S %03d.%03d %10u"
MSG2.C .AZ "$%h/$%h %16S %03d.%03d n/a"
MSG1 .AZ "%03d %7s $%H "
MSG2.B .AZ "%s $%h/$%h %16S %03d.%03d %10u"
MSG2.C .AZ "%s $%h/$%h %16S %03d.%03d n/a"
MSG.SFLAGS .AS "BWRLNEIO"
*--------------------------------------
.DUMMY
.OR 0
DS.START
DEV.ID .BS 1
DEV.S .BS 1
DEV.DIB .BS S.DIB
DEV.SFLAGS .BS 9
DS.END
.ED

View File

@ -87,7 +87,7 @@ CS.INIT ldy #S.PS.ARGC
bra .1
.8 >LDYA L.LIBCRYPT
>SYSCALL LoadLib.YA
>SYSCALL LoadLib
bcs .9
sta hLIBCRYPT

View File

@ -52,7 +52,7 @@ L.MSG1.S .DA MSG1.S.0
.DA 0
*--------------------------------------
CS.INIT >LDYA L.LIBTCPIP
>SYSCALL LoadLib.YA
>SYSCALL LoadLib
bcs .9
sta hLIBTCPIP

View File

@ -47,7 +47,7 @@ L.MSG.UNREACH .DA MSG.UNREACH
.DA 0
*--------------------------------------
CS.INIT >LDYA L.LIBTCPIP
>SYSCALL LoadLib.YA
>SYSCALL LoadLib
bcs .9
sta hLIBTCPIP

View File

@ -48,7 +48,7 @@ CS.INIT ldy #S.PS.ARGC
beq .99
>LDYA L.LIBTCPIP
>SYSCALL LoadLib.YA
>SYSCALL LoadLib
sta hLIBTCPIP
>LIBCALL hLIBTCPIP,LIBTCPIP.GET.IPCFG is TCPIP loaded ?

View File

@ -4,12 +4,13 @@ AUTO 4,1
.LIST OFF
.OP 65C02
.OR $2000
.TF /A2OSX.BUILD/DRV/CONSOLE.DRV
.TF DRV/CONSOLE.DRV
*--------------------------------------
.INB /A2OSX.BUILD/INC/MACROS.I
.INB /A2OSX.BUILD/INC/A2OSX.I
.INB /A2OSX.BUILD/INC/IO.I
.INB /A2OSX.BUILD/INC/NET.TELNET.I
.INB INC/MACROS.I
.INB INC/A2OSX.I
.INB INC/MLI.ERR.I
.INB INC/IO.I
.INB INC/NET.TELNET.I
*--------------------------------------
* File Header (16 Bytes)
*--------------------------------------
@ -37,9 +38,9 @@ Dev.Detect >LDYA L.MSG.DETECT
>PUSHWI DRV.CS.END
>PUSHWI DRV.CS.START
>LDYA L.DRV.CS.START
>DEBUG
>SYSCALL InsDrv
bcs .9
>STYA FD.DEV+S.FD.DEV.DRVPTR
>LDYA L.FD.DEV
@ -84,7 +85,6 @@ DRV.CS.START cld
.DA READ
.DA WRITE
.DA A2osX.BADCALL IRQ
L.DEVSTAT .DA DEVSTAT
*--------------------------------------
J.CtrlChars .DA ENQ 5
.DA BS 8
@ -105,14 +105,42 @@ J.EscSequences .DA Esc.DispAttr m
.DA Esc.Home H
.DA 0 end of relocation
*--------------------------------------
STATUS >LDYA L.DEVSTAT
STATUS >STYA ZPIOCTL
ldy #S.IOCTL.STATCODE
lda (ZPIOCTL),y
beq .1
cmp #S.IOCTL.STATCODE.GETDIB
bne .9
ldx #S.DIB-1
.HS 2C bit abs
.1 ldx #3
ldy #S.IOCTL.BUFPTR
lda (ZPIOCTL),y
sta .3+1
iny
lda (ZPIOCTL),y
sta .3+2
.2 lda DIB,x
.3 sta $ffff,x SELF MODIFIED
dex
bpl .2
clc
rts
.9 lda #MLI.E.BADCTL
sec
rts
*--------------------------------------
OPEN sta A2osX.SCRNDEVS DEV.ID in A
lda #S.DSTAT.S.OPENED
tsb DEVSTAT
lda #S.DIB.S.OPENED
tsb DIB+S.DIB.S
stz CURON
@ -142,7 +170,10 @@ CONTROL sta SETTEXT
clc
rts
*--------------------------------------
CLOSE stz A2osX.SCRNDEVS+1
CLOSE lda #S.DIB.S.OPENED
trb DIB+S.DIB.S
stz A2osX.SCRNDEVS+1
clc
rts
*--------------------------------------
@ -960,10 +991,10 @@ EscSeq .BS ESCSEQ.MAXLEN+1
EscSeqParamCnt .BS 1
EscSeqParam .BS 4
*--------------------------------------
DEVSTAT .DA #S.DSTAT.S.WRITE+S.DSTAT.S.READ
DIB .DA #S.DIB.S.WRITE+S.DIB.S.READ
.DA #0,#0,#0
>PSTR "ANSI 80c Console"
.DA #S.DSTAT.T.CHAR
.DA #S.DIB.T.CHAR
.DA #0
.DA #0
.DA KVER

View File

@ -71,7 +71,7 @@ Dev.Detect >LDYA L.MSG.DETECT
bne .1
lda #$80
sta DSTAT+S.DSTAT.ST $80=//c
sta DSTAT+S.DIB.ST $80=//c
>LDYA L.MSG.DETECT.IIC
@ -102,7 +102,7 @@ Dev.Detect >LDYA L.MSG.DETECT
bne .2
dec
sta DSTAT+S.DSTAT.ST 0=80C,$ff=EVE
sta DSTAT+S.DIB.ST 0=80C,$ff=EVE
.2 stx $400 Set back Aux $400
sta CLRPAGE2
@ -115,7 +115,7 @@ Dev.Detect >LDYA L.MSG.DETECT
>LDYA L.MSG.DETECT.EVE
bit DSTAT+S.DSTAT.ST
bit DSTAT+S.DIB.ST
bmi .3
>LDYA L.MSG.DETECT.80C
@ -213,7 +213,7 @@ OPEN sta A2osX.SCRNDEVS+2 DEV.ID in A
*--------------------------------------
CONTROL ldy #0
bit DSTAT+S.DSTAT.ST
bit DSTAT+S.DIB.ST
bmi .1 //c,EVE mode
ldy #CONTROL.LCM-CONTROL.80C
@ -424,7 +424,7 @@ DSTAT .DA #0
.DA #0,#0,#0
>PSTR "Apple II DHGR"
.BS 3
.DA #S.DSTAT.T.GFX
.DA #S.DIB.T.GFX
.DA #0
.DA #0
.DA #91

View File

@ -123,7 +123,7 @@ DRV.CS.START .DA STATUS
L.DEVSTAT .DA DEVSTAT
.DA 0 end or relocation
*--------------------------------------
STATUS lda #S.DSTAT.NIC.STATUS.10
STATUS lda #S.DIB.NIC.STATUS.10
sta LINK.STATUS
ldx DEVSLOTx0
@ -134,7 +134,7 @@ STATUS lda #S.DSTAT.NIC.STATUS.10
and /L91C96.0.EPHSR.LINK
beq .1
lda LINK.STATUS
ora #S.DSTAT.NIC.STATUS.OK
ora #S.DIB.NIC.STATUS.OK
sta LINK.STATUS
.1 lda L91C96.0.TCR,x
@ -142,7 +142,7 @@ STATUS lda #S.DSTAT.NIC.STATUS.10
and /L91C96.0.TCR.FDSE
bne .2
lda LINK.STATUS
ora #S.DSTAT.NIC.STATUS.FD
ora #S.DIB.NIC.STATUS.FD
sta LINK.STATUS
.2 >LDYA L.DEVSTAT
@ -437,7 +437,7 @@ DEVSTAT .DA #0
.BS 3 size
>PSTR "LanCEGS/L91C96"
.BS 1
.DA #S.DSTAT.T.NET
.DA #S.DIB.T.NET
.BS 1 Subtype
.BS 2 Version
*--------------------------------------

View File

@ -314,7 +314,7 @@ DEVSTAT .DA #0
.DA #0,#0,#0
>PSTR "Apple II Mouse"
.BS 2
.DA #S.DSTAT.T.XY
.DA #S.DIB.T.XY
.DA #0
.DA #0
.DA #91

View File

@ -147,11 +147,11 @@ DEVSLOT0n .BS 1
DEVSLOTCn .BS 1
DEVSLOTn0 .BS 1
*--------------------------------------
STAT .DA #S.DSTAT.S.WRITE
STAT .DA #S.DIB.S.WRITE
.DA #0,#0,#0
>PSTR "Parallel Card"
.DA #0,#0,#0
.DA #S.DSTAT.T.CHAR
.DA #S.DIB.T.CHAR
.DA #0
.DA $0900
*--------------------------------------

View File

@ -501,12 +501,12 @@ DEVSLOTx0 .BS 1
DEVSTAT .DA #0
.BS 3 size
>PSTR "UtherNetII/W5100"
.DA #S.DSTAT.T.NET
.DA #S.DIB.T.NET
.BS 1 Subtype
.BS 2 Version
*--------------------------------------
FLAGS .DA #S.DSTAT.NIC.FLAGS.ARPOFFLOAD+S.DSTAT.NIC.FLAGS.IPOFFLOAD
LINK.STATUS .DA #S.DSTAT.NIC.STATUS.OK+S.DSTAT.NIC.STATUS.FD+S.DSTAT.NIC.STATUS.100
FLAGS .DA #S.DIB.NIC.FLAGS.ARPOFFLOAD+S.DIB.NIC.FLAGS.IPOFFLOAD
LINK.STATUS .DA #S.DIB.NIC.STATUS.OK+S.DIB.NIC.STATUS.FD+S.DIB.NIC.STATUS.100
MAC .BS 6
MAN
SAVE /A2OSX.SRC/DRV/UTHER2.AI.DRV.S

View File

@ -85,9 +85,9 @@ Dev.Detect >STYA ARGS
sta PacketPagePTR,x
lda PacketPageDATA+1,x
sta DEVSTAT+S.DSTAT.VERSION+1 set Hardware version
sta DEVSTAT+S.DIB.VERSION+1 set Hardware version
lda PacketPageDATA,x
sta DEVSTAT+S.DSTAT.VERSION
sta DEVSTAT+S.DIB.VERSION
>LDYA ARGS
>STYA ZPTmpPTR
@ -153,7 +153,7 @@ DRV.CS.START .DA STATUS
L.DEVSTAT .DA DEVSTAT
.DA 0 end or relocation
*--------------------------------------
STATUS lda #S.DSTAT.NIC.STATUS.10
STATUS lda #S.DIB.NIC.STATUS.10
sta LINK.STATUS
ldx DEVSLOTx0
@ -169,7 +169,7 @@ STATUS lda #S.DSTAT.NIC.STATUS.10
beq .1
lda LINK.STATUS
ora #S.DSTAT.NIC.STATUS.OK
ora #S.DIB.NIC.STATUS.OK
sta LINK.STATUS
.1 lda /PP.TestCTL
@ -183,7 +183,7 @@ STATUS lda #S.DSTAT.NIC.STATUS.10
beq .2
lda LINK.STATUS
ora #S.DSTAT.NIC.STATUS.FD
ora #S.DIB.NIC.STATUS.FD
sta LINK.STATUS
.2 >LDYA L.DEVSTAT
@ -441,7 +441,7 @@ DEVSLOTx0 .BS 1
DEVSTAT .DA #0
.BS 3 size
>PSTR "Uthernet/CS8900A"
.DA #S.DSTAT.T.NET
.DA #S.DIB.T.NET
.BS 1 Subtype
.BS 2 Version
*--------------------------------------

View File

@ -388,12 +388,12 @@ DEVSLOTx0 .BS 1
DEVSTAT .DA #0
.BS 3 size
>PSTR "UtherNetII/W5100"
.DA #S.DSTAT.T.NET
.DA #S.DIB.T.NET
.BS 1 Subtype
.BS 2 Version
*--------------------------------------
FLAGS .DA #0
LINK.STATUS .DA #S.DSTAT.NIC.STATUS.OK+S.DSTAT.NIC.STATUS.FD+S.DSTAT.NIC.STATUS.100
LINK.STATUS .DA #S.DIB.NIC.STATUS.OK+S.DIB.NIC.STATUS.FD+S.DIB.NIC.STATUS.100
MAC .BS 6
MAN
SAVE /A2OSX.SRC/DRV/UTHERNET2.DRV.S

View File

@ -404,17 +404,17 @@ OUTBUF .BS BUF.SIZE
*--------------------------------------
STAT .DO SSCIRQ=1
.DA #S.DSTAT.S.WRITE+S.DSTAT.S.READ+S.DEV.S.IRQ
.DA #S.DIB.S.WRITE+S.DIB.S.READ+S.DEV.S.IRQ
.ELSE
.DA #S.DSTAT.S.WRITE+S.DSTAT.S.READ
.DA #S.DIB.S.WRITE+S.DIB.S.READ
.FIN
.DA #0,#0,#0
>PSTR "Serial Card/Port"
.DA #S.DSTAT.T.CHAR
.DA #S.DIB.T.CHAR
.DA #0
.DA #0
.DA #91

View File

@ -326,48 +326,48 @@ S.IOCTL.ADDRPTR .EQ 6 3 BYTES
*
S.IOCTRL .EQ 9
*--------------------------------------
S.DSTAT.S .EQ 0
S.DSTAT.S.BLOCK .EQ %10000000
S.DSTAT.S.WRITE .EQ %01000000
S.DSTAT.S.READ .EQ %00100000
S.DSTAT.S.ONLINE .EQ %00010000
S.DSTAT.S.NOFMT .EQ %00001000
S.DSTAT.S.WENABL .EQ %00000100
S.DSTAT.S.IRQ .EQ %00000010
S.DSTAT.S.OPENED .EQ %00000001
S.DSTAT.SIZE .EQ 1 3 bytes
S.DSTAT.IDS .EQ 4 1 (LEN) + 16 MAX
S.DSTAT.T .EQ 21
S.DSTAT.T.RAM .EQ $00 Memory Expansion Card (RAM disk)
S.DSTAT.T.3.5 .EQ $01 3.5" disk
S.DSTAT.T.PROFILE .EQ $02 ProFile-type hard disk
S.DSTAT.T.GENSCSI .EQ $03 Generic SCSI
S.DSTAT.T.ROM .EQ $04 ROM disk
S.DSTAT.T.CDROM .EQ $05 SCSI CD-ROM
S.DSTAT.T.TAPE .EQ $06 SCSI tape or other SCSI sequential device
S.DSTAT.T.HD .EQ $07 SCSI hard disk
S.DIB.S .EQ 0
S.DIB.S.BLOCK .EQ %10000000
S.DIB.S.WRITE .EQ %01000000
S.DIB.S.READ .EQ %00100000
S.DIB.S.ONLINE .EQ %00010000
S.DIB.S.NOFMT .EQ %00001000
S.DIB.S.WENABL .EQ %00000100
S.DIB.S.IRQ .EQ %00000010
S.DIB.S.OPENED .EQ %00000001
S.DIB.SIZE .EQ 1 3 bytes
S.DIB.IDS .EQ 4 1 (LEN) + 16 MAX
S.DIB.T .EQ 21
S.DIB.T.RAM .EQ $00 Memory Expansion Card (RAM disk)
S.DIB.T.3.5 .EQ $01 3.5" disk
S.DIB.T.PROFILE .EQ $02 ProFile-type hard disk
S.DIB.T.GENSCSI .EQ $03 Generic SCSI
S.DIB.T.ROM .EQ $04 ROM disk
S.DIB.T.CDROM .EQ $05 SCSI CD-ROM
S.DIB.T.TAPE .EQ $06 SCSI tape or other SCSI sequential device
S.DIB.T.HD .EQ $07 SCSI hard disk
* .EQ $08 Reserved
S.DSTAT.T.SPRINTER .EQ $09 SCSI printer
S.DSTAT.T.5.25 .EQ $0A 5-1/4" disk
S.DIB.T.SPRINTER .EQ $09 SCSI printer
S.DIB.T.5.25 .EQ $0A 5-1/4" disk
* .EQ $0B Reserved
* .EQ $0C Reserved
S.DSTAT.T.PRINTER .EQ $0D Printer
S.DSTAT.T.CLOCK .EQ $0E Clock
S.DSTAT.T.MODEM .EQ $0F Modem
S.DSTAT.T.DISKII .EQ $10
S.DSTAT.T.PRODOS .EQ $11
S.DSTAT.T.NET .EQ $12 Network board
S.DSTAT.T.XY .EQ $13 X,Y Pointing Device
S.DSTAT.T.CHAR .EQ $14
S.DSTAT.T.GFX .EQ $15
S.DSTAT.T.SND .EQ $16
S.DSTAT.ST .EQ 22
S.DSTAT.ST.EXT .EQ $80
S.DSTAT.ST.DSKSW .EQ $40
S.DSTAT.ST.NOREM .EQ $20
S.DSTAT.VERSION .EQ 23
S.DIB.T.PRINTER .EQ $0D Printer
S.DIB.T.CLOCK .EQ $0E Clock
S.DIB.T.MODEM .EQ $0F Modem
S.DIB.T.DISKII .EQ $10
S.DIB.T.PRODOS .EQ $11
S.DIB.T.NET .EQ $12 Network board
S.DIB.T.XY .EQ $13 X,Y Pointing Device
S.DIB.T.CHAR .EQ $14
S.DIB.T.GFX .EQ $15
S.DIB.T.SND .EQ $16
S.DIB.ST .EQ 22
S.DIB.ST.EXT .EQ $80
S.DIB.ST.DSKSW .EQ $40
S.DIB.ST.NOREM .EQ $20
S.DIB.VERSION .EQ 23
*
S.DSTAT .EQ 25
S.DIB .EQ 25
*--------------------------------------
* S.FD
*--------------------------------------

View File

@ -7,11 +7,11 @@ AUTO 6
*--------------------------------------
* GFX Devices
*--------------------------------------
S.DSTAT.GFX.F .EQ S.DSTAT
S.DSTAT.GFX.S .EQ S.DSTAT+1
S.DSTAT.GFX.W .EQ S.DSTAT+2
S.DSTAT.GFX.H .EQ S.DSTAT+4
S.DSTAT.GFX .EQ S.DSTAT+6
S.DIB.GFX.F .EQ S.DIB
S.DIB.GFX.S .EQ S.DIB+1
S.DIB.GFX.W .EQ S.DIB+2
S.DIB.GFX.H .EQ S.DIB+4
S.DIB.GFX .EQ S.DIB+6
*--------------------------------------
MAN
SAVE /A2OSX.BUILD/INC/GFX.I

View File

@ -85,7 +85,7 @@ A2osX.SaveSX .EQ $101 Aux
* Aux $3FE -> 3FF : IRQ Vector
*--------------------------------------
K.S.STAT .EQ $0300 S.STAT for internal kernel operations
*K.S.DSTAT .EQ $0340 S.DSTAT=25 or higher depends on dev type
*K.S.DIB .EQ $0340 S.DIB=25 or higher depends on dev type
K.S.IOCTL .EQ $0360 9 bytes
K.MLI.PATH .EQ $0369 64+1
K.MLI.PARAMS .EQ $03AA Main, 18 bytes min for GetFileInfo (ATLK needs MORE!!!...32 max for now)

View File

@ -5,17 +5,17 @@ AUTO 4,1
*--------------------------------------
* NIC Devices
*--------------------------------------
S.DSTAT.NIC.FLAGS .EQ S.DSTAT
S.DSTAT.NIC.FLAGS.ARPOFFLOAD .EQ %00000001
S.DSTAT.NIC.FLAGS.IPOFFLOAD .EQ %00000010
S.DSTAT.NIC.STATUS .EQ S.DSTAT+1
S.DSTAT.NIC.STATUS.OK .EQ $80
S.DSTAT.NIC.STATUS.FD .EQ $40
S.DSTAT.NIC.STATUS.10 .EQ $01
S.DSTAT.NIC.STATUS.100 .EQ $02
S.DSTAT.NIC.STATUS.1000 .EQ $03
S.DSTAT.NIC.MAC .EQ S.DSTAT+2
S.DSTAT.NIC .EQ S.DSTAT+8
S.DIB.NIC.FLAGS .EQ S.DIB
S.DIB.NIC.FLAGS.ARPOFFLOAD .EQ %00000001
S.DIB.NIC.FLAGS.IPOFFLOAD .EQ %00000010
S.DIB.NIC.STATUS .EQ S.DIB+1
S.DIB.NIC.STATUS.OK .EQ $80
S.DIB.NIC.STATUS.FD .EQ $40
S.DIB.NIC.STATUS.10 .EQ $01
S.DIB.NIC.STATUS.100 .EQ $02
S.DIB.NIC.STATUS.1000 .EQ $03
S.DIB.NIC.MAC .EQ S.DIB+2
S.DIB.NIC .EQ S.DIB+8
*--------------------------------------
MAN
SAVE /A2OSX.BUILD/INC/NIC.I

View File

@ -12,7 +12,7 @@ WND.Init >LDYA L.DEVNAME.GFX
bcs .9
>STYA ZPPtr1
ldy #S.DSTAT.GFX.W
ldy #S.DIB.GFX.W
lda (ZPPtr1),y
sta WND.Cache+S.OBJ.W
@ -25,7 +25,7 @@ WND.Init >LDYA L.DEVNAME.GFX
adc #6
sta WND.TB.H
iny #S.DSTAT.GFX.H
iny #S.DIB.GFX.H
lda (ZPPtr1),y
sec

View File

@ -37,10 +37,10 @@ SET.IPCFG >PULLW ZPTmpPtr1
>SYSCALL GetDevStatus
>STYA ZPTmpPtr2
ldy #S.DSTAT.NIC.FLAGS
ldy #S.DIB.NIC.FLAGS
lda (ZPTmpPtr2),y
sta DevFlags
and #S.DSTAT.NIC.FLAGS.ARPOFFLOAD
and #S.DIB.NIC.FLAGS.ARPOFFLOAD
beq .4
>PUSHB IPCFG+S.IPCFG.HDEV

View File

@ -76,7 +76,7 @@ FRM.NewIP stx .8+1
sta ZPDataOutPtr+1
lda DevFlags
and #S.DSTAT.NIC.FLAGS.IPOFFLOAD
and #S.DIB.NIC.FLAGS.IPOFFLOAD
bne .7
ldy #S.ETH.ETHERTYPE
@ -136,7 +136,7 @@ FRM.SendIP ldx #3 Copy SRC.IP even if IP offload
bpl .1
lda DevFlags
and #S.DSTAT.NIC.FLAGS.IPOFFLOAD
and #S.DIB.NIC.FLAGS.IPOFFLOAD
bne .21
ldy #S.IP.TOTAL.LENGTH+1
@ -217,7 +217,7 @@ FRM.SendIP ldx #3 Copy SRC.IP even if IP offload
jsr ICMP.ComputeChecksum
.5 lda DevFlags
and #S.DSTAT.NIC.FLAGS.ARPOFFLOAD
and #S.DIB.NIC.FLAGS.ARPOFFLOAD
bne .6
jsr IP.SetDestMAC

View File

@ -50,7 +50,7 @@ L.DHCP.REQ .DA DHCP.REQ
.DA 0
*--------------------------------------
CS.INIT >LDYA L.LIBTCPIP
>SYSCALL LoadLib.YA
>SYSCALL LoadLib
sta hLIBTCPIP
>LIBCALL hLIBTCPIP,LIBTCPIP.GET.IPCFG

View File

@ -225,11 +225,7 @@ CS.QUIT >LDA.G hBinName
.1 >LDA.G hDEV
beq .8
>PUSHA
>PUSHBI IOCTL.CLOSE
>PUSHBI 0
>SYSCALL IOCTL
>SYSCALL close
.8 clc
rts

View File

@ -38,7 +38,7 @@ L.MouseData .DA MouseData
.DA 0
*--------------------------------------
CS.INIT >LDYA L.LIBGUI
>SYSCALL LoadLib.YA
>SYSCALL LoadLib
bcs .98
sta hLIBGUI

View File

@ -48,7 +48,7 @@ L.HTTP.200OK .DA HTTP.200OK
.DA 0
*--------------------------------------
CS.INIT >LDYA L.LIBTCPIP
>SYSCALL LoadLib.YA
>SYSCALL LoadLib
sta hLIBTCPIP
lda (pPs)

View File

@ -4,10 +4,10 @@ AUTO 4,1
.LIST OFF
.OP 65C02
.OR $2000
.TF /A2OSX.BUILD/SBIN/INSDRV
.TF SBIN/INSDRV
*--------------------------------------
.INB /A2OSX.BUILD/INC/MACROS.I
.INB /A2OSX.BUILD/INC/A2OSX.I
.INB INC/MACROS.I
.INB INC/A2OSX.I
*--------------------------------------
ZPPTR1 .EQ ZPBIN
ZPPTR2 .EQ ZPBIN+2

View File

@ -176,14 +176,12 @@ CS.RUN >LDA.G bReadMode READ Command ?
.1 >SLEEP
>SYSCALL GetChar
bcc .3
bcs .1 no char
cmp #C.EOF
beq .9
bne .1 no char
.3 jsr CL.CHARIN
jsr CL.CHARIN
>LDA.G bCmdBufExec Something to execute ?
bpl .1

View File

@ -47,7 +47,7 @@ L.IPCFG .DA IPCFG
.DA 0
*--------------------------------------
CS.INIT >LDYA L.LIBTCPIP
>SYSCALL LoadLib.YA
>SYSCALL LoadLib
bcs .99
sta hLIBTCPIP
@ -120,7 +120,7 @@ CS.INIT.DEV >LDYA L.DEVNAME
bcs .9
>STYA ZPDevStatusPtr
ldy #S.DSTAT+2 MAC
ldy #S.DIB+2 MAC
ldx #S.IPCFG.MAC
.2 lda (ZPDevStatusPtr),y

View File

@ -49,7 +49,7 @@ L.MSG.BYTE .DA MSG.BYTE
.DA 0
*--------------------------------------
CS.INIT >LDYA L.LIBTCPIP
>SYSCALL LoadLib.YA
>SYSCALL LoadLib
sta hLIBTCPIP
lda (pPs)

View File

@ -240,11 +240,11 @@ BIN.Load.1 >PUSHWI K.S.STAT
ldy #H.BIN.CODE.LEN get Code Len
lda (ZPPtr1),y
clc
adc ZPPtr1
adc BIN.R.CS.Start
sta BIN.R.CS.End ZPPtr1 + CodeLen
iny
lda (ZPPtr1),y
adc ZPPtr1+1
adc BIN.R.CS.Start+1
sta BIN.R.CS.End+1
jsr BIN.RelExe
@ -285,10 +285,11 @@ BIN.hMem .BS 1
* `void * insdrv (void * src, void * crvcsstart, void * drvcsend, void * drvend);`
* ##ASM
* **In:**
* >PUSHW DRV.END
* >PUSHW DRV.CS.END
* >PUSHW DRV.CS.START
* >LDYA L.SRC
* `>PUSHW DRV.END`
* `>PUSHW DRV.CS.END`
* `>PUSHW DRV.CS.START`
* `>LDYA L.SRC`
* `SYSCALL insdrv`
* **Out:**
* Y,A = Ptr to installed driver
*\--------------------------------------
@ -450,6 +451,15 @@ BIN.RelDrv ldy #H.BIN.DRV.REL.TABLE
bcc .3
inc ZPPtr1+1 ZPPtr1=Current Code PTR
lda BIN.R.CS.End compute new CS.END to stop relocating
clc
adc BIN.R.Offset
sta .7+1
lda BIN.R.CS.End+1
adc BIN.R.Offset+1
sta .71+1
.3 lda (ZPPtr1) get OPCODE
lsr /2
tax
@ -502,10 +512,10 @@ BIN.RelDrv ldy #H.BIN.DRV.REL.TABLE
bcc .7
inc ZPPtr1+1
.7 eor BIN.R.CS.End A = ZPPtr1
.7 eor #$ff SELF MODIFIED A = ZPPtr1
bne .3
lda ZPPtr1+1
eor BIN.R.CS.End+1
.71 eor #$ff SELF MODIFIED
bne .3 next opcode....
.8 rts

View File

@ -382,13 +382,15 @@ CORE.ScrSel and #$0F
tax
ldy A2osX.SCRNDEVS-1,x
lda A2osX.SCRNDEVS-1,x
beq .8 No device claimed this screen
stx A2osX.ASCREEN
stx A2osX.ASCREEN set active screen
>PUSHBI 0
lda #IOCTL.CONTROL
pha
>PUSHWI 0 Param
>PUSHBI IOCTL.CONTROL request
pla ID
jsr K.IOCTL

View File

@ -71,13 +71,21 @@ K.GetDev.NODEV lda #MLI.E.NODEV
K.GetDev.9 rts
*/--------------------------------------
* # GetDevStatus
* ## C
* `int getdevstatus ( int devid, S.DIB * dstat );`
* ## ASM
* **In:**
* >PUSHWI S.DSTAT
* lda DevID
* `>PUSHWI S.DIB`
* `lda DevID`
* `>SYSCALL GetDevStatus`
* **Out:**
* Y,A = S.DSTAT
*\--------------------------------------
K.GetDevStatus jsr K.GetDevByID
K.GetDevStatus pha
>PULLW K.S.IOCTL+S.IOCTL.BUFPTR
pla
jsr K.GetDevByID
bcs K.GetDev.9
>STYA pFD
@ -89,10 +97,15 @@ K.GetDevStatus jsr K.GetDevByID
lda (pFD),y
sta .1+2
lda #S.IOCTL.STATCODE.GETDIB
sta K.S.IOCTL+S.IOCTL.STATCODE
>LDYAI K.S.IOCTL
ldx #IOCTL.STATUS
.1 jmp $ffff
.9 rts
*/--------------------------------------
* # MKDev
* **In:**

View File

@ -17,16 +17,15 @@ DRV.DiskII cld
.9 jmp A2osX.BadCall
*--------------------------------------
DRV.DiskII.STATUS
>LDYAI DRV.DiskII.DSTAT
>LDYAI DRV.DiskII.DIB
jmp DRV.STATUS.YA
*--------------------------------------
DRV.DiskII.DSTAT
.DA #S.DSTAT.S.BLOCK+S.DSTAT.S.WRITE+S.DSTAT.S.READ
DRV.DiskII.DIB .DA #S.DIB.S.BLOCK+S.DIB.S.WRITE+S.DIB.S.READ
.DA 280
.DA #0
>PSTR "Disk II 5.25"
.BS 4
.DA #S.DSTAT.T.DISKII
.DA #S.DIB.T.DISKII
.DA #0
.DA KVER
*--------------------------------------
@ -48,19 +47,19 @@ DRV.RamDrive cld
DRV.RamDrive.STATUS
jsr DRV.Blk
bcs .9
stx DRV.RamDrive.DSTAT+S.DSTAT.SIZE
sty DRV.RamDrive.DSTAT+S.DSTAT.SIZE+1
stx DRV.RamDrive.DIB+S.DIB.SIZE
sty DRV.RamDrive.DIB+S.DIB.SIZE+1
>LDYAI DRV.RamDrive.DSTAT
>LDYAI DRV.RamDrive.DIB
jmp DRV.STATUS.YA
.9 rts
*--------------------------------------
DRV.RamDrive.DSTAT
.DA #S.DSTAT.S.BLOCK+S.DSTAT.S.WRITE+S.DSTAT.S.READ
DRV.RamDrive.DIB
.DA #S.DIB.S.BLOCK+S.DIB.S.WRITE+S.DIB.S.READ
.BS 3
>PSTR "ProDOS /RAM Disk"
.DA #S.DSTAT.T.RAM
.DA #S.DIB.T.RAM
.DA #0
.DA KVER
*--------------------------------------
@ -82,18 +81,18 @@ DRV.BlkDevice cld
DRV.BlkDevice.STATUS
jsr DRV.Blk
bcs .9
stx DRV.BlkDevice.DSTAT+S.DSTAT.SIZE
sty DRV.BlkDevice.DSTAT+S.DSTAT.SIZE+1
stx DRV.BlkDevice.DIB+S.DIB.SIZE
sty DRV.BlkDevice.DIB+S.DIB.SIZE+1
>LDYAI DRV.BlkDevice.DSTAT
>LDYAI DRV.BlkDevice.DIB
jmp DRV.STATUS.YA
.9 rts
*--------------------------------------
DRV.BlkDevice.DSTAT
.DA #S.DSTAT.S.BLOCK+S.DSTAT.S.WRITE+S.DSTAT.S.READ
DRV.BlkDevice.DIB
.DA #S.DIB.S.BLOCK+S.DIB.S.WRITE+S.DIB.S.READ
.BS 3
>PSTR "ProDOS Block Dev"
.DA #S.DSTAT.T.PRODOS
.DA #S.DIB.T.PRODOS
.DA #0
.DA KVER
*--------------------------------------
@ -206,7 +205,7 @@ DRV.NULL cld
.DA DRV.NULL.WRITE
.DA A2osX.BADCALL IRQ
*--------------------------------------
DRV.NULL.STATUS >LDYAI DRV.NULL.DSTAT
DRV.NULL.STATUS >LDYAI DRV.NULL.DIB
jmp DRV.STATUS.YA
DRV.NULL.READ ldx #C.EOF
@ -217,11 +216,11 @@ DRV.NULL.WRITE
DRV.NULL.CLOSE clc
rts
*--------------------------------------
DRV.NULL.DSTAT .DA #S.DSTAT.S.WRITE+S.DSTAT.S.READ+S.DSTAT.S.OPENED
DRV.NULL.DIB .DA #S.DIB.S.WRITE+S.DIB.S.READ+S.DIB.S.OPENED
.DA #0,#0,#0
>PSTR "NULL DEVICE"
.BS 5
.DA #S.DSTAT.T.CHAR
.DA #S.DIB.T.CHAR
.DA #0
.DA KVER
*--------------------------------------
@ -242,12 +241,12 @@ DRV.SYS cld
.DA DRV.SYS.Write
.DA A2osX.BADCALL IRQ
*--------------------------------------
DRV.SYS.STATUS >LDYAI DRV.SYS.DSTAT
DRV.SYS.STATUS >LDYAI DRV.SYS.DIB
jmp DRV.STATUS.YA
*--------------------------------------
DRV.SYS.Open lda #DEVID.SYS
sta A2osX.SCRNDEVS+1
jsr DRV.SYS.Home
jsr DRV.SYS.FF
*--------------------------------------
DRV.SYS.Control sta SETTEXT
sta SETALTCHAR
@ -315,34 +314,88 @@ DRV.SYS.WRITE ldy #S.IOCTL.BUFPTR
DRV.SYS.COUT phx
phy
cmp #' '
bcs .7
bcs .1
cmp #10
bne .1
jsr DRV.SYS.LF
jsr DRV.SYS.CTRL
bra .8
.1 cmp #13
bne .2
jsr DRV.SYS.CR
bra .8
.2 ora #$20
.HS 2C BIT ABS
.7 ora #$80
.1 ora #$80
ldy DRV.SYS.CH
ldx DRV.SYS.CV
jsr DRV.SYS.SetCharAtYX
jsr DRV.SYS.FSOut
jsr DRV.SYS.FS
.8 ply
plx
clc
rts
*--------------------------------------
DRV.SYS.FSOut lda DRV.SYS.CH
DRV.SYS.CTRL ldx #DRV.SYS.CTRLCNT-1
.1 cmp DRV.SYS.CTRLS,x
beq .2
dex
bpl .1
clc
rts
.2 txa
asl
tax
jmp (.3,x)
.3 .DA DRV.SYS.ENQ 5
.DA DRV.SYS.BS 8
.DA DRV.SYS.LF 10
.DA DRV.SYS.FF 12
.DA DRV.SYS.CR 13
.DA DRV.SYS.FS 21
.DA DRV.SYS.ESC 27
*--------------------------------------
DRV.SYS.ENQ clc
rts
*--------------------------------------
DRV.SYS.BS ldx DRV.SYS.CH
beq .1
dec DRV.SYS.CH
bra .3
.1 ldy DRV.SYS.CV
cpy #1
bne .2
clc
rts
.2 lda #79
sta DRV.SYS.CH
dec DRV.SYS.CV
.3 clc
rts
*--------------------------------------
DRV.SYS.LF ldx DRV.SYS.CV
cpx #23
beq DRV.SYS.Scroll
inc DRV.SYS.CV
rts
*--------------------------------------
DRV.SYS.FF ldx #23
.1 jsr DRV.SYS.ClrLineAtX
dex
bne .1
stz DRV.SYS.CH
lda #1
sta DRV.SYS.CV
rts
*--------------------------------------
DRV.SYS.CR jsr DRV.SYS.ClrEOL
stz DRV.SYS.CH
rts
*--------------------------------------
DRV.SYS.FS lda DRV.SYS.CH
cmp #79
bne .1
@ -352,14 +405,9 @@ DRV.SYS.FSOut lda DRV.SYS.CH
.1 inc DRV.SYS.CH
rts
*--------------------------------------
DRV.SYS.CR jsr DRV.SYS.ClrEOL
stz DRV.SYS.CH
rts
*--------------------------------------
DRV.SYS.LF ldx DRV.SYS.CV
cpx #23
beq DRV.SYS.Scroll
inc DRV.SYS.CV
DRV.SYS.ESC
clc
rts
*--------------------------------------
DRV.SYS.ClrEOL ldx DRV.SYS.CV
@ -431,18 +479,6 @@ DRV.SYS.ClrLineAtX
rts
*--------------------------------------
DRV.SYS.Home ldx #23
.1 jsr DRV.SYS.ClrLineAtX
dex
bne .1
stz DRV.SYS.CH
lda #1
sta DRV.SYS.CV
rts
*--------------------------------------
DRV.SYS.SetCharAtYX
cmp #$40
bcc .1
@ -479,10 +515,10 @@ DRV.SYS.SetBaseX
sta ZPDRV+1
rts
*--------------------------------------
DRV.SYS.DSTAT .DA #S.DSTAT.S.WRITE+S.DSTAT.S.READ+S.DSTAT.S.OPENED
DRV.SYS.DIB .DA #S.DIB.S.WRITE+S.DIB.S.READ+S.DIB.S.OPENED
.DA #0,#0,#0
>PSTR "A2osX SYS Screen"
.DA #S.DSTAT.T.CHAR
.DA #S.DIB.T.CHAR
.DA #0
.DA KVER
*--------------------------------------
@ -491,6 +527,8 @@ DRV.SYS.CV .BS 1
*--------------------------------------
DRV.SYS.BASEL .HS 00.80.00.80.00.80.00.80.28.A8.28.A8.28.A8.28.A8.50.D0.50.D0.50.D0.50.D0
DRV.SYS.BASEH .HS 08.08.09.09.0A.0A.0B.0B.08.08.09.09.0A.0A.0B.0B.08.08.09.09.0A.0A.0B.0B
DRV.SYS.CTRLCNT .EQ 7
DRV.SYS.CTRLS .HS 05080A0C0D151B
*--------------------------------------
DRV.STATUS.YA >STYA .2+1
@ -501,7 +539,7 @@ DRV.STATUS.YA >STYA .2+1
cmp #S.IOCTL.STATCODE.GETDIB
bne .9
ldx #15
ldx #S.DIB-1
.HS 2C bit abs
.1 ldx #3

View File

@ -850,7 +850,7 @@ DevMgrInit.SP ldy #$ff
.DA SP.DEV.STATUS
bcs .9
ldx SP.DEV.STATUS.DATA+S.DSTAT.S
ldx SP.DEV.STATUS.DATA+S.DIB.S
>LDYAI DRV.SmartPort
jsr DevMgrInit.AddBDev
@ -1082,7 +1082,7 @@ SP.DEV.STATUS.DEVID
.DA SP.DEV.STATUS.DATA
.DA S.IOCTL.STATCODE.GETDIB
SP.DEV.STATUS.DATA
.BS S.DSTAT
.BS S.DIB
*--------------------------------------
MAN
SAVE /A2OSX.SRC/SYS/KERNEL.S.INIT

View File

@ -100,7 +100,7 @@ K.Read jsr IO.SELECT
>PULLW K.S.IOCTL+S.IOCTL.BUFPTR
>PULLW K.S.IOCTL+S.IOCTL.BYTECNT
K.Read.I lda (pFD) #S.FD.T
IO.Read.I lda (pFD) #S.FD.T
tax
jmp (.1,x)
@ -146,7 +146,7 @@ K.Write jsr IO.SELECT
>PULLW K.S.IOCTL+S.IOCTL.BUFPTR
>PULLW K.S.IOCTL+S.IOCTL.BYTECNT
K.Write.I lda (pFD) #S.FD.T
IO.Write.I lda (pFD) #S.FD.T
tax
jmp (.1,x)
@ -225,25 +225,18 @@ IO.WRITE.FIFO ldy #S.FD.FIFO.S
*/--------------------------------------
* # IOCTL
* ## C
* `int ioctl(int fd, unsigned long request, void * param );`
* `int ioctl(int devid, int request, void * param );`
* ## ASM
* **In:**
* `PUSHWI param`
* `lda #request`
* `ldy fd`
* `PUSHBI request`
* `lda devid`
* `>SYSCALL IOCTL`
* **Out:**
* Y,A = ...
*\--------------------------------------
K.IOCTL sta .7+1 op
>PULLW pIOCTL
tya id
jsr K.GetDevByID
bcs K.IOCTL.9
>STYA pFD
K.IOCTL jsr IO.SELECT
bcs .9
ldy #S.FD.DEV.DRVPTR
lda (pFD),y
@ -252,10 +245,15 @@ K.IOCTL sta .7+1 op
lda (pFD),y
sta .8+2
.7 ldx #$ff SELF MODIFIED
>PULLA
tax request
>PULLYA param
.8 jmp $ffff SELF MODIFIED x = op
K.IOCTL.9 rts
.9 >RET 3
*/--------------------------------------
* # pipe
* ## C

View File

@ -191,7 +191,7 @@ K.IrqH.Switch inc IRQ.Tick
K.IrqH.DEV ldx #0
.1 lda FD.Table.F,x
and #S.DSTAT.S.IRQ
and #S.DIB.S.IRQ
beq .2
lda FD.Table.PTRLO,x

View File

@ -40,7 +40,7 @@ K.PutChar.X >LDYAI K.IOBuf
>STYA K.S.IOCTL+S.IOCTL.BUFPTR
stx K.S.IOCTL+S.IOCTL.BYTECNT
stz K.S.IOCTL+S.IOCTL.BYTECNT+1
jmp K.WRITE.I
jmp IO.Write.I
*/--------------------------------------
* # PutS
* Write Str to StdOut, appends '\r\n'
@ -98,7 +98,7 @@ K.FPutS.I jsr IO.SELECT
.2 sty K.S.IOCTL+S.IOCTL.BYTECNT
stx K.S.IOCTL+S.IOCTL.BYTECNT+1
jmp K.WRITE.I
jmp IO.Write.I
*/--------------------------------------
* # PrintF/SPrintF/FPrintF
* Prints C-Style String
@ -577,7 +577,7 @@ PrintF.COut phy
clc
rts
*--------------------------------------
PrintF.Flush jmp K.Write.I
PrintF.Flush jmp IO.Write.I
*/--------------------------------------
* # GetChar
* Get char from StdIn
@ -609,7 +609,7 @@ K.GetC jsr IO.SELECT
lda #1
sta K.S.IOCTL+S.IOCTL.BYTECNT
stz K.S.IOCTL+S.IOCTL.BYTECNT+1
jsr K.READ.I
jsr IO.READ.I
bcs .9
lda K.IOBuf
.9 rts

View File

@ -60,7 +60,7 @@ L.MSG.DEBUG.S3 .DA MSG.DEBUG.S3
.DA 0
*--------------------------------------
CS.INIT >LDYA L.LIBPAK
>SYSCALL LoadLib.YA
>SYSCALL LoadLib
bcs .9
sta hLIBPAK