Date: Sun, 10 Jun 2001 17:14:56 +0100 From: Ian Dowse <iedowse@maths.tcd.ie> To: Warner Losh <imp@village.org> Cc: Mark Hittinger <bugs@freebsd.netcom.com>, hackers@FreeBSD.ORG Subject: Re: Strange request: Reading RX-50 (aka DEC Rainbow 100) disks Message-ID: <200106101714.aa32440@salmon.maths.tcd.ie> In-Reply-To: Your message of "Sat, 09 Jun 2001 21:08:40 MDT." <200106100308.f5A38el17955@billy-club.village.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <200106100308.f5A38el17955@billy-club.village.org>, Warner Losh writ es: >I do have the options of connection the hardware up to the floppy >controller in my desktop too :-). I have both the RX-50 drives, as >well as a pair of TEAC FD55 drives (that do the same data rate as the >RX-50's, with the same heads, but with only one drive per spindle and >two read heads instead of one). Trouble is, it looks like our floppy >driver doesn't grok single sided 400k disks :-(. That's what I'm >looking to hack and advise on how to hack. The fdcontrol program allows most of the paramaters to be set to match the disks, but unfortunately it cannot set the sector offset. MSDOS disks sectors are numbered starting at 1 (the sector offset is 1), but it was common practice with old 8-bit CP/M-type systems to choose sector numbers starting at 0x41, 0x81 or other values. I was attempting something similar last summer, but with disks from an Amstrad CPC computer. I used the following patch to the fd driver and fdcontrol to allow the sector offset to be specified along with the other parameters. It also allows a head offset to be specified, which is useful for reading the second side of double-sided disks that were written as single-sided disks with a hardware switch on the side-select line (i.e the head number written to disk does not match the hardware head number). The patch below is against RELENG_4 around Jan 2000, so it will need updating. I'm also not sure what sector offset the DEC Rainbow used - I think I have a Rainbow boot disk here, but I'd have to dig out a 5.25 floppy drive to check :-) Once you get the settings right, you can just dd the disk to an image file. Ian Index: sys/i386/include/ioctl_fd.h =================================================================== RCS file: /dump/FreeBSD-CVS/src/sys/i386/include/Attic/ioctl_fd.h,v retrieving revision 1.13 diff -u -r1.13 ioctl_fd.h --- sys/i386/include/ioctl_fd.h 1999/12/29 04:33:02 1.13 +++ sys/i386/include/ioctl_fd.h 2001/06/10 15:36:24 @@ -86,6 +86,7 @@ struct fd_type { int sectrac; /* sectors per track */ int secsize; /* size code for sectors */ + int secoff; /* starting sector number */ int datalen; /* data len when secsize = 0 */ int gap; /* gap len between sectors */ int tracks; /* total num of tracks */ @@ -95,6 +96,7 @@ int heads; /* number of heads */ int f_gap; /* format gap len */ int f_inter; /* format interleave factor */ + int headoff; }; #define FD_FORM _IOW('F', 61, struct fd_formb) /* format a track */ Index: sys/isa/fd.c =================================================================== RCS file: /dump/FreeBSD-CVS/src/sys/isa/fd.c,v retrieving revision 1.176 diff -u -r1.176 fd.c --- sys/isa/fd.c 2000/01/08 09:33:06 1.176 +++ sys/isa/fd.c 2001/06/10 15:52:19 @@ -125,24 +125,24 @@ static struct fd_type fd_types[NUMTYPES] = { -{ 21,2,0xFF,0x04,82,3444,1,FDC_500KBPS,2,0x0C,2 }, /* 1.72M in HD 3.5in */ -{ 18,2,0xFF,0x1B,82,2952,1,FDC_500KBPS,2,0x6C,1 }, /* 1.48M in HD 3.5in */ -{ 18,2,0xFF,0x1B,80,2880,1,FDC_500KBPS,2,0x6C,1 }, /* 1.44M in HD 3.5in */ -{ 15,2,0xFF,0x1B,80,2400,1,FDC_500KBPS,2,0x54,1 }, /* 1.2M in HD 5.25/3.5 */ -{ 10,2,0xFF,0x10,82,1640,1,FDC_250KBPS,2,0x2E,1 }, /* 820K in HD 3.5in */ -{ 10,2,0xFF,0x10,80,1600,1,FDC_250KBPS,2,0x2E,1 }, /* 800K in HD 3.5in */ -{ 9,2,0xFF,0x20,80,1440,1,FDC_250KBPS,2,0x50,1 }, /* 720K in HD 3.5in */ -{ 9,2,0xFF,0x2A,40, 720,1,FDC_250KBPS,2,0x50,1 }, /* 360K in DD 5.25in */ -{ 8,2,0xFF,0x2A,80,1280,1,FDC_250KBPS,2,0x50,1 }, /* 640K in DD 5.25in */ -{ 8,3,0xFF,0x35,77,1232,1,FDC_500KBPS,2,0x74,1 }, /* 1.23M in HD 5.25in */ - -{ 18,2,0xFF,0x02,82,2952,1,FDC_500KBPS,2,0x02,2 }, /* 1.48M in HD 5.25in */ -{ 18,2,0xFF,0x02,80,2880,1,FDC_500KBPS,2,0x02,2 }, /* 1.44M in HD 5.25in */ -{ 10,2,0xFF,0x10,82,1640,1,FDC_300KBPS,2,0x2E,1 }, /* 820K in HD 5.25in */ -{ 10,2,0xFF,0x10,80,1600,1,FDC_300KBPS,2,0x2E,1 }, /* 800K in HD 5.25in */ -{ 9,2,0xFF,0x20,80,1440,1,FDC_300KBPS,2,0x50,1 }, /* 720K in HD 5.25in */ -{ 9,2,0xFF,0x23,40, 720,2,FDC_300KBPS,2,0x50,1 }, /* 360K in HD 5.25in */ -{ 8,2,0xFF,0x2A,80,1280,1,FDC_300KBPS,2,0x50,1 }, /* 640K in HD 5.25in */ +{ 21,2,1,0xFF,0x04,82,3444,1,FDC_500KBPS,2,0x0C,2 }, /* 1.72M in HD 3.5in */ +{ 18,2,1,0xFF,0x1B,82,2952,1,FDC_500KBPS,2,0x6C,1 }, /* 1.48M in HD 3.5in */ +{ 18,2,1,0xFF,0x1B,80,2880,1,FDC_500KBPS,2,0x6C,1 }, /* 1.44M in HD 3.5in */ +{ 15,2,1,0xFF,0x1B,80,2400,1,FDC_500KBPS,2,0x54,1 }, /* 1.2M in HD 5.25/3.5 */ +{ 10,2,1,0xFF,0x10,82,1640,1,FDC_250KBPS,2,0x2E,1 }, /* 820K in HD 3.5in */ +{ 10,2,1,0xFF,0x10,80,1600,1,FDC_250KBPS,2,0x2E,1 }, /* 800K in HD 3.5in */ +{ 9,2,1,0xFF,0x20,80,1440,1,FDC_250KBPS,2,0x50,1 }, /* 720K in HD 3.5in */ +{ 9,2,1,0xFF,0x2A,40, 720,1,FDC_250KBPS,2,0x50,1 }, /* 360K in DD 5.25in */ +{ 8,2,1,0xFF,0x2A,80,1280,1,FDC_250KBPS,2,0x50,1 }, /* 640K in DD 5.25in */ +{ 8,3,1,0xFF,0x35,77,1232,1,FDC_500KBPS,2,0x74,1 }, /* 1.23M in HD 5.25in */ + +{ 18,2,1,0xFF,0x02,82,2952,1,FDC_500KBPS,2,0x02,2 }, /* 1.48M in HD 5.25in */ +{ 18,2,1,0xFF,0x02,80,2880,1,FDC_500KBPS,2,0x02,2 }, /* 1.44M in HD 5.25in */ +{ 10,2,1,0xFF,0x10,82,1640,1,FDC_300KBPS,2,0x2E,1 }, /* 820K in HD 5.25in */ +{ 10,2,1,0xFF,0x10,80,1600,1,FDC_300KBPS,2,0x2E,1 }, /* 800K in HD 5.25in */ +{ 9,2,1,0xFF,0x20,80,1440,1,FDC_300KBPS,2,0x50,1 }, /* 720K in HD 5.25in */ +{ 9,2,1,0xFF,0x23,40, 720,2,FDC_300KBPS,2,0x50,1 }, /* 360K in HD 5.25in */ +{ 8,2,1,0xFF,0x2A,80,1280,1,FDC_300KBPS,2,0x50,1 }, /* 640K in HD 5.25in */ }; #define DRVS_PER_CTLR 2 /* 2 floppies */ @@ -1858,7 +1858,7 @@ sectrac = fd->ft->sectrac; sec = blknum % (sectrac * fd->ft->heads); head = sec / sectrac; - sec = sec % sectrac + 1; + sec = sec % sectrac + fd->ft->secoff; fd->hddrv = ((head&1)<<2)+fdu; if(format || !read) @@ -1931,7 +1931,7 @@ } if (fd_cmd(fdc, 9, (read ? NE7CMD_READ : NE7CMD_WRITE), - head << 2 | fdu, /* head & unit */ + (head + fd->ft->headoff) << 2 | fdu, /* head & unit */ fd->track, /* track */ head, sec, /* sector + 1 */ Index: usr.sbin/fdcontrol/fdcontrol.c =================================================================== RCS file: /dump/FreeBSD-CVS/src/usr.sbin/fdcontrol/fdcontrol.c,v retrieving revision 1.6 diff -u -r1.6 fdcontrol.c --- usr.sbin/fdcontrol/fdcontrol.c 1999/08/28 01:16:13 1.6 +++ usr.sbin/fdcontrol/fdcontrol.c 2001/06/10 15:36:13 @@ -119,6 +119,7 @@ ask(sectrac, "%d"); ask(secsize, "%d"); + ask(secoff, "%d"); ask(datalen, "0x%x"); ask(gap, "0x%x"); ask(tracks, "%d"); @@ -128,6 +129,7 @@ ask(heads, "%d"); ask(f_gap, "0x%x"); ask(f_inter, "%d"); + ask(headoff, "%d"); if(ioctl(fd, FD_STYPE, &ft) < 0) { To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi? <200106101714.aa32440>