Skip to content

0.16.0 --- openkal 0.20: transfers at an offset through a second handle, openkal.region, a program's and a unit's memory, the job's own limit - #40

Merged
Sunrisepeak merged 3 commits into
mainfrom
openkal-0.20
Nov 1, 2026
Merged

Sunrisepeak merged 3 commits into
mainfrom
openkal-0.20

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Implements openkal 0.20 (mcpplibs/openkal#58). See the commit message and README 'Version 0.16'.

Sunrisepeak and others added 3 commits November 2, 2026 03:00
…le, openkal.region, a program's and a unit's memory, the job's own limit

- kal_fs_read_at and kal_fs_write_at go through a second handle to the same file, opened relative to the first with exactly its access when first needed, so that neither uses nor moves the position the system shares with the programs the file is given to.
- openkal.region over VirtualAlloc/VirtualFree: reserve, commit, decommit, MEM_RESET to discard, release whole; an alignment above 64 KiB reserved wide and again at the aligned address. KAL_REGION_PROP_OVERCOMMIT is not claimed.
- KAL_PINFO_MEMORY is the commit charge (K32GetProcessMemoryInfo); kal_process_job_usage is the job's ActiveProcesses and JobMemory.
- kal_process_job_limit sets JOB_OBJECT_LIMIT_JOB_MEMORY (KAL_PROCESS_PROP_JOB_LIMIT_HARD); each limited job reports to one completion port, and a context ends the job when it reports its limit, so the whole unit ends; kal_process_wait reports KAL_TERMINATED_LIMIT.
- kal_process_job_terminate ends the job with the number kal_process_terminate uses, so its programs are reported as ended rather than as having returned 15.

Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
…ition is claimed there, and an ended program whose counters read zero reports no memory

Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
@Sunrisepeak
Sunrisepeak merged commit 975b518 into main Nov 1, 2026
4 checks passed
@Sunrisepeak
Sunrisepeak deleted the openkal-0.20 branch November 1, 2026 20:31
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