Chapter 10 of 16 · Deutschnullos.de

Drivers

What hardware NULLos talks to today – and what's coming.

Today (x86_64; ARM64 and RISC-V 64 with their own layer and device tree, see Runs everywhere)

WhatHow
ScreenUEFI GOP framebuffer: nb asks for it, the kernel draws text into it with its own line font (sharp at any size, with real lowercase letters). Shows UTF-8: all of Latin-1 with umlauts, „quotation marks“, dashes – —, €, arrows and box lines. Understands the most important ANSI control sequences.
KeyboardPS/2 via interrupt (IRQ 1) – or over USB if the computer has no PS/2 controller (like Macs and new PCs). German layout with umlauts, AltGr and Caps Lock, delivers UTF-8. Switch: kb load us, Mac keyboards: kb load de-mac.
Serial port16550 on COM1, 115200 baud, via interrupt (IRQ 4). Runs alongside the screen – that's how QEMU talks to the terminal and the boot test talks to NULLos.
CPUsAll cores from the ACPI table (up to 16), started via INIT/SIPI, each with its own timer.
InterruptsLocal APIC + IOAPIC, found via ACPI (MADT). The old PIC is off.
TimeAPIC timer at 100 Hz, calibrated against the HPET (otherwise PIT); fine time from the TSC; clock time from the CMOS clock.
DisksSATA via AHCI, NVMe SSDs, USB sticks and virtio-blk – all become sda, sdb … with partitions (GPT, MBR or none). Programs can only read them so far; the kernel can already write to NVMe. Writing from programs is coming soon
USBxHCI controller, hubs (up to 5 levels), keyboard, mouse, sticks (Bulk-Only + SCSI), USB Ethernet (CDC-ECM/NCM). Plugging in and unplugging while running works. Protection against BadUSB: At startup only the first pure keyboard is allowed, every new device waits without a driver until you allow it.
File systemFAT12, FAT16 and FAT32 with long names, read only: the boot partition under /boot, more via mount from a disk or image file. Plus the RAM file system /.
Network cardsvirtio-net (legacy and virtio 1.x), Intel e1000e and igb (82576), USB Ethernet and Intel e1000 (82540EM, 82545EM, 82574L). net at the kernel prompt shows addresses and counters.
TCP/IPIts own stack, IPv6 and IPv4 on equal terms: neighbor discovery, SLAAC, DNS from the router advertisement, DHCPv6, ARP, DHCPv4, ping replies, UDP, TCP. Plus Unix sockets.
Devices/dev with numbers like Linux: null zero random urandom tty console, the disk as sda with partitions sda1 …; device list with all PCI functions.
RandomnessRDSEED/RDRAND of the CPU, virtio-rng (legacy and 1.x), interrupt timings → ChaCha20 generator.
Reboot / OffVia ACPI with its own AML interpreter: “off” really powers down, power button, battery and lid are detected (in QEMU with test tables). Sleep: coming soon
Sound/dev/snd via virtio-sound and Intel HDA, checked bit-exact in QEMU.
Mouse, tablet, touchpadUSB HID with wheel and extra buttons, absolute pointers, touchpad with several fingers – all as events in /dev/eingabe.

Tested in QEMU (machine q35): TCP with 1 MB there and back over IPv4 and IPv6, and two NULLos talking to each other over a link. DHCPv6 is still untested (QEMU has no server for it). USB and NVMe are checked with QEMU's emulated devices. Real PCs: not yet. coming soon

Booting works from SATA, NVMe SSD and USB stick – the UEFI firmware does the loading. After that NULLos reads the disk itself; /boot from NVMe is checked in QEMU.

Network tools on NULLos

Checked in QEMU on NULLos itself:

ipInterfaces and addresses
piping – over IPv4 and IPv6
tratraceroute (ICMP)
dnsResolve names (UDP and TCP)
ncnetcat, TCP and UDP, can also listen
dlFetch files over HTTP
htpsmall web server
sshto the Mac's SSH server
ssdSSH server: OpenSSH from the Mac gets onto NULLos – with pseudo-terminal (prompt, Ctrl+C), greeting and /etc/motd (the firewall lets nothing in, only after fw auf rein 22)
sk, rtshow open sockets, show and set routes

Setting the MTU (ip NAME mtu ZAHL) and the neighbor list (nb) work since version 10 of the kernel. Not yet: the router list (ra) – the kernel still lacks it, and the tool says so too. coming soon

Planned

All coming soon – the order is in the sessions plan: