![]() |
Max OS 0.3
|
Driver for the VESA Console during boot, handles the printing of characters and strings to the screen using VESA protocol. More...
#include <vesaboot.h>
Public Member Functions | |
| VESABootConsole (common::GraphicsContext *) | |
| Constructs a new VESA Boot Console object, initializing the console area for text output. | |
| uint16_t | width () final |
| Gets the width of the console. | |
| uint16_t | height () final |
| Gets the height of the console. | |
| void | finish () const |
| Cleans up the boot console. | |
| void | put_character (uint16_t x, uint16_t y, char) final |
| Places a character at the specified location. | |
| void | set_foreground_color (uint16_t x, uint16_t y, common::ConsoleColour) final |
| Sets the foreground color at the specified location. | |
| void | set_background_color (uint16_t x, uint16_t y, common::ConsoleColour) final |
| Sets the background color at the specified location. | |
| void | scroll_up (uint16_t left, uint16_t top, uint16_t width, uint16_t height, common::ConsoleColour foreground, common::ConsoleColour background, char fill) final |
| Scrolls the console up by 1 line. | |
| char | get_character (uint16_t x, uint16_t y) final |
| Gets the character at the specified location. | |
| common::ConsoleColour | get_foreground_color (uint16_t x, uint16_t y) final |
| Gets the foreground color at the specified location. | |
| common::ConsoleColour | get_background_color (uint16_t x, uint16_t y) final |
| Gets the background color at the specified location. | |
Public Member Functions inherited from MaxOS::drivers::Driver | |
| virtual void | activate () |
| Activate the driver. | |
| virtual void | deactivate () |
| Deactivate the driver. | |
| virtual void | initialise () |
| Initialise the driver. | |
| virtual uint32_t | reset () |
| Reset the driver. | |
| virtual string | vendor_name () |
| Get who created the device. | |
| virtual string | device_name () |
| Get the device name of the driver. | |
Public Member Functions inherited from MaxOS::drivers::console::Console | |
| virtual void | put_character (uint16_t x, uint16_t y, char c, common::ConsoleColour foreground, common::ConsoleColour background) |
| Put a character on the console with a given foreground and background color. | |
| virtual void | put_string (uint16_t x, uint16_t y, string s, common::ConsoleColour foreground=common::ConsoleColour::LightGrey, common::ConsoleColour background=common::ConsoleColour::Black) |
| Put a string on the console. | |
| virtual void | scroll_up () |
| Scroll the entire console up by 1 line. | |
| virtual void | clear () |
| virtual void | clear (uint16_t left, uint16_t top, uint16_t width, uint16_t height, common::ConsoleColour foreground=common::ConsoleColour::LightGrey, common::ConsoleColour background=common::ConsoleColour::Black, char fill=' ') |
| Clear an area of the console. | |
| virtual void | invert_colors (uint16_t x, uint16_t y) |
| Invert the colors of a character on the console. | |
Static Public Member Functions | |
| static void | print_logo (bool is_panic=false) |
| Prints the logo to the center of the screen. | |
| static void | update_progress_bar (uint8_t percentage) |
| Updates the progress bar. | |
Public Attributes | |
| ConsoleStream * | cout |
| The boot console output stream. | |
Driver for the VESA Console during boot, handles the printing of characters and strings to the screen using VESA protocol.
Definition at line 30 of file vesaboot.h.
|
explicit |
Constructs a new VESA Boot Console object, initializing the console area for text output.
| graphics_context | The graphics context to use for rendering |
Definition at line 25 of file vesaboot.cpp.
References MaxOS::Logger::active_logger(), MaxOS::drivers::console::Console::clear(), cout, height(), MaxOS::Logger::INFO(), MaxOS::memory::MemoryManager::kmalloc(), print_logo(), and width().
| void VESABootConsole::finish | ( | ) | const |
Cleans up the boot console.
Definition at line 349 of file vesaboot.cpp.
References MaxOS::Logger::active_logger(), MaxOS::common::ANSI_COLOURS, cout, MaxOS::Logger::HEADER(), and MaxOS::drivers::console::ConsoleStream::set_cursor().
Referenced by kernel_main().
|
finalvirtual |
Gets the background color at the specified location.
| x | The x coordinate |
| y | The y coordinate |
Reimplemented from MaxOS::drivers::console::Console.
Definition at line 229 of file vesaboot.cpp.
References height(), MaxOS::system::CPU::panic_lock, and width().
Referenced by put_character(), and scroll_up().
Gets the character at the specified location.
| x | The x coordinate |
| y | The y coordinate |
Reimplemented from MaxOS::drivers::console::Console.
Definition at line 186 of file vesaboot.cpp.
|
finalvirtual |
Gets the foreground color at the specified location.
| x | The x coordinate |
| y | The y coordinate |
Reimplemented from MaxOS::drivers::console::Console.
Definition at line 206 of file vesaboot.cpp.
References height(), MaxOS::system::CPU::panic_lock, and width().
Referenced by put_character(), and scroll_up().
|
finalvirtual |
Gets the height of the console.
Reimplemented from MaxOS::drivers::console::Console.
Definition at line 62 of file vesaboot.cpp.
References MaxOS::gui::FONT_HEIGHT, and MaxOS::common::Rectangle< Type >::height.
Referenced by get_background_color(), get_character(), get_foreground_color(), put_character(), scroll_up(), set_background_color(), set_foreground_color(), and VESABootConsole().
Prints the logo to the center of the screen.
| is_panic | Whether to print the kernel panic logo or the normal logo |
Definition at line 250 of file vesaboot.cpp.
References MaxOS::common::Rectangle< Type >::height, LOGO_HEADER_PIXEL, LOGO_HEIGHT, LOGO_WIDTH, memset(), update_progress_bar(), and MaxOS::common::Rectangle< Type >::width.
Referenced by MaxOS::system::CPU::prepare_for_panic(), and VESABootConsole().
Places a character at the specified location.
| x | The x coordinate |
| y | The y coordinate |
| c | The character to place |
Reimplemented from MaxOS::drivers::console::Console.
Definition at line 73 of file vesaboot.cpp.
References MaxOS::gui::Font::draw_text(), MaxOS::gui::FONT_HEIGHT, get_background_color(), get_foreground_color(), height(), strcmp(), MaxOS::common::Colour::to_console_colour(), and width().
|
finalvirtual |
Scrolls the console up by 1 line.
| left | The left coordinate of the area to scroll |
| top | The top coordinate of the area to scroll |
| width | The width of the area to scroll |
| height | The height of the area to scroll |
| foreground | The foreground color of the new line |
| background | The background color of the new line |
| fill | The character to fill the new line with |
Reimplemented from MaxOS::drivers::console::Console.
Definition at line 295 of file vesaboot.cpp.
References MaxOS::gui::FONT_HEIGHT, MaxOS::gui::FONT_WIDTH, get_background_color(), get_foreground_color(), height(), memmove(), set_background_color(), set_foreground_color(), MaxOS::common::Rectangle< Type >::width, and width().
|
finalvirtual |
Sets the background color at the specified location.
| x | The x coordinate |
| y | The y coordinate |
| background | The background color |
Reimplemented from MaxOS::drivers::console::Console.
Definition at line 166 of file vesaboot.cpp.
References height(), and width().
Referenced by scroll_up().
|
finalvirtual |
Sets the foreground color at the specified location.
| x | The x coordinate |
| y | The y coordinate |
| foreground | The foreground color |
Reimplemented from MaxOS::drivers::console::Console.
Definition at line 146 of file vesaboot.cpp.
References height(), and width().
Referenced by scroll_up().
Updates the progress bar.
| percentage | The percentage to update the progress bar to (0-100) |
Definition at line 362 of file vesaboot.cpp.
References MaxOS::common::Rectangle< Type >::height, LOGO_HEIGHT, LOGO_WIDTH, and MaxOS::common::Rectangle< Type >::width.
Referenced by print_logo(), and MaxOS::Logger::set_log_level().
|
finalvirtual |
Gets the width of the console.
Reimplemented from MaxOS::drivers::console::Console.
Definition at line 53 of file vesaboot.cpp.
References MaxOS::gui::FONT_WIDTH, and MaxOS::common::Rectangle< Type >::width.
Referenced by get_background_color(), get_character(), get_foreground_color(), put_character(), scroll_up(), set_background_color(), set_foreground_color(), and VESABootConsole().
| ConsoleStream* MaxOS::drivers::console::VESABootConsole::cout |
The boot console output stream.
Definition at line 51 of file vesaboot.h.
Referenced by finish(), and VESABootConsole().