diff -ur linux-2.4.25/CREDITS linux/CREDITS --- linux-2.4.25/CREDITS 2004-02-28 11:42:25.000000000 +0100 +++ linux/CREDITS 2004-03-13 09:31:38.000000000 +0100 @@ -1620,7 +1620,7 @@ S: Germany N: Alain L. Knaff -E: Alain.Knaff@poboxes.com +E: Alain.Knaff@lll.lu D: floppy driver S: 19, rue Jean l'Aveugle S: L-1148 Luxembourg-City diff -ur linux-2.4.25/drivers/block/floppy.c linux/drivers/block/floppy.c --- linux-2.4.25/drivers/block/floppy.c 2003-08-25 13:44:41.000000000 +0200 +++ linux/drivers/block/floppy.c 2004-03-10 23:31:07.000000000 +0100 @@ -2252,6 +2252,10 @@ } } } + if(_floppy->stretch & FD_ZEROBASED) { + for(count = 0; count < F_SECT_PER_TRACK; count++) + here[count].sect--; + } } static void redo_format(void) @@ -2674,7 +2678,8 @@ } HEAD = sector_t / _floppy->sect; - if (((_floppy->stretch & FD_SWAPSIDES) || TESTF(FD_NEED_TWADDLE)) && + if (( (_floppy->stretch & (FD_SWAPSIDES | FD_ZEROBASED)) || + TESTF(FD_NEED_TWADDLE)) && sector_t < _floppy->sect) max_sector = _floppy->sect; @@ -2704,7 +2709,8 @@ GAP = _floppy->gap; CODE2SIZE; SECT_PER_TRACK = _floppy->sect << 2 >> SIZECODE; - SECTOR = ((sector_t % _floppy->sect) << 2 >> SIZECODE) + 1; + SECTOR = ((sector_t % _floppy->sect) << 2 >> SIZECODE) + + ((_floppy->stretch & FD_ZEROBASED) ? 0 : 1); /* tracksize describes the size which can be filled up with sectors * of size ssize. @@ -3341,7 +3347,7 @@ g->track <= 0 || g->track > UDP->tracks>>STRETCH(g) || /* check if reserved bits are set */ - (g->stretch&~(FD_STRETCH|FD_SWAPSIDES)) != 0) + (g->stretch&~(FD_STRETCH|FD_SWAPSIDES|FD_ZEROBASED)) != 0) return -EINVAL; if (type){ if (!capable(CAP_SYS_ADMIN)) @@ -3366,11 +3372,13 @@ drive_state[cnt].fd_device)); } } else { + int oldStretch; LOCK_FDC(drive,1); if (cmd != FDDEFPRM) /* notice a disk change immediately, else * we lose our settings immediately*/ CALL(poll_drive(1, FD_RAW_NEED_DISK)); + oldStretch = g->stretch; user_params[drive] = *g; if (buffer_drive == drive) SUPBOUND(buffer_max, user_params[drive].sect); @@ -3385,7 +3393,10 @@ * whose number will change. This is useful, because * mtools often changes the geometry of the disk after * looking at the boot block */ - if (DRS->maxblock > user_params[drive].sect || DRS->maxtrack) + if (DRS->maxblock > user_params[drive].sect || + DRS->maxtrack || + ((user_params[drive].sect ^ oldStretch) & + (FD_SWAPSIDES | FD_ZEROBASED))) invalidate_drive(device); else process_fd_request(); diff -ur linux-2.4.25/include/linux/fd.h linux/include/linux/fd.h --- linux-2.4.25/include/linux/fd.h 2002-08-03 02:39:45.000000000 +0200 +++ linux/include/linux/fd.h 2004-03-10 23:21:03.000000000 +0100 @@ -17,6 +17,7 @@ stretch; /* !=0 means double track steps */ #define FD_STRETCH 1 #define FD_SWAPSIDES 2 +#define FD_ZEROBASED 4 unsigned char gap, /* gap1 size */