loading from grub...

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
User avatar
prinzrainer
Posts: 13
Joined: Sun Nov 22, 2009 11:36 pm

loading from grub...

Post by prinzrainer »

I already finished my boot loader just enough to load my kernel from a fat16/32, ata drive. For compatibility/portability's sake, I wanted to support multiboot specification and grub. I planned to chain load it from grub to my 2nd stage loader but one obstacle is blocking me, it says that grub only load images above 1mb and since my 2nd stage loader is loaded at 0x8e00(due to realmode limitation) grub won't load it.. But one thing I've seen, grub loads linux zImage below 1mb (?), it says that grub allowed it because it has fixed starting point and size. So there a way. But how? By just specifying the headerAddr and loadEndAddr in multi boot info?
TylerH
Member
Member
Posts: 285
Joined: Tue Apr 13, 2010 8:00 pm
Contact:

Re: loading from grub...

Post by TylerH »

The only method I know of that would allow you to be loaded below 1mb is chainloading. Chainloading comes with it's own issues though, you will be loaded in an environment meant to imitate the environment an MBR expects. I'm not sure if all the multiboot info is still passed by pointer in ebx, anyone know?
User avatar
JackScott
Member
Member
Posts: 1032
Joined: Thu Dec 21, 2006 3:03 am
Location: Hobart, Australia
Mastodon: https://aus.social/@jackscottau
GitHub: https://github.com/JackScottAU
Contact:

Re: loading from grub...

Post by JackScott »

Linux isn't Multiboot compliant. GRUB has a special mode that's halfway in between chainloading and Multiboot just for Linux (yeah... kinda defeats the purpose of Multiboot, huh?).

If you want to support Multiboot (a good idea, IMHO), then the best thing to do would be to simply let GRUB load your kernel directly. Or alternatively write your bootloader to support enough of the Multiboot specification in order to be able to load your kernel. This would give people a choice of which bootloader to use.
Post Reply