Command Line Flags 1/2 | GPT Disk Image | UEFI Dev (in C)

Channel:
Subscribers:
5,840
Published on ● Video Link: https://www.youtube.com/watch?v=o96Weh8CqQg



Duration: 2:05:06
358 views
21


Adding command line options/flags to set sizes and add files to partitions in the disk image.
It took a while to add all the flags so this is split into 2 parts, ~2hrs each.

Errata:
- The file paths added to the ESP has a slash at the end visually, which looks like it adds directories. That was fixed later to visually remove the ending slash.

Notes:
- I did change later to add files outside of the current directory to the ESP by using an array of FILE *s passed around to the add path to esp/file to esp functions.

- Adding files to the data partition was also changed later to create & update 1 file for info on all files in the data partition, instead of each file having their own info file.

Links:
https://uefi.org/specifications
https://en.wikipedia.org/wiki/Design_of_the_FAT_file_system
https://msdn.microsoft.com/en-us/windows/hardware/gg463080.aspx (EFI FAT Filesystem Spec)

UEFI Programming playlist:
https://www.youtube.com/playlist?list=PLT7NbkyNWaqZYHNLtOZ1MNxOt8myP5K0p

Next video:
- Adding an option for a fixed vhd footer, debugging that, and tying up any loose ends after recording.

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 ff1a4bea046fb6c6e53cc9610ecbcf107eeed38b

Repo state at the end of the next video:
git checkout 9c1278a21cbf9552a931dbe9f025dccf82f56fb5

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 my setup/software/etc.?
Check the FAQ: https://queso_fuego.srht.site/about.html

Outline:
0:00 Intro
3:03 Options struct
6:09 Start get_opts() function, help flag
11:05 Image name flag
15:04 Lba size flag
22:28 Add esp files flag
44:17 Esp size & Data size flags
53:00 Print image/size info to user
57:57 Debug & set partition sizes
1:07:40 Debug adding files to ESP
1:16:20 Add data files flag & function & debugging
2:04:34 Outro

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/

#getopts #diskimage #cprogramming







Tags:
queso fuego
cli flags
commandline flags
c programming
disk image
gpt disk
uefi
low level
getopts