# HG changeset patch # User boisy # Date 1041806708 0 # Node ID 339845ea35077ad49e39a39f0ab15373dad24153 # Parent bd7c8348adecf7df2e7f9aab25cbf34cb7e5ea64 Backported rammer.asm from NitrOS-9 to OS-9 Level Two diff -r bd7c8348adec -r 339845ea3507 level2/modules/makefile --- a/level2/modules/makefile Sun Jan 05 21:48:33 2003 +0000 +++ b/level2/modules/makefile Sun Jan 05 22:45:08 2003 +0000 @@ -22,7 +22,7 @@ clock_smart clock_harris clock_tc3 clock_soft FMGRS = scf.mn rbf.mn pipeman.mn pipeman_named.mn DRIVERS = cc3disk.dr cc3hdisk.dr cc3io.dr modpak.dr \ - vrn.dr piper.dr printer.dr sio.dr ram.dr sspak.dr \ + vrn.dr piper.dr printer.dr sio.dr rammer.dr sspak.dr \ sacia.dr dacia.dr IOSUBS = windint.io vdgint.io keydrv joydrv_joy \ joydrv_6551L joydrv_6552L joydrv_6551M joydrv_6552M snddrv @@ -107,29 +107,29 @@ $(AS) $< $(ASOUT)$@ $(AFLAGS) $(DSDD80) -aDNum=2 # RAM Disk descriptors -r0_8k.dd: rx.asm - $(AS) $< $(ASOUT)$@ $(AFLAGS) -aSectors=32 +r0_8k.dd: r0.asm + $(AS) $< $(ASOUT)$@ $(AFLAGS) -aRAMSize=8 -ddr0_8k.dd: rx.asm - $(AS) $< $(ASOUT)$@ $(AFLAGS) -aSectors=32 -aDD=1 +ddr0_8k.dd: r0.asm + $(AS) $< $(ASOUT)$@ $(AFLAGS) -aRAMSize=8 -aDD=1 -r0_96k.dd: rx.asm - $(AS) $< $(ASOUT)$@ $(AFLAGS) -aSectors=384 +r0_96k.dd: r0.asm + $(AS) $< $(ASOUT)$@ $(AFLAGS) -aRAMSize=96 -ddr0_96k.dd: rx.asm - $(AS) $< $(ASOUT)$@ $(AFLAGS) -aSectors=384 -aDD=1 +ddr0_96k.dd: r0.asm + $(AS) $< $(ASOUT)$@ $(AFLAGS) -aRAMSize=96 -aDD=1 -r0_128k.dd: rx.asm - $(AS) $< $(ASOUT)$@ $(AFLAGS) -aSectors=512 +r0_128k.dd: r0.asm + $(AS) $< $(ASOUT)$@ $(AFLAGS) -aRAMSize=128 -ddr0_128k.dd: rx.asm - $(AS) $< $(ASOUT)$@ $(AFLAGS) -aSectors=512 -aDD=1 +ddr0_128k.dd: r0.asm + $(AS) $< $(ASOUT)$@ $(AFLAGS) -aRAMSize=128 -aDD=1 -r0_192k.dd: rx.asm - $(AS) $< $(ASOUT)$@ $(AFLAGS) -aSectors=768 +r0_192k.dd: r0.asm + $(AS) $< $(ASOUT)$@ $(AFLAGS) -aRAMSize=192 -ddr0_192k.dd: rx.asm - $(AS) $< $(ASOUT)$@ $(AFLAGS) -aSectors=768 -aDD=1 +ddr0_192k.dd: r0.asm + $(AS) $< $(ASOUT)$@ $(AFLAGS) -aRAMSize=192 -aDD=1 cc3go_rom: cc3go.asm $(AS) -aROM=1 $(AFLAGS) $< $(ASOUT)$@ diff -r bd7c8348adec -r 339845ea3507 level2/modules/r0.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/level2/modules/r0.asm Sun Jan 05 22:45:08 2003 +0000 @@ -0,0 +1,54 @@ +******************************************************************** +* R0 - RAMMER Device Descriptor +* +* $Id$ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* NitrOS-9 2.00 distribution + + nam R0 + ttl RAMMER Device Descriptor + + ifp1 + use defsfile + endc + +tylg set Devic+Objct +atrv set ReEnt+rev +rev set $01 + +RAMSize set 128 +SAS set 4 + + mod eom,name,tylg,atrv,mgrnam,drvnam + + fcb DIR.+SHARE.+PREAD.+PWRIT.+PEXEC.+READ.+WRITE.+EXEC. mode byte + fcb HW.Page extended controller address + fdb $FFE0 physical controller address + fcb initsize-*-1 initilization table size + fcb DT.RBF device type:0=scf,1=rbf,2=pipe,3=scf + fcb $00 drive number + fcb $00 step rate + fcb $20 drive device type + fcb $01 media density:0=single,1=double + fdb RAMSize + fcb $01 number of sides + fcb $01 verify disk writes:0=on + fdb 4 # of sectors per track + fdb 4 # of sectors per track (track 0) + fcb $01 sector interleave factor + fcb SAS minimum size of sector allocation +initsize equ * + + IFNE DD +name fcs /DD/ + ELSE +name fcs /R0/ + ENDC +mgrnam fcs /RBF/ +drvnam fcs /Rammer/ + + emod +eom equ * + end diff -r bd7c8348adec -r 339845ea3507 level2/modules/rammer.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/level2/modules/rammer.asm Sun Jan 05 22:45:08 2003 +0000 @@ -0,0 +1,292 @@ +******************************************************************** +* Rammer - OS-9 Level Two RAM Disk +* +* $Id$ +* +* Alan DeKok's version of RAMMER - Based on original Keving Darling version +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 4 Original Kevin Darling Version +* 5 Several changes by L. Curtis Boyle LCB 00/03/14 +* 1) Allowed driver to go past 400K 00/05/09 +* 2) Attempted some fixes for handling /MD, so +* that setting vfy=0 on /R0 would not +* completely crash the system. +* 3) Fixed some error reporting bugs that would +* crash the system +* 4) Moved entry table to between READ/WRITE to +* allow short branches to both +* +* NOTE: For some reason, when DEINIZing /r0, the INIT routine gets called... +* but it still deallocates memory! + +* Following CAN be set higher, but will take another page of system RAM then. +* 200 will allow maximum of 1,638,400 byte RAM drive. +MAXBLOCK set 201 Maximum # of MMU blocks allowed in RAM drive + + nam Rammer + ttl OS-9 Level Two RAM Disk + + ifp1 + use defsfile + use rbfdefs + endc + +tylg set Drivr+Objct +atrv set ReEnt+rev +rev set $02 +edition set 5 + + mod eom,name,tylg,atrv,start,size + +* Device mem stuff - can make MMUTable bigger, but will take 2 pages of system +* RAM then for device memory +u0000 rmb DRVBEG+DRVMEM Reserve room for 1 entry drive table +MDFlag rmb 1 0=R0 descriptor, <>0=MD descriptor +numofBlk rmb 1 # of MMU blocks allocated for RAM drive +MMUTable rmb MAXBLOCK Table of MMU Block #'s being used. +size equ . + + fcb DIR.+SHARE.+PREAD.+PWRIT.+PEXEC.+READ.+WRITE.+EXEC. + +name fcs /Rammer/ + fcb edition + +* Terminate routine - deallocates RAM +L0024 lda $FFA0 Map in RAM drive block into block #0 + IFNE H6309 + ldw #$0100 256 byte transfer + tfm x+,y+ Copy between the two buffers + ELSE + clrb +WriteLp lda ,x+ + sta ,y+ + decb + bne WriteLp + ENDC + stb >$FFA0 Remap in system block 0 + andcc #^(IntMasks+Carry) Turn IRQ's back on & no error + rts + +* Subroutine to calculate MMU block # and offset based on sector # requested +* Entry: Y=path dsc. ptr +* U=device mem ptr +* B:X=LSN to calculate for +* Exit: A=MMU block # we need to map in +* X=offset within MMU block to get sector from (always <8K) +* Y=Sector buffer ptr for RBF +* MDFlag,u=0 if NOT MD, else MD +L00C8 clr MDFlag,u Flag that we are on "real" RAM Drive + IFNE H6309 + ldw PD.DEV,y Get our Device table entry ptr + ldw V$DESC,w Get device descriptor ptr + lda M$Opt,w Get size of options table + ELSE + pshs x + ldx PD.DEV,y Get our Device table entry ptr + ldx V$DESC,x Get device descriptor ptr + lda M$Opt,x Get size of options table + puls x + ENDC + deca + bne L00DB Not MD, skip ahead + inc MDFlag,u Flag we are on MD + sta 0, exit with Sector error +L00DE pshs x Preserve LSW of sector # + ldd ,s Load it again into D + tst MDFlag,u We on MD? + bne L00EE Yes, skip ahead + leax DRVBEG,u Point to drive table + cmpd DD.TOT+1,x LSW of sector compared to table's # of sectors + bhs L010E Sector # too large, exit with error +L00EE equ * + IFNE H6309 + rold A=MMU block offset in RAM drive image + rold + rold + ELSE + rolb + rola + rolb + rola + rolb + rola + ENDC + tst MDFlag,u We on /MD? + bne L0100 Yup, skip calculating MMU stuff + leax