Page 1 of 1

Grub Menuentry in Qemu

Posted: Tue Oct 08, 2013 6:02 am
by sacridex
Hello folks,

I'm not really working on my own OS, but still I think this is the right place to ask for help.

At the moment I'm playing a little with Grub(2.00 from gnu.org) debugging & developing, as far I can build Grub from source(also with an additional module written by myself, which is pretty much the hello mod but that is not important right here) and create an Image with grub-mkimage and then boot it with qemu -kernel my.img [-s -S]. debugging also works fine. I'm using a very simple grub.cfg for this image, which has only one menuentry.
But here starts the problem, I only get some errors and the menuentry is not utilized.

Code: Select all

Welcome to GRUB!

Unknown command `#´ .
Try `help´ for usage
Unknown command `}´ .
Try `help´ for usage
error: no menuentry definition
These messages are only shown very short before the grub shell is displayed (had do breapkoint at rescue parser error output).
Then again commands like set debug=all or else do work well.

I would really need the Grub menu, because I want to play a little with the usb input in the menu loop.
Can anyone help?

Thanks

Appendix
This is my script which creates the image:

Code: Select all

#!/bin/sh

grub-mkimage \
-O i386-pc \
-c grub.cfg \
-d installed/lib/grub/i386-pc \
-o grub.img \
loadenv biosdisk part_msdos part_gpt fat ntfs \
ext2 ntfscomp iso9660 loopback search linux boot minicmd cat cpuid chain \
halt help ls reboot echo test configfile normal sleep memdisk tar font \
gfxterm gettext true vbe vga video_bochs video_cirrus multiboot multiboot2 usb usbtest usb_keyboard
installed is my prefix.

This is my grub.cfg:

Code: Select all

# Begin /boot/grub/grub.cfg
set default=0
set timeout=5
set pager=1

insmod ext2
set root=(hd0,2)

menuentry "GNU/Linux, Linux 3.8.1-lfs-7.3" {
        linux   /boot/vmlinuz-3.8.1-lfs-7.3 root=/dev/sda2 ro
}

Re: Grub Menuentry in Qemu

Posted: Wed Oct 09, 2013 4:08 pm
by Jvac
sacridex wrote:I would really need the Grub menu,
Sure see here GNU GRUB Manual 2.00