Timer Event & Printing Date/Time | UEFI Dev (in C)

Channel:
Subscribers:
4,000
Published on ● Video Link: https://www.youtube.com/watch?v=ejYWzGUnb3s



Duration: 50:21
1,618 views
56


Making a timer event to print the current date/time every 1 second.

Notes:
- In the overall menu loop, I probably should have closed the timer event with CloseEvent() before creating a new event each time. Right now it might keep adding timer events every time the user goes into and back out of a menu choice.

- My laptop defaults to using UTC, which may be what most other devices do as well. If you don't like UTC, then a good exercise would be converting to your local time using the other values from the EFI_TIME struct.

Links:
https://uefi.org/specifications (uefi & other specifications)

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

Git Repo:
https://github.com/queso-fuego/uefi-dev

Repo state at the start of this video:
git clone --recurse-submodules https://github.com/queso-fuego/uefi-dev
cd uefi-dev
git checkout 04a3d221f3d83989613da4d2d8b841166391014b

Repo state at the end of this video:
git checkout f384bac13dea2ca77706dcfc52073fab8ed0dc8f

Next video:
- Reading files, getting the memory map, or other things.

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:00 Intro
0:00:45 Basic event info in UEFI Spec
0:05:39 CreateEvent() for timer
0:13:12 SetTimer() to set a timer for event
0:19:30 Add function to print date/time with GetTime()
0:36:43 Test in qemu, add %c to printf to zero pad values
0:43:11 Disable watchdog timer w/ SetWatchdogTimer()
0:48:41 Add CloseEvent() for timer & 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/

#uefidev #cprogramming #time







Tags:
queso fuego
date time
timestamp
uefi programming
uefi dev
c programming
low level
boot loader
efi application
get time
print date time
timer event
uefi events