How to boot a computer?
It's a interesting question. I searched internet and found the answer maybe like below:
step 1,
1), when you pressed the power-on button, the CPU will recieve a reset signal.
2), read the ROM which contenting the BIOS (basic input/output systerm).
3), POST (power-on self test).
4), boot sequence.
step 2,
issue 1, read MBR 0x55 0xAA ->0x7c000
issue A, for primary partition, read VBR (value boot record)
issue B, extend && logic partition, read EBR (extend boot record) 64 byte
issue C, boot loader
eg , GRUB
GRUB && GRUB2 is different.
stage1, 446bytes, source code is grub's source code: stage1/stage1.S, assembled as a 512bytes file boot.img,
it was recorded in the 0 side 0 track 1st sector of the disk, (MBR? the content is almost the same as MBR)
the boot.img is used to copy the content of the side 0 track 2nd sector of the disk to the memory's 0x8000, then run 0x8000.
ps: the 0 side 0 track 2nd sector's curent was the code stage1/start.S' assembled result, it will run the stage1.5 or stage2.
stage1.5, only for grub not grub2
file: xx_stage1_5 && nbgrub && pxegrub
xx: e2fs(for ext2/ext3) /fat /jfs /minix /reiserfs / vstafs /xfs
Fseek 0 side 0 track 3rd sector, size more than 11k.
stage 1.5 process is content a boot partitions file systerm for searching the core.img from the path /boot/grub/
stage 2, Entry: stage2/asm.s : initialize a c language environment , then load configuration and run command.
issue 2, GPT
the GPT partition table's boot progress ls similar like MBR.
REFERENCE: