changeset 52:3f0f7b4e5111

Added Cloud-9 FlashPak driver (untested, no hardware yet)
author boisy
date Sat, 20 Apr 2002 15:04:53 +0000
parents 09767531e395
children ccdb91b25aa5
files 3rdparty/drivers/flashpak/defsfile 3rdparty/drivers/flashpak/f0.asm 3rdparty/drivers/flashpak/flashpak.asm 3rdparty/drivers/flashpak/makefile
diffstat 4 files changed, 254 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /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
--- /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   
--- /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   <PD.DRV,y
+         leay  DRVBEG,u
+         ldb   #DRVMEM
+         mul   
+         leay  d,y
+         ldb   #DD.SIZ-1
+LSN0Loop lda   b,x
+         sta   b,y
+         decb  
+         bne   LSN0Loop
+         rts   
+
+
+* GetStat
+*
+* Entry:
+*    A  = function code
+*    Y  = address of path descriptor
+*    U  = address of device memory area
+*
+* Exit:
+*    CC = carry set on error
+*    B  = error code
+*
+GetStat  comb  
+         ldb   #E$UnkSvc
+         rts   
+
+* SetStat
+*
+* Entry:
+*    A  = function code
+*    Y  = address of path descriptor
+*    U  = address of device memory area
+*
+* Exit:
+*    CC = carry set on error
+*    B  = error code
+*
+SetStat        
+
+* Term
+*
+* Entry:
+*    U  = address of device memory area
+*
+* Exit:
+*    CC = carry set on error
+*    B  = error code
+*
+Term     clrb  
+         rts   
+
+         emod  
+eom      equ   *
+         end   
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/3rdparty/drivers/flashpak/makefile	Sat Apr 20 15:04:53 2002 +0000
@@ -0,0 +1,21 @@
+include ../../../Makefile.rules
+
+L1 = $(AFLAGS) -aLevel=1
+L2 = $(AFLAGS) -aLevel=2
+
+DEPENDS		= ./Makefile
+DRVRS		= flashpak.dr
+DESCS           = f0_l1.dd f0_l2.dd
+ALLOBJS		= $(DRVRS) $(DESCS)
+
+all:	$(ALLOBJS) $(DEPENDS)
+
+f0_l1.dd: f0.asm
+	$(AS) $(ASOUT)$@ $< $(L1)
+
+f0_l2.dd: f0.asm
+	$(AS) $(ASOUT)$@ $< $(L2)
+
+clean:
+	$(RM) $(ALLOBJS)
+