# HG changeset patch # User boisy # Date 1019315093 0 # Node ID 3f0f7b4e51119bf6beb9b08578896e52d31bead8 # Parent 09767531e39581d22d1a5ae6c90710baa8c40d0b Added Cloud-9 FlashPak driver (untested, no hardware yet) diff -r 09767531e395 -r 3f0f7b4e5111 3rdparty/drivers/flashpak/defsfile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/3rdparty/drivers/flashpak/defsfile Sat Apr 20 15:04:53 2002 +0000 @@ -0,0 +1,7 @@ + use os9defs + use rbfdefs + ifeq Level-1 + use systype.l1 + else + use systype.l2 + endc diff -r 09767531e395 -r 3f0f7b4e5111 3rdparty/drivers/flashpak/f0.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/3rdparty/drivers/flashpak/f0.asm Sat Apr 20 15:04:53 2002 +0000 @@ -0,0 +1,38 @@ + nam f0 + ttl Cloud-9 Flash Pak descriptor + + ifp1 + use defsfile + endc + +tylg set Devic+Objct +atrv set ReEnt+rev +rev set $02 + + mod eom,name,tylg,atrv,mgrnam,drvnam + + fcb DIR.!ISIZ.!SHARE.!PEXEC.!PWRIT.!PREAD.!EXEC.!UPDAT. mode byte + fcb HW.Page extended controller address + fdb $FF5C physical controller address + fcb initsize-*-1 initilization table size + fcb DT.RBF device type:0=scf,1=rbf,2=pipe,3=scf + fcb 0 drive number + fcb 0 step rate + fcb TYP.NSF drive device type + fcb DNS.MFM media density:0=single,1=double + fdb 32 number of cylinders (tracks) + fcb 1 number of sides + fcb 1 verify disk writes:0=on + fdb 64 # of sectors per track + fdb 64 # of sectors per track (track 0) + fcb 1 sector interleave factor + fcb 1 minimum size of sector allocation + +initsize equ * +name fcs /f0/ +mgrnam fcs /RBF/ +drvnam fcs /FlashPak/ + + emod +eom equ * + end diff -r 09767531e395 -r 3f0f7b4e5111 3rdparty/drivers/flashpak/flashpak.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/3rdparty/drivers/flashpak/flashpak.asm Sat Apr 20 15:04:53 2002 +0000 @@ -0,0 +1,188 @@ +******************************************************************** +* FlashPak - Cloud-9 Flash Pak device driver +* +* $Id$ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 1 Original version BGP 02/04/15 + + nam FlashPak + ttl Cloud-9 Flash Pak device driver + + ifp1 + use defsfile + endc + +tylg set Drivr+Objct +atrv set ReEnt+rev +rev set $01 +edition set 1 + +MSB set 0 +LSB set 1 +DATA set 2 + + mod eom,name,tylg,atrv,start,size + +* RBF Data Area + rmb 129 + +* Free for driver use +size equ . + +name fcs /FlashPak/ + fcb edition + +start lbra Init + lbra Read + lbra Write + lbra GetStat + lbra SetStat + lbra Term + +* Init +* +* Entry: +* Y = address of device descriptor +* U = address of device memory area +* +* Exit: +* CC = carry set on error +* B = error code +* +Init ldd #($FF*256)+1 + stb V.NDRV,u + leax DRVBEG,u +* For each B, compute total sectors... +Init010 sta V.TRAK,x + pshs b,a + lda IT.CYL+1,y + ldb IT.SCT+1,y + mul + std DD.TOT+1,x + puls b,a + leax DRVMEM,x + decb + bne Init010 + rts + +* Write +* +* Entry: +* B = MSB of the disk's LSN +* X = LSB of the disk's LSN +* Y = address of path descriptor +* U = address of device memory area +* +* Exit: +* CC = carry set on error +* B = error code +* +Write leas -1,s make room on the stack + ldy V.PORT,u + tfr x,d + sta MSB,y + stb LSB,y + ldx PD.BUF,y load X with address of path buffer + clrb +WritLoop lda ,x+ + sta DATA,y + sta ,s +WritVfy lda DATA,y verify loop is here + cmpa ,s + bne WritVfy + incb + bne WritLoop + leas 1,s restore stack + rts + +* Read +* +* Entry: +* B = MSB of the disk's LSN +* X = LSB of the disk's LSN +* Y = address of path descriptor +* U = address of device memory area +* +* Exit: +* CC = carry set on error +* B = error code +* +Read cmpx #$0000 + beq ReadLSN0 + +ReadSect ldy V.PORT,u + tfr x,d + sta MSB,y + stb LSB,y + ldx PD.BUF,y load X with address of path buffer + clrb +ReadLoop lda DATA,y + sta ,x+ + incb + bne ReadLoop + rts + + +* Read LSN0 into our path descriptor +ReadLSN0 pshs y + bsr ReadSect + puls y + ldx PD.BUF,y + lda