summaryrefslogtreecommitdiff
path: root/Kernel/Graphics/Console
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Graphics/Console')
-rw-r--r--Kernel/Graphics/Console/VGATextModeConsole.cpp8
-rw-r--r--Kernel/Graphics/Console/VGATextModeConsole.h2
2 files changed, 6 insertions, 4 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++) {
diff --git a/Kernel/Graphics/Console/VGATextModeConsole.h b/Kernel/Graphics/Console/VGATextModeConsole.h
index 7bc3393462..12666e309f 100644
--- a/Kernel/Graphics/Console/VGATextModeConsole.h
+++ b/Kernel/Graphics/Console/VGATextModeConsole.h
@@ -36,7 +36,7 @@ public:
private:
void clear_vga_row(u16 row);
- VGATextModeConsole();
+ explicit VGATextModeConsole(NonnullOwnPtr<Memory::Region>);
mutable Spinlock m_vga_lock;