⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module terminal

Module terminal 

Source
Expand description

Terminal state tracking for /dev/console and /dev/tty*

Provides POSIX-compatible terminal attributes (struct termios equivalent) and window size tracking. The terminal state is queried and modified via SYS_IOCTL (syscall 112) with TCGETS/TCSETS/TIOCGWINSZ requests.

The state is used by the console read path to implement canonical vs raw mode, echo control, and control character handling.

Structs§

KernelTermios
Linux struct termios layout (60 bytes).
KernelWinsize
Terminal window size, matching the C struct winsize layout.
TerminalState
Combined terminal state for a single console device.

Constants§

CREAD
CS8
ECHO
ECHOE
ECHOK
HUPCL
ICANON
ICRNL
IEXTEN
ISIG
IXON
NCCS
Number of control characters.
ONLCR
OPOST
TCGETS
Get terminal attributes (struct termios).
TCSETS
Set terminal attributes immediately.
TCSETSF
Set terminal attributes after draining output and flushing input.
TCSETSW
Set terminal attributes after draining output.
TIOCGPGRP
Get foreground process group ID.
TIOCGWINSZ
Get terminal window size (struct winsize).
TIOCSPGRP
Set foreground process group ID.
TIOCSWINSZ
Set terminal window size.
VEOF
VERASE
VINTR
VKILL
VMIN
VQUIT
VSTART
VSTOP
VSUSP
VTIME

Functions§

get_console_terminal
Get the global console terminal state.
get_termios_snapshot
Get a snapshot of the current termios (for the ioctl handler).
get_verase
Get the erase character from the console terminal state.
get_vmin
Get the VMIN value from the console terminal state.
get_vtime
Get the VTIME value from the console terminal state.
get_winsize_snapshot
Get a snapshot of the current winsize (for the ioctl handler).
init
Initialize the global console terminal state.
is_canonical_mode
Check if the console is in canonical (line-buffered) mode.
is_echo_enabled
Check if echo is enabled on the console.
set_termios
Set the terminal attributes (from TCSETS/TCSETSW/TCSETSF ioctl).
set_winsize
Set the window size (from TIOCSWINSZ ioctl).