@@ -0,0 +1,4 @@
|
||||
// Drive path: /bin/echo — print arguments (kernel invokes run(argv))
|
||||
async function run(ctx, argv) {
|
||||
ctx.console.log(argv.slice(1).join(' '))
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
async function run(ctx, _argv) {
|
||||
ctx.console.log('Commands: help, echo <text>, exit')
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
NAME="BareOS"
|
||||
VERSION="0.1.0"
|
||||
VARIANT="hyperdrive-only"
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* 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 — commands: help, echo, exit')
|
||||
while (true) {
|
||||
const line = await readLine('bare-os> ')
|
||||
if (line == null) break
|
||||
const t = line.trim()
|
||||
if (t === '' || t === 'exit') {
|
||||
if (t === 'exit') break
|
||||
continue
|
||||
}
|
||||
await execLine(t)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user