fdisk issue

Michael Neumann mneumann at ntecs.de
Sat Aug 11 09:38:04 PDT 2007


Erik Wikström wrote:
On 2007-08-11 13:37, Michael Neumann wrote:
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.
 From the man-page:

Normally if the CHS fields for a partition are set to all 1's if they 
would otherwise wrap.  This typically causes BIOSes to properly detect 
that the disk should be put in Large mode.  If this option is specified 
the CHS fields will be set to wrapped values instead.  This option may 
be needed on very old PCs.

And from the fact that you have to open up your computer to boot from CD 
I'd say that you computer is quite old.
Hmm, not so old. It's actually a 1.3 GHz Centrino laptop ;-)

PS: the first sentence might need some work, as a non-native speaker it 
took me some time to figure it out.
That's because I'm a non-native speaker as well :). Thanks anyway.

Regards,

  Michael





More information about the Kernel mailing list