Is my bootloader doing enough to boot Linux Image
Posted: Sat Mar 30, 2013 12:31 pm
I am new to bootloader and Linux kernel and been working on a project where we have to port underlying QNX kernel to Linux .The current modified bootloader code has support for booting QNX kernel.It seems like bootloader also has support for booting Linux, but will it be enough to boot linux image. Below is what our Bootloader is doing
Bootloader is calling start_kernel fuction which have two argument passed to it one is kernel entry point and second is pointer to boot line
1.Address 0X90000ULL which is type casted to boot_params structure.
2.Relocate initrd
3.Copy boot sector ,Set up data and commad line to final resting place
4.Initialize Linux GDT
5.Jump to Kernel entry point
6.Disable interrupt
7.Lunch_kernel()
Now in above code two tricky things which doubted support for Linux kernel booting.
The first thing is the way Jump to kernel entry point, normally I see jumping to kernel entry in uboot or LInux source is in assembly but in our bootloade it simply filing a structure .
struct
{
long Kernelentry;
long kernel_code_segment;
}
jumpv;
void *jump_s;
jumpv.kernelentry=first argument pass to start_kernel;
jumpv.kernel_code_segment=0x10;
jump_s=(void *)&jumpv;
Second thing is the Lunch_kernel() for which definition is not present at all in code base.
Now is above stuff enough to pass control to linux image or what else I can add/modified to boot the linux image in our current bootloader code.
We are on working X86 architecture.
Due to some reason we can't do hit and trial on our borad untill we are sure about things.
Bootloader is calling start_kernel fuction which have two argument passed to it one is kernel entry point and second is pointer to boot line
1.Address 0X90000ULL which is type casted to boot_params structure.
2.Relocate initrd
3.Copy boot sector ,Set up data and commad line to final resting place
4.Initialize Linux GDT
5.Jump to Kernel entry point
6.Disable interrupt
7.Lunch_kernel()
Now in above code two tricky things which doubted support for Linux kernel booting.
The first thing is the way Jump to kernel entry point, normally I see jumping to kernel entry in uboot or LInux source is in assembly but in our bootloade it simply filing a structure .
struct
{
long Kernelentry;
long kernel_code_segment;
}
jumpv;
void *jump_s;
jumpv.kernelentry=first argument pass to start_kernel;
jumpv.kernel_code_segment=0x10;
jump_s=(void *)&jumpv;
Second thing is the Lunch_kernel() for which definition is not present at all in code base.
Now is above stuff enough to pass control to linux image or what else I can add/modified to boot the linux image in our current bootloader code.
We are on working X86 architecture.
Due to some reason we can't do hit and trial on our borad untill we are sure about things.