Optionaloptions: NodeKernelHostOptionsDestroy the kernel and release all resources
Snapshot the kernel's process table — one row per live process. Used
by Kandelo's Inspector → Procs tab. Mirrors BrowserKernel.enumProcs.
Serialize the quiescent worker-owned root filesystem for a later boot. The root image is durable; boot-scoped scratch and device mounts are not. Callers must wait for every guest process to exit before invoking this.
Send an HTTP request to a server running inside the kernel and return the parsed response. Bypasses real TCP by using the kernel's injected connection path directly. Prototype API.
The in-kernel server must already be listening on port. Each call
opens a fresh injected connection.
Optionaloptions: { timeoutMs?: number }Read the kernel's per-process fork counter. Used by the spawn
regression tests to assert a SYS_SPAWN call didn't fall back to
fork — getForkCount(parent) should return the same value before
and after a posix_spawn.
Returns u64::MAX (as bigint) if the pid does not exist; callers
should compare against an explicit before-value.
Return the kernel Wasm instance's current size in 64 KiB pages. This is kernel allocator telemetry, not guest process memory.
Initialize the kernel by spawning a dedicated worker_thread
OptionalkernelWasmBytes: ArrayBufferHand an OffscreenCanvas to the kernel worker as the scanout
target for KMS CRTC crtcId. Mirrors BrowserKernel.kmsAttachCanvas.
Under Node, OffscreenCanvas is only available when the host wires
a polyfill (none ships with kandelo). Without one, the worker's
attachKmsCanvas is a no-op and only kmsAttachStats is useful.
Optionalstats: SharedArrayBufferOptionalopts: { mode?: "2d" | "webgl2" | "auto" }Register a stats SAB for KMS CRTC crtcId without binding a
scanout canvas. The worker still writes commit_count and
last_frame_us into slots 5/6 each vblank tick.
Resize the PTY for a process
Write data to the PTY master for a process
Read a regular file from the existing worker-owned VFS. This is the Node peer of BrowserKernel.readFileFromVfs(); it never falls back to an ambient host path and may materialize a deferred VFS entry.
Read /proc/[pid]/maps for a foreign process. Returns the raw text
(one line per mapping), "" if the process has no mappings, or
null if the pid is gone.
Set a process's stdin data (complete buffer with implicit EOF)
Spawn a new process. Returns a promise that resolves with the exit code.
Optionaloptions: SpawnOptionsSpawn a process whose executable already lives in the worker-owned VFS. This mirrors BrowserKernel.spawnFromVfs(): no executable bytes cross the main-thread/worker boundary, and a missing VFS path fails rather than consulting an ambient host path.
Optionaloptions: SpawnOptionsSubscribe to worker-owned lazy VFS transport progress.
Subscribe to the kernel-worker's syscall trace. Returns an
unsubscribe function. Mirrors BrowserKernel.subscribeSyscalls.
Terminate a specific process
Append data to a process's stdin buffer (process sees more data, no EOF)