Boot Orlix through hosted Linux ELF userspace#3
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a hosted Linux ELF userspace execution path for Orlix (including hosted syscall-gate entry, user fault/signal handling, and host-driven timing), and introduces an OrlixOS packaging lane that builds a minimal Bash-based rootfs plus a Linux-owned /sbin/init. It also removes now-forbidden script-based bootstrap/packaging paths and rewires kselftest/mlibc testing to run through the app-hosted kernel/userspace path.
Changes:
- Add hosted-exec kernel + HostAdapter trap/timer infrastructure to run Linux AArch64 ELF userspace inside the app-hosted kernel environment.
- Introduce OrlixOS (Bash +
/sbin/init) rootfs packaging staged underBuild/OrlixOS, and wire it intomake build/make run. - Update Orlix kselftests and mlibc tests to run through the OrlixMLibC/userspace path; remove obsolete bootstrap/xcframework scripting.
Reviewed changes
Copilot reviewed 83 out of 83 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/verify-orlixkernel-simulator-xcframework.sh | Remove simulator XCFramework verifier script |
| scripts/package-orlixkernel-simulator-xcframework.sh | Remove simulator XCFramework packager script |
| scripts/bootstrap-orlix-linux-userspace-sysroot.sh | Remove Debian sysroot bootstrap script |
| README.md | Document OrlixOS + mlibc upstream paths |
| project.yml | Add HostAdapter runtime sources to build |
| OrlixTerminal/Sources/TerminalViewController.swift | Forward terminal input to hosted console |
| OrlixTerminal/Sources/OrlixBootLauncher.h | Expose console input API |
| OrlixTerminal/Sources/OrlixBootLauncher.c | Bridge console input to HostAdapter |
| OrlixTerminal/Makefile | Build rootfs before running kernel |
| OrlixOS/Sources/init/init.c | Add Linux-owned first-stage /sbin/init |
| OrlixOS/Makefile | Build Bash + init; assemble base rootfs |
| OrlixMLibC/Tests/mlibc_test_init.c | Add in-guest mlibc test init/runner |
| OrlixMLibC/Sources/patches/0001-sysdeps-linux-aarch64-use-orlix-hosted-syscall-gate.patch | Route mlibc syscalls via hosted syscall gate |
| OrlixMLibC/Sources/patches/0002-mlibc-apply-frigg-positional-printf-arg-cache-diff.patch | Apply frigg positional printf cache diff |
| OrlixMLibC/Sources/patches/0003-sysdeps-linux-aarch64-use-orlix-page-size.patch | Use hosted page size for guards/alignment |
| OrlixKernel/Sources/ports/orlix/overlay/tools/testing/selftests/orlix/virtio_mmio_probe_contract.c | Switch Orlix selftests to local TAP helpers |
| OrlixKernel/Sources/ports/orlix/overlay/tools/testing/selftests/orlix/orlix_kselftest_user.h | Add minimal userspace TAP/test utilities |
| OrlixKernel/Sources/ports/orlix/overlay/tools/testing/selftests/orlix/Makefile | Add init probe + kselftest init binaries |
| OrlixKernel/Sources/ports/orlix/overlay/tools/testing/selftests/orlix/kselftest_init.c | Add kselftest init runner for Orlix tests |
| OrlixKernel/Sources/ports/orlix/overlay/tools/testing/selftests/orlix/init_exec_probe.c | Add fork/wait/mmap exec probe |
| OrlixKernel/Sources/ports/orlix/overlay/tools/testing/selftests/orlix/boot_profile_contract.c | Update boot profile/DT/console assertions |
| OrlixKernel/Sources/ports/orlix/overlay/drivers/orlix/virtio/mmio.c | Add virtio-console MMIO slot + polling |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/mm/uaccess.c | Add hosted user uaccess implementation |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/mm/fault.c | Add hosted user fault handling |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/mm/Makefile | Build new mm uaccess/fault objects |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/mm/init.c | Sync syscall gate + mapping alignment fixes |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/kernel/time.c | Implement host-backed clocksource/clockevent |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/kernel/syscall.c | Add syscall dispatch + mmap syscall wrapper |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/kernel/signal.c | Add signal delivery + rt_sigreturn |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/kernel/process.c | Implement hosted user entry + clone TLS state |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/kernel/Makefile | Add hosted_exec/idle/signal/syscall objects |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/kernel/idle.c | Implement idle via host deadline sleep |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/kernel/hosted_exec.c | Hosted syscall gate + trap resume plumbing |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/Kconfig | Select MM/VMA + add hosted timer config |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/include/uapi/asm/unistd.h | Add UAPI unistd wrapper |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/include/uapi/asm/ucontext.h | Add UAPI ucontext definition |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/include/uapi/asm/signal.h | Add UAPI signal constants |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/include/uapi/asm/Kbuild | Install syscall UAPI header |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/include/internal/asm/host_trap.h | Define host<->user trap frame contract |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/include/internal/asm/host_time.h | Declare host monotonic time shim |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/include/internal/asm/host_thread.h | Declare host idle primitives |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/include/internal/asm/host_console.h | Add host console input read API |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/include/asm/unistd.h | Add arch unistd glue |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/include/asm/ucontext.h | Add arch ucontext include |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/include/asm/uaccess.h | Switch to real uaccess functions |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/include/asm/time.h | Add timer poll/next-deadline API |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/include/asm/signal.h | Add arch signal API declarations |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/include/asm/processor.h | Define hosted user VA layout + TLS/SIMD state |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/include/asm/pgtable.h | Fix USER_PTRS_PER_PGD + swap encoding |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/include/asm/Kbuild | Install syscall table header; adjust generics |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/include/asm/hosted_exec.h | Declare hosted exec entry points |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/include/asm/elf.h | Adjust ET_DYN base for hosted layout |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/boot/dts/development.dts | Add hvc0 console + virtio-console node |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/boot/dts/appstore.dts | Add hvc0 console + virtio-console node |
| OrlixKernel/Sources/ports/orlix/overlay/arch/orlix/boot/boot.c | Increase boot memory; capture host trap context |
| OrlixKernel/Sources/ports/orlix/configs/development_defconfig | Enable virtio-console + tmpfs xattr |
| OrlixKernel/Sources/ports/orlix/configs/appstore_defconfig | Enable virtio-console + tmpfs xattr |
| OrlixKernel/Sources/boot/params.c | Switch console device to hvc0; add console arg |
| OrlixHostAdapter/Sources/OrlixHostAdapter/terminal/console.h | Add enqueue/read console input APIs |
| OrlixHostAdapter/Sources/OrlixHostAdapter/terminal/console.c | Implement console input ring buffer + TLS guards |
| OrlixHostAdapter/Sources/OrlixHostAdapter/runtime/trap.h | Add runtime trap shim header |
| OrlixHostAdapter/Sources/OrlixHostAdapter/runtime/trap.c | Add Mach/signal-based hosted user trap transport |
| OrlixHostAdapter/Sources/OrlixHostAdapter/runtime/time.h | Add host monotonic time header |
| OrlixHostAdapter/Sources/OrlixHostAdapter/runtime/time.c | Implement host monotonic time via clock_gettime |
| OrlixHostAdapter/Sources/OrlixHostAdapter/runtime/thread.h | Add host idle API header |
| OrlixHostAdapter/Sources/OrlixHostAdapter/runtime/thread.c | Implement idle sleeps with host TLS switching |
| OrlixHostAdapter/Sources/OrlixHostAdapter/runtime/host_tls.h | Add host TLS enter/leave helpers |
| OrlixHostAdapter/Sources/OrlixHostAdapter/memory/kernel_mapping.c | Wrap Mach VM ops with host TLS switching |
| OrlixHostAdapter/Sources/OrlixHostAdapter/boot/resources.c | Wrap file I/O/free with host TLS switching |
| Makefile | Orchestrate OrlixOS rootfs in build/run/clean |
| docs/UPSTREAM_LINUX_IOS_PORT_SPEC.md | Update spec for hosted ELF + OrlixOS lanes |
| docs/adr/0022-use-hosted-linux-elf-execution.md | Add ADR for hosted Linux ELF execution |
| docs/adr/0020-build-linux-as-mach-o-native-orlixkernel-framework.md | Update ADR wording re: start_kernel + lane status |
| docs/adr/0019-keep-make-targets-linux-shaped.md | Update ADR to include OrlixOS + remove libc=linux lane |
| docs/adr/0017-product-runtime-claim-promotion-order.md | Update claim ladder to OrlixMLibC kselftest-only |
| docs/adr/0016-keep-orlix-userspace-abi-profile-invariant.md | Update OrlixMLibC upstream path wording |
| docs/adr/0002-ground-milestones-in-linux-native-proof.md | Update kselftest proof rules/language |
| CONTEXT.md | Remove temporary kselftest/sysroot lane references |
| AGENTS.md | Document OrlixOS + updated proof lane rules |
| .gitattributes | Disable certain whitespace checks for *.patch |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+424
to
+433
| static void OrlixHostUserTimerSleep(unsigned long long delay_ns) | ||
| { | ||
| struct timespec delay = { | ||
| .tv_sec = (time_t)(delay_ns / 1000000000ULL), | ||
| .tv_nsec = (long)(delay_ns % 1000000000ULL), | ||
| }; | ||
|
|
||
| while (nanosleep(&delay, &delay) == -1) { | ||
| } | ||
| } |
Comment on lines
+156
to
+179
| static int orlix_read_file(const char *path, char *buffer, size_t capacity, | ||
| size_t *size) | ||
| { | ||
| int fd = open(path, O_RDONLY); | ||
|
|
||
| if (fd < 0) | ||
| return -1; | ||
|
|
||
| *size = 0; | ||
| while (*size + 1 < capacity) { | ||
| ssize_t nread = read(fd, buffer + *size, capacity - *size - 1); | ||
|
|
||
| if (nread < 0) { | ||
| close(fd); | ||
| return -1; | ||
| } | ||
| if (nread == 0) | ||
| break; | ||
| *size += (size_t)nread; | ||
| } | ||
| buffer[*size] = '\0'; | ||
| close(fd); | ||
| return 0; | ||
| } |
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.
Summary
Validation