Files
bare-operating-system/packages/bare-os-seeder/kernel/init.js
T
Raven Scott 45cf20ea3c
CI / test (push) Failing after 4m58s
updates
2026-04-02 23:25:35 -04:00

21 lines
660 B
JavaScript

/**
* Hyperdrive-resident kernel (staged as /boot/init.js).
* Loaded by the booter with an injected ctx object (trusted replication source).
*/
async function start(ctx) {
const { console, drive, readLine, execLine, b4a } = ctx
const rel = await drive.get('/etc/os-release')
if (rel) console.log(b4a.toString(rel))
console.log(
'Bare operating system — POSIX-ish shell: cd, export, exit, quit | try: help, ls /bin, pwd'
)
while (true) {
const line = await readLine('bare-os> ')
if (line == null) break
const t = line.trim()
if (t === '') continue
const status = await execLine(t)
if (status === 'exit') break
}
}