miniOS
x86_64 hobby kernel with SMP, VFS, and POSIX process model
Loading...
Searching...
No Matches
vt.h File Reference
#include <miniOS/types.h>
Include dependency graph for vt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void vt_init (void)
 Clears the VGA framebuffer, resets cursor position to (0,0), sets default attribute (light gray on black), and initialises the ANSI escape parser state machine. Called once during kernel boot before any console output.
void vt_clear (void)
 Fills all 80x25 VGA cells with space characters using the current default attribute, resets the cursor position to row 0 column 0, and updates the hardware cursor via VGA CRT registers.
void vt_write_byte (char c)
 If inside an ANSI escape sequence, feeds to the CSI parser and applies the completed command (cursor movement, erase, SGR color). Otherwise:
void vt_write (const char *buf, size_t len)
 Calls vt_write_byte() for each byte in [buf, buf+len). Efficient for bulk output from tty_write() or printk().
void vt_set_cursor_visible (bool visible)
 Writes to VGA CRT registers VGA_CUR_START_REG (index 0x0A): sets VGA_CUR_DISABLE bit to hide, clears it and sets scanline range to show.
void vt_get_winsize (uint16_t *rows, uint16_t *cols)
 Used by tty_ioctl TIOCGWINSZ to fill struct minios_winsize.ws_row/ws_col.
uint8_t vt_current_attr (void)
 The attribute byte encodes foreground color (bits 3:0), background color (bits 6:4), and blink (bit 7) as set by the most recent SGR sequence.