I have downloaded few bootloaders from osdev and successfully loaded a kernel. But now I want to learn theory behind bootloader. I want to know why the system boots up and everything behind the bootloader codes. Can anybody give me a link or link to a book? Thanks in advance. System is x86.
https://pdos.csail.mit.edu/6.828/2014/xv6/book-rev8.pdf
On Appendix B, it gives a short overview in the first paragraph:
When an x86 PC boots, it starts executing a program called the BIOS, which is stored in non-volatile memory on the motherboard. The BIOS’s job is to prepare the hardware and then transfer control to the operating system. Specifically, it transfers control to code loaded from the boot sector, the first
512
-byte sector of the boot disk.The boot sector contains the boot loader: instructions that load the kernel int o memory. The BIOS loads the boot sector at memory address0x7c00
and then jumps (sets the processor's%ip
) to that address. When the boot loader begins executing, the processor is simulating an Intel 8088, and the loader's job is to put the processor in a more modern operating mode, to load the xv6 kernel from disk into memory, and then to transfer control to the kernel. The xv6 boot loader comprises two source files, one written in a combination of 16-bit and 32-bit x86 assembly (bootasm.S
;(8900)) and one written in C (bootmain.c
;(9000)).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With