This guide documents the technical details of the ArkOS system boot flow, signature verification pipeline, the arkrt monolithic system services framework, the isolated Main User UI (swift_splash), and the Unix Domain Socket IPC communication layer.
The ArkOS boot sequence traverses multiple stages of execution, beginning with the boot sector and ending with the isolated user space application:
graph TD
A[Bootloader Sector 1] -->|Loads Stage 2| B[Stage 2 Bootloader]
B -->|Modesetting & Quiet Console| C[Linux Kernel]
C -->|Launches PID 1| D[init.c]
D -->|Quiet Verified Boot Check| E[arkrt Daemon]
E -->|Isolated fork & execve| F[swift_splash UI]
F -->|Unix Domain Socket IPC| E
bootloader.asm0x7C00. It initializes segment registers, sets up a temporary stack, and loads the larger Stage 2 bootloader from disk sectors into memory before transferring control.console=tty0 logo.nologo quiet to prevent the kernel from dumping device detection and mode initialization text, ensuring a seamless visual transition to the screen clear./proc, /sys, and /dev (via mount syscalls).arkrt daemon executable.arkrt process via fork() and execve().ArkOS enforces a secure verified boot mechanism for its user space services.
sign.pybuild.c compiles the arkrt binary.arkrt executable using SHA-256.signature.bin.ARK-OS-... is injected directly into init.c as a macro ARK_KEY.init.c)/arkrt, init.c reads the contents of /arkrt and computes its SHA-256 checksum.[OK] (silenced to keep the boot quiet) and executes the daemon. If it fails, the boot sequence halts.arkrt Monolithic System Service FrameworkThe arkrt service manager acts as the core system daemon of ArkOS, running as a privileged background process.
KernelBridge.swift)getrusage API with 0 (RUSAGE_SELF) to read the resident set size (ru_maxrss) dynamically and verify that idle consumption does not cross the 2.0 GB RAM cap./sys/class/power_supply dynamically to locate the battery subsystem node (e.g. BAT0, BAT1), parses the capacity percentage file, and triggers system shutdown via a wrapper calling the Linux C symbol reboot with LINUX_REBOOT_CMD_POWER_OFF (0x4321fedc)./sys/class/net to query interface names, and queries getifaddrs from libc to dynamically parse IPv4 address buffers of active networks (filtering out loopback devices).IPC.swift)/dev/arkrt.sock using static handlers.autoreleasepool block around connection cycles on Linux to guarantee that intermediate structures allocated during socket operations are immediately reclaimed.CommandRouter.swift)UnsafeRawBufferPointer to route request codes to their corresponding Swift namespace handlers under the ark.system API layer.Communication between the isolated UI and arkrt uses a strict binary packet structure. This eliminates JSON/string serialization parsing overhead and ensures high performance.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Command ID (2 Bytes) | Payload Length (4 Bytes) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Payload Data (N Bytes) |
| ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
UInt16): The numeric code representing the system call command (sent big-endian).UInt32): The size of the payload following the header in bytes (sent big-endian).| Command ID | Command Name | Description | Response Format |
|---|---|---|---|
| 101 | CMD_GET_TIME |
Retrieve system formatted time | UTF-8 String (e.g., Jul 5, 2026 at 10:12:00 AM) |
| 102 | CMD_GET_IP |
Query active interface IP | UTF-8 String (e.g., 10.0.2.15 / 127.0.0.1) |
| 103 | CMD_GET_BATTERY |
Query battery level percentage | UTF-8 String (e.g., 98%) |
| 104 | CMD_GET_BLUETOOTH |
Query Bluetooth device status | UTF-8 String (ACTIVE or INACTIVE) |
| 105 | CMD_SHUTDOWN |
Shutdown the OS | UTF-8 String (SHUTTING_DOWN) |
| 106 | CMD_DUMP_LOGS |
Retrieve circular buffer logs | Newline-separated UTF-8 Log String |
swift_splash.swift)The user interface layer is decoupled from the service framework, operating as an isolated process with restricted privileges to prevent UI faults from crashing the kernel.
/dev/fb0.mmap).tpl) and an active workspace buffer (work).blit loop using memcpy to sync the workspace to the screen framebuffer. This eliminates vertical tearing and flickering.diskAA): Draws a filled circle at a coordinate $(cx, cy)$ with radius $r$. It computes pixel distances and applies linear opacity interpolation on the edges:
$$\alpha = r_{\text{outer}} - d$$
Ensuring smooth, anti-aliased circular corners.ringAA): Draws a hollow outline of a circle by evaluating whether the pixel falls on the inner or outer border limits, interpolating transparency symmetrically around the center radius.Once the splash screen animation completes, the UI launches an IPC client:
/dev/arkrt.sock.UnsafeRawBufferPointer.