An experimental port of NetBSD, FreeBSD, OpenBSD, and XNU to unkernel unkernel.dev
README.md

unkernel for PureScript #

The bindings run on Node 24 or newer. Guest operations return Aff actions. This example boots the bundled base shell, prints its architecture, and releases the kernel when the action finishes.

import Prelude
import Effect (Effect)
import Effect.Aff (launchAff_)
import Effect.Class.Console (log)
import Unkernel as VM

main :: Effect Unit
main = launchAff_ $
  VM.options # VM.withMemory 256 # VM.withKernel \vm -> do
    result <- vm # VM.exec "uname" [ "-m" ]
    log result.stdout

Run the smoke test from this directory.

npm install
spago test

To use these bindings in another Spago project, add unkernel as a dependency with a local path to this directory in workspace.extraPackages. Install the unkernel npm dependency from this directory's package.json in the consuming project. Use withDistro with a local image path to boot a distro.