Bootloader

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
LindusSystem
Member
Member
Posts: 63
Joined: Sat Apr 28, 2012 9:41 am
Location: Earth -> Asia

Bootloader

Post 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.
Anyone has a idea of making a ntfs bootsector?if yes PM me , plz.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Bootloader

Post 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.
User avatar
Yoda
Member
Member
Posts: 255
Joined: Tue Mar 09, 2010 8:57 am
Location: Moscow, Russia

Re: Bootloader

Post 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.
Yet Other Developer of Architecture.
OS Boot Tools.
Russian national OSDev forum.
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: Bootloader

Post 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).
If you have seen bad English in my words, tell me what's wrong, please.
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: Bootloader

Post by VolTeK »

LindusSystem
Member
Member
Posts: 63
Joined: Sat Apr 28, 2012 9:41 am
Location: Earth -> Asia

Re: Bootloader

Post 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
Anyone has a idea of making a ntfs bootsector?if yes PM me , plz.
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: Bootloader

Post by VolTeK »

LindusSystem wrote:@Voltek, I am in booloader stage, not a kernel stage.

No, no your not.
LindusSystem
Member
Member
Posts: 63
Joined: Sat Apr 28, 2012 9:41 am
Location: Earth -> Asia

Re: Bootloader

Post by LindusSystem »

I did not get you ,VolTek.
Anyone has a idea of making a ntfs bootsector?if yes PM me , plz.
Post Reply