Skip to contentSkip to conversation

Disk Geometries reported incorrectly on 2.6.0-testX

DISCUSSION Norman Diamond 3 participants 5 messages Nov 30, 2003 – Dec 3, 2003

lore
Share & tools
lore
#0 lore raw

Andries Brouwer replied to Andrew Clausen:

Quoted 2 lines

I am happy with that description.
"Disk geometry is: some numbers that your BIOS invents".

I'm happy with that too. Now, since the Linux kernel has no fantasies about disk geometry, it is fine to refuse to provide such non-existent fantasies to user space. However, it remains necessary to provide the BIOS's fantasies to user space. Sometimes user space does something (via the kernel) that will later be interpreted by the BIOS. User space has to be able to do it in the manner that the BIOS wants.

Quoted 6 lines
Quoted 2 lines

(i.e. have you got any evidence that, say, that 99.x% of Windows XP installations use LBA to bootstrap?)

Just ask yourself this question: does Windows XP require a bootable partition to start below the 1024 cylinder mark?
Windows NT4 has such a restriction. Not Windows 2000 or XP.

The answer is still yes. Not on sufficiently modern BIOSes but yes in the way that the booter uses the BIOS to load the kernel. I think that a computer dating from 1998 is not terribly old to expect Linux to run, especially when Linux does run and Windows XP does run. I have to keep the following partitions under the 8 GB mark:
C: (NTLDR, NTDETECT.COM, BOOT.INI, BOOTSECT.LNX, etc.)
D: (WINNT\whatever the names are for kernel, drivers, etc.) /boot (grub files and vmlinuz-whatever versions)

Windows NT4 SP4 partly overcame the 8GB mark, but of course SP4 was so badly broken that it is fortunate that the relevant ATAPI.SYS file is downloadable separately. This ATAPI.SYS (when renamed to C:\NTBOOTDD.SYS) can load a kernel for NT4, 2000, or XP even past the 8GB mark, but this file itself and NTLDR and BOOT.INI etc. must remain below the 8GB mark. To do this you have to keep all of C: below the 8GB mark. If you install Windows 2000 or XP on such a machine then you have to take a separate download of this specific version of ATAPI.SYS again, and you have to manually hack BOOT.INI partway through the installation sequence. If you don't do things right then Windows 2000 or XP becomes unbootable, sometimes during the installation process (if lucky), sometimes years after the install (when a file needed during booting gets updated and moved).

Anyway, regardless of which OS you're running, the OS isn't running until it's running. The MBR depends on BIOS functions (e.g. the infamous INT13) to read in the boot loader and the boot loader depends on BIOS functions to read in the kernel. Yes Dr. Brouwer, I know you know this. The question is why you think that commands such as parted don't have to know this?

#1 lore raw
Quoted 11 lines · Norman Diamond

Andries Brouwer replied to Andrew Clausen:

Quoted 2 lines

I am happy with that description.
"Disk geometry is: some numbers that your BIOS invents".

I'm happy with that too. Now, since the Linux kernel has no fantasies about disk geometry, it is fine to refuse to provide such non-existent fantasies to user space. However, it remains necessary to provide the BIOS's fantasies to user space. Sometimes user space does something (via the kernel) that will later be interpreted by the BIOS. User space has to be able to do it in the manner that the BIOS wants.

The point is just that the Linux kernel has no idea about these BIOS fantasies. It may have a more or less elaborate system of guesses, but it has no knowledge. In practice things work better if the kernel never tries to tell anything to user space, and user space derives the desired BIOS fantasies from the partition table.

Quoted 5 lines

Anyway, regardless of which OS you're running, the OS isn't running until it's running. The MBR depends on BIOS functions (e.g. the infamous INT13) to read in the boot loader and the boot loader depends on BIOS functions to read in the kernel. Yes Dr. Brouwer, I know you know this. The question is why you think that commands such as parted don't have to know this?

You invent a title for me that I never used.
You invent an opinion for me that I never had.

#2 lore raw
Quoted 2 lines · Andries Brouwer

The point is just that the Linux kernel has no idea about these BIOS fantasies.

Can't you look inside BIOS memory, etc.?
Even call interrupts to query this stuff?

Cheers,
Andrew

#3 lore raw
Quoted 5 lines · Andrew Clausen
Quoted 2 lines

The point is just that the Linux kernel has no idea about these BIOS fantasies.

Can't you look inside BIOS memory, etc.?
Even call interrupts to query this stuff?

Of course. And the details differ from BIOS to BIOS.

#4 lore raw
Quoted 7 lines · Andries Brouwer
Quoted 5 lines
Quoted 2 lines

The point is just that the Linux kernel has no idea about these BIOS fantasies.

Can't you look inside BIOS memory, etc.?
Even call interrupts to query this stuff?

Of course. And the details differ from BIOS to BIOS.

I know. But can't you figure it out for the 5 most popular BIOSes, or whatever? Seems like a job for the kernel.

Cheers,
Andrew