Expand description
s9vm : 16550A-compatible UART device (pure model, COM1).
The guest sees the eight-byte register window of a COM1 16550A at
BASE_PORT. The kernel bridges the model onto the host: bytes written to
the transmit holding register are collected by Uart::drain_output (the
kernel logs them), and host input is queued with Uart::push_input for
the guest to read from the receive buffer. Uart::irq_asserted drives the
UART interrupt line IRQ_LINE.
The model implements the register semantics a booting guest relies on:
divisor latch access through LCR.DLAB, the IIR priority chain (line
status, receive data, transmitter empty, modem status), IER masking,
loopback mode through MCR, scratch register and the LSR/MSR status bits.
It is transport-agnostic and host-tested; the only extra dependency is the
alloc vector holding output and input bytes.
Re-exportsยง
Modulesยง
- ier
- Interrupt enable bits in
reg::IER. - iir
- Interrupt identification values returned by
reg::IIR_FCRreads. - lsr
- Bits of the line status register.
- mcr
- Bits of the modem control register.
- msr
- Bits of the modem status register.
- reg
- Register offsets, relative to
BASE_PORT.
Structsยง
- Uart
- Software model of the COM1 16550A UART.
Constantsยง
- BASE_
PORT - Base I/O port of COM1.
- INPUT_
CAPACITY - Receive FIFO capacity (bytes pushed by the kernel but not yet read).
- IRQ_
LINE - IRQ line driven by the COM1 UART.
- LSR_
IDLE ๐ - Value of
reg::LSRat reset: transmitter holding register empty and transmitter empty. The data-ready bit depends on the receive FIFO. - MSR_
IDLE ๐ - Value of
reg::MSRat reset: CTS, DSR and DCD asserted (the host is considered connected), no delta bit pending. - PORT_
COUNT - Number of consecutive I/O ports used by the UART.
Functionsยง
- handles_
port - True when
portbelongs to the COM1 register window.