Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrapping linux

I am trying to boot linux kernel by writing a boot loader myself, but dont know how to load the kernel.

All are saying to use int 13h to load sector from hard disk to memory. Which sector should be loaded?? What to do after loading the sector?? Please share the code of a simple boot loader for the linux kernel if you can....

When searching for a boot loader, we can see only how to make the hello world bootloader, just to print hello world or asimilar message using assembly language.... nothing more can be seen...

What is kernel entry point?? Some says the start() function need to be called... but how??

like image 944
bilinbs Avatar asked May 22 '26 13:05

bilinbs


1 Answers

About the entry point:

In the Linux source code the file Documentation/x86/boot.txt is titled "The Linux/x86 Boot Protocol". It explains the current procedure for calling the kernel including the mode in which the CPU must be when booting and memory initialization.

About the disk sectors:

That file explains the booting process after you have loaded the compressed kernel from disk to memory. I suppose (but I'm not sure of it) that every bootloader has its own way to find the disk sectors corresponding to the kernel image and their second stage (512bytes of the MBR are usually not enough) and its own way to store those information.

like image 114
David Costa Avatar answered May 28 '26 07:05

David Costa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!