Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
8b432d3
feature: add init skeleton for keyboard, implements ps2client and pro…
domnudragota Sep 1, 2025
1ef553f
feature: add init skeleton for keyboard, implements ps2client and pro…
domnudragota Sep 1, 2025
56b38de
feature: add UART Receive path + FIFO, deferred RX pump + TX consume
domnudragota Sep 4, 2025
6e71b5a
feature: add keyboardconsole glue capsule and wire it to keyboard-vga…
domnudragota Sep 4, 2025
21b1d92
rebase ps2-keyboard-console-capsule from ps2-keyboard-v2
domnudragota Sep 4, 2025
e8b6d45
workflow: test PC on VGA output, add more encoding support for VGA
domnudragota Sep 4, 2025
f2d70ef
fix: add glyph support for kernel command table
domnudragota Sep 4, 2025
fb75f33
fix: ran cargo fmt + makeprepush again
domnudragota Sep 4, 2025
578038b
fix: removed rebase artifacts
domnudragota Sep 11, 2025
0b0fc87
capsules/core: add TextConsoleUart - UART over TextScreen
domnudragota Sep 15, 2025
670db49
document TextScreen UART adapter in README
domnudragota Sep 15, 2025
db60143
feature: add VgaTextScreen adapter implementing kernel::hil::text_scr…
domnudragota Sep 15, 2025
adff4cb
feature: wired capsule in main.rs, removed old glue
domnudragota Sep 16, 2025
29558bd
feature: gate VGA to text mode via sealed capability
domnudragota Sep 16, 2025
5c74b7a
fix: fix old remnants from rebase
domnudragota Sep 17, 2025
730ec87
Merge branch 'ps2-keyboard-v2' into ps2-keyboard-console-capsule
domnudragota Sep 18, 2025
3163314
feature: PS/2 split + Keyboard HIL; TextScreen-backed UART; VGA wiring
domnudragota Sep 18, 2025
d1fed94
Merge branch 'ps2-keyboard-v2' into ps2-keyboard-console-capsule
domnudragota Sep 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions boards/qemu_i486_q35/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@

use capsules_core::alarm;
use capsules_core::console::{self, Console};
use capsules_core::text_screen_uart::TextConsoleUart;
use capsules_core::virtualizers::virtual_alarm::{MuxAlarm, VirtualMuxAlarm};
use components::console::ConsoleComponent;
use components::debug_writer::DebugWriterComponent;
use core::ptr;
use kernel::capabilities;
use kernel::component::Component;
use kernel::debug;
use kernel::deferred_call::DeferredCallClient;
use kernel::hil;
use kernel::hil::keyboard::Keyboard;
use kernel::ipc::IPC;
use kernel::platform::chip::Chip;
use kernel::platform::scheduler_timer::VirtualSchedulerTimer;
Expand All @@ -30,6 +33,7 @@ use kernel::{create_capability, static_init};
use x86::registers::bits32::paging::{PDEntry, PTEntry, PD, PT};
use x86::registers::irq;
use x86_q35::pit::{Pit, RELOAD_1KHZ};
use x86_q35::vga_textscreen::VgaTextScreen;
use x86_q35::{Pc, PcComponent};

mod multiboot;
Expand Down Expand Up @@ -177,12 +181,30 @@ unsafe extern "cdecl" fn main() {
let uart_mux = components::console::UartMuxComponent::new(chip.com1, 115_200)
.finalize(components::uart_mux_component_static!());

// Alternative for VGA
let vga_uart_mux = components::console::UartMuxComponent::new(chip.vga, 115_200)
// VGA path: TextScreen (chip) + UART capsule over it
let vga_screen = static_init!(VgaTextScreen<'static>, VgaTextScreen::new());
// VgaTextScreen completes print() via deferred call
vga_screen.register();

let vga_text_uart = static_init!(
TextConsoleUart<'static, VgaTextScreen<'static>>,
TextConsoleUart::new(vga_screen)
);

// Wire the PS/2 keyboard into the text console via the Keyboard HIL.
chip.keyboard.init_device();
chip.keyboard.set_client(vga_text_uart);

// TextConsoleUart pumps RX via deferred call and needs screen callback
vga_text_uart.register();
vga_text_uart.set_as_screen_client();

// Build a UartMux on top of the TextConsoleUart so PC can attach
let vga_uart_mux = components::console::UartMuxComponent::new(vga_text_uart, 115_200)
.finalize(components::uart_mux_component_static!());

// Debug output uses VGA when available, otherwise COM1
let debug_uart_device = vga_uart_mux;
let debug_uart_device = uart_mux;

// Create a shared virtualization mux layer on top of a single hardware
// alarm.
Expand Down Expand Up @@ -236,7 +258,7 @@ unsafe extern "cdecl" fn main() {
// For now the ProcessConsole (interactive shell) is wired to COM1 so the user can
// type commands over the serial port. Once keyboard input is implemented
// we can switch `console_uart_device` to `vga_uart_mux`.
let console_uart_device = uart_mux;
let console_uart_device = vga_uart_mux;

// Initialize the kernel's process console.
let pconsole = components::process_console::ProcessConsoleComponent::new(
Expand Down
5 changes: 5 additions & 0 deletions capsules/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ various elements of Tock.
low-level debugging tasks, such as debugging toolchain and relocation issues.
- **[Process Console](src/process_console.rs)**: Provide a UART console to
inspect the status of process and stop/start them.
- **[TextScreen UART](src/text_screen_uart.rs)**: UART HIL adapter that runs over a
`TextScreen`, allowing boards to drive `ProcessConsole` (and other UART clients)
on displays like VGA without changing those clients. TX forwards to `print()`,
RX buffers keystrokes and completes on newline/full. Not a userspace syscall driver.


Virtualized Hardware Resources
------------------------------
Expand Down
1 change: 1 addition & 0 deletions capsules/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ pub mod process_console;
pub mod rng;
pub mod spi_controller;
pub mod spi_peripheral;
pub mod text_screen_uart;
pub mod virtualizers;
Loading