Subject: patch for 720K floppies
To: None <current-users@sun-lamp.cs.berkeley.edu>
From: Frank van der Linden <vdlinden@fwi.uva.nl>
List: current-users
Date: 11/28/1993 10:53:41
Here is a patch to read 720K and 360K floppies. I think I saw someone
from Japan asking about it. To read/write 720K floppies use /dev/rfd1e
(if your 3.5" drive is drive 1), or /dev/rfd0e (if your 3.5" drive is drive 0).
The minor number of this device equals 4, which is the right index
into the fdtypes table.
Onno van der Linden c/o vdlinden@fwi.uva.nl (Frank van der Linden)
*** fd.c.old Fri Nov 19 20:17:14 1993
--- fd.c Fri Nov 19 21:03:41 1993
***************
*** 84,88 ****
{ 9,2,0xFF,0x23,40,720,2,1,2 }, /* 360k floppy in 1.2meg drive */
{ 9,2,0xFF,0x2A,40,720,1,1,2 }, /* 360k floppy in DD drive */
! { 9,2,0xFF,0x2A,80,1440,1,0 }, /* 720K drive. PROBABLY WRONG */
};
--- 84,88 ----
{ 9,2,0xFF,0x23,40,720,2,1,2 }, /* 360k floppy in 1.2meg drive */
{ 9,2,0xFF,0x2A,40,720,1,1,2 }, /* 360k floppy in DD drive */
! { 9,2,0xFF,0x2A,80,1440,1,2,2 },/* 720K drive. PROBABLY WRONG */
};
***************
*** 339,343 ****
fdc = fd->fdc;
fdcu = fdc->fdcu;
! /*type = FDTYPE(minor(bp->b_dev));*/
if ((fdu >= NFD) || (bp->b_blkno < 0)) {
--- 339,343 ----
fdc = fd->fdc;
fdcu = fdc->fdcu;
! fd->ft = &fd_types[FDTYPE(minor(bp->b_dev))];
if ((fdu >= NFD) || (bp->b_blkno < 0)) {
***************
*** 486,495 ****
{
fdu_t fdu = FDUNIT(minor(dev));
! /*int type = FDTYPE(minor(dev));*/
int s;
/* check bounds */
if (fdu >= NFD) return(ENXIO);
! /*if (type >= sizeof(fd_types)/sizeof(fd_types[0]) ) return(ENXIO);*/
fd_data[fdu].flags |= FD_OPEN;
--- 486,495 ----
{
fdu_t fdu = FDUNIT(minor(dev));
! int type = FDTYPE(minor(dev));
int s;
/* check bounds */
if (fdu >= NFD) return(ENXIO);
! if (type >= sizeof(fd_types)/sizeof(fd_types[0]) ) return(ENXIO);
fd_data[fdu].flags |= FD_OPEN;
------------------------------------------------------------------------------