Repository navigation
0.9.0: main and its initialisers, the environment, time and the board's exit; x86_64-uefi through openkal-uefi-platform - #16
Merged
Conversation
…'s exit; x86_64-uefi through openkal-uefi-platform efi_main turns off the watchdog, records the image's tables and load options, runs the program's static initialisers from the image's .ctors and .CRT sections, and calls main(argc, argv, envp). The interfaces are abort, stream, memory, env and time: GetTime for the wall clock, the processor's counter measured against Stall for the monotonic clock, Stall for a sleep. kal_exit calls the board's exit (okuefi_board_exit, weak) and then Exit with the status. The specification is declared as ^0.25.0 (openkal clause 8). The target row, its compile and link conventions and its runner are the platform package's; examples/hello names it. CI builds the example for x86_64-uefi, checks the image's headers, and boots it under QEMU with the edk2 firmware, reading the status from the debug-exit device.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
openkal-uefi follows openkal 0.25 (it was written against 0.14.1) and becomes the kernel-abi layer of a platform package, so that a program names
x86_64-uefiand nothing else.efi_mainturns off the boot manager's watchdog, records the tables and the image's load options, runs the static initialisers from the image's own.ctorsand.CRTsections (there is no C runtime), and callsmain(argc, argv, envp); firmware that gives no options gives one empty name.GetTime; the monotonic clock is the processor's counter calibrated againstStall; a sleep isStall.kal_exitcalls the board's exit (okuefi_board_exit, weak; the platform's writes QEMU's debug-exit port) and thenExitwith the status.^0.25.0(openkal clause 8).examples/hellobuilt forx86_64-uefithrough mcpplibs/openkal-uefi-platform (its branch of the same name), the PE32+ headers checked (llvm-readobj), and the image booted under QEMU q35 with the edk2 firmware; the status (42) is read from the debug-exit device and the console must say "all held".Measured locally: built with mcpp 2026.11.12.1 and booted by dirun 0.3.0 with the platform's runner words, "all held" and status 42 in 0.43 s (KVM).