Skip to content

0.9.0: main and its initialisers, the environment, time and the board's exit; x86_64-uefi through openkal-uefi-platform - #16

Merged
Sunrisepeak merged 2 commits into
mainfrom
feat/0.9.0-family
Nov 13, 2026
Merged

Sunrisepeak merged 2 commits into
mainfrom
feat/0.9.0-family

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

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-uefi and nothing else.

  • efi_main turns off the boot manager's watchdog, records the tables and the image's load options, runs the static initialisers from the image's own .ctors and .CRT sections (there is no C runtime), and calls main(argc, argv, envp); firmware that gives no options gives one empty name.
  • Interfaces: abort, stream, memory, env, time. The wall clock is GetTime; the monotonic clock is the processor's counter calibrated against Stall; a sleep is Stall. kal_exit calls the board's exit (okuefi_board_exit, weak; the platform's writes QEMU's debug-exit port) and then Exit with the status.
  • The specification is declared as ^0.25.0 (openkal clause 8).
  • CI: examples/hello built for x86_64-uefi through 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).

…'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.
@Sunrisepeak
Sunrisepeak merged commit 8a69b66 into main Nov 13, 2026
3 checks passed
@Sunrisepeak
Sunrisepeak deleted the feat/0.9.0-family branch November 13, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant