LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   how to boot linux kernel with my own simple bootloader (https://www.linuxquestions.org/questions/linux-kernel-70/how-to-boot-linux-kernel-with-my-own-simple-bootloader-943066/)

mhdjavanmardi 05-03-2012 05:33 AM

how to boot linux kernel with my own simple bootloader
 
Hi everyone
I want to develope my own very very simple bootloader which has only a simple jump to the kernel (don't ask the reason plz).
how can I do this? How can I find the physical address of my kernel to load in the memory?? How can I load the kernel? How can I pass the initrd to the kernel? and what is it's physical address? I want to modify the MBR created by LILO and make these changes..
How can I do these??

thank you
Javan

towheedm 05-03-2012 08:08 AM

Look at how some other bootloader does it or subscribe to LKML. Research how the kernel is loaded with or without and initrd. I might be wrong but I think a non-relocatable kernel loads at 0x100000. Also, you need to know the specifics of passing kernel command line parameters, such as root= to the kernel.

syg00 05-03-2012 08:47 AM

In short, there is no such thing as
Quote:

very very simple bootloader which has only a simple jump to the kernel

mhdjavanmardi 05-09-2012 01:05 AM

Quote:

Originally Posted by towheedm (Post 4669397)
Look at how some other bootloader does it or subscribe to LKML. Research how the kernel is loaded with or without and initrd. I might be wrong but I think a non-relocatable kernel loads at 0x100000. Also, you need to know the specifics of passing kernel command line parameters, such as root= to the kernel.

In the bootloader I should load the kernel to the memory, but I don't know where is address of the kernel. LILO creates offline map file which stores address of the kernel, but I don't know structure or format of that file to decode that. I'm looking at the LILO source code, but it's complex.. my bootloader is simple & doesn't support the file system, therefore I need to know address of the kernel on the HDD.
How can I write very simple bootloader which loads a kernel?? I don't want to use other bootloaders like LILO or GRUB..
Thank you

mhdjavanmardi 05-09-2012 01:20 AM

Somebody knows structure of the LILO map file?

wang 07-16-2012 12:15 AM

Quote:

Originally Posted by mhdjavanmardi (Post 4673975)
Somebody knows structure of the LILO map file?

I don't think you should do things like that,nor read any modern source code.they won't help much but bring you set-backs,and it seems that you are not an experienced linux user,after all(sorry if i am wrong).

If your target is to simply boot up the kernel,i will suggest you to study older kernels. 0.11 is a good one.If you understand the several assembly files,you will figure out many things yourself(according to what you asked).I do believe you will understand many aspects about the kernel,not only the boot phase(it is not that simple,of course).

good luck!


All times are GMT -5. The time now is 12:46 AM.