fdisk issue

Michael Neumann mneumann at ntecs.de
Sat Aug 11 04:37:05 PDT 2007


Hi,

I had experienced that my laptop's BIOS hangs up when I don't specify
fdisk's -C option! The source code in question in fdisk.c follows:
   if (tcyl > MAXCYL && C_flag == 0) {
     printf("Warning: starting cylinder wraps, using all 1's\n");
     partp->dp_scyl = -1;
     partp->dp_ssect = -1;
     partp->dp_shd = -1;
   } else {
     partp->dp_scyl = DOSCYL(tcyl);
     partp->dp_ssect = DOSSECT(tsec,tcyl);
     partp->dp_shd = thd;
   }
I'd like to understand why we set dp_* to -1. Is there a special reason? 
FreeBSD just ignores this and executes the "else" part.

In my opinion the C_flag should default to being set (=1), as in my case
it does a lot more harm when it is unset (default in the 
bsdinstaller.org). Harm in my case means, that I can't boot any 
operation system unless I take a screwdriver and disconnect the hard 
disk, then, once the BIOS detects the CD to boot from, I have to put it 
in the right moment in again, so that it is being detected. So I'd 
suggest to just leave the warning about the "cylinder wrapping", but 
don't set dp_* to -1. Maybe there should be an option to set them all -1 
when a cylinder wrap occurs (kind of a -no-C option), but not by default.

I could provide a patch for this, with some additional changes that come 
from the FreeBSD version (minor cleanups + some additional partition types).

But maybe I'm missing something!?

Regards,

  Michael





More information about the Kernel mailing list