Ozgunh82 - The Ozguxxx- wrote:
Well I just want to see what grub offers and see if they are useful for me.
Then check the Multiboot Specification. That is basically a "contract" between bootloader and kernel. A given Multiboot compliant bootloader can boot any Multiboot compliant kernel; a given Multiboot compliant kernel can be booted by any Multiboot compliant bootloader.
In a nutshell:
GRUB boots from the MBR (Master Boot Record), reads the partition table, reads a "stage 2" (where to find
that it has been told when installed in the MBR), reads some data from the BIOS, switches to protected mode / enables A20 gate, reads a configuration file, and executes the commands listed in there. (Usually a boot menu - which kernel / system to boot.)
This gives you the ability of changing the configuration without ever touching the bootloader - all you need is editing the config file in a text editor.
Then it loads the specified kernel into RAM, sets registers and flags to values defined by the Multiboot specification, sets up some data structures (among others containing the BIOS data read earlier, like available memory, drives etc.), puts a pointer to the struct in
ebx), and passes controll to your kernel image.
Major advantages:
* quite some info has been read from BIOS already, so you don't have to;
* pmode / A20 are already enabled;
* your kernel can be a standard issue ELF file (or a.out or PE!);
* no special magic done to the kernel image - compile, and copy it where the GRUB config expects it;
* no limit on the number of kernels that can be booted from the same file system (like, C:\boot on your FAT32 Windows partition);
* GRUB reads various file systems, and can even boot across a network.
Bottom line, GRUB basically does all the stuff
every decent OS has to do, and starts you up to the point where you can begin doing things
differently.