miniOS
x86_64 hobby kernel with SMP, VFS, and POSIX process model
Toggle main menu visibility
Loading...
Searching...
No Matches
vt.h
Go to the documentation of this file.
1
// MIT License
2
//
3
// Copyright (c) 2026 Christian Spoo
4
//
5
// Permission is hereby granted, free of charge, to any person obtaining a copy
6
// of this software and associated documentation files (the "Software"), to deal
7
// in the Software without restriction, including without limitation the rights
8
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
// copies of the Software, and to permit persons to whom the Software is
10
// furnished to do so, subject to the following conditions:
11
//
12
// The above copyright notice and this permission notice shall be included in all
13
// copies or substantial portions of the Software.
14
//
15
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
// SOFTWARE.
22
34
35
#ifndef _MINIOS_DRIVERS_VT_H_
36
#define _MINIOS_DRIVERS_VT_H_
37
38
#include <
miniOS/types.h
>
39
47
void
vt_init
(
void
);
48
56
void
vt_clear
(
void
);
57
71
void
vt_write_byte
(
char
c);
72
81
void
vt_write
(
const
char
*buf,
size_t
len
);
82
90
void
vt_set_cursor_visible
(
bool
visible);
91
99
void
vt_get_winsize
(
uint16_t
*rows,
uint16_t
*cols);
100
109
uint8_t
vt_current_attr
(
void
);
110
127
#ifdef CONSOLE_GOP
128
void
vt_init_gop(
uint64_t
fb_virt,
uint32_t
width,
uint32_t
height,
129
uint32_t
pitch,
uint8_t
red_pos,
uint8_t
green_pos,
130
uint8_t
blue_pos);
131
139
void
vt_cursor_tick(
void
);
140
#endif
141
143
144
#endif
vt_write_byte
void vt_write_byte(char c)
If inside an ANSI escape sequence, feeds to the CSI parser and applies the completed command (cursor ...
Definition
vt.c:731
vt_init
void vt_init(void)
Clears the VGA framebuffer, resets cursor position to (0,0), sets default attribute (light gray on bl...
Definition
vt.c:709
vt_set_cursor_visible
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,...
Definition
vt.c:793
vt_get_winsize
void vt_get_winsize(uint16_t *rows, uint16_t *cols)
Used by tty_ioctl TIOCGWINSZ to fill struct minios_winsize.ws_row/ws_col.
Definition
vt.c:798
vt_write
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 ...
Definition
vt.c:787
vt_clear
void vt_clear(void)
Fills all 80x25 VGA cells with space characters using the current default attribute,...
Definition
vt.c:722
vt_current_attr
uint8_t vt_current_attr(void)
The attribute byte encodes foreground color (bits 3:0), background color (bits 6:4),...
Definition
vt.c:807
types.h
uint16_t
unsigned short uint16_t
Definition
types.h:31
uint32_t
unsigned int uint32_t
Definition
types.h:34
uint64_t
unsigned long int uint64_t
Definition
types.h:37
uint8_t
unsigned char uint8_t
Definition
types.h:28
len
uint32_t len
Definition
virtio_net.c:1
include
miniOS
drivers
vt.h
Generated by
1.18.0