Utilities · zero-dependency · MIT

larznet

LarzOS's own real networking - straight from the kernel.

This is a LarzOS KERNEL command, not a hosted-mode Larzscript package - it wraps the kernel's own /net/ virtual files (kernel/net.c: an RTL8139 driver plus a real ARP/IPv4/ICMP/DNS/HTTP stack, written from scratch, no libc). It only runs inside a booted LarzOS kernel session; native/hosted Larzscript has no /net/ VFS - use the http package + your real OS's own tools there instead.

larzscript pkg install net
View on GitHub →Learn the stack

What you get

Usage (inside a booted LarzOS kernel session)

import "net" as net
net.status()                          → {"up":true,"mac":"...","ip":"...","gw":"..."}
net.ping("10.0.2.2")                  → true/false
net.resolve("example.com")            → "93.184.216.34" or nil
net.get("93.184.216.34", 80, "/")     → HTTP GET body, or nil
net.serve(fn(req) { return "hello" }) → accept/handle/reply loop
Documented shape
This runs inside the LarzOS kernel's own boot session, not the hosted
larzscript CLI - so there is no CLI-testable output to show here. The
shape above is exactly what net.c's /net/ VFS returns, straight from
the package's own docstring, not a hosted-mode simulation.

Why it's in the Larz Stack

larznet is a real Larzscript package (larzscript pkg install net) - part of LarzOS, the real operating system written in Larzscript, running on its own from-scratch kernel network driver. It composes with the rest of the Larz Stack and the Larz framework.