Max OS 0.3
Loading...
Searching...
No Matches
vesaboot.h
Go to the documentation of this file.
1
9#ifndef MAXOS_DRIVERS_CONSOLE_VESABOOTCONSOLE_H
10#define MAXOS_DRIVERS_CONSOLE_VESABOOTCONSOLE_H
11
12#include <cstdint>
13#include <gui/font.h>
14#include <drivers/driver.h>
16#include <common/logo.h>
17#include <common/logo_kp.h>
18#include <common/colour.h>
19#include <system/cpu.h>
20#include <memory/memoryIO.h>
22
23
24namespace MaxOS::drivers::console {
25
30 class VESABootConsole : public Driver, public Console {
31
32 private:
33 uint16_t* m_video_memory_meta;
34 inline static common::GraphicsContext* s_graphics_context = nullptr;
35 ConsoleArea* m_console_area;
36 gui::Font m_font;
37
38 uint8_t ansi_code_length = -1;
39 char ansi_code[8] = "0000000";
40
41 common::ConsoleColour m_foreground_color = common::ConsoleColour::Uninitialised;
42 common::ConsoleColour m_background_color = common::ConsoleColour::Uninitialised;
43
44 public:
47
48 uint16_t width() final;
49 uint16_t height() final;
50
52 void finish() const;
53
54 void put_character(uint16_t x, uint16_t y, char) final;
55 void set_foreground_color(uint16_t x, uint16_t y, common::ConsoleColour) final;
56 void set_background_color(uint16_t x, uint16_t y, common::ConsoleColour) final;
57
58 void scroll_up(uint16_t left, uint16_t top, uint16_t width, uint16_t height, common::ConsoleColour foreground, common::ConsoleColour background, char fill) final;
59
60 char get_character(uint16_t x, uint16_t y) final;
61 common::ConsoleColour get_foreground_color(uint16_t x, uint16_t y) final;
62 common::ConsoleColour get_background_color(uint16_t x, uint16_t y) final;
63
64 static void print_logo(bool is_panic = false);
65 static void update_progress_bar(uint8_t percentage);
66 };
67
68}
69
70
71#endif //MAXOS_DRIVERS_CONSOLE_VESABOOTCONSOLE_H
Draws pixels to the screen, and handles drawing lines, rectangles and circles.
base class for all drivers, handles the activation, deactivation, initialisation and reset of the dri...
Definition driver.h:27
A console that is a subsection of another console, limited by a width and height.
Definition console.h:59
A stream that can be used to write to a console.
Definition console.h:91
Abstract class for a console, allows for the printing of characters and strings with colours.
Definition console.h:24
virtual void scroll_up()
Scroll the entire console up by 1 line.
Definition console.cpp:142
Driver for the VESA Console during boot, handles the printing of characters and strings to the screen...
Definition vesaboot.h:30
common::ConsoleColour get_foreground_color(uint16_t x, uint16_t y) final
Gets the foreground color at the specified location.
Definition vesaboot.cpp:206
void set_foreground_color(uint16_t x, uint16_t y, common::ConsoleColour) final
Sets the foreground color at the specified location.
Definition vesaboot.cpp:146
void finish() const
Cleans up the boot console.
Definition vesaboot.cpp:349
char get_character(uint16_t x, uint16_t y) final
Gets the character at the specified location.
Definition vesaboot.cpp:186
void put_character(uint16_t x, uint16_t y, char) final
Places a character at the specified location.
Definition vesaboot.cpp:73
uint16_t width() final
Gets the width of the console.
Definition vesaboot.cpp:53
void set_background_color(uint16_t x, uint16_t y, common::ConsoleColour) final
Sets the background color at the specified location.
Definition vesaboot.cpp:166
static void print_logo(bool is_panic=false)
Prints the logo to the center of the screen.
Definition vesaboot.cpp:250
ConsoleStream * cout
The boot console output stream.
Definition vesaboot.h:51
static void update_progress_bar(uint8_t percentage)
Updates the progress bar.
Definition vesaboot.cpp:362
uint16_t height() final
Gets the height of the console.
Definition vesaboot.cpp:62
common::ConsoleColour get_background_color(uint16_t x, uint16_t y) final
Gets the background color at the specified location.
Definition vesaboot.cpp:229
A class that can be used to draw text.
Definition font.h:27
Defines a Colour class for representing colours in RGBA format, along with ANSI and console colour en...
ConsoleColour
Enumeration of console colour codes.
Definition colour.h:67
Defines a Console class for handling text-based console output with colour support.
Defines Central Processing Unit (CPU) structures and functions for managing CPU state and features.
Defines a base Driver class and DriverManager for managing drivers.
Defines a Font class for drawing text onto a graphics context.
GIMP generated header file for the kernel logo.
GIMP generated logo header for kernel panic screen.
Defines classes for memory input and output operations of various bit widths (8, 16,...
Defines a MemoryManager class for handling memory allocation and deallocation.