Out of Space

Liam Proven lproven at gmail.com
Wed Aug 10 17:18:15 UTC 2016


On 10 August 2016 at 19:05, Gene Heskett <gheskett at shentel.net> wrote:
> Oli, I think that needs an explanation.
>
> As the first point I''l raise my hand & wave madly on mention of, it IS
> the bios that starts the boot loader, presumably from whatever passes as
> the agreed on starting sector we usually call the MBR, and its name is
> not germain to the discussion other than serving as the anchoring
> starting point in the boot process.  It (the bios) doesn't ever need to
> accessed again (except in a UEFI environment with  GPT partitioned disk)
> but it must be done.
>
> So please shine a light in that crevice holding the secret sauce that
> makes all this work.
>
> I am sure I am not the only one with a visible curiosity bump, :)


My understanding is this...

The "classic" original PC boot process, at least from the AT onwards, was:

At power on, the BIOS is in the memory map at the point where the CPU
starts executing code.

The code in the BIOS does a self-test, then it looks for the drives
listed in the CMOS settings.

It goes to the bootable drive, usually either the first floppy or the
first hard disk. It reads the first sector into memory and runs it.
This is the "boot block". This contains code to do one of 2 things.
OK, 3 things.

#1 Display a little message saying that this disk isn't bootable.

#2 Locate the first partition, then load and run what is in _its_ boot block.

#3 -- not originally planned -- load a virus into memory. ;-)

No. 1 is the reason why a disk formatted on DOS or Windows in a
non-English language may display a non-English message on your PC
saying something like "non-system disk or disk error" in German or
whatever.

What LILO and GRUB do is embed a bit of code into spare space in the
boot block to intercept and redirect this behaviour. Instead, they
load the _rest_ of their own code from your Linux root partition, and
then it displays a boot menu, offering a choice of OSes -- or just
boot the default OS.

LILO and GRUB (or SysLinux for removable media) let your PC boot
non-DOS OSes that the BIOS was never intended to run.

For a long time, the Linux kernel contained its own floppy bootloader
in the first 1K or so of code, so if you just DDed the kernel onto a
floppy, and booted that floppy, it would load the kernel, then ask for
a root diskette.

Now the kernel won't fit on a floppy, and that code was removed long ago.

DOS has its bootloader in IBMBIOS.COM or a similarly-named
hidden/system/read-only file.

NT has it in a file called NTLDR.

OS/2 has one too, whose name I forget.

Those are the "official" OSes that work with the BIOS. The rest --
BSD, Netware 2, whatever -- have to roll their own.


-- 
Liam Proven • Profile: http://lproven.livejournal.com/profile
Email: lproven at cix.co.uk • GMail/G+/Twitter/Flickr/Facebook: lproven
MSN: lproven at hotmail.com • Skype/AIM/Yahoo/LinkedIn: liamproven
Cell/Mobiles: +44 7939-087884 (UK) • +420 702 829 053 (ČR)




More information about the ubuntu-users mailing list