Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Input

This document describes the input subsystem in the Kyronix kernel. It is the child of Drivers.

Source

kernel/drivers/input.c, kernel/drivers/kbd.c, kernel/drivers/ps2mouse.c

Overview

The input subsystem provides an event-based interface for keyboard and mouse input. Events are delivered to user-space via character devices at /dev/input/event0 (keyboard) and /dev/input/event1 (mouse).

Event Structure

struct input_event {
    uint32_t type;      // Event type
    uint32_t code;      // Key/button code
    int32_t  value;     // Value (press/release/movement)
};

Event Types

TypeDescription
Keyboard eventKey press/release with scancode
Mouse eventRelative X/Y movement and button state

Devices

DevicePathSource
Keyboard/dev/input/event0PS/2 keyboard
Mouse/dev/input/event1PS/2 mouse

Functions

FunctionDescription
input_init()Initialize input subsystem
kbd_init()Initialize PS/2 keyboard
ps2mouse_init()Initialize PS/2 mouse

Terminal Integration

The input subsystem is connected to the TTY layer. Keyboard events drive the virtual terminal, and mouse events are forwarded to user-space via the event devices.

Last reviewed: 2026-07-22