[Gllug] Partioning advice needed

Mike Brodbelt mike at coruscant.demon.co.uk
Fri Feb 16 20:26:12 UTC 2007


Chris Bell wrote:

> Is this affected by different ways of addressing discs, such as CHS and LBA?

To a degree - the sector is loaded into RAM by an int 0x13 BIOS call,
which used to require registers to be loaded with CHS numbers. The MBR
must reside within this 512 byte sector, and loses at least 66 bytes to
4 16-byte partition table entries, and a 2 byte MBR signature. So, what
remains is far too small to contain a disk driver, and in fact simply
contains just enough logic to find a second stage boot loader. Under
DOS, the MBR simply found the active partition, loaded its boot sector
into memory, and transferred control to it. The bootsector would then
read the root directory of a 12 or 16-bit FAT, check that the first two
entriess we IO.SYS and MSDOS.SYS, then read the first three sectors of
IO.SYS into RAM and carry on. DOS however wasn't a real OS, and didn't
actually contain a disk driver (usually), it just relied on the BIOS.

With a Linux system, the MBR will either do the same job as the old DOS
one and chainload a bootsector, or it will contain stage 1 of LILO or
GRUB, which has to fit enough intelligence to find stage 2 into 512-66
bytes. LILO puts a sector map of boot.b in there, which then takes over
loading the kernel. GRUB stores the sector addresses of its stage 2 loader.

As far as disk geometry goes, at this stage in the boot process, BIOS
int 0x13 is all you have to talk to your disk. Newer BIOSes support an
extended int0x13, which allows you to use sector addressing in LBA mode.
If you're stuck with a BIOS without LBA support, BIOS routines only
provide 10 bits for the cylinder number, leading to the cylider 1024
issues, as higher cylinders on the the disk are not accessible to the
BIOS. If you've got LBA, then you can use a 28-bit sector address in
BIOS calls, and the problem went away (mostly). It came back when disks
got to 128 GiB, which is when you run out of 2^28 512-byte sectors. The
current standard is for 48-bit sector addressing, which should last a
while longer (but then that's been said every time...).

HTH,

Mike
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list