[Coco] OS9Gen patch for CoCoSDC and other mass storage controllers

Barry Nelson barry.nelson at amobiledevice.com
Sun Oct 25 11:31:56 EDT 2015


I am currently in the process of testing this patch to OS9Gen, which creates a -l option that should allow it to work properly with the CoCoSDC and some other mass storage controllers. Comments are welcome and appreciated. (Note: This patch has not been properly tested yet, I am posting this so I can get comments on the idea and the code, attempt to use this at your own risk.)

--- os9gen.asm	2015-10-16 16:43:00.000000000 -0400
+++ os9gen.asm	2015-10-25 11:23:54.000000000 -0400
@@ -46,6 +46,12 @@
 * Cleaned up code and removed multiple calculations of shift divisor by
 * calculating it once and storing it in data.
 * Corrected sector count calculation to include partial clusters.
+*
+*         2015/10/25 Barry Nelson
+* Added -l option to force offset to the boot track to logical sector number
+* 612, ignoring number of sides. This is needed for the CoCoSDC and maybe
+* some other hard drive controllers to have a properly working boot track.
+* Also enabled the help text by default.
 
          nam   OS9Gen
          ttl   OS-9 bootfile generator
@@ -59,7 +65,7 @@
          use   defsfile
          ENDC
 
-DOHELP   set   0
+DOHELP   set   1
 DOHD     set   1		allow bootfile creation on HD
 
 tylg     set   Prgrm+Objct   
@@ -94,6 +100,7 @@
 u0035    rmb   9
 u003E    rmb   2
 eflag    rmb   1
+lflag    rmb   1
 sngldrv  rmb   1
 bootdev  rmb   32
 btshift  rmb   2
@@ -124,6 +131,8 @@
          fcb   C$LF
          fcc   " -e = extended boot (fragmented)"
          fcb   C$LF
+         fcc   " -l = lsn mode (ignore number of sides)"
+         fcb   C$LF
          fcc   " -s = single drive operation"
          fcb   C$LF
          fcc   " -t=boottrack = set boot track file"
@@ -207,6 +216,7 @@
          stb   <u0005
          stb   <sngldrv		assume multi-drive
          stb   <eflag       assume not extended bootfile
+         stb   <lflag       assume not lsn mode
          stu   <statptr		save statics pointer
          leas  >u047E,u		point stack pointer to u047e
          pshs  u
@@ -242,6 +252,8 @@
          beq   onedrive		branch if so
          cmpa  #'E			is it E
          beq   extend		branch if so
+         cmpa  #'L			is it L
+         beq   lsnmode		branch if so
          cmpd  #81*256+61	does D = 'Q='
          beq   quick
          cmpd  #84*256+61	does D = 'T='
@@ -271,6 +283,8 @@
          bra   parsein
 extend   inc   <eflag		set extended boot flag
          bra   parsein
+lsnmode  inc   <lflag		set lsn mode flag
+         bra   parsein
 quick    leay  1,y			point past =
          sty   <qfname		save pointer to quick filename
          sta   <qflag
@@ -715,6 +729,9 @@
 * Entry: A = track, B = sector
 * Returns in D
 AbsLSN   pshs  b
+         ldb   <lflag		get lsn mode flag
+         cmpb  #0               is it set?
+         bne   AbsLSN1          yes, so force 1 side
          ldb   <lsn0+DD.FMT,u	get format byte
          andb  #FMT.SIDE	test sides bit
          beq   AbsLSN1		branch if 1


More information about the Coco mailing list