A livecd / usb that boots from both PC BIOS and EFI BIOS?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
tom9876543
Member
Member
Posts: 170
Joined: Wed Jul 18, 2007 5:51 am

A livecd / usb that boots from both PC BIOS and EFI BIOS?

Post by tom9876543 »

Hi

I was wondering if its possible to create a bootable CD that can boot from both legacy BIOS and EFI BIOS?

Also would it be possible to create a bootable USB that can boot from both? It would probably need to be GPT partitioned I guess.

That would be an interesting challenge. I don't have an EFI hardware so can't try it myself.
User avatar
turdus
Member
Member
Posts: 496
Joined: Tue Feb 08, 2011 1:58 pm

Re: A livecd / usb that boots from both PC BIOS and EFI BIOS

Post by turdus »

I do not use CDs, but my OS disk image can boot from BIOS and EFI as well. Unfortunatelly the EFI loader is not finished yet, but it gets started by the firmware if I create an EFI partition on 1mb boundary with size of at least of 100Mb.
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: A livecd / usb that boots from both PC BIOS and EFI BIOS

Post by egos »

It's possible because EFI doesn't use boot code on the media and CDFS doesn't use first (reserved) sectors of the media.
If you have seen bad English in my words, tell me what's wrong, please.
ACcurrent
Member
Member
Posts: 125
Joined: Thu Aug 11, 2011 12:04 am
Location: Watching You

Re: A livecd / usb that boots from both PC BIOS and EFI BIOS

Post by ACcurrent »

OK heres what you do for an EFI/BIOS live CD.
1 - Create a fat floppy image.
2 - Place your bios boot sector in the MBR.
3 - Create an EFI boot loader and call it bootx64.efi (or bootx86.efi depending on the architecture).
4 - Place your EFI boot loader in your floppy in the following path /EFI/BOOT.
5 - You should now have a floppy with a boot sector and a file called /EFI/BOOT/BOOTx64.efi.
6 - Use the floppy image in a CD.
7 - Tada!
I did this to try and get a fedora live usb working on both my mac and dell guess what? THE EFI GRUB DOES NOT WORK. (Im working on my own bootloader).
Get back to work!
Github
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: A livecd / usb that boots from both PC BIOS and EFI BIOS

Post by Combuster »

That's because you're expecting EFI to look for the bootcode inside a filesystem stored inside a floppy image stored in an ISO9660 volume.

Basically to support both systems is to write a CD bootloader (with floppy emulation perhaps) and build an ISO9660 volume with it to satisfy legacy bioses, then use the areas not needed by ISO9660 to store the partition table and all other relevant data. This is also how basically all non-x86 CD booting systems work that I've seen (mcd, sparc, hppa, dreamcast). Special code injection tools exist for all these platforms for that very specific purpose.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply