diff options
Diffstat (limited to 'Kernel/Graphics/Console/VGATextModeConsole.cpp')
-rw-r--r-- | Kernel/Graphics/Console/VGATextModeConsole.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Kernel/Graphics/Console/VGATextModeConsole.cpp b/Kernel/Graphics/Console/VGATextModeConsole.cpp index 9af77c0465..3b0fd9dee8 100644 --- a/Kernel/Graphics/Console/VGATextModeConsole.cpp +++ b/Kernel/Graphics/Console/VGATextModeConsole.cpp @@ -13,12 +13,14 @@ namespace Kernel::Graphics { UNMAP_AFTER_INIT NonnullRefPtr<VGATextModeConsole> VGATextModeConsole::initialize() { - return adopt_ref(*new VGATextModeConsole()); + auto vga_window_size = MUST(Memory::page_round_up(0xc0000 - 0xa0000)); + auto vga_window_region = MUST(MM.allocate_kernel_region(PhysicalAddress(0xa0000), vga_window_size, "VGA Display"sv, Memory::Region::Access::ReadWrite)); + return adopt_ref(*new (nothrow) VGATextModeConsole(move(vga_window_region))); } -UNMAP_AFTER_INIT VGATextModeConsole::VGATextModeConsole() +UNMAP_AFTER_INIT VGATextModeConsole::VGATextModeConsole(NonnullOwnPtr<Memory::Region> vga_window_region) : Console(80, 25) - , m_vga_window_region(MM.allocate_kernel_region(PhysicalAddress(0xa0000), Memory::page_round_up(0xc0000 - 0xa0000).release_value_but_fixme_should_propagate_errors(), "VGA Display"sv, Memory::Region::Access::ReadWrite).release_value()) + , m_vga_window_region(move(vga_window_region)) , m_current_vga_window(m_vga_window_region->vaddr().offset(0x18000).as_ptr()) { for (size_t index = 0; index < height(); index++) { |