Skip to content

[ISSUE] Phase 5: Networking (AF_INET / AF_NETLINK) and Mount Management Syscalls #283

Todo
0 of 3 issues completed

Description

@marcobuschini

Parent Epic

#265

Blocked By / Dependencies

#280 (Phase 2 — event-loop readiness) and #281 (Phase 3 — VFS namespace/metadata foundations)

Problem Statement & Context

Milo already has a working virtio-net NIC driver (kernel/drivers/virtio/virtio_net.*) and AF_UNIX socket layer (kernel/net/af_unix.*), but sys_socket currently rejects any domain other than AF_UNIX with -EAFNOSUPPORT, and filesystem mounting/root switching is only performed internally during boot. Standard Linux networking clients/servers, device-discovery stacks (libudev/Wayland), and container/init utilities require AF_INET TCP/UDP/ICMP sockets over virtio-net, minimal AF_NETLINK (NETLINK_ROUTE / NETLINK_KOBJECT_UEVENT), and dynamic mount management (mount, umount2, chroot, pivot_root).

Scope & Technical Touchpoints

In Scope

  • Freestanding IPv4/ARP/ICMP/UDP/TCP stack + loopback (127.0.0.1) over Kernel::Net::NetworkDevice (virtio-net) and AF_INET support in SocketSyscalls.cpp
  • Minimal AF_NETLINK socket domain (NETLINK_ROUTE, NETLINK_KOBJECT_UEVENT)
  • Dynamic mount and root-switching syscalls: umount2 (39), mount (40), pivot_root (41), chroot (51)

Technical Touchpoints

  • kernel/uapi/socket.hpp, kernel/net/NetworkDevice.hpp, new protocol modules under kernel/net/
  • kernel/syscalls/SocketSyscalls.cpp, kernel/syscalls/FileSyscalls.cpp, kernel/syscalls/SyscallDispatcher.cpp
  • kernel/fs/Vfs.hpp, kernel/fs/Vfs.cpp, kernel/process/Process.hpp
  • tests/host/, kernel/shell/tests/

Out of Scope

  • Full iptables/netfilter, IPsec, or kernel TLS offload
  • AF_INET6 full SLAAC/NDP stack unless explicitly scoped in a follow-up (clean -EAFNOSUPPORT until implemented)

Split Verdict: SPLIT

Rationale: Bringing up an IPv4 TCP/UDP stack, implementing AF_NETLINK device/route sockets, and adding VFS mount/umount2/chroot/pivot_root are three substantial, independently testable subsystems. Splitting into 3 subissues makes review and verification tractable.

Subissues

Acceptance Criteria

  • Loopback and virtio-net UDP/TCP AF_INET sockets work with poll/epoll and pass host + QEMU tests
  • AF_NETLINK (NETLINK_ROUTE, NETLINK_KOBJECT_UEVENT) responds cleanly to standard interface/device queries
  • mount, umount2, chroot, and pivot_root manage VFS superblocks/dentries with zero refcount or PFA leaks
  • make format && make clean-tests && make -j"$(nproc)" all && make -j"$(nproc)" quality passes with zero warnings

Sub-issues

Sub-issues

0 of 3 Issues completed
Loading 3 sub-issues

Metadata

Metadata

Assignees

Labels

enhancementipc

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions