Architecture overview
Understand repository layering, crate roles, and runtime assembly across Core, Applications, and Platforms.
Xila is structured across independent repositories. The repositories separate portable kernel services, user-space applications, platform drivers, and packaging tools. This separation enforces clear dependency directions and keeps core operating system logic independent of hardware targets.
Context
Section titled “Context”Embedded operating systems often tangle driver implementations, kernel primitives, and user applications together. This tight coupling makes testing difficult and prevents running system services across different hardware targets.
Xila addresses this challenge by isolating portable abstractions from platform runtimes. The same operating system services compile and run on bare-metal microcontrollers, native desktop environments, and web browsers without modifying kernel logic.
Dependencies follow a strict unidirectional hierarchy:
coreis consumed byapplicationsandplatforms.package_manageris a leaf repository consumed byapplicationsandplatforms.applicationsis consumed byplatforms.platformsintegrates all repositories to produce bootable target binaries.registrycontains signed package release metadata and holds no code dependencies.
How it works
Section titled “How it works”Repository layering
Section titled “Repository layering”The following diagram shows the dependency relationships among Xila repositories. Each arrow points from a repository to a repository it depends on; registry holds no code and has no arrow.
Each repository owns a distinct responsibility in the ecosystem:
- Core provides portable operating system subsystems, reusable data structures, and the top-level
xilafaçade crate. Core workspace crates depend on no other Xila repository. - package_manager is a leaf repository providing package creation, manifest validation, cryptographic signing, and verification. It has no dependencies on any other Xila repository.
- Applications contains official system executables, shells, user-space utilities, and the WebAssembly (Wasm) host interpreter. Applications depends on Core and package manager.
- Platforms contains target drivers, filesystem seed generation tools, and target entry points that assemble full system images. Platforms depends on Core, package manager, and Applications.
- registry is a standalone metadata repository that records signed package versions and developer keys.
Crate layering
Section titled “Crate layering”The following diagram illustrates how crates are layered from hardware drivers up to user-facing executables.
Crates belong to one of five architectural roles:
- Subsystems: own runtime state and background lifecycles for core services such as task scheduling, graphics rendering, and path resolution.
- Libraries: provide stateless contracts, data formats, cryptographic utilities, and synchronization primitives.
- Devices: define unified interface traits and typed control commands for hardware and virtual devices.
- Drivers: implement concrete hardware or host adapters that fulfill the device trait contracts.
- Executables: programs that the system launches. They interact with services through runtime contexts.
Runtime assembly
Section titled “Runtime assembly”Platforms integrates Core subsystems with concrete drivers and Applications executables to create runnable binaries. During boot, the target entry point executes the following initialization steps:
- Initializes the target memory allocator and installs the global logger.
- Instantiates the task manager and registers the Embassy executor spawner.
- Constructs the users manager and initializes the time manager with a hardware time source.
- Mounts the root file system and initializes the virtual file system (VFS).
- Populates the default directory hierarchy and mounts device nodes under
/devices/. - Mounts static executables into
/applications/executables/. - Seeds initial user accounts through the authentication library.
- Launches the initial user interface shell.
Design choices and trade-offs
Section titled “Design choices and trade-offs”- Strict dependency directions: circular dependencies between repositories or crate layers are forbidden. Builds stay predictable and components stay modular.
- Portable kernel core: Core does not link against platform SDKs or standard operating system libraries. Unit tests can run on native hosts without hardware dependencies.
- Explicit manager lifecycle: subsystem managers are constructed explicitly and passed to execution contexts. This avoids hidden global state, except where C libraries or runtime allocators require it.
API reference
Section titled “API reference”xilacrate - the root façade crate re-exporting Core subsystems and libraries.core/src/lib.rs- façade module definitions and feature re-exports.examples/native/src/main.rs- native desktop target initialization and assembly.
Related
Section titled “Related”- Component map - complete inventory of crates and packages.
- Guest applications - sandboxed Wasm applications that run on every Xila target.
- Subsystems - kernel-managed runtime services.
- Libraries - reusable system libraries and contracts.
- Drivers - platform hardware and simulation drivers.
- Executables - built-in system applications and launchers.