Skip to content

Build a 9P service

Adding a capability to InferNode means serving files. This section walks a complete service from namespace sketch to shipped man page, using one that already exists in the tree so you can read the finished thing alongside each step.

The service is countfs: a counter with three files and three control verbs. Deliberately tiny — small enough to hold in your head, complete enough to exercise every convention a real service uses.

ArtifactPath
The serviceappl/cmd/countfs.b (~200 lines)
Its bytecodedis/countfs.dis (built by mk install)
Contract testtests/inferno/countfs.sh
Man pageman/4/countfs

Everything it produces compiles and passes in CI.

You need a source checkout rather than a release — you are building bytecode, so you need the toolchain. See QUICKSTART.md for the per-platform build.

You should also have read Design the interface first. This section is the practice; that page is the theory, and the tutorial assumes it.