Skip to content

0.26.2: i386 (openkal 0.25.1, clause 5.5); one rt_sigaction record and one return from a handler - #55

Merged
Sunrisepeak merged 3 commits into
mainfrom
feat/0.27.0-i386
Nov 13, 2026
Merged

Sunrisepeak merged 3 commits into
mainfrom
feat/0.27.0-i386

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

openkal-linux 0.26.2: the implementation on i386 (openkal 0.25.1, clause 5.5; design K7). No interface changes; x86_64 and aarch64 call the same system calls as before.

i386

Part Change
gate and numbers (src/sys.h) int $0x80, the sixth argument in ebp; i386's own table. Where a call has a 64-bit time form, the name stands for it (clock_gettime64, clock_getres_time64, ppoll_time64, futex_time64, utimensat_time64).
calls whose arguments differ functions every caller uses on every architecture: okl::openat (O_LARGEFILE on i386), fstat/fstatat (via statx on i386: stat64's times are 32-bit), fstatfs (statfs64), mmap (mmap2, pages), lseek (_llseek), pread/pwrite (pread64 with the position in two words), ftruncate (ftruncate64), nanosleep (clock_nanosleep_time64). The common numbers are -1 on i386, so a call that bypassed them fails instead of truncating a position.
records kflock without the padding (flock64 aligns positions to 4); kstat filled from statx; ELF32 program headers for the thread-local image and for the fault report's symbol lookup.
thread pointer set_thread_area, %gs; clone with CLONE_SETTLS takes a user_desc; __okl_clone and _start for i386; the fault report reads i386's ucontext.
handles width-aware: 17 bits of descriptor and 15 of generation on a 32-bit word (src/handle.h); a program's handle: kind in bits 30-31, number in 0-21, an observed program's start in 22-29, an opened program's descriptor (its number from /proc/self/fdinfo).
vDSO not read on i386 (ELF32, 32-bit records); the 64-bit clock_gettime64 is called.

Duplicates converged (P17)

rt_sigaction's record was declared three times with an unsigned long mask (half of i386's 64-bit set, and the size the call is told was refused there); one okl::k_sigaction with a 64-bit mask now. The return from a handler was written twice (observe.cpp, process.cpp); one okl_signal_return.

Verification

  • tools/word32-check.sh (new, and a step of the CI job's llvm leg): builds src/*.cpp standalone for i386 with -Werror, links tests/word32/runs.cpp with ld.lld, runs it: a pointer is 4 bytes; a file is written, read, sized and sought at 5 GiB; a task with its own thread-local value is started and joined; a 20 ms sleep through the 64-bit clock. Local: all held.
  • x86_64: the specification's conformance suite (run-conformance.sh openkal-linux . full): 261 held, 0 did not hold; mcpp test: 22 passed.
  • The full conformance suite for i686 runs where the family's C library and C++ runtime are built for i386 (openkal-musl, openkal-llvm-runtime, openkal-platform).

@Sunrisepeak
Sunrisepeak merged commit 20d5c87 into main Nov 13, 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