Repository navigation
0.11.0: fs over the simple file system, the Shell's arguments, a random source - #18
Merged
Merged
Conversation
…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.
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.
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), throughEFI_SIMPLE_FILE_SYSTEM_PROTOCOLandEFI_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_propsclaimsMODIFIED_TIME,CAPACITYandRENAME_NO_REPLACE; links, hard links, locks, the executable property, the resolved name and attenuation are not claimed and reportkal_err_not_supported(clause 6.2).EFI_SHELL_PARAMETERS_PROTOCOLon 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_PROTOCOLthroughLocateProtocol; firmware without one answerskal_err_not_supportedand fills nothing.static_asserton its offsets, with GUIDs from the UEFI and UEFI Shell specifications.-mno-stack-arg-probe: on openkal-platform's row a frame larger than a page linked to an undefined__chkstk.processis 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 withvirtio-rng-pci, checking the arguments, the file operations and the random source, and the host reads the file it left;examples/std(import stdon 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_supportedand the warning appears.