diff --git a/dosfsck/boot.c b/dosfsck/boot.c index ae1a98f..bc9da05 100644 --- a/dosfsck/boot.c +++ b/dosfsck/boot.c @@ -375,9 +375,11 @@ void read_boot(DOS_FS *fs) if (logical_sector_size & (SECTOR_SIZE-1)) die("Logical sector size (%d bytes) is not a multiple of the physical " "sector size.",logical_sector_size); +#if 0 /* linux kernel doesn't check that either */ /* ++roman: On Atari, these two fields are often left uninitialized */ if (!atari_format && (!b.secs_track || !b.heads)) die("Invalid disk format in boot sector."); +#endif if (verbose) dump_boot(fs,&b,logical_sector_size); } diff --git a/mkdosfs/mkdosfs.c b/mkdosfs/mkdosfs.c index 33aa028..efc8233 100644 --- a/mkdosfs/mkdosfs.c +++ b/mkdosfs/mkdosfs.c @@ -746,8 +746,8 @@ establish_params (int device_num,int size) { /* Can we get the drive geometry? (Note I'm not too sure about */ /* whether to use HDIO_GETGEO or HDIO_REQ) */ - if (ioctl (dev, HDIO_GETGEO, &geometry)) { - printf ("unable to get drive geometry, using default 255/63"); + if (ioctl (dev, HDIO_GETGEO, &geometry) || geometry.sectors == 0 || geometry.heads == 0) { + printf ("unable to get drive geometry, using default 255/63\n"); bs.secs_track = CT_LE_W(63); bs.heads = CT_LE_W(255); }