GPT Headers & Tables | GPT Disk Image | UEFI Dev (in C)
Writing the GPT part of the GPT disk image, including GUID Partition Table Headers & Tables and supporting values like GUIDs and CRC32s.
Believe it or not, this finishes all the main parts of a GPT disk image! It's a pretty small spec. However, there's still more to do if you want to fill out the partitions on the disk image, like the EFI System Partition.
Errata:
- Hardcoding 32 for the size of the gpt tables in lbas only works for an lba size of 512 bytes. I'll fix that at the start of the next video, maybe by adding another enum value or constant somewhere for (partition array size / lba size).
Links:
https://uefi.org/specifications
https://en.wikipedia.org/wiki/GUID_Partition_Table
https://www.rodsbooks.com/gdisk (for sgdisk & other info)
UEFI Programming playlist:
https://www.youtube.com/playlist?list=PLT7NbkyNWaqZYHNLtOZ1MNxOt8myP5K0p
Next video:
- Adding a FAT32 filesystem for the EFI System Partition, for an "/EFI/BOOT" directory structure.
Git Repo:
https://github.com/queso-fuego/UEFI-GPT-image-creator
Repo state at the start of this video:
git clone -n https://github.com/queso-fuego/UEFI-GPT-image-creator
cd UEFI-GPT-image-creator
git checkout 8654aff6a29d09e8bfd8edaad0d7da701974004a
Repo state at the end of this video:
git checkout 9469347a4872e01e71429823c788ec95bbc7ddc2
Join the Community Discord: https://discord.gg/yKm4T89QFn
Contact:
https://queso_fuego.srht.site/contact.html
- Let me know if there's anything specific you'd like to see!
Questions about setup/software/etc.?
Check the FAQ: https://queso_fuego.srht.site/about.html
Outline:
0:00 intro / going over GPT info in UEFI spec
9:22 start coding, fix TODOs for MBR
14:04 start write_gpts() function
23:50 GUID definition
27:22 new_guid() function
41:15 CRC32 table and functions
46:03 gpt table entry info in UEFI spec
51:27 continue write_gpts()
1:21:56 sgdisk confirmation & coming up
Music credits:
Winter Night by Sakura Girl | https://soundcloud.com/sakuragirl_official
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons CC BY 3.0
https://creativecommons.org/licenses/by/3.0/
#therealgpt #diskimage #cprogramming