31 lines
1.4 KiB
Zig
31 lines
1.4 KiB
Zig
//! danos user-space runtime library — a nascent libc. Every user binary (init,
|
|
//! and later the VFS server + device drivers) imports this as `@import("runtime")`:
|
|
//! system_call wrappers, the C-convention heap, IPC helpers, and the process start
|
|
//! shim. It is compiled into each binary (inheriting its `.large` code model and
|
|
//! freestanding target), so all user programs share one implementation.
|
|
//!
|
|
//! A user binary needs three lines:
|
|
//! const runtime = @import("runtime");
|
|
//! pub const panic = runtime.panic;
|
|
//! comptime { _ = &runtime.start._start; } // pull the entry shim in
|
|
//! and a `pub fn main() void`.
|
|
|
|
pub const system = @import("system.zig");
|
|
pub const heap = @import("heap.zig");
|
|
pub const ipc = @import("ipc.zig");
|
|
pub const start = @import("start.zig");
|
|
/// The VFS wire protocol (shared with the VFS server).
|
|
pub const vfs_protocol = @import("vfs-protocol");
|
|
/// POSIX-style file API: open/read/write/lseek/stat/close.
|
|
/// C stdio: fopen/fread/fwrite/fseek/ftell/fclose over unistd.
|
|
/// Device access for drivers: enumerate/claim/mmioMap.
|
|
pub const device = @import("device.zig");
|
|
/// DMA-capable memory for drivers: contiguous, pinned, uncacheable buffers.
|
|
pub const dma = @import("dma.zig");
|
|
|
|
/// Re-exported so a user binary can `pub const panic = runtime.panic;`.
|
|
pub const panic = start.panic;
|
|
|
|
/// The heap as a `std.mem.Allocator`, for Zig `std` containers in user code.
|
|
pub const allocator = heap.allocator;
|