suggestion for the QEMU advent calendar
Hi there,
thank you very much for the QEMU advent calender! What a neat idea, I enjoy it very much.
I'd like to add one suggestion: GRUB Invaders [1]. This is a multi-boot compliant kernel game that allows to play Space Invaders from within GRUB, i.e. without an operating system. I especially recommend the version [2] packaged in Debian which contains some extra patches.
Thank you for considering!
Best regards,
Fabian
[1] http://www.erikyyy.de/invaders/
[2] https://packages.qa.debian.org/i/invaders.html
Quoted 4 lines · Fabian Greffrath
I'd like to add one suggestion: GRUB Invaders [1]. This is a multi-boot compliant kernel game that allows to play Space Invaders from within GRUB, i.e. without an operating system. I especially recommend the version [2] packaged in Debian which contains some extra patches.
Thanks! I've added it to the list of ideas for the remaining slots.
If you have the time to create the image yourself, please let me know.
Stefan
Am Montag, den 08.12.2014, 10:14 +0000 schrieb Stefan Hajnoczi:
Quoted 1 line
If you have the time to create the image yourself, please let me know.
I'd love to, but how do I create an image with just GRUB and the game, but no actual OS?
- Fabian
Quoted 10 lines · Fabian Greffrath
Am Montag, den 08.12.2014, 10:14 +0000 schrieb Stefan Hajnoczi:
Quoted 1 line
If you have the time to create the image yourself, please let me know.
I'd love to, but how do I create an image with just GRUB and the game, but no actual OS?
- Fabian
I would use a boot environment, like the "try it out" mode of Fedora/Ubuntu etc to get a working linux environment, create a /boot partition on a smallish virtual hard disk, and install your packages as needed.
If manually installing a bootable grub sounds gross, I would try a two virtual disk approach where you put /boot on -hda and / on -hdb, and just run through e.g. the Debian installation process and install your grub packages as needed. Then once completed, you can use either the OS installation or a boot disk to cull the OS entries from grub, then delete the second virtual disk to leave you with a functioning grub stub.
Am Montag, den 08.12.2014, 11:03 -0500 schrieb John Snow:
Quoted 1 line
If manually installing a bootable grub sounds gross, [...]
Actually, this turns out not to be necessary at all. After all, GRUB Invaders is a multiboot-compliant kernel game and as such can be loaded directly by means of qemu's -kernel parameter. Thus, the "run" script would look like this:
qemu-system-i386 -kernel invaders.exec
Please find the kernel image attached. It is built from the Debian sources found here:
https://packages.qa.debian.org/i/invaders.html
Hope this helps. If there are any further questions, please do not hesitate to ask me.
- Fabian
PS: I am a bit shocked by the fact how complicated it is to install GRUB on a disk image. And, John, even if the approach you outlined worked, I guess GRUB will find its device.map puzzled when it will get rebooted from inside an image file instead of an actual hard-drive partition the next time.
Quoted 18 lines · Fabian Greffrath
Am Montag, den 08.12.2014, 11:03 -0500 schrieb John Snow:
Quoted 1 line
If manually installing a bootable grub sounds gross, [...]
Actually, this turns out not to be necessary at all. After all, GRUB Invaders is a multiboot-compliant kernel game and as such can be loaded directly by means of qemu's -kernel parameter. Thus, the "run" script would look like this:
qemu-system-i386 -kernel invaders.exec
Please find the kernel image attached. It is built from the Debian sources found here:
https://packages.qa.debian.org/i/invaders.html
Hope this helps. If there are any further questions, please do not hesitate to ask me.
Quoted 7 lines
- Fabian
PS: I am a bit shocked by the fact how complicated it is to install GRUB on a disk image. And, John, even if the approach you outlined worked, I guess GRUB will find its device.map puzzled when it will get rebooted from inside an image file instead of an actual hard-drive partition the next time.
Thanks!
Stefan
Am 08.12.2014 um 17:54 hat Fabian Greffrath geschrieben:
Quoted 5 lines
PS: I am a bit shocked by the fact how complicated it is to install GRUB on a disk image. And, John, even if the approach you outlined worked, I guess GRUB will find its device.map puzzled when it will get rebooted from inside an image file instead of an actual hard-drive partition the next time.
As long as you don't say which version of GRUB, it's easy. Install GRUB Legacy, copy stage[12] and menu.lst to the image and do this in the GRUB shell:
device (hd0) $IMAGE_PATH
root (hd0,0)
install /boot/grub/stage1 (hd0) /boot/grub/stage2 p /boot/grub/menu.lst
Or boot from a floppy/CD with GRUB in the VM and run the same thing without the "device" command.
Syslinux is relatively easy as well. Just avoid GRUB 2 if you want to set up disk images from the host. I've done it before, but it's ugly...
Kevin
Am Dienstag, den 09.12.2014, 10:28 +0100 schrieb Kevin Wolf:
Quoted 2 lines
Syslinux is relatively easy as well. Just avoid GRUB 2 if you want to set up disk images from the host. I've done it before, but it's ugly...
Yep, I was talking about GRUB 2. However, in the meantime I have figured out what to do in order to create a "minimal" booting image. After all the image creation, partitioning, formatting, device mapping and finally mounting you only have to call "grub-install" with the right parameters (!), copy the actual kernel into the image and create a minimal grub.cfg file.
By "right parameters" I meant that grub-install per default copies GRUB 2 in its entirety onto the image, including the whole menu system, graphical support, file system drivers and localization, etc. This will take up about 10MB, which is why I put the "minimal" word in quotation marks. You can, of course, manually select which modules you want to install, but this must be a perfect guess. In my simple case it worked with '--install-modules="part_msdos ext2 multiboot normal" --locales=""' passed to grub-install on the command line.
Anyway, it's easier to just boot the multiboot kernel image and be done with it. ;)
Cheers,
Fabian
Quoted 20 lines · Fabian Greffrath
Am Dienstag, den 09.12.2014, 10:28 +0100 schrieb Kevin Wolf:
Quoted 2 lines
Syslinux is relatively easy as well. Just avoid GRUB 2 if you want to set up disk images from the host. I've done it before, but it's ugly...
Yep, I was talking about GRUB 2. However, in the meantime I have figured out what to do in order to create a "minimal" booting image. After all the image creation, partitioning, formatting, device mapping and finally mounting you only have to call "grub-install" with the right parameters (!), copy the actual kernel into the image and create a minimal grub.cfg file.
By "right parameters" I meant that grub-install per default copies GRUB 2 in its entirety onto the image, including the whole menu system, graphical support, file system drivers and localization, etc. This will take up about 10MB, which is why I put the "minimal" word in quotation marks. You can, of course, manually select which modules you want to install, but this must be a perfect guess. In my simple case it worked with '--install-modules="part_msdos ext2 multiboot normal" --locales=""' passed to grub-install on the command line.
Quoted 2 lines
Anyway, it's easier to just boot the multiboot kernel image and be done with it. ;)
The multiboot image is fine.
10 MB for a boot loader? Just wow, at some point it's better to slap a boot sector onto the Linux kernel and be done with it, kexec already exists.
Stefan
Am Dienstag, den 09.12.2014, 09:51 +0000 schrieb Stefan Hajnoczi:
Quoted 1 line
The multiboot image is fine.
I think so.
Quoted 3 lines
10 MB for a boot loader? Just wow, at some point it's better to slap a boot sector onto the Linux kernel and be done with it, kexec already exists.
Well, it's a bit more than "just" a boot loader, but yeah:
$ du -h /boot/grub/ 3,2M /boot/grub/locale 2,4M /boot/grub/i386-pc 2,3M /boot/grub/fonts 11M /boot/grub/
- Fabian