Time is a kernel concern in danos: the kernel owns the scheduling timer and already exposes monotonic time via the clock/sleep/timer_bind syscalls, so a userspace time service would be a redundant, slower path. This adds the generic runtime.time module over those syscalls, retires the two demonstration drivers, reorganizes the milestone docs, and makes the monotonic clock correct on Intel, AMD, and inside any VM. runtime.time (library/runtime/time.zig) - Instant/Duration interface: now, sleep, spin, after, monotonicNanos, available - a thin layer over system.clock/sleep/timerOnce; unit-tested arithmetic Remove the demo drivers hpet and bus (a teaching example belongs in the docs, not shipped in the tree) - system/drivers/ now holds only real drivers: pci-bus, ps2-bus, usb-xhci-bus - device-manager end-to-end test repointed to pci-bus (asserts on kernel state: the process table and the device tree, not a racy serial marker) - device_register containment moved to a new in-kernel `containment` test - the driver-model worked example moved inline into docs/drivers.md Reorganize milestone docs into topic docs - m17-m18 / m19-m20 / m21 plans dissolved into process-lifecycle, device-manager, discovery, and acpi docs; new docs/power.md and docs/timers.md; ~20 citations repointed; plan docs deleted TSC reliability (apic.zig, smp.zig, cpu.zig, kernel.zig) - check the invariant-TSC bit (CPUID 0x80000007 EDX[8]) on Intel and AMD - cross-core "warp" check at SMP bring-up, pairwise BSP<->AP as each core comes up - fall back to the HPET clocksource when the TSC is not invariant (a bare VM) or not synchronized (a warp), switched continuously so time never jumps - boot log reports the outcome; new tsc-sync test exercises the TSC + warp path Verified: zig build; zig build test; 60/60 QEMU cases (incl. new containment and tsc-sync).
36 lines
1.7 KiB
Zig
36 lines
1.7 KiB
Zig
//! /system/services/fdt — the devicetree discovery service: the ARM twin of the
|
|
//! acpi service (docs/discovery.md — firmware neutrality). **Placeholder: not
|
|
//! implemented.** It exists so the build's `-Ddiscovery` option has both of its
|
|
//! values from day one; the implementation lands with the Raspberry Pi
|
|
//! bring-up (docs/arm.md).
|
|
//!
|
|
//! What it becomes: the per-firmware discoverer for boots that hand over a
|
|
//! flattened device tree instead of ACPI tables. It claims the
|
|
//! `devicetree-blob` node the kernel publishes (the FDT the loader received),
|
|
//! walks the tree — pure data, no bytecode, so unlike the acpi service it
|
|
//! needs no port grant and no interpreter — and, like any bus-shaped driver:
|
|
//! `device_register`s what it finds (containment against the blob node's
|
|
//! recorded apertures), reports each child to the device manager
|
|
//! (`child_added`, identity = the node's `compatible` string), and stays
|
|
//! resident under the manager's supervision (hello, restart, the usual
|
|
//! contract).
|
|
//!
|
|
//! Known prerequisite recorded in docs/discovery.md: `DeviceDescriptor`'s 8-byte `hid`
|
|
//! cannot hold an FDT `compatible` string ("brcm,bcm2835-aux-uart") — identity
|
|
//! widens before this file grows a body.
|
|
|
|
const runtime = @import("runtime");
|
|
|
|
pub fn main(init: runtime.process.Init) void {
|
|
_ = init;
|
|
// Not implemented: exit cleanly and silently (a bare spawn by the
|
|
// initial-ramdisk sweep must not derange other tests' markers). The
|
|
// supervisor reads a clean exit as "meant to stop" — correct for a
|
|
// placeholder.
|
|
}
|
|
|
|
pub const panic = runtime.panic;
|
|
comptime {
|
|
_ = &runtime.start._start; // pull the runtime entry shim into the image
|
|
}
|