EFI System Partition: Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content added Content deleted
mNo edit summary
 
(10 intermediate revisions by 5 users not shown)
Line 1: Line 1:
The EFI System Partition is a dedicated partition on [[GPT]]. Usually a small one (128-256MiB), located at the beginning of the disk and its partition record at the beginning of the GPT.
The '''EFI System Partition (ESP)''' is a dedicated partition on [[GPT]]. Usually a small one (32-256MiB), located at the beginning of the disk and its partition record at the beginning of the GPT.


== Identify ==
== Identify ==
Unlike normal bootable partitions, which have the attribute flag bit 2 set, ESP is identified by it's GUID, which is
Unlike normal bootable partitions, which have the attribute flag bit 2 set, ESP is identified by its GUID, which is


C12A7328-F81F-11D2-BA4B-00A0C93EC93B
C12A7328-F81F-11D2-BA4B-00A0C93EC93B


== Format ==
== Format ==
In theory ESP can be formatted to any [[FAT]] file system, [[FAT12]]/[[FAT16|16]]/[[FAT32|32]]. In reality most firmware only support FAT32, and some platforms with limited resources may support [[FAT16]] too. [[FAT12]] is very rarely implemented, and it's safe to assume it won't work on a real hardware.
The ESP can be formatted to any [[FAT]] file system, [[FAT12]]/[[FAT16|16]]/[[FAT32|32]]. Often [[NTFS]] may also be supported. There's one notable exception, some older Apple machines (like iMac and MacBooks) use a special firmware which only accepts [[HFS+]] file system on the EFI System Partition.

There's one notable exception, Apple machines (like iMac and MacBooks) use a special firmware which only accepts [[HFS+]] file system on the EFI System Partition.


== Access ==
== Access ==
In the EFI Shell, the ESP is the very first file system, denoting as ''FS0:''. [[GRUB]] and [http://elilo.sourceforge.net ELILO] recognize ESP, and they install their files there by default. Other boot loaders, like [http://www.rodsbooks.com/refind/ rEFInd] can only work if ESP exists.
In the EFI Shell, the ESP is the very first file system, denoting as ''FS0:''. [[GRUB]] and [http://elilo.sourceforge.net ELILO] recognize ESP, and they install their files there by default. Other boot loaders, like [http://www.rodsbooks.com/refind/ rEFInd] can only work if ESP exists.
From your application, you can use the [[Loading files under UEFI|EFI_SIMPLE_FILESYSTEM_PROTOCOL]] to access files on the ESP programmatically.


== Important Files on ESP ==
== Important Files on ESP ==
* FS0:\STARTUP.NSH - an EFI Shell script, similar to MS-DOS autoexec.bat
* FS0:\STARTUP.NSH - an EFI Shell script, similar to MS-DOS autoexec.bat
* FS0:\BOOTMGR.EFI - the EFI boot manager
* FS0:\BOOTMGR.EFI - the EFI boot manager
* FS0:\BOOT\BOOTX86.EFI - the default x86_32 boot loader
* FS0:\BOOT\BOOTIA32.EFI - the default IA-32 (32-bit x86) boot loader
* FS0:\BOOT\BOOTX64.EFI - the default x86_64 boot loader
* FS0:\BOOT\BOOTX64.EFI - the default x86-64 boot loader


To avoid filename clashes, you should not create files in the root directory of ESP. The specification mandates that root directory is for vendor directories, like FS0:\APPLE, FS0:\MICROSOFT etc. Some applications (like GRUB) just creates a one level directory without vendor parent directory. Feel free to create a directory for your own OS, and put your files there.
To avoid filename clashes, you should not create files in the root directory of ESP. The specification mandates that root directory is for vendor directories, like FS0:\APPLE, FS0:\MICROSOFT etc. Some applications (like GRUB) just creates a one level directory without vendor parent directory. Feel free to create a directory for your own OS, and put your files there.
Line 25: Line 24:
=== Articles ===
=== Articles ===
* [[UEFI]]
* [[UEFI]]
* [[Bootable Disk]] - tutorial on how to create GPT


=== External Links ===
=== External Links ===
Line 32: Line 32:
[[Category:Firmware]]
[[Category:Firmware]]
[[Category:UEFI]]
[[Category:UEFI]]
[[Category:Disks]]

Latest revision as of 10:07, 10 June 2024

The EFI System Partition (ESP) is a dedicated partition on GPT. Usually a small one (32-256MiB), located at the beginning of the disk and its partition record at the beginning of the GPT.

Identify

Unlike normal bootable partitions, which have the attribute flag bit 2 set, ESP is identified by its GUID, which is

C12A7328-F81F-11D2-BA4B-00A0C93EC93B

Format

The ESP can be formatted to any FAT file system, FAT12/16/32. Often NTFS may also be supported. There's one notable exception, some older Apple machines (like iMac and MacBooks) use a special firmware which only accepts HFS+ file system on the EFI System Partition.

Access

In the EFI Shell, the ESP is the very first file system, denoting as FS0:. GRUB and ELILO recognize ESP, and they install their files there by default. Other boot loaders, like rEFInd can only work if ESP exists. From your application, you can use the EFI_SIMPLE_FILESYSTEM_PROTOCOL to access files on the ESP programmatically.

Important Files on ESP

  • FS0:\STARTUP.NSH - an EFI Shell script, similar to MS-DOS autoexec.bat
  • FS0:\BOOTMGR.EFI - the EFI boot manager
  • FS0:\BOOT\BOOTIA32.EFI - the default IA-32 (32-bit x86) boot loader
  • FS0:\BOOT\BOOTX64.EFI - the default x86-64 boot loader

To avoid filename clashes, you should not create files in the root directory of ESP. The specification mandates that root directory is for vendor directories, like FS0:\APPLE, FS0:\MICROSOFT etc. Some applications (like GRUB) just creates a one level directory without vendor parent directory. Feel free to create a directory for your own OS, and put your files there.

See Also

Articles

External Links