13using namespace MaxOS::drivers;
14using namespace MaxOS::drivers::video;
15using namespace MaxOS::memory;
16using namespace MaxOS::system;
17using namespace MaxOS::common;
31 m_bpp = m_framebuffer_info->
common.framebuffer_bpp;
32 m_pitch = m_framebuffer_info->
common.framebuffer_pitch;
33 m_framebuffer_size = m_framebuffer_info->
common.framebuffer_height * m_pitch;
35 Logger::DEBUG() <<
"Framebuffer: bpp=" << m_bpp <<
", pitch=" << m_pitch <<
", size=" << m_framebuffer_size <<
"\n";
38 auto physical_address = (
uint64_t) m_framebuffer_info->
common.framebuffer_addr;
52VideoElectronicsStandardsAssociation::~VideoElectronicsStandardsAssociation() =
default;
65 return width == m_framebuffer_info->
common.framebuffer_width
66 &&
height == m_framebuffer_info->
common.framebuffer_height
82 return width == m_framebuffer_info->
common.framebuffer_width
83 &&
height == m_framebuffer_info->
common.framebuffer_height
122 return "NEC Home Electronics";
131 return "VESA compatible graphics card";
static Logger DEBUG()
Gets active logger set to DEBUG level.
static Logger INFO()
Gets active logger set to info level.
uint32_t width() const
Gets the width of the screen.
uint64_t * m_framebuffer_address
The address of the framebuffer.
uint32_t height() const
Gets the height of the screen.
uint32_t color_depth() const
Gets the current color depth (bits per pixel)
Stores the left, top, width and height of a rectangle.
bool set_mode(uint32_t width, uint32_t height, uint32_t color_depth)
Set the mode of the video driver.
bool supports_mode(uint32_t width, uint32_t height, uint32_t) final
Checks if the VESA driver supports the given mode.
VideoElectronicsStandardsAssociation(multiboot_tag_framebuffer *framebuffer_info)
Constructs a new VESA driver object. Maps the framebuffer into the higher half.
string device_name() final
The name of the device.
string vendor_name() final
The name of the vendor of the VESA standard.
static void * to_dm_region(uintptr_t physical_address)
Converts a physical address to a direct map region address if it is in the lower region using the hig...
static PhysicalMemoryManager * s_current_manager
The current physical memory manager in use.
static size_t size_to_frames(size_t size)
Converts a size to the number of frames.
Defines a Logger class for logging messages with different severity levels to multiple output streams...
@ PRESENT
The page is present in memory.
@ WRITE
Memory in this page is writable.
A tag containing information about the framebuffer.
struct multiboot_tag_framebuffer_common common
*copydoc multiboot_tag_framebuffer_common
Defines a Video Electronics Standards Association (VESA) video driver for handling pixel rendering us...