Alexander Viro wrote:
No, they aren't. DOS sectors are linear within the partition.
And that's it. It uses damned amount of layers: linear in the partition -[int25/26]->3D-[BIOS Int13]-->3D----[IDE,EIDE] ->linear[EIDE,SCSI] For Linux: linear -[driver]-->3D----[IDE] ->linear[EIDE,SCSI]
Okay.. yeah, I actually knew most of that, I just hadn't put it together yet (sure... :). It's worse, even, because when you use IDE drives with 3D geometry, thye are doing their own translations to the *real* physical disk geometry. Swell.
What I don't understand is: If DOS and Linux coexisting on the same system, and you have BIOS geometry translation on to support DOS, Linux still works. But Linux doesn't use the BIOS. So how does that work?
It uses either linear addresses or native drive CHS.
All point of BIOS translation is to map CHS addresses provided by DOS into the real addresses.
But, the system partition table uses CHS. DOS and Linux use that same partition table. In order to figure out what's what in the partition table, Linux would need to know the method the BIOS was using to map the LBA (or native drive CHS) to the CHS geometry that the BIOS is feeding DOS, otherwise the partitions would be out of sync. Right?
Hmm. Then you can take Linux IDE driver and put it into BIOS. Yep,
it will break some things. DOS, for example. And Virus95, for it is loaded by BIOS drivers. And LILO (well, _that_ is not a problem for we have the source, but DOS & Virus...). NT will survive, for it uses its own loader. And consider the fact that BIOS access is _slow_. So Linux will still use its own driver (in regular RAM) for speed reasons. The only thing that will gain something would be LILO (rewritten, i.e.).
Someone already suggested hacking/modifing DOS to use LBA or our own custom BIOS calls. I would expect most modern OSes would still use their own internal drivers, though it would be nice to not have to worry about, "Now, is my kernel file/boot partition below the latest stupid BIOS limit?".
But I mentioned it mainly as an exercise in theory. :-)
For BIOS partitions don't exist. They are just linear chunks of disk. It's determined by OS. Even in case of DOS it is so (in MSDOS.SYS, as far as I remember).
Hey, something I know. :-) Your typcial BIOS checks the floppy drive, and then the first fixed disk. The first device it finds that works has the boot sector loaded and the BIOS bootloader transfers control to it. For floppy disks, the boot sector is the OS boot sector.
For fixed disks (or anything behaving like one), the boot sector is the Master Boot Record (MBR). The MBR contains a boot loader and your primary partition table. The MBR checks the partition table for the active primary partition, and loads the boot sector from that. That is the true OS bootloader. The MBR, incidentally, is what LILO overwrites. When I first heard about LILO (years ago), I was almost scared. "A boot loader that overwrites my partition table???" :-)
One of the things I like about this is that we can finally tell the BIOS about partitions. :-)
-- Ben hawk@ttlc.net
--- OpenBIOS -- http://www.linkscape.net/openbios/ openbios-request@linkscape.net Body: un/subscribe Problems? dcinege@psychosis.com