Page 1 of 1
Bootloader
Posted: Sat Apr 28, 2012 9:45 am
by LindusSystem
What all you think dose BootLoader needs to provide to the kernel?
Dont say A20 ,PMode,etc
Just what information it needs, somewhat like Multiboot structure.
EDIT:
Sorry for lack of information.
What I mean is what information do I need to give the kernel before jumping to the kernel.I have planned to develop a structure and pass the base address in "ebx" and the size in "edx" registers before giving control to the kernel.I have done things to supply the memory map.
Re: Bootloader
Posted: Sat Apr 28, 2012 10:38 am
by bluemoon
IMO, the boot loader need to provide to kernel:
1. basic information that comes handy from BIOS, for example:
- memory map
- video modes
- kernel loaded address and size
- list of modules with loaded address and size
2. safe and consistence environment expected by the kernel
- cpu flags, I would set to 2
- pmode, long mode (if expected by kernel)
- page directory layout (if expected by kernel)
- machine met the minimal hardware requirement (eg. if kernel assume 1~4MiB is usable, but the memory map say that there is a hole and not usable, the kernel may crash if it is executed)
ps. there are much more to add for a good loader.
Re: Bootloader
Posted: Sat Apr 28, 2012 10:59 am
by Yoda
LindusSystem wrote:What all you think dose BootLoader needs to provide to the kernel?
It depends on what the kernel estimates from bootloader. I prefer to pass only data that could not be get in any other way than through bootloader. At this moment I know only one that info: drive and partition from which the kernel is loaded. That is what my bootloader passes.
Re: Bootloader
Posted: Sat Apr 28, 2012 11:53 am
by egos
LindusSystem wrote:What all you think dose BootLoader needs to provide to the kernel?
My kernel/stage 2 is loaded together with one additional file (loaded directly after it) and usually takes control in RM so it needs system disk/partition/folder and size of additional file:
dl - BIOS disk number;
dh - partition number in current partitioning scheme or 0 (whole device or default partition);
ax:cx - size of additional file or 0 (autodetect);
bx != 0xAA55 (reserved for future extensions).
System folder name is passed in special structure stored at the end of kernel image. When Multiboot-compliant boot loader was used all required parameters are passed through Multiboot structures (system folder name can be taken from Multiboot command line).
Re: Bootloader
Posted: Sat Apr 28, 2012 1:09 pm
by VolTeK
Re: Bootloader
Posted: Sat Apr 28, 2012 9:47 pm
by LindusSystem
Ok, thank you all.
So I have planned to create a structure in the bootloader keep all the info and pass the address and limit of it in "ebx" and "edx" register.
Will this work?
@Voltek, I am in booloader stage, not a kernel stage.
Anyway Thanks for your consideration
Re: Bootloader
Posted: Sat Apr 28, 2012 10:18 pm
by VolTeK
LindusSystem wrote:@Voltek, I am in booloader stage, not a kernel stage.
No, no your not.
Re: Bootloader
Posted: Sun Apr 29, 2012 12:48 am
by LindusSystem
I did not get you ,VolTek.