filmov
tv
Intro / Overview | UEFI Dev (in C)

Показать описание
Intro, setup, and hello world program to start programming for x86_64 EFI applications.
We'll be writing a program to make GPT disk images with an EFI system partition and basic data partition, and an OS loader EFI application for an operating system bootloader.
Everything will follow official specifications and documentation for UEFI, ACPI, FAT32, etc. as much as possible.
Hopefully this will show that UEFI isn't mysterious or complex, and is actually nice to program for, assuming your machines support it.
I'll try to explain all code as I'm typing it up and reading the docs. Expect some long, boring videos unless I suddenly become really funny or great at editing.
UEFI dev playlist:
Git Repo:
Repo state as of this video (with slight makefile changes):
cd uefi-dev
git checkout 9f65a7b05543bc42c43a12baec3b5cb878cf4a37
Videos for the EFI application (BOOTX64.EFI) will update this repo, after the gpt disk image videos are done.
Notes:
- wchar_t and L"" string literals are not needed, and I don't like them much due to wide characters being 16 bit on windows and 32 bit on linux by default. UTF-16 can be used directly with C11 or later, with u"" string literals and char16_t from uchar.h. If you have errors with uchar.h or don't want to use it, you can use 'typedef uint_least16_t char16_t;' and cast string literals to (char16_t *)"" to get the C11+ standard UTF-16 type.
- You can of course write EFI applications in other languages, even assembly. The system table pointer is passed to an efi entry point in RDX (see UEFI 2.10 spec section 2.3.4.1). Calling conventions seem to follow Microsoft's x86_64 calling convention/abi.
- I may make an .iso creator program in the future as an alternative to the GPT hard disk image creator. The ISO9660 and El Torito specs are public and freely available, but look a lot more involved than GPT images which are only a couple structs & arrays for the MBR and GPT headers & tables.
Misc links:
Alternatively, for C development on Windows:
or WSL/WSL2
Next video(s):
- Starting a C program to create valid GPT hard disk images, including an EFI system partition with FAT32 filesystem, which will boot an EFI application in emulation and on real hardware.
Contact:
- Let me know if there's anything specific you'd like to see!
Questions about setup/software/etc.?
Outline:
0:00 intro/overview
6:30 dev tools for linux & windows
27:47 example EFI application, BOOTX64.EFI
38:58 test on qemu
41:00 test on hardware (laptop)
42:51 wrapping up/coming up
Music credits:
Creative Commons CC BY 3.0
#uefi #x86_64 #intro
We'll be writing a program to make GPT disk images with an EFI system partition and basic data partition, and an OS loader EFI application for an operating system bootloader.
Everything will follow official specifications and documentation for UEFI, ACPI, FAT32, etc. as much as possible.
Hopefully this will show that UEFI isn't mysterious or complex, and is actually nice to program for, assuming your machines support it.
I'll try to explain all code as I'm typing it up and reading the docs. Expect some long, boring videos unless I suddenly become really funny or great at editing.
UEFI dev playlist:
Git Repo:
Repo state as of this video (with slight makefile changes):
cd uefi-dev
git checkout 9f65a7b05543bc42c43a12baec3b5cb878cf4a37
Videos for the EFI application (BOOTX64.EFI) will update this repo, after the gpt disk image videos are done.
Notes:
- wchar_t and L"" string literals are not needed, and I don't like them much due to wide characters being 16 bit on windows and 32 bit on linux by default. UTF-16 can be used directly with C11 or later, with u"" string literals and char16_t from uchar.h. If you have errors with uchar.h or don't want to use it, you can use 'typedef uint_least16_t char16_t;' and cast string literals to (char16_t *)"" to get the C11+ standard UTF-16 type.
- You can of course write EFI applications in other languages, even assembly. The system table pointer is passed to an efi entry point in RDX (see UEFI 2.10 spec section 2.3.4.1). Calling conventions seem to follow Microsoft's x86_64 calling convention/abi.
- I may make an .iso creator program in the future as an alternative to the GPT hard disk image creator. The ISO9660 and El Torito specs are public and freely available, but look a lot more involved than GPT images which are only a couple structs & arrays for the MBR and GPT headers & tables.
Misc links:
Alternatively, for C development on Windows:
or WSL/WSL2
Next video(s):
- Starting a C program to create valid GPT hard disk images, including an EFI system partition with FAT32 filesystem, which will boot an EFI application in emulation and on real hardware.
Contact:
- Let me know if there's anything specific you'd like to see!
Questions about setup/software/etc.?
Outline:
0:00 intro/overview
6:30 dev tools for linux & windows
27:47 example EFI application, BOOTX64.EFI
38:58 test on qemu
41:00 test on hardware (laptop)
42:51 wrapping up/coming up
Music credits:
Creative Commons CC BY 3.0
#uefi #x86_64 #intro