From: lee@Hawaii.Edu (Greg Lee)
Subject: overstuffed 3.5" floppy
Organization: University of Hawaii
X-Newsreader: TIN [version 1.1 PL6]
Date: Sat, 12 Dec 1992 20:02:35 GMT


With a few minor changes to /usr/src/linux/kernel/blk_drv/floppy.c
one can format and use hd 3.5" floppy disks with 1722 blocks, instead
of 1440 blocks.  At least, I've had no problems with it.  After
the patch below and remaking the system, e.g., for a 3.5" drive A,

	% ln -s /dev/fd0H360 /dev/fh
	% fdformat /dev/fh
	% mkfs -c /dev/fh 1722

(The patch makes unavailable the floppy device for a 360k disk in a
720k drive. The patch is against the 0.98.5 or 0.98.6 version of
floppy.c)
--
Greg Lee <lee@uhunix.uhcc.hawaii.edu>

*** floppy.c.orig	Sun Nov 29 12:41:34 1992
--- floppy.c	Sat Dec 12 09:20:02 1992
***************
*** 138,144 ****
  	{    0, 0,0, 0,0,0x00,0x00,0x00,0x00,NULL },	/* no testing */
  	{  720, 9,2,40,0,0x2A,0x02,0xDF,0x50,NULL },	/* 360kB PC diskettes */
  	{ 2400,15,2,80,0,0x1B,0x00,0xDF,0x54,NULL },	/* 1.2 MB AT-diskettes */
! 	{  720, 9,2,40,1,0x2A,0x02,0xDF,0x50,NULL },	/* 360kB in 720kB drive */
  	{ 1440, 9,2,80,0,0x2A,0x02,0xDF,0x50,NULL },	/* 3.5" 720kB diskette */
  	{  720, 9,2,40,1,0x23,0x01,0xDF,0x50,NULL },	/* 360kB in 1.2MB drive */
  	{ 1440, 9,2,80,0,0x23,0x01,0xDF,0x50,NULL },	/* 720kB in 1.2MB drive */
--- 138,145 ----
  	{    0, 0,0, 0,0,0x00,0x00,0x00,0x00,NULL },	/* no testing */
  	{  720, 9,2,40,0,0x2A,0x02,0xDF,0x50,NULL },	/* 360kB PC diskettes */
  	{ 2400,15,2,80,0,0x1B,0x00,0xDF,0x54,NULL },	/* 1.2 MB AT-diskettes */
! /*	{  720, 9,2,40,1,0x2A,0x02,0xDF,0x50,NULL },*/	/* 360kB in 720kB drive */
! 	{ 3444,21,2,82,0,0x0C,0x00,0xCF,0x0C,NULL },	/* 1.722MB diskette */
  	{ 1440, 9,2,80,0,0x2A,0x02,0xDF,0x50,NULL },	/* 3.5" 720kB diskette */
  	{  720, 9,2,40,1,0x23,0x01,0xDF,0x50,NULL },	/* 360kB in 1.2MB drive */
  	{ 1440, 9,2,80,0,0x23,0x01,0xDF,0x50,NULL },	/* 720kB in 1.2MB drive */
***************
*** 177,183 ****
  	MAX_DISK_SIZE, MAX_DISK_SIZE, MAX_DISK_SIZE, MAX_DISK_SIZE,
  	 360, 360 ,360, 360,
  	1200,1200,1200,1200,
! 	 360, 360, 360, 360,
  	 720, 720, 720, 720,
  	 360, 360, 360, 360,
  	 720, 720, 720, 720,
--- 178,185 ----
  	MAX_DISK_SIZE, MAX_DISK_SIZE, MAX_DISK_SIZE, MAX_DISK_SIZE,
  	 360, 360 ,360, 360,
  	1200,1200,1200,1200,
! /*	 360, 360, 360, 360,*/
! 	1722,1722,1722,1722,
  	 720, 720, 720, 720,
  	 360, 360, 360, 360,
  	 720, 720, 720, 720,
***************
*** 895,900 ****
--- 897,906 ----
  		transfer();
  }
  
+ static int il21[] ={
+     1,12,2,13,3,14,4,15,5,16,6,17,7,18,8,19,9,20,10,21,11
+ };
+ 
  static void setup_format_params(void)
  {
      unsigned char *here = (unsigned char *) tmp_floppy_area;
***************
*** 912,918 ****
      for (count = 0; count < floppy->sect; count++) {
  	*here++ = track;
  	*here++ = head;
! 	*here++ = 1 + (( count + total_shift ) % floppy->sect);
  	*here++ = 2; /* 512 bytes */
      }
  }
--- 918,927 ----
      for (count = 0; count < floppy->sect; count++) {
  	*here++ = track;
  	*here++ = head;
! 	if (floppy->sect == 21)
! 	    *here++ = il21[(( count + total_shift ) % floppy->sect)];
! 	else
! 	    *here++ = 1 + (( count + total_shift ) % floppy->sect);
  	*here++ = 2; /* 512 bytes */
      }
  }