Page 1 of 1

How to set up iso directory grub.cfg

Posted: Thu Feb 07, 2013 9:51 pm
by BenjiWiebe
I am following the steps in the C# OSDev series, except I am writing the kernel in C. I am using grub2. My directory layout:

Code: Select all

.:
boot  kernel.bin

./boot:
grub2

./boot/grub2:
grub.cfg
Contents of grub.cfg:

Code: Select all

multiboot /kernel.bin
boot
But I get a grub prompt when I run

Code: Select all

grub2-mkrescue -o image.iso iso
and boot the image.iso.

Anyone have any ideas?

Re: How to set up iso directory grub.cfg

Posted: Fri Feb 08, 2013 12:11 am
by egos
Contents of grub.cfg:

Code: Select all

multiboot /kernel.bin
boot
Is that all? Try this:

Code: Select all

menuentry "Run my kernel" {
multiboot /kernel.bin
}

Re: How to set up iso directory grub.cfg

Posted: Fri Feb 08, 2013 12:46 am
by jnc100
Grub2 looks for its configuration file in /boot/grub/grub.cfg (not /boot/grub2/grub.cfg).

Regards,
John.

Re: How to set up iso directory grub.cfg

Posted: Fri Feb 08, 2013 7:55 am
by BenjiWiebe
jnc100 wrote:Grub2 looks for its configuration file in /boot/grub/grub.cfg (not /boot/grub2/grub.cfg).

Regards,
John.
Thanks!! That fixed it. I wonder why, but in Fedora 17 (what I currently run) the grub.cfg file is located only in /boot/grub2. The only file in /boot/grub is /boot/grub/splash.xpm.gz. Hmmm... Interesting.

Re: How to set up iso directory grub.cfg

Posted: Fri Feb 08, 2013 1:14 pm
by Kazinsal
BenjiWiebe wrote:
jnc100 wrote:Grub2 looks for its configuration file in /boot/grub/grub.cfg (not /boot/grub2/grub.cfg).

Regards,
John.
Thanks!! That fixed it. I wonder why, but in Fedora 17 (what I currently run) the grub.cfg file is located only in /boot/grub2. The only file in /boot/grub is /boot/grub/splash.xpm.gz. Hmmm... Interesting.
The GRUB2 installer can take an argument to change the directory in which it looks for (some) things.