use GRUB to boot

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
nlg
Member
Member
Posts: 40
Joined: Mon Mar 14, 2016 5:34 am

use GRUB to boot

Post by nlg »

i want to test my hobby os with Grub. to boot , i have to copy a file at a specific adress and jump to it in real mode but i dont find the right way to do it with grub. is it possible? and how can i do?
for now i use the nework booting (PXE) and it work fine
Octocontrabass
Member
Member
Posts: 5581
Joined: Mon Mar 25, 2013 7:01 pm

Re: use GRUB to boot

Post by Octocontrabass »

nlg wrote:is it possible?
No. GRUB can only boot your OS in protected mode, not real mode.

If you would like to modify your OS so GRUB can load it, you'll need to look at the multiboot specification.
nlg
Member
Member
Posts: 40
Joined: Mon Mar 14, 2016 5:34 am

Re: use GRUB to boot

Post by nlg »

i found the command "chainloader" to load file, i dont found any information where the file is exacly loaded but it seem to be used in Dos or Windows booting so i think the file is loaded in the adress 7C00h and the command "boot" jump to it
if the command work like i this, it was perfect function for me, now i have to install grub on a usb key to test it
User avatar
iansjack
Member
Member
Posts: 4705
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: use GRUB to boot

Post by iansjack »

You can use chainloader to boot DOS from grub, but it chains to another boot loader. Unless you want to boot multiple operating systems, that rather defeats the purpose of using grub.

https://www.gnu.org/software/grub/manua ... 02dloading
nlg
Member
Member
Posts: 40
Joined: Mon Mar 14, 2016 5:34 am

Re: use GRUB to boot

Post by nlg »

alas for me, chainloader only loads the 512 first byte of the file (i test it)

my home bootloader loads an image from a partition and I hope to replace it with grub. at least I can multiboot with my OS even if I still have to sacrifice a MBR partition for that (or I can try to make my kernel multiboot compatible)

thank you all for your indication, it helped me a lot
Post Reply