Booting of Linux kernel

Arshad Hussain arshad.super at gmail.com
Sun Oct 2 00:09:34 EDT 2016


On 02-Oct-2016, at 9:07 am, Amit Kumar <free.amit.kumar at gmail.com> wrote:

> 
> 
> On Tue, Sep 6, 2016, 8:10 PM Er Krishna <erkrishna at gmail.com> wrote:
> Hi all
> 
> I have a basic question for understanding :
> 
> If we want to boot the Linux kernel without bootloader what needs to be done?

Floopy is a good example of booting OS without boot loader.  This means that
the compressed Linux image is placed right at the start of the floppy. This is
where BIOS locates the floppy and boots the OS.

> 
> In other words what all the core subsystem like memory and all
> needs initialisation by bootloader and if bootloader is not there then how to do it ?

AFAIK, whatever GDT, IDT is initialised by boot-looder is overwritten by OS proper.
We normally do not use GDT etc setup by boot loader.

> 
> I'm also a newbie but whatever I know I tell you.
> When you start/reset your board, there are some code in the ROM, which looks for your 
> code at a particular address in an internal RAM.

Actually, BIOS is hard coded to execute a predefined address on power on. 
This in turn calls boot loader which loads OS from disk onto RAM.


> The size of this RAM is limited, so this 
> code should initialize the regular RAM then load rest of your code and initialize other parts
> of the board.

BIOS normally sets up hardware. Using the standard BIOS calls. Then the OS discards them
and sets up the hardware later. For example after Linux is booted it does not use int 10h calls
anymore. 

> I've read that previously kernel used to include a bootloader but I think after 
> availability of more general bootloaders, it has been removed.
> 
> On which board do you want to test this? You may read docs and read bootloaders code to
> learn where ROM looks for your code and how to initialize RAM and load your code.
> 
> Last but not least you need arm-none-eabi compiler and some linker scripts to place you code 
> at a particular address.
> 
> Thanks
> Krishna
> 
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> -- 
> Regards,
> Amit Kumar
> Twitter: @freeark1
> Only Numbers Can Command.
> 
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




More information about the Kernelnewbies mailing list