drv-serial is the userspace serial hardware driver daemon for EriX.
Find a file
2026-03-23 10:19:52 +02:00
.github Add CI workflow, Cargo.toml, linker script, and main.rs implementation for drv-serial 2026-03-11 02:30:43 +02:00
src drv-serial: keep fallback service slots available across build modes 2026-03-23 10:16:33 +02:00
.editorconfig Initial commit 2026-03-10 23:09:02 +01:00
.gitignore Initial commit 2026-03-10 23:09:02 +01:00
ARCHITECTURE.md drv-serial: register as SERIAL provider in deviced 2026-03-17 13:52:30 +02:00
Cargo.toml drv-serial: add serial probe mode and provider registration fixes 2026-03-21 03:31:23 +02:00
CODE_OF_CONDUCT.md Initial commit 2026-03-10 23:09:02 +01:00
CONTRIBUTING.md Initial commit 2026-03-10 23:09:02 +01:00
LICENSE Initial commit 2026-03-10 23:09:02 +01:00
linker.ld Add CI workflow, Cargo.toml, linker script, and main.rs implementation for drv-serial 2026-03-11 02:30:43 +02:00
README.md drv-serial: register as SERIAL provider in deviced 2026-03-17 13:52:30 +02:00
ROADMAP.md drv-serial: register as SERIAL provider in deviced 2026-03-17 13:52:30 +02:00
rustfmt.toml drv-serial: drop unstable rustfmt options for stable toolchains 2026-03-23 10:19:52 +02:00
SECURITY.md docs: align security policy phase numbering 2026-03-11 05:28:11 +02:00

drv-serial

drv-serial is the userspace serial hardware driver daemon for EriX.

It owns the COM1 serial hardware interaction path exposed through kernel control operations and the interrupt-routing path exposed through irqd.

What it does

  • Validates startup envelope and role contract (SERVICE_ROLE_DRV_SERIAL).
  • Registers itself with named and resolves irqd in serial integration mode.
  • Resolves deviced and registers itself as a serial provider (REGISTER_PROVIDER, interface class SERIAL).
  • Registers a UART COM1 interrupt handler with irqd, then unmasks the line.
  • Handles RPC operations:
    • IPC_PHASE3_DRV_SERIAL_OP_WRITE
    • IPC_PHASE3_DRV_SERIAL_OP_READ
    • IPC_PHASE3_DRV_SERIAL_OP_READ_STATS
  • Writes bytes to COM1 data port (0x3F8) via IPC_KERNEL_CONTROL_OP_IOPORT_WRITE8.
  • Maintains bounded RX ring and deterministic counters (rx_bytes, tx_bytes, irq_count, dropped_irq_count).

Runtime model

  • Single-threaded event loop with mixed RPC and interrupt-notify handling.
  • Fixed message buffers (IPC_MSG_BUFFER_BYTES = 1024).
  • Fixed RX ring (RX_RING_CAPACITY = 4096).
  • No dynamic allocation and no external crates.

Interrupt path

  • Interrupt source: IPC_INTERRUPT_LINE_UART_COM1.
  • Delivery path: kernel -> irqd -> drv-serial notify payload (Phase2IrqdEventNotifyV1).
  • ACK is explicit via lib-interrupt::ack.
  • The implementation masks the UART line after the first acknowledged interrupt in the current runtime model to avoid notify flooding.

Feature flags

  • drv-serial-integration-smoke
  • drv-serial-integration-force-fail
  • drv-serial-integration-phase3-serial

Default build has no integration feature enabled.

Build and test

cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all-targets --all-features

Dependencies

  • lib-bootstrap
  • lib-capabi
  • lib-ipc
  • lib-service
  • lib-interrupt
  • ipc-syscall-x86_64

No third-party crates are used.