Skip to main content
The serial UART driver (serial-uart-16550) attaches to the first serial port (COM1) at I/O base address 0x3F8 and mirrors every byte of kernel output to the wire. Any text written to the VGA display — shell command output, kernel log messages, and kernel panic output — is also sent through serial_put so you can capture a complete runtime transcript without a monitor. This makes the serial driver especially useful when running MVH Kernel under QEMU or other emulators where a physical display is inconvenient.

What Gets Mirrored

The serial driver receives every character the kernel emits, with no filtering or buffering delay. This includes:
  • All interactive shell output (ls, cat, cpuinfo, lspci, dmesg, and every other command)
  • The structured kernel log ring (viewable live, not just via dmesg)
  • Kernel panic output: panic code, exception details, register dump, and stack trace
  • The kernel boot sequence messages
The serial port is write-only from the kernel’s perspective in the current release — the driver does not implement serial input. All user input is handled exclusively by the PS/2 keyboard driver.

Using Serial Output with QEMU

QEMU routes COM1 serial output to whatever backend you specify with the -serial flag. Two common workflows: Capture output to a log file:
Stream output to your terminal (stdio):
When you use -serial stdio, QEMU mixes serial output with its own console. If you want clean separation, use -nographic together with -serial stdio to redirect the entire session:

Port and Baud Rate

The driver initializes the 16550 UART at boot via serial_init(), configures the baud rate divisor, enables the FIFO, and sets the line control register for 8N1 framing before the shell becomes interactive.

API Reference

The serial driver exposes two functions from include/mvh/serial.h:
Both functions are called internally by the kernel’s output layer — you do not need to call them directly unless you are extending the kernel.

Driver ID

The device manager registers this driver under the ID serial-uart-16550. Run devices in the shell to confirm it is online.