Skip to content

0.11.0: fs over the simple file system, the Shell's arguments, a random source - #18

Merged
Sunrisepeak merged 1 commit into
mainfrom
feat/0.11.0-fs-shell-rng
Nov 15, 2026
Merged

Sunrisepeak merged 1 commit into
mainfrom
feat/0.11.0-fs-shell-rng

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Three gaps measured on x86_64-uefi under OVMF: a program could read no file (N34), a quoted argument was split at its space (N35), and the C library's allocator found no secure random source (N15).

  • openkal.fs: the volume the image was loaded from (LoadedImage->DeviceHandle), through EFI_SIMPLE_FILE_SYSTEM_PROTOCOL and EFI_FILE_PROTOCOL; its root is the one directory supplied, named /. Opening with the whole intent, transfers through a file's stream and at an offset, seek, truncate, enquiry (absence an answer, clause 7.7), mkdir, remove, rename (into another directory; KAL_RENAME_NO_REPLACE), a modification time, capacity, listing. Handles are a slot and a generation (clause 7.2). kal_fs_props claims MODIFIED_TIME, CAPACITY and RENAME_NO_REPLACE; links, hard links, locks, the executable property, the resolved name and attenuation are not claimed and report kal_err_not_supported (clause 6.2).
  • The arguments: EFI_SHELL_PARAMETERS_PROTOCOL on the image handle where the Shell started the program; otherwise the load options divided with double quotes and the Shell's ^.
  • openkal.random: EFI_RNG_PROTOCOL through LocateProtocol; firmware without one answers kal_err_not_supported and fills nothing.
  • Every new protocol structure is pinned by static_assert on its offsets, with GUIDs from the UEFI and UEFI Shell specifications.
  • The sources are compiled with -mno-stack-arg-probe: on openkal-platform's row a frame larger than a page linked to an undefined __chkstk.
  • process is not provided; README states what remains of it.

CI: the example also runs through the UEFI Shell (startup.nsh: hello.efi --shell "a b" c) on a writable FAT volume with virtio-rng-pci, checking the arguments, the file operations and the random source, and the host reads the file it left; examples/std (import std on openkal-platform 0.28.0 with this implementation in place of the released one) runs the same way and is required to print no "unable to use secure randomness" warning. mcpp is pinned to 2026.11.15.1, which openkal-platform 0.28.0 requires.

Verified locally with mcpp 2026.11.15.1 under QEMU q35 and the edk2 firmware: both examples hold every check and return 42; without a random device, the source answers kal_err_not_supported and the warning appears.

…om source

openkal.fs is the volume the image was loaded from (LoadedImage->DeviceHandle),
through EFI_SIMPLE_FILE_SYSTEM_PROTOCOL and EFI_FILE_PROTOCOL; its root is the
one directory supplied, named "/". Names are converted from /-separated UTF-8 to
\-separated UCS-2. Handles are a slot and a generation. kal_fs_props claims a
modification time, capacity and a rename that does not replace; links, locks,
the executable property, the resolved name and attenuation report
kal_err_not_supported (clause 6.2). A file's stream is carried by
openkal.stream.

The arguments are the Shell's EFI_SHELL_PARAMETERS_PROTOCOL where the Shell
started the program, and otherwise the load options divided with quotes and the
Shell's escape character; "a b" is one argument.

openkal.random is EFI_RNG_PROTOCOL; firmware without one answers
kal_err_not_supported.

The sources are compiled without stack probes, which a row without the flag
otherwise links to an undefined __chkstk. CI runs the example through the UEFI
Shell on a writable FAT volume with a virtual random device, and examples/std
beneath the C library, requiring mimalloc's random-source warning to be absent;
mcpp is pinned to 2026.11.15.1, which openkal-platform 0.28.0 requires.
@Sunrisepeak
Sunrisepeak merged commit 6dad39f into main Nov 15, 2026
3 checks passed
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