Kernel/Graphics: Remove unnecessary VGAConsole class abstraction

The original intention was to support other types of consoles based on
standard VGA modes, but it never came to an implementation, nor we need
such feature at all.
Therefore, this class is not needed and can be removed.
This commit is contained in:
Liav A 2022-07-13 20:07:33 +03:00 committed by Linus Groh
parent 3f93aec720
commit 97a769d2a9
Notes: sideshowbarker 2024-07-17 09:00:46 +09:00
5 changed files with 5 additions and 61 deletions

View file

@ -79,7 +79,6 @@ set(KERNEL_SOURCES
Graphics/Console/GenericFramebufferConsole.cpp
Graphics/Console/ContiguousFramebufferConsole.cpp
Graphics/Console/TextModeConsole.cpp
Graphics/Console/VGAConsole.cpp
Graphics/DisplayConnector.cpp
Graphics/Generic/DisplayConnector.cpp
Graphics/GraphicsManagement.cpp

View file

@ -17,7 +17,8 @@ UNMAP_AFTER_INIT NonnullRefPtr<TextModeConsole> TextModeConsole::initialize()
}
UNMAP_AFTER_INIT TextModeConsole::TextModeConsole()
: VGAConsole(VGAConsole::Mode::TextMode, 80, 25)
: Console(80, 25)
, m_vga_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_current_vga_window(m_vga_region->vaddr().offset(0x18000).as_ptr())
{
for (size_t index = 0; index < height(); index++) {

View file

@ -8,11 +8,11 @@
#include <AK/RefCounted.h>
#include <AK/Types.h>
#include <Kernel/Graphics/Console/VGAConsole.h>
#include <Kernel/Graphics/Console/Console.h>
#include <Kernel/Locking/Spinlock.h>
namespace Kernel::Graphics {
class TextModeConsole final : public VGAConsole {
class TextModeConsole final : public Console {
public:
static NonnullRefPtr<TextModeConsole> initialize();
virtual size_t chars_per_line() const override { return width(); };
@ -40,6 +40,7 @@ private:
mutable Spinlock m_vga_lock;
NonnullOwnPtr<Memory::Region> m_vga_region;
VirtualAddress m_current_vga_window;
};

View file

@ -1,19 +0,0 @@
/*
* Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <Kernel/Graphics/Console/VGAConsole.h>
#include <Kernel/Sections.h>
namespace Kernel::Graphics {
UNMAP_AFTER_INIT VGAConsole::VGAConsole(Mode mode, size_t width, size_t height)
: Console(width, height)
, m_vga_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_mode(mode)
{
}
}

View file

@ -1,38 +0,0 @@
/*
* Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/RefCounted.h>
#include <AK/Types.h>
#include <Kernel/Graphics/Console/Console.h>
namespace Kernel::Graphics {
class VGAConsole : public Console {
public:
// Note: these are the modes we will support and only these
enum class Mode {
TextMode = 1, // Text Mode
Colored256, // 320x200 256 color mode
Colored16, // 640x480 16 color mode
};
public:
static NonnullRefPtr<VGAConsole> initialize(Mode, size_t width, size_t height);
virtual bool is_hardware_paged_capable() const override { return false; }
virtual bool has_hardware_cursor() const override { return false; }
virtual void flush(size_t, size_t, size_t, size_t) override { }
virtual ~VGAConsole() = default;
protected:
VGAConsole(Mode, size_t width, size_t height);
NonnullOwnPtr<Memory::Region> m_vga_region;
const Mode m_mode;
};
}