QEMU and alternatives for fancy menu evaluation

77 views
Skip to first unread message

pxw

unread,
Nov 23, 2009, 4:28:15 AM11/23/09
to burg-devel
Hi,

As noted before, I was using qemu for burg fancy menu evaluation but
it broke after rev 1767. Maybe this is just another Apple 4gb ram
issue for qemu. It might be easier to use other virtual machine
methods, but qemu seemed easiest.

I checked and found burg rev 1767 introduced gfx_region.c, gfxrgn and
textrgn and other menu changes.

Details of problem -

QEMU PC emulator version 0.10.0, Copyright (c) 2003-2008 Fabrice
Bellard
ii qemu 0.10.0-1ubuntu1 fast processor emulator

qemu host ubuntu904 amd64. Host machine Apple (intel) Imac81 with 4GB
RAM.

grub source build -

$ bzr branch lp:burg -r 1766 burg66
$ ./autogen.sh
$ mkdir build-pc && cd build-pc
$ ../configure --with-platform=pc --prefix=$HOME/burg66-pc
$ make && make install
$ ./grub-mkrescue --image-type=floppy grub66.img

$ sync && qemu -fda grub66.img -hda adisk.img -vga std
(having set up qemu and loop mounted adisk.img for editing menu)

For r1766, this works well and gets to the grub fancy gfx menu in
qemu. using grub2.cfg and menu2 files in the adisk.img.
(grub-mkrescue puts all modules in memdisk). grub.cfg and menu files
can be edited and restart qemu to check.

But for burg rev1767 or later with gfxrgn , the same procedure starts
grub.img in qemu, but goes to black screen when 'load_config /menu3/
default.txt'. Without load_config it shows the plain nmenu and can run
grub shell comands.

The following outside RAM error was also seen but only without -vga
std ....
pxw@im:~/qemu$ sync && qemu -fda grub72.img -hda adisk.img
qemu: fatal: Trying to execute code outside RAM or ROM at 0xff0720ff

Note that qemu has max 2074MB virtual ram. )
--------------------------------
Here is the grub3.cfg used for rev1772 same problem as 1767

#grub3.cfg 20091123 burg 1767 gfxrgn breaks qemu?
# menu config as in http://ubuntuforums.org/showpost.php?p=8215344&postcount=28

set root=(hd0)

timeout=20

menuentry "REBOOT" {
reboot
}
menuentry "HALT" {
halt
}

set gfxmode="640x480"
set gfxfont="Unifont Regular 16"
loadfont /menu3/unifont.pf2
insmod vbe
insmod png
insmod coreui
# breaks here
load_config /menu3/default.txt
------------------

pxw

Bean

unread,
Nov 23, 2009, 5:13:48 AM11/23/09
to burg-...@googlegroups.com
Hi,

Oh, the latest theme file is at:

http://grub4dos.sourceforge.net/themes.tar.bz2

The zip version is not updated anymore.

BTW, the simplest way to test i386-pc is to use cdrom image, create a
directory like cdrom, and extract theme files to it:

mkdir cdrom
cd cdrom
tar xjf ~/themes.tar.bz2

Then create config file cdrom/boot/grub/grub.cfg.

Finally, create iso image with grub-mkrescue:

grub-mkrescue --overlay cdrom grub2.iso

Start it in qemu:

qemu -cdrom grub2.iso

Tested on using latest themes file and r1778.

--
Bean

Project: https://launchpad.net/burg
Document: https://help.ubuntu.com/community/Burg
Mailing list: http://groups.google.com/group/burg-devel

Bean

unread,
Nov 23, 2009, 5:16:30 AM11/23/09
to burg-...@googlegroups.com
On Mon, Nov 23, 2009 at 6:13 PM, Bean <bean...@gmail.com> wrote:
> Hi,
>
> Oh, the latest theme file is at:
>
> http://grub4dos.sourceforge.net/themes.tar.bz2
>
> The zip version is not updated anymore.
>
> BTW, the simplest way to test i386-pc is to use cdrom image, create a
> directory like cdrom, and extract theme files to it:
>
> mkdir cdrom
> cd cdrom
> tar xjf ~/themes.tar.bz2
>
> Then create config file cdrom/boot/grub/grub.cfg.
>
> Finally, create iso image with grub-mkrescue:
>
> grub-mkrescue --overlay cdrom grub2.iso

Hi,

Oh sorry, it should be:

grub-mkrescue --overlay=cdrom grub2.iso

Bean

unread,
Nov 23, 2009, 5:23:34 AM11/23/09
to burg-...@googlegroups.com
On Mon, Nov 23, 2009 at 6:16 PM, Bean <bean...@gmail.com> wrote:
> On Mon, Nov 23, 2009 at 6:13 PM, Bean <bean...@gmail.com> wrote:
>> Hi,
>>
>> Oh, the latest theme file is at:
>>
>> http://grub4dos.sourceforge.net/themes.tar.bz2
>>
>> The zip version is not updated anymore.
>>
>> BTW, the simplest way to test i386-pc is to use cdrom image, create a
>> directory like cdrom, and extract theme files to it:
>>
>> mkdir cdrom
>> cd cdrom
>> tar xjf ~/themes.tar.bz2
>>
>> Then create config file cdrom/boot/grub/grub.cfg.
>>
>> Finally, create iso image with grub-mkrescue:
>>
>> grub-mkrescue --overlay cdrom grub2.iso
>
> Hi,
>
> Oh sorry, it should be:
>
> grub-mkrescue --overlay=cdrom grub2.iso

Hi,

Oh btw, as cdrom can't be written, if you want to test the save
default function, create a small floppy image that contain the
environment file, and in grub.cfg:

set envfile=(fd0)/env

load_env and save_env would work just fine. Start qemu:

qemu -boot d -fda env.img -cdrom grub2.iso

Peter Cros

unread,
Nov 23, 2009, 8:37:49 AM11/23/09
to burg-...@googlegroups.com

Yes, thanks, I tried all those alternatives already including the overlay method, just rechecked -r1772 again with themes as below, it has the same problem with qemu here.
--------
#grubtheme.cfg 2009-11-23 as in ubuntu help burg doc
# with boot/grub/themes extracted from http://grub4dos.sourceforge.net/themes.tar.bz2

# qemu disk image is (hd0), but initial (memdisk)/boot/grub/grub.cfg runs first
# then drops back to grub shell, manually run 'configfile (hd0)/grubthemes.cfg'


set root=(hd0)

timeout=20

menuentry "REBOOT" {
 reboot
}
menuentry "HALT" {
 halt
}

set gfxmode="640x480"
set gfxfont="Unifont Regular 16"
loadfont /boot/grub/themes/fonts/unifont.pf2
loadfont /boot/grub/themes/fonts/aqui.pf2
loadfont /boot/grub/themes/fonts/edges.pf2
loadfont /boot/grub/themes/fonts/lime.pf2
loadfont /boot/grub/themes/fonts/7x13B.pf2
loadfont /boot/grub/themes/fonts/smoothansi.pf2
loadfont /boot/grub/themes/fonts/Helvetica-Bold-14.pf2

insmod vbe
insmod png
insmod coreui
load_config /boot/grub/themes/proto/theme.txt

##############

Same result giving black screen and qemu hangup, that is consistent for various menu config options I tried.

The problem begins at the last line -
'load_config /boot/grub/themes/proto/theme.txt'

A real grub boot with themes or other gfx menu all works, but very inconvenient.

I think we differ in the host machine and RAM size, so you don't have the same problem, although I don't understand it.

But I can always try virtualbox in OSX with a full guest install of Ubuntu or debian, which I think is how Evan G is doing it, just seems excessive when qemu works for you. I have not used virtual machine before this, and had it working very well with -r 1766.
--
Cros (pxw)


Bean

unread,
Nov 23, 2009, 8:54:53 AM11/23/09
to burg-...@googlegroups.com
Hi,

That's odd, qemu is ok for me. I've tried qemu 0.10.50 from windows
host, and 0.10.6 from OSX host, both all right. I upload my iso image
here, perhaps you can give it a try:

http://grub4dos.sourceforge.net/grub2.iso.bz2

BTW, the loading time is a little long in qemu. Here, it take about 7
seconds to show the menu, so maybe you can wait a while to see if the
image comes up.

Peter Cros

unread,
Nov 23, 2009, 9:29:29 AM11/23/09
to burg-...@googlegroups.com
Hi,

Yes your iso is fine, qemu -cdrom grub2.iso -vga std. Thats with overlay in hd96.
Thanks, I will compare details  with what I was doing, hopefully find where I went wrong. I assume that is -r 1778?

BTW I am running qemu in ubuntu904 amd64  linux host.
--
Cros (pxw)


Bean

unread,
Nov 23, 2009, 9:33:50 AM11/23/09
to burg-...@googlegroups.com
On Mon, Nov 23, 2009 at 10:29 PM, Peter Cros <pxw...@gmail.com> wrote:
> Hi,
>
> Yes your iso is fine, qemu -cdrom grub2.iso -vga std. Thats with overlay in
> hd96.
> Thanks, I will compare details  with what I was doing, hopefully find where
> I went wrong. I assume that is -r 1778?
>
> BTW I am running qemu in ubuntu904 amd64  linux host.

Hi,

Yep, it's 1778.

Keun

unread,
Nov 23, 2009, 3:12:36 PM11/23/09
to burg-devel
I also had burg working under kvm, which is similar to qemu and also
quite light. I believe faster than qemu due to its kernel level
virtualization and virtualization instruction sets on more recent
processors, but it didn't support resolutions above 1024x768 in the
boot screen.

E

On Nov 23, 8:37 am, Peter Cros <pxwp...@gmail.com> wrote:
> Yes, thanks, I tried all those alternatives already including the overlay
> method, just rechecked -r1772 again with themes as below, it has the same
> problem with qemu here.
> --------
> #grubtheme.cfg 2009-11-23 as in ubuntu help burg doc
> # with boot/grub/themes extracted fromhttp://grub4dos.sourceforge.net/themes.tar.bz2
> On Mon, Nov 23, 2009 at 9:23 PM, Bean <bean12...@gmail.com> wrote:
>
> > On Mon, Nov 23, 2009 at 6:16 PM, Bean <bean12...@gmail.com> wrote:

Peter Cros

unread,
Nov 24, 2009, 3:55:50 AM11/24/09
to burg-...@googlegroups.com
I am glad to report that qemu is now happy with burg -r 1778. The bug seems to have been self inflicted by using grub shell to source a second grub.cfg or menu config, after the first grub.cfg had run. For some reasonm this was ok prior to rev 1767.

Now using -

$ grub-mkrescue --overlay=overlay grub78.iso
$ qemu -cdrom grub78.iso -vga std
 Resolution is up to 1440x900 1600x1200 and 2560x1600 (shown by vbeinfo)
 Without -vga std,  max 1024x768.

Now to try some menu tricks.

Thanks.

Bean

unread,
Nov 25, 2009, 2:04:14 AM11/25/09
to burg-...@googlegroups.com
On Tue, Nov 24, 2009 at 4:55 PM, Peter Cros <pxw...@gmail.com> wrote:
> I am glad to report that qemu is now happy with burg -r 1778. The bug seems
> to have been self inflicted by using grub shell to source a second grub.cfg
> or menu config, after the first grub.cfg had run. For some reasonm this was
> ok prior to rev 1767.

Hi,

I believe this is caused by the handling of menu viewer. Previously,
the new menu system need to be started using command menu_start, but
now it's implemented as a menu viewer. After grub.cfg is parsed, the
system tries to choose a menu viewer automatically based on if a
screen section exists. However, command like configfile calls the menu
viewer itself, which is not initialized yet. Perhaps I should revert
to previous behavior, the normal viewer is selected by default, and
users need to use an additional command to switch to new viewer.

Peter Cros

unread,
Nov 25, 2009, 4:26:08 AM11/25/09
to burg-...@googlegroups.com
Hi,

Sounds like a good explanation. From a users point of view I don't see any problem to require a menu_start command if it seems desirable.

But I am quite happy with the -r 1778 version for qemu menu evaluation, using overlay for grub-mkrescue grub.iso. It is better than the previous method I used for qemu.

--
Cros (pxw)


Reply all
Reply to author
Forward
0 new messages