ps2-keyboard-en-us) reads scancodes from the PS/2 controller at I/O port 0x60 and translates them into ASCII characters using a built-in English US keymap. It is the sole source of user input in MVH Kernel — every character you type at the mvh> shell prompt passes through this driver. The driver handles the Shift modifier and Caps Lock state internally, so the shell receives clean, correctly-cased characters without any additional processing.
Layout and Modifier Support
English US Layout
The keymap is hard-coded to the standard QWERTY English US layout (en-US). All alphabetic, numeric, and symbol keys follow the US keyboard standard.
Shift Modifier
Holding Shift while pressing a key produces the shifted character — uppercase letters,
!@#$%^&*() from number row, and shifted punctuation — exactly as you would expect on a physical US keyboard.Caps Lock
Pressing Caps Lock toggles the internal caps state. When Caps Lock is active, alphabetic keys produce uppercase letters without requiring Shift. Shift still inverts the case when Caps Lock is on.
Shell Integration
keyboard_read_char() blocks until a key is pressed and returns the translated ASCII character. The shell reads characters one at a time and echoes them to the VGA display as you type.Shell Input Flow
When you type at themvh> prompt, the following sequence occurs:
- The PS/2 controller raises an IRQ 1 interrupt.
- The keyboard driver reads the scancode from port
0x60. - The scancode is translated using the en-US keymap, applying the current Shift and Caps Lock state.
keyboard_read_char()returns the ASCII character to the shell’s input loop.- The shell echoes the character to VGA and appends it to the command buffer.
- When you press Enter, the shell dispatches the buffered command for execution.
Language Switching vs. Keyboard Layout
Thelanguage shell command lets you switch the language used for shell output messages between English (en), German (de), Spanish (es), and French (fr). This does not change the keyboard layout. The keyboard layout is always English US regardless of the selected output language. The manifest hard-codes "keyboard_layout": "en-US".
API Reference
The keyboard driver exposes one function frominclude/mvh/keyboard.h:
Driver ID
The device manager registers this driver under the IDps2-keyboard-en-us. Run devices in the shell to confirm it is online.