Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No FS0 in EFI Shell

I want to try programming for EFI so I created a VM using virtualbox, checked "enable efi" option and left CD empty. The efi shell boots how it should but instead of FS0 i only see BLK0, BLK1 etc. Is there any way to have FS without inserting USB disk (which is displayed as FS)?

Edit: Thanks for your replies. For people who still want to use VB - formatting VB disk with DISKPART using Windows CD solves the problem.

like image 263
Corson Avatar asked Dec 15 '15 20:12

Corson


1 Answers

@unixsmurf answer in comments is correct. Your image need file system supported by UEFI. If you can't see fsX in output of map command then it means that non of attached block devices (blkX) contain supported file system. Please create FAT32 partition on your disk, then you will be able to see fsX in map output. To switch between file systems use DOS like syntax command ie. fs0: switch to FS0 file system.

According to UEFI specification 2.5 section 12.3:

EFI encompasses the use of FAT32 for a system partition, and FAT12 or FAT16 for removable media.

I would suggest to use OVMF (Open Virtual Machine Firmware) directly with QEMU not through VirtualBox. Why ?

  • Because you can hack OVMF and learn how it works internally, this give you better understanding, VirtualBox hide internals and I'm not sure if it allow firmware replacement
  • OVMF was developed initially for QEMU and it is adapted by various other virtual machines, because of that there is much more support for OVMF on QEMU then OVMF on VirtualBox
  • using QEMU also give you ability to emulate your hardware and write drivers/applications in UEFI that use it

I wrote beginners tutorial that help setting up development environment needed for UEFI application development using OVMF.

More about OVMF.

like image 79
Piotr Król Avatar answered Sep 25 '22 10:09

Piotr Król