Reset/Shutdown & Main "Menu" | UEFI Dev (in C)
Adding an ESC keybind for shutting down with ResetSystem(), and making the initial screen a "menu" to choose options with arrow keys & enter.
With this, similar logic can be done for a menu to choose the text mode, graphics mode, or do other things, with a somewhat better user experience.
Notes:
- Full time on (Alpine) Linux now! For programming/recording/some future streaming. Am dual booting and still using Windows for gaming and editing/rendering for YouTube.
The audio/video _should_ only have minor tweaks from now on, this is basically the final ouput.
PCM 24 bit audio, FFMPEG VAAPI HEVC video using the GPU encoder. When available on linux OBS, will try out FFMPEG VAAPI AV1 or other AV1 GPU encoders.
May change the initial container from fragmented .mov to .mkv, as Davinci Resolve crashed on windows, but the same files in .mp4 containers worked fine, go figure. MKV would allow PCM audio and AV1 also, so will probably go with that, assuming resolve works. If not, then will remux to .mp4 from OBS or rewrap to .mp4 later before editing.
Might do a workflow/setup video in the future; not that it'd be interesting, but more so if I lose everything then at least I'd have documented footage on what I had set up.
- To capture a phone camera in OBS, I added Alpine Linux packages "droidcam-gui" and "android-tools". On my phone, I got/paid for the app "droidcamX" as droidcam OBS is not available/supported on alpine at this time.
Plug your android phone in to your PC with a usb cable for power/data, and on linux do 'adb kill-server' and 'doas adb start-server' to set up permissions, and check that the phone shows up under 'adb devices -l'.
Then run 'droidcam &' and 'obs &' to start up droidcam and obs, start the droidcamX app on your phone, choose USB only in the droidcam window on linux, and hit start. That should start camera capture in the app on your phone.
You may want to change the app settings on your phone for camera, video quality, etc.
* NOTE: If you get "Unable to query video device. errno=22", then you can try 'doas rmmod v4l2loopback' and 'doas modprobe v4l2loopback' to ensure the loopback capture is an active kernel module, and restart droidcam.
In OBS, add a source for v4l2 capture device, and choose the dummy loopback device. That should be all you need for a basic capture setup, and can tweak settings from there.
In ~/.config/droidcam, you can change the video size WidthxHeight value up to 1920x1080 (officially supported) or 3840x2160 (not documented, but is what I used here as my phone supports it, though it uses a _lot_ of CPU and bitrate).
Restart droidcam and OBS for any video size changes to take effect.
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 2cc778a91c5dcffa64817b2062038106d7e33d57
Repo state at the end of this video:
git checkout 6602f47ad24c649b6400015925c4b38601c6a314
Next video:
- Make the set graphics mode option go to a menu, to query and set a graphics mode with the GOP (Graphics Output Protocol), and maybe blit pixels and add mouse input with the simple pointer protocol.
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 on actual linux now, and a few changes/fixes
0:02:38 add runtime services only for reset/shutdown
0:06:28 add reset system for Escape key
0:14:26 show current status on laptop/testing laptop capture
0:17:40 move set text mode to a function
0:21:22 set initial main menu choices and highlighting
0:31:16 add keybinds to bottom of main menu
0:35:20 add up/down keybinds to choose menu selection
0:51:18 make enter run function for menu option, fix setting text mode
1:08:16 coming up & 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 #menusystem