AntOS Library — os (reference)
The
oslibrary's design and native core.osis the one place AntOS most carefully honours the standard Lua/Luau contract — time and process functions are stock, and AntOS only adds. It is also the OS's control surface: scripts, the hardware clock, settings, DBFS volumes, and the shadow backup. The script-facing API is luau_os; the rule that governs it is antos_library_design §5.
What it is
Four bands:
- Standard time/process —
os.time/os.date/os.clock/os.difftime, the VM's own, untouched. - Restored host functions —
os.remove/os.rename/os.getenv/os.tmpname/os.exit, re-introduced with reference signatures. - OS control — script running (
run/spawn/exec/arguments),reset/hostname/version/notify/panic, andset_time. - Folded-in subsystems — the hardware clock (
os.rtc.*, from the P4rtclib), settings (os.settings.*, fromsettings), DBFS volume management (os.dbfs.*), and shadow-backup control (os.shadow.*).
Design notes
- The
os.clock()deviation is fixed. The ESP32-P4os.clock()returned monotonic wall-time; the rewrite restores the reference meaning (process CPU seconds), with the other clocks reachable via an optionalos.clock(source)argument ("monotonic"/"uptime"/"wall") that portable code never passes. Monotonic time and uptime also have their canonical home onsys, along withos.heap_info/os.uptime— soosstops carrying system-introspection that pulled it away from standard. - The stock time functions are never reimplemented in the core — they come from the VM; a compat test guards it (antos_library_design §5).
os.rtcfolds the MCP79410 driver in as a sub-namespace rather than a separate library, because it is the clock the OS reads;os.set_timewrites both the system clock and the RTC, and the NTP half lives innet.os.dbfsis a mount-level surface — switching the active volume remountsD:wholesale, above the per-filefs/dblayer.- Settings is an extensible registry. The Settings window is a registry of pages, not a fixed list — libraries and scripts register their own tabs with
os.settings.page, rendered as imgui draw callbacks alongside the system pages. A library ships its settings UI with itself, and the built-in pages use the identical mechanism, so there's no privileged "system settings" path.
Native cores
libantos_os (env/config store, drives, script metadata, DBFS-volume and shadow control, reset/hostname) plus the folded-in sys_rtc (MCP79410 over I²C) and sys_settings (config store). The binding marshals these and leaves the VM's time/process functions in place.
Related
- luau_os — the script API · antos_sys (uptime, memory, tasks) · antos_library_design · antos_io · Storage / RTC · AntOS Libraries hub