Repository navigation
0.4.0 --- openkal 0.23: an image at a base of each boot, its touch note, a snapshot of its initialisers, and the runner's measurement and debugging - #21
Merged
Conversation
… loader that applies only the relocations naming a symbol (openkal 0.23) `okld place` chooses a base from the image's bytes, computes each writable segment with a file part for it (RELA's and RELR's relative relocations applied), appends them at offsets congruent to their addresses modulo 64 KiB and fills the placement note (SPEC 12.4, type 3; format 1.1). Where the implementation reports KAL_EXEC_PROP_PLACE, libokld reserves the image at that base (okld_host::reserve_at, kal_exec_alloc_at), takes the stored segments, maps each 64 KiB of PT_GNU_RELRO no symbol relocation writes from the file, and applies only the relocations naming a symbol; otherwise it relocates as before. okrun sets reserve_at (OKRUN_PLACE=0 declines it). `okld check` holds a placement to the image; `okld place` refuses a signed image. build-image.sh packs relative relocations and places every image. Over openkal 0.23.0 (openkal-linux 0.24.0, openkal-macos 0.21.0, openkal-windows 0.19.0). Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
…ebugger scripts Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
… the placement's data in memory for economy, the snapshots' bound), okrun cache, a compressed okb (okb 2) expanded into the cache, the runner's choices in a report Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
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-image 0.4.0 (openkal-ld, openkal-run, openkal-tools) for openkal 0.23 (mcpplibs/openkal, branch
openkal-0.23; mcpp design 2026-11-03, part 4).An image at its base.
okld placewrites the placement note (SPEC 12.4, type 3); the loader reserves the span at a base (kal_exec_alloc_at), takes the stored data and applies only the relocations naming a symbol. Read-only-after-relocation blocks no such relocation writes are the file's pages; the range is sealed once relocated (kal_exec_seal_part, for good for an image never unloaded). The data is mapped privately from the file (KAL_EXEC_MAP_WRITE).A base for each boot. A slide chosen once per user and boot moves the image from the base of its digest; the first start writes the data for that base as a prepared copy (type 5,
<digest>-<base>.okseg) in the user's cache, later starts map it, and a new boot removes it.OKRUN_PLACE=sealedandOKRUN_PLACE=0keep the sealed base or place anywhere.The touch note (type 4):
okprof record --what touchrecords first executions throughkal_prof_touch_*;okld touchwrites the note; the loader reads noted runs in (KAL_EXEC_MAP_PREFETCH) by the program's resource preference;okprof report --orderwrites a symbol ordering file.A snapshot of the initialisers (docs/snapshot.md): the runner makes one once a boot in a runner it starts again (
OKRUN_SNAPSHOT=start/make), binding the image to memory, the implementation's facts and recorded answers (processors, cores, resource preference, named values) and refusing everything else; a proof holds that no word but an import's slot is a binding's address; a start maps the copy, applies the import relocations again and enters__okrun_snapshot_start.okld_bound_imports,OKLD_PREPARED_MAX.Measurement and debugging:
phases,samples(the implementation's sampler),touch,names(recorded grants);okprof report --flame / --format=trace / --order / --names;okgdb.py,oklldb.pyandokld debug-split; a perfect hash forokrun_resolve; okprof and the scripts released beside okrun and okld.What a start spends (the program's resource preference,
kal_env_resources): performance reads the noted runs and the data ahead (prefetch level 2), balanced reads the noted runs (level 1), economy computes the placement's data in memory, makes no snapshot and reads nothing ahead; balanced is taken as economy when available memory is under 15 % or the cache's device has under 1 GiB free.OKRUN_PREFETCH=0|touch|allstates the level. Snapshots are bounded (2 GiB for performance, 512 MiB otherwise) and the least recently used is removed first.okrun cache [list|gc [--all]]lists and reclaims what the runner keeps.A compressed okb (okb 2, docs/okb.md §5):
okld bundle --compressstores the images with DEFLATE (method 8), the manifest and the signature stored; the runner expands a member once into its cache (okrun/expanded) and maps it from there;okld_inflateis libokld's own freestanding reader.mcpp pack --pkg-format okb --compress gzipreaches it throughMCPP_PACK_COMPRESS.The runner's choices in the report: a
runnerarray (point,outcome,bytes) states whether the placement, the snapshot and the expansion were used, made or declined, and why.CI: the placement step covers this boot's base, the sealed base, anywhere and unplaced; a snapshot step covers made, used, declined by a changed named value and by
OKRUN_SNAPSHOT=0, and refused for an initialiser that asks for the time; a compressed okb is built, checked and run; an economy start writes nothing to the cache. It resolves openkal 0.23 and its implementations from the index, so it runs after they are released.