Skip to content

add support of virtio console according to the VirtIO standard #1781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 22, 2025

Conversation

stlankes
Copy link
Contributor

@stlankes stlankes commented Jun 19, 2025

During runtime the kernel checks, if a virtio console device is available, initialize this device and use it to print kernel messages.

A device support at the early stage of the boot process is currently not possible.

This PR depends rust-osdev/virtio-spec-rs#1.

On x86_64, I tested the PR with following command:

qemu-system-x86_64 -display none -kernel hermit-loader-x86_64 -initrd target/x86_64-unknown-hermit/debug/hello_world -device isa-debug-exit,iobase=0xf4,iosize=0x04 -smp 1 -m 1024M -global virtio-mmio.force-legacy=off -chardev stdio,id=charconsole0 -device virtio-serial-pci,disable-legacy=on -device virtconsole,chardev=charconsole0

In case of aarch64, I used following command.

qemu-system-aarch64 -display none -kernel hermit-loader-aarch64 -device guest-loader,addr=0x48000000,initrd=target/aarch64-unknown-hermit/debug/hello_world -machine virt,gic-version=3 -cpu cortex-a72 -semihosting -smp 1 -m 256M -global virtio-mmio.force-legacy=off -chardev stdio,id=charconsole0 -device virtio-serial-device -device virtconsole,chardev=charconsole0

Closes #1751.

@stlankes stlankes force-pushed the console branch 3 times, most recently from 5d734fb to 662b2fb Compare June 19, 2025 17:20
@stlankes stlankes requested a review from mkroening June 19, 2025 17:25
@stlankes stlankes force-pushed the console branch 2 times, most recently from 9750a3b to c065f2e Compare June 19, 2025 20:04
@stlankes stlankes changed the title add support of virtio console according to the VirtIO standar add support of virtio console according to the VirtIO standard Jun 23, 2025
@stlankes stlankes force-pushed the console branch 11 times, most recently from e1e1150 to c08b826 Compare June 24, 2025 21:10
@stlankes
Copy link
Contributor Author

@mkroening Now, you can review this PR.

@stlankes stlankes force-pushed the console branch 13 times, most recently from 44c151f to 287a2ee Compare July 19, 2025 16:04
@mkroening mkroening force-pushed the console branch 2 times, most recently from cfa15cb to 030c2be Compare July 21, 2025 15:31
During runtime the kernel checks, if a virtio console device is
available, initialize this device and use it to print kernel
messages.

A device support at the early stage of the boot process is currently
not possible.
@mkroening mkroening force-pushed the console branch 2 times, most recently from f205464 to 11458cf Compare July 21, 2025 18:06
stlankes and others added 3 commits July 22, 2025 12:12
Moving interface partly to the platform independent part and detect on
supported architectures the virtio interface.
@mkroening mkroening enabled auto-merge July 22, 2025 10:36
@mkroening mkroening added this pull request to the merge queue Jul 22, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 22, 2025
@mkroening mkroening added this pull request to the merge queue Jul 22, 2025
Merged via the queue into hermit-os:main with commit dc34ec0 Jul 22, 2025
15 checks passed
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.

Tracking issue for a virtio-console driver
2 participants