Exemple #1
0
void terminal_initialize(void) {
	terminal_row = 0;
	terminal_column = 0;
	terminal_color = vga_entry_color(VGA_COLOR_LIGHT_GREY, VGA_COLOR_BLACK);
	terminal_buffer = (uint16_t*)0xB8000;

	for (size_t y = 0; y < VGA_HEIGHT; y++) {
		for (size_t x = 0; x < VGA_WIDTH; x++) {
			const size_t index = y * VGA_HEIGHT + x;
			terminal_buffer[index] = vga_entry(' ', terminal_color);
		}
	}
}
Exemple #2
0
Terminal* get_task_terminal_instance() {
    static bool isInit = false;
    static Terminal instance;

    if (!isInit) {
        instance.row = TASK_GUI_START_X;
        instance.column = TASK_GUI_START_Y;
        instance.color = vga_entry_color(VGA_COLOR_WHITE, VGA_COLOR_BLACK);
        ((vga_t*)&instance)->buffer = (uint16_t*) 0xB8000;
        isInit = true;
    }

    return &instance;
}
Exemple #3
0
Terminal* get_interrupt_terminal_instance() {
    static Terminal instance;
    static bool isInit = false;

    if (!isInit) {
        instance.row = TERMINAL_START_Y;
        instance.column = TERMINAL_START_X;
        instance.color = vga_entry_color(VGA_COLOR_WHITE, VGA_COLOR_BLACK);
        ((vga_t*)&instance)->buffer = (uint16_t*) 0xB8000;
        fill_screen_with_colors((vga_t*)&instance, instance.color);
        isInit = true;
    }

    return &instance;
}
Exemple #4
0
void set_color(color fg, color bg) {
	set_color(vga_entry_color(fg, bg));
}