grub2, grub-mkrescue, bios, vbe framebuffer, custom kernel

2.6k views Asked by At

Time to ask my first-ever question here.

At some point in past, I used to have my kernel Just Work (TM) with GRUB2; it still does with GRUB Legacy, but I want [VBE] framebuffer graphics.

The first problem I noticed is that

grub-mkrescue -o cd.iso cdimg/

builds bogus, unbootable images. The latest version I've tried builds an okay text-mode image if I copy my kernel to the root of the image source directory and call it efi.img (otherwise, xorriso fails due to missing efi.img).

I suppose the real question here is if GRUB2 is even supposed to work with non-EFI systems? :( As far as I know, my framebuffer initialisation and filling the screen with white are the exact same code that used to work with some earlier version of GRUB2 before.

Thanks in advance,

Vendu

P.S. FWIW, the OS project is at https://github.com/vendu/OS-Zero/

P.P.S. I hope this isn't all too vague... :)

2

There are 2 answers

7
Thomas Schmitt On

i am the developer of xorriso (but not much involved in GRUB2).

the real question here is if GRUB2 is even supposed to work with non-EFI systems? :(

My own test system has AMD 64 bit with BIOS, not EFI. It boots grub-mkrescue images from CD/DVD and from USB stick.

Does yours boot with a grub-mkrescue image without payload ?

grub-mkrescue -o cd.iso

(you should get a GRUB2 boot prompt then)

A GRUB2 based GNU/Linux image which boots for me from CD/DVD is epidemic-4.1-b1-1-amd64.iso . (It fails to boot from USB stick because of a shortcomming in its initrd. This is not the fault of GRUB2.) Its GRUB2 is not the newest one, though.

builds bogus, unbootable images.

Can you post the outcome of

xorriso -indev cd.iso -toc

which should report about the El Torito boot info which is used by BIOS and UEFI when booting from CD and DVD. (Interesting are only images which do not boot properly, of course.)

If this looks good so far, then you should report the problem to your distro's maintainer (if you aren't in that role yourself) or to grub-devel mailing list.

P.P.S. I hope this isn't all too vague... :)

You will have to give at least an exact description of the refusal to boot: What BIOS do you have ? What version of GRUB2 did you use ? What messages do you see ? Does it happen on more than one machine ? ...any unusual circumstances ... ?

Have a nice day :)

Thomas

3
variable On

Hit this one today on Debian Jessie. To fix the grub-mkrescue -o boot.iso failing with missing /efi.img just install mtools package. Grub depends on mtools (optionally) and fails silently if it doesn't exist.

On Debian apt-get install mtools solved this for me. Hope it helps.