2.1.117 w/ genhd.c patch: lilo problems and kludge

Anil B. Somayaji (soma@cs.unm.edu)
23 Aug 1998 13:48:37 -0600


--pgp-sign-Multipart_Sun_Aug_23_13:48:34_1998-1
Content-Type: text/plain; charset=US-ASCII

Unfortunately, linux-2.1.117, even with the patch to genhd.c, still
gives the wrong geometry for my drive. However, I have a kludge to
fix it - hopefully it will help you or someone else figure out a way
to do this "right".

Here's what is reported about my drives at bootup:

hda: QUANTUM BIGFOOT_CY4320A, 4134MB w/67kB Cache, CHS=560/240/63
hdc: ATAPI 24X CDROM drive, 128kB Cache

(This is on an HP Pavilion 8260, FYI.)

As you can see, the BIOS gives the drive a translation with fewer than
1024 cylinders, and in fact this is the translation that DOS/Win95
likes. (I can get rid of this mapping by going changing the BIOS
translation from "DOS" to "Other," but then DOS is annoyed, since this
produces a 8960/15/63 BIOS translation.)

I think the problem arises from line 424 in drivers/block/genhd.c.
With my translation, the test

if (heads == 16 || heads == 32 || heads == 64 || heads == 128 ||
heads == 255)

fails, causing the BIOS LBA translation to be used (giving me a
527/255/63 translation).

Now, if I just change this line to

if (heads == 16 || heads == 32 || heads == 64 || heads == 128 ||
heads == 240 ||heads == 255)

everything works fine.

I'm guessing that this works because of this line in ide_xlate_1024
(line 2561 in ide.c, for those following along):

if (xparm > 1 && xparm <= drive->bios_head && drive->bios_sect == 63)
return 0; /* we already have a translation */

Please let me know if you need any more information. I hope this
helps!

--Anil

-- 
Anil Somayaji (soma@cs.unm.edu)
http://www.cs.unm.edu/~soma
+1 505 872 3150

--pgp-sign-Multipart_Sun_Aug_23_13:48:34_1998-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit

-----BEGIN PGP MESSAGE----- Version: 2.6.2

iQCVAwUBNeByFULkmkLHxWM5AQGP0AP/UmrfqqTtyh1P/DtECCyes6lNO3bfQFmX xquaD0dK+uZ8t+H2xJRdi+kiff4WOo5pF0LLIVKEwrZQVLm2di9Al7/zW4q0YOKS uMq8vmHWfnJ0zPAL7E0m7o1ShaYpFBIEgdkGd/drUHRdF1ERFQXkP6ko+0gj8g/K JWxUzgnPI6g= =delj -----END PGP MESSAGE-----

--pgp-sign-Multipart_Sun_Aug_23_13:48:34_1998-1--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html