diff --git a/.Floppies/A2OSX.BUILD.po b/.Floppies/A2OSX.BUILD.po index 7a89a39b..b40dc41d 100644 Binary files a/.Floppies/A2OSX.BUILD.po and b/.Floppies/A2OSX.BUILD.po differ diff --git a/.Floppies/ProDOSFX.BOOT.po b/.Floppies/ProDOSFX.BOOT.po index 1285da6a..278a03ae 100644 Binary files a/.Floppies/ProDOSFX.BOOT.po and b/.Floppies/ProDOSFX.BOOT.po differ diff --git a/BIN/FORMAT.S.txt b/BIN/FORMAT.S.txt index 4c62f8f4..6a01f77e 100644 --- a/BIN/FORMAT.S.txt +++ b/BIN/FORMAT.S.txt @@ -424,7 +424,7 @@ CS.RUN.LL >PUSHW L.MSG.LL bcs .9 >LDA.G DIB+S.DIB.T - cmp #S.DIB.T.DISKII + cmp #S.DIB.T.D2 beq CS.RUN.LL.DISKII >PUSHB hDevID diff --git a/BIN/KCONFIG.S.txt b/BIN/KCONFIG.S.txt index b007f087..25b1b2ec 100644 --- a/BIN/KCONFIG.S.txt +++ b/BIN/KCONFIG.S.txt @@ -358,9 +358,9 @@ CS.QUIT lda hFileBuf CS.END SLOTS .DA #0 .DA #A2osX.S.Z80 - .DA #A2osX.S.VXDRIVE - .DA #A2osX.S.ATCARD - .DA #A2osX.S.DII + .DA #A2osX.S.VXD + .DA #A2osX.S.ATK + .DA #A2osX.S.D2 .DA #A2osX.S.BLK .DA #A2osX.S.SP .DA #A2osX.S.COM diff --git a/BIN/LSDEV.S.txt b/BIN/LSDEV.S.txt index 4f09d8ab..bd0f42cb 100644 --- a/BIN/LSDEV.S.txt +++ b/BIN/LSDEV.S.txt @@ -280,7 +280,7 @@ FD.T.PIPE .AZ "PIPE" BLANK.DIB .DA #0 #S.DIB.S.BLOCK+S.DIB.S.WRITE+S.DIB.S.READ .BS 3 .PS "(No IDS String!)" - .DA #0 #S.DIB.T.PRODOS + .DA #0 .DA #0 .DA 0 K.VER *-------------------------------------- diff --git a/INC/A2osX.I.txt b/INC/A2osX.I.txt index 6b760362..cdc29dca 100644 --- a/INC/A2osX.I.txt +++ b/INC/A2osX.I.txt @@ -70,9 +70,9 @@ A2osX.F.CHROOT .EQ %10000000 ChRooting to /RAMx A2osX.F.PMODE .EQ %01000000 Pre-emptive Mode A2osX.S .EQ $BEF8 $BEF9->$BEFF, 7 slots A2osX.S.Z80 .EQ $80 -A2osX.S.VXDRIVE .EQ $81 -A2osX.S.ATCARD .EQ $82 -A2osX.S.DII .EQ $C0 +A2osX.S.VXD .EQ $81 +A2osX.S.ATK .EQ $82 +A2osX.S.D2 .EQ $C0 A2osX.S.BLK .EQ $C1 A2osX.S.SP .EQ $C2 A2osX.S.COM .EQ $E0 @@ -436,8 +436,8 @@ S.DIB.T.5.25 .EQ $0A 5-1/4" disk *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.D2 .EQ $10 +S.DIB.T.BLK .EQ $11 S.DIB.T.NIC .EQ $12 Network Interface Card S.DIB.T.XY .EQ $13 X,Y Pointing Device S.DIB.T.CHAR .EQ $14 @@ -486,8 +486,10 @@ S.FD.DEV.BUSPTR .EQ 4 word S.FD.DEV.DRVPTR .EQ 6 word S.FD.DEV.DCBPTR .EQ 8 word S.FD.DEV.BUFPTR .EQ 10 word +S.FD.DEV.TYPE .EQ 12 Byte +S.FD.DEV.SIZE .EQ 13 3 Bytes * -S.FD.DEV .EQ 12 +S.FD.DEV .EQ 16 *-------------------------------------- * S.FD.LNK *-------------------------------------- diff --git a/SYS/KERNEL.S.DRV.txt b/SYS/KERNEL.S.DRV.txt index 9d239fc4..fe2fcd87 100644 --- a/SYS/KERNEL.S.DRV.txt +++ b/SYS/KERNEL.S.DRV.txt @@ -1,135 +1,106 @@ NEW AUTO 3,1 *-------------------------------------- -* DRV.DiskII +* DRV.Disk][ * X = IOCTL * Y,A = PTR to S.IOCTL *-------------------------------------- -DRV.DiskII cld - cpx #IOCTL.FORMAT - bcs DRV.BadCall - - >STYA pIOCTL - jmp (.1,x) - -.1 .DA DRV.DiskII.S - .DA DRV.BLK READ - .DA DRV.BLK WRITE -*-------------------------------------- -DRV.DiskII.S >LDYAI DRV.DiskII.DIB - jmp DRV.STATUS.YA -*-------------------------------------- -DRV.DiskII.DIB .DA #S.DIB.S.BLOCK+S.DIB.S.WRITE+S.DIB.S.READ - .DA 280 - .DA #0 - .PS "Disk ][ 5.25" - .BS 4 - .DA #S.DIB.T.DISKII - .DA #0 - .DA K.VER -*-------------------------------------- -* DRV.RAM -* X = IOCTL -* Y,A = PTR to S.IOCTL -*-------------------------------------- -DRV.RAM cld - cpx #IOCTL.CONTROL - bcs DRV.BadCall - - >STYA pIOCTL - jmp (.1,x) - -.1 .DA DRV.RAM.S - .DA DRV.BLK READ - .DA DRV.BLK WRITE - .DA DRV.BLK FORMAT - -DRV.BadCall jmp A2osX.BadCall -*-------------------------------------- -DRV.RAM.S jsr DRV.Blk +DRV.D2 cpx #IOCTL.FORMAT + .HS 2C BIT ABS +DRV.BLK cpx #IOCTL.CONTROL bcs .9 - stx DRV.RAM.DIB+S.DIB.SIZE - sty DRV.RAM.DIB+S.DIB.SIZE+1 - >LDYAI DRV.RAM.DIB - jmp DRV.STATUS.YA - -.9 rts -*-------------------------------------- -DRV.RAM.DIB .DA #S.DIB.S.BLOCK+S.DIB.S.WRITE+S.DIB.S.READ - .BS 3 - .PS "ProDOS /RAM Disk" - .DA #S.DIB.T.RAM - .DA #0 - .DA K.VER -*-------------------------------------- -* DRV.BlkDev -* X = IOCTL -* Y,A = PTR to S.IOCTL -*-------------------------------------- -DRV.BlkDev cld - cpx #IOCTL.CONTROL - bcs DRV.BadCall - >STYA pIOCTL jmp (.1,x) -.1 .DA DRV.BlkDev.S - .DA DRV.BLK READ - .DA DRV.BLK WRITE - .DA DRV.BLK FORMAT +.1 .DA DRV.BLK.S + .DA DRV.GBLK READ + .DA DRV.GBLK WRITE + .DA DRV.GBLK FORMAT + +.9 lda #MLI.E.BADCALL +* sec +DRV.RTS rts *-------------------------------------- -DRV.RSP cld - cpx #IOCTL.CONTROL - bcs DRV.BadCall +DRV.BLK.S ldy #S.FD.DEV.SIZE + lda (pFD),y + tax + + iny + lda (pFD),y + tay + bne .8 + + txa + bne .8 - >STYA pIOCTL - jmp (.1,x) +* ldx #IOCTL.STATUS -.1 .DA DRV.RSP.S - .DA DRV.BLK READ - .DA DRV.BLK WRITE - .DA DRV.BLK FORMAT -*-------------------------------------- -DRV.BlkDev.S jsr DRV.Blk - bcs .9 + jsr DRV.GBLK + bcs DRV.RTS - stx DRV.BlkDev.DIB+S.DIB.SIZE - sty DRV.BlkDev.DIB+S.DIB.SIZE+1 +.8 stx DRV.BLK.DIB+S.DIB.SIZE + sty DRV.BLK.DIB+S.DIB.SIZE+1 - >LDYAI DRV.BlkDev.DIB + ldy #S.FD.DEV.TYPE + lda (pFD),y + tay + + lda DRV.IDS,y + tax + lda DRV.IDS+1,y + sta DRV.BLK.DIB+S.DIB.T + + ldy #0 + +.1 lda DRV.D2.IDS,x + beq .2 + + sta DRV.BLK.DIB+S.DIB.IDS+1,y + inx + iny + bra .1 + +.2 sty DRV.BLK.DIB+S.DIB.IDS + + lda #C.SPACE + +.3 cpy #16 + beq .4 + + sta DRV.BLK.DIB+S.DIB.IDS+1,y + iny + bra .2 + +.4 >LDYAI DRV.BLK.DIB jmp DRV.STATUS.YA -.9 rts *-------------------------------------- -DRV.BlkDev.DIB .DA #S.DIB.S.BLOCK+S.DIB.S.WRITE+S.DIB.S.READ +DRV.BLK.DIB .DA #S.DIB.S.BLOCK+S.DIB.S.WRITE+S.DIB.S.READ .BS 3 - .PS "ProDOS Block Dev" - .DA #S.DIB.T.PRODOS + .BS 17 IDString + .DA #S.DIB.T.BLK .DA #0 .DA K.VER *-------------------------------------- -DRV.RSP.S jsr DRV.Blk - bcs .9 - - stx DRV.RSP.DIB+S.DIB.SIZE - sty DRV.RSP.DIB+S.DIB.SIZE+1 - - >LDYAI DRV.RSP.DIB - jmp DRV.STATUS.YA - -.9 rts +DRV.IDS .DA #0,#S.DIB.T.D2 + .DA #DRV.RAM.IDS-DRV.D2.IDS,#S.DIB.T.BLK + .DA #DRV.USER.IDS-DRV.D2.IDS,#S.DIB.T.BLK + .DA #DRV.BLK.IDS-DRV.D2.IDS,#S.DIB.T.BLK + .DA #DRV.RBLK.IDS-DRV.D2.IDS,#S.DIB.T.BLK + .DA #0,#0 Smartport + .DA #DRV.RSP.IDS-DRV.D2.IDS,#S.DIB.T.BLK *-------------------------------------- -DRV.RSP.DIB .DA #S.DIB.S.BLOCK+S.DIB.S.WRITE+S.DIB.S.READ - .BS 3 - .PS "Remapped SP Dev " - .DA #S.DIB.T.PRODOS - .DA #0 - .DA K.VER +DRV.D2.IDS .CZ "Disk ][ 5.25" +DRV.RAM.IDS .CZ "ProDOS /RAM Disk" +DRV.USER.IDS .CZ "User Block Dev" +DRV.BLK.IDS .CZ "ProDOS Block Dev" +DRV.RBLK.IDS .CZ "Remapped BLK Dev" +DRV.RSP.IDS .CZ "Remapped SP Dev" *-------------------------------------- * IOCTL to BLK protocol converter * in : pIOCTL *-------------------------------------- -DRV.BLK txa +DRV.GBLK txa lsr sta DRV.BLK.P CMD @@ -183,8 +154,7 @@ DRV.BLK.P .BS 6 *-------------------------------------- * Smartport Driver *-------------------------------------- -DRV.SP cld - >STYA pIOCTL +DRV.SP >STYA pIOCTL >STYA .3 smartport Params txa @@ -221,31 +191,22 @@ DRV.SP.Cnt .HS 03030301030101010404 * - OPEN,WRITE,CLOSE always succeed. * - READ returns EOF. *-------------------------------------- -DRV.NULL cld - >STYA pIOCTL +DRV.NULL >STYA pIOCTL txa beq DRV.NULL.S - jmp (.1-12,x) -*-------------------------------------- -.1 -* .DA DRV.NULL.STATUS -* .DA A2osX.BADCALL READBLOCK -* .DA A2osX.BADCALL WRITEBLOCK -* .DA A2osX.BADCALL FORMAT -* .DA A2osX.BADCALL CONTROL -* .DA A2osX.BADCALL INIT - .DA DRV.CLCRTS OPEN - .DA DRV.CLCRTS CLOSE - .DA DRV.NULL.R - .DA DRV.CLCRTS WRITE -*-------------------------------------- -DRV.NULL.DIB .DA #S.DIB.S.WRITE+S.DIB.S.READ+S.DIB.S.OPENED - .DA #0,#0,#0 - .PS "NULL Device" - .BS 5 - .DA #S.DIB.T.CHAR - .DA #0 - .DA K.VER + + cmp #IOCTL.READ + beq DRV.NULL.R + + cmp #IOCTL.OPEN + bcc .9 + + cmp #IOCTL.IRQ + bcs .9 + + rts + +.9 jmp A2osX.BADCALL *-------------------------------------- DRV.NULL.S >LDYAI DRV.NULL.DIB *-------------------------------------- @@ -297,10 +258,18 @@ DRV.NULL.R ldx #C.EOF lda (pIOCTL),y sta .1+2 .1 stx $ffff SELF MODIFIED -*-------------------------------------- -DRV.CLCRTS clc + + clc rts *-------------------------------------- +DRV.NULL.DIB .DA #S.DIB.S.WRITE+S.DIB.S.READ+S.DIB.S.OPENED + .DA #0,#0,#0 + .PS "NULL Device" + .BS 5 + .DA #S.DIB.T.CHAR + .DA #0 + .DA K.VER +*-------------------------------------- MAN SAVE usr/src/sys/kernel.s.drv LOAD usr/src/sys/kernel.s diff --git a/SYS/KERNEL.S.INIT.txt b/SYS/KERNEL.S.INIT.txt index 2cd02e3f..fbc77793 100644 --- a/SYS/KERNEL.S.INIT.txt +++ b/SYS/KERNEL.S.INIT.txt @@ -474,7 +474,7 @@ CPU.Init >PUSHWI MSG.CPU cmp #A2osX.HWType.IIc beq CPU.Init2c *-------------------------------------- -* VBL = 20.000us 50hz, 16.666 60hz +* VBL = 20.000us 50hz, 16.666 60hz *-------------------------------------- ldx A2osX.HZ @@ -502,7 +502,7 @@ CPU.Init >PUSHWI MSG.CPU eor VBL bpl .3 - + lda VBL bmi .3 @@ -524,7 +524,7 @@ CPU.Init2c lda RDIOUDIS bit IO.IIC.CLRVBLIRQ clear //c IRQ .3 ldx A2osX.HZ - + .4 pha (3) pla (4) pha (3) @@ -706,14 +706,21 @@ DevMgrInit >LDYAI MSG.DEV cmp #$FF /RAM is always $FF00 bne .2 - jsr DevMgr.RAM + ldx #2 + jsr DevMgr.AddBDev bra .8 keep slot free .2 cmp #$D0 Disk II Driver is $D000 bne .3 - jsr DevMgr.DII - lda #A2osX.S.DII + lda #280 + sta FD.BDEV+S.FD.DEV.SIZE + lda /280 + sta FD.BDEV+S.FD.DEV.SIZE+1 + + ldx #0 + jsr DevMgr.AddBDev + lda #A2osX.S.D2 bra .7 Go mark slot as USED .3 bcs .53 > $D0, Some SP remapped DRV @@ -721,14 +728,15 @@ DevMgrInit >LDYAI MSG.DEV cmp #$C0 bcs .4 $C0 .. $CF, in slot ROM - jsr DevMgr.USR Outside ROM/LC space, User loaded BLK dev + ldx #4 + jsr DevMgr.AddBDev Outside ROM/LC space, User loaded BLK dev bra .8 keep slot free -.4 ldx #SmartPort.SIG-SmartPort.OFS-1 +.4 ldx #BDEV.SIG-BDEV.OFS-1 -.5 ldy SmartPort.OFS,x Check if there is a smartport firmware +.5 ldy BDEV.OFS,x Check if there is a smartport firmware lda (ZPPtr1),y - cmp SmartPort.SIG,x + cmp BDEV.SIG,x bne .8 not a Disk Controller... dex @@ -738,14 +746,39 @@ DevMgrInit >LDYAI MSG.DEV lda (ZPPtr1),y bne .6 $Cn07=00 : SmartPort - jsr DevMgr.SP + ldy #$ff + lda (ZPPtr1),y + clc + adc #3 Compute smartport entry point + sta FD.BDEV+S.FD.DEV.BUSPTR + + ldx #10 + jsr DevMgr.AddBDev lda #A2osX.S.SP bra .7 -.53 jsr DevMgr.RSP Remapped SP devices.... +.53 ldx #12 + jsr DevMgr.AddBDev Remapped SP devices.... bra .8 don't mark slot as busy -.6 jsr DevMgr.BLK +.6 ldy #$FC Size in Blk + lda (ZPPtr1),y + sta FD.BDEV+S.FD.DEV.SIZE + iny + lda (ZPPtr1),y + sta FD.BDEV+S.FD.DEV.SIZE+1 + + lda FD.BDEV+S.FD.DEV.BUSID 00000SSS + eor FD.BDEV+S.FD.DEV.BUSPTR+1 Cn + cmp #$C0 + beq .70 + + ldx #8 + jsr DevMgr.AddBDev Remapped BLK devices.... + bra .8 don't mark slot as busy + +.70 ldx #6 + jsr DevMgr.AddBDev lda #A2osX.S.BLK .7 ldx FD.BDEV+S.FD.DEV.BUSID @@ -759,36 +792,17 @@ DevMgrInit >LDYAI MSG.DEV .80 clc rts *-------------------------------------- -DevMgr.RAM ldx #0 - .HS 2C BIT ABS -*-------------------------------------- -DevMgr.DII ldx #2 - .HS 2C BIT ABS -*-------------------------------------- -DevMgr.USR ldx #4 - .HS 2C BIT ABS -*-------------------------------------- -DevMgr.BLK ldx #6 - .HS 2C BIT ABS -*-------------------------------------- -DevMgr.RSP ldx #10 - bra DevMgr.AddBDev -*-------------------------------------- -DevMgr.SP ldy #$ff - lda (ZPPtr1),y - clc - adc #3 Compute smartport entry point - sta FD.BDEV+S.FD.DEV.BUSPTR +DevMgr.AddBDev stx FD.BDEV+S.FD.DEV.TYPE - ldx #8 -*-------------------------------------- -DevMgr.AddBDev >LDYA DRV.BLKDEVX,x - >STYA FD.BDEV+S.FD.DEV.DRVPTR + lda DRV.BDEVs,x + sta FD.BDEV+S.FD.DEV.DRVPTR + lda DRV.BDEVs+1,x + sta FD.BDEV+S.FD.DEV.DRVPTR+1 - >PUSHWI MSG.BLKDEV + >PUSHWI MSG.BDEV >PUSHWI FD.BDEV.NAME >PUSHW FD.BDEV+S.FD.DEV.BUSPTR - >PUSHW MSG.BLKDEV.TBL,x + >PUSHW MSG.BDEVs,x >PUSHBI 6 >SYSCALL2 printf @@ -829,7 +843,7 @@ DevMgr.VXD >LDYAI VSD.PATCH bit RRAMWRAMBNK1 bit RRAMWRAMBNK1 - lda #A2osX.S.VXDRIVE + lda #A2osX.S.VXD sta A2osX.S,x plp @@ -899,22 +913,22 @@ IrqMgrInit >LDYAI MSG.IRQ pea $0000 pea $0000 >TKCALL GetVector - bcs * +* bcs * pla sta IRQ.GSVect+2 - + pla sta IRQ.GSVect - + pea $000C Vertical blanking interrupt handler pea $0000 pea CORE.IRQGS >TKCALL SetVector - bcs * - +* bcs * + pea $0002 Enable vertical blanking interrupts >TKCALL IntSource - bcs * +* bcs * sep #$30 short M,X sec @@ -1276,8 +1290,8 @@ Mouse.SIG .HS 38180120D6 TClock.OFS .HS 00020406 TClock.SIG .HS 08285870 *-------------------------------------- -SmartPort.OFS .HS 010305 -SmartPort.SIG .HS 200003 +BDEV.OFS .HS 010305 +BDEV.SIG .HS 200003 *-------------------------------------- MSG.Init2 .CZ "A2osX[Stage2]:Init\rRelocating Kernel...\r" MSG.KCREAD .CZ "Reading Kernel Config File..." @@ -1289,25 +1303,28 @@ MSG.Init2.OK .CZ "A2osX[Stage2]:Complete." *-------------------------------------- MSG.Init3 .CZ "A2osX[Stage3]:Init *** Press Ctrl-R for entering ROOT Mode ***\r\n" MSG.DEV .AZ "Device Manager..." -MSG.BLKDEV .CZ " Adding Device: /dev/%s, Addr:%H, Type: %s\r\n" -MSG.BLKDEV.TBL .DA MSG.BLKDEV.RAM - .DA MSG.BLKDEV.DII - .DA MSG.BLKDEV.USR - .DA MSG.BLKDEV.BLK - .DA MSG.BLKDEV.SP - .DA MSG.BLKDEV.RSP -MSG.BLKDEV.RAM .AZ "/RAM Disk" -MSG.BLKDEV.DII .AZ "Disk ][" -MSG.BLKDEV.USR .AZ "User" -MSG.BLKDEV.BLK .AZ "Generic Block" -MSG.BLKDEV.SP .AZ "SmartPort" -MSG.BLKDEV.RSP .AZ "SmartPort (Remapped)" -DRV.BLKDEVX .DA DRV.RAM - .DA DRV.DiskII - .DA DRV.BlkDev - .DA DRV.BlkDev +MSG.BDEV .CZ " Adding Device: /dev/%s, Addr:%H, Type: %s\r\n" +MSG.BDEVs .DA MSG.BDEV.D2 + .DA MSG.BDEV.RAM + .DA MSG.BDEV.USR + .DA MSG.BDEV.BLK + .DA MSG.BDEV.RBLK + .DA MSG.BDEV.SP + .DA MSG.BDEV.RSP +MSG.BDEV.D2 .AZ "Disk ][" +MSG.BDEV.RAM .AZ "/RAM Disk" +MSG.BDEV.USR .AZ "User Block" +MSG.BDEV.BLK .AZ "Generic Block" +MSG.BDEV.RBLK .AZ "Generic Block (Remapped)" +MSG.BDEV.SP .AZ "SmartPort" +MSG.BDEV.RSP .AZ "SmartPort (Remapped)" +DRV.BDEVs .DA DRV.BLK D2 + .DA DRV.BLK RAM + .DA DRV.BLK USR + .DA DRV.BLK + .DA DRV.BLK RBLK .DA DRV.SP - .DA DRV.RSP + .DA DRV.BLK RSP *-------------------------------------- MSG.IRQ .AZ "Interrupt Manager..." MSG.IRQGS .AZ " Apple IIgs VBL IRQ Activated." @@ -1375,6 +1392,7 @@ FD.NULL .DA #S.FD.T.CDEV .DA DRV.NULL .DA 0 DCBPTR .DA 0 BUFPTR + .BS 4 *-------------------------------------- FD.NULL.NAME .AZ "null" NAME *-------------------------------------- @@ -1386,6 +1404,7 @@ FD.TTY .DA #S.FD.T.CDEV .DA DRV.TERM .BS 2 DCBPTR .BS 2 BUFPTR + .BS 4 *-------------------------------------- FD.CONSOLE.NAME .AZ "console" FD.TTY.NAME .AZ "tty0" @@ -1398,6 +1417,8 @@ FD.BDEV .DA #S.FD.T.BDEV .BS 2 DRVPTR .DA 0 DCBPTR .DA 0 BUFPTR + .DA 0 SIZE + .DA 0 *-------------------------------------- FD.BDEV.NAME .AZ "s1d1" *-------------------------------------- diff --git a/SYS/KERNEL.S.TERM.txt b/SYS/KERNEL.S.TERM.txt index 9ddd4030..5f497c22 100644 --- a/SYS/KERNEL.S.TERM.txt +++ b/SYS/KERNEL.S.TERM.txt @@ -1,8 +1,7 @@ NEW AUTO 3,1 *-------------------------------------- -DRV.TERM cld - jmp (.1,x) +DRV.TERM jmp (.1,x) .1 .DA TERM.STATUS .DA A2osX.BADCALL