Skip to content

[WIP] Support virtio-console#139

Draft
shengwen-tw wants to merge 1 commit into
sysprog21:masterfrom
shengwen-tw:virtio-console
Draft

[WIP] Support virtio-console#139
shengwen-tw wants to merge 1 commit into
sysprog21:masterfrom
shengwen-tw:virtio-console

Conversation

@shengwen-tw

@shengwen-tw shengwen-tw commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Overview

This adds a virtio-console device as a secondary console.

The existing 8250 UART remains the primary console and early boot path. The virtio-console device exposes /dev/hvc0 inside the guest and can be connected from a host PTY endpoint.

This is still a draft while I evaluate the best integration model of virtio-consolefor semu.

Test procedures

  1. Build the Linux image with virtio-console enabled:
scripts/build-image.sh --all --clean-build
  1. Launch semu:
cd semu/
make check
  1. Connect to the virtio-console from another host terminal:
screen /tmp/semu-hvc0
  1. Confirm inside the guest:
cat /proc/consoles
ls -l /dev/hvc0

Summary by cubic

Add virtio-console as a secondary console that exposes /dev/hvc0 and connects to a host PTY. The 8250 UART remains the primary console; new CLI and build options let you choose which consoles to enable.

  • New Features
    • MMIO virtio-console device with RX/TX queues and PLIC IRQ 10; integrated into the emulator loop and interrupt path.
    • New CLI flag --virtio-console-path to create a symlink to the host PTY (used by make check as /tmp/semu-hvc0).
    • Build option SEMU_CONSOLE={virtio|uart8250|both} to select consoles; default is both.
    • Device tree adds virtio@5200000; Linux enables CONFIG_VIRTIO_CONSOLE=y.
    • Buildroot post-build script adds a getty on /dev/hvc0; README updated with usage and examples.

Written for commit 1ab73d0. Summary will update on new commits.

Review in cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant