local kernel = require("src.kernel")
kernel.run() -- or kernel.run({no_shell = false})local kernel = require("src.kernel")
kernel.run({no_shell = true})local kernel = require("src.kernel")
-- Initialize with options
kernel.init({no_shell = true})
-- Do additional setup here
kernel.start_scheduler()
-- Then run
kernel.run() -- Will use the options from init()- Create a new Lua file (e.g.,
my_gui.lua) - Require the kernel API
- Define your GUI logic
- Start the kernel in GUI mode
-- my_gui.lua
local kernel = require("src.kernel")
-- Start kernel in GUI mode with boot flag
kernel.run({no_shell = true})
-- Define your GUI process
local function gui_process()
while true do
-- Your GUI code here
-- Handle user input, draw interface, etc.
os.sleep(0.1)
end
end
-- Create and start your GUI process
local pid = kernel.create_process(gui_process, "my_gui", "user", {"basic"})The kernel includes several built-in user accounts:
trusteddaniel: Highest privilege user (password: "noshell")admin: Administrative user (password: "")user: Standard user (password: "")guest: Limited user (password: "")
Available permission levels:
basic: Basic system accessuser: User-level operationsadmin: Administrative functionssystem: System-level operationstrusted: Trusted operations
Processes can be in these states:
ready: Waiting to run
This quickstart describes how to use the kernel API. Note: public APIs now live under src/api/. require("src.kernel") remains a compatible shim that returns the same API.
local kernel = require("src.kernel") -- shim to src.api.kernel
kernel.run() -- or kernel.run({no_shell = false})local kernel = require("src.kernel")
kernel.run({no_shell = true})local kernel = require("src.kernel")
-- Initialize with options
kernel.init({no_shell = true})
-- Do additional setup here (requires proper permissions)
kernel.start_scheduler()
-- Then run
kernel.run() -- Will use the options from init()- Create a new Lua file (e.g.,
my_gui.lua) - Require the kernel API (
require("src.kernel")) - Define your GUI logic
- Start the kernel in GUI mode
Example:
-- my_gui.lua
local kernel = require("src.kernel")
-- Start kernel in GUI mode with boot flag
kernel.run({no_shell = true})
-- Define your GUI process
local function gui_process()
while true do
-- Your GUI code here
-- Handle user input, draw interface, etc.
os.sleep(0.1)
end
end
-- Create and start your GUI process (may fail with permission errors)
local pid, err = kernel.create_process(gui_process, "my_gui", "user", {"basic"})
if not pid then
error("failed to create GUI process: " .. tostring(err))
endThe kernel ships with a secure loader at src/api/secure_loader.lua that prevents unprivileged programs from requiring internal modules such as src.utils. If you are developing internal modules that should remain private, add their module names or patterns to the protected_patterns table in that file. Kernel code and privileged processes may still access protected modules.
The kernel ships with several example built-in user accounts (see src/main.lua):
trusteddaniel: Highest privilege user (password: "noshell")admin: Administrative useruser: Standard userguest: Limited user
Passwords in the sample configuration are intentionally blank or simple for development; replace them before production use.
Key permission levels used in the kernel:
basic: Basic system accessuser: User-level operationsadmin: Administrative functionssystem: System-level operationstrusted: Trusted operations
Only admin/system/trusted callers may perform elevated actions through the kernel API wrappers.
Processes can be in these states:
ready: Waiting to runrunning: Currently executingsuspended: Pauseddead: Terminated normallymurdered: Force-killed