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
What you get
- A real driver-level network stack, written from scratch
- status()/ping()/resolve()/get() over the kernel's own /net/ VFS
- serve() - a blocking accept/handle/reply HTTP loop
- Kernel-only - the hosted `http` package is the equivalent elsewhere
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 loopDocumented 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.