Skip to content

Boot Orlix through hosted Linux ELF userspace#3

Merged
rudironsoni merged 34 commits into
mainfrom
feature/boot-to-virtio-probe
May 25, 2026
Merged

Boot Orlix through hosted Linux ELF userspace#3
rudironsoni merged 34 commits into
mainfrom
feature/boot-to-virtio-probe

Conversation

@rudironsoni

Copy link
Copy Markdown
Owner

Summary

  • add the hosted Linux ELF execution path for Orlix userspace
  • wire OrlixMLibC upstream mlibc tests through the app-hosted kernel path
  • add OrlixOS Bash rootfs packaging plus a Linux-owned first-stage /sbin/init
  • remove forbidden script-based packaging/bootstrap paths

Validation

  • rtk make -f OrlixMLibC/Makefile test PROFILE=appstore
  • rtk make -f OrlixTerminal/Makefile run PROFILE=appstore
  • simulator log reached /sbin/init, sh-5.3#, ORLIX_SHELL_OK, and no new OrlixTerminal crash report appeared

Copilot AI review requested due to automatic review settings May 25, 2026 16:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 under Build/OrlixOS, and wire it into make 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;
}
@rudironsoni rudironsoni merged commit a605464 into main May 25, 2026
1 check 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.

2 participants