|
miniOS
x86_64 hobby kernel with SMP, VFS, and POSIX process model
|
#include <miniOS/arch/x86_64/port.h>#include <miniOS/arch/x86_64/spinlock.h>#include <miniOS/drivers/console.h>#include <miniOS/drivers/vt.h>#include <miniOS/mm/vmm.h>
Classes | |
| struct | vt_attr_state_t |
| struct | vt_state_t |
Enumerations | |
| enum | vt_parser_state { VT_STATE_NORMAL = 0 , VT_STATE_ESC , VT_STATE_CSI } |
Functions | |
| static void | serial_init (void) |
| static void | serial_putchar (char c) |
| static uint8_t * | vt_vga_cell (uint16_t row, uint16_t col) |
| static void | vt_reset_parser (void) |
| static void | vt_reset_attr (void) |
| static uint8_t | vt_attr_byte (void) |
| static void | vt_write_cell (uint16_t row, uint16_t col, uint16_t ch, uint8_t attr) |
| static void | vt_clear_row_range (uint16_t row, uint16_t col_start, uint16_t col_end, uint8_t attr) |
| static void | vt_scroll_if_needed (void) |
| static void | vt_update_cursor_hw (void) |
| static void | vt_clamp_cursor (void) |
| static int | vt_csi_param (uint8_t index, int default_value) |
| static void | vt_erase_in_display (int mode) |
| static void | vt_erase_in_line (int mode) |
| static uint8_t | vt_map_256_to_vga (int color) |
| static uint8_t | vt_sgr_16_color (int code, bool background) |
| static void | vt_apply_sgr (void) |
| static void | vt_put_printable (uint16_t ch) |
| static uint8_t | latin1_to_cp437 (uint8_t c) |
| static void | vt_put_codepoint (uint32_t cp) |
| static void | utf8_flush_raw (void) |
| static void | utf8_emit_codepoint (uint32_t cp) |
| static void | vt_handle_normal_char (char c) |
| void | vt_handle_csi (char final) |
| 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. | |
Variables | |
| static uint16_t | vt_rows = SCREEN_ROWS |
| static uint16_t | vt_cols = SCREEN_COLS |
| static spinlock_t | vt_fb_lock = SPINLOCK_INIT |
| static vt_state_t | vt_state |
| static uint8_t | vt_palette_rgb [16][3] |
| static int | utf8_rem |
| static uint32_t | utf8_cp |
| static uint8_t | utf8_buf [4] |
| static int | utf8_buf_len |
| enum vt_parser_state |
|
static |


|
static |


|
static |


|
static |


|
static |


|
static |

|
static |



|
static |

|
static |


|
static |


| void vt_handle_csi | ( | char | final | ) |


|
static |


|
static |

|
static |


|
static |


|
static |

|
static |

|
static |


|
static |

|
static |





|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |