1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 00:45:06 +00:00
serenity/Kernel/Graphics/VGA/ISAAdapter.h
Liav A fafa339264 Kernel/Graphics: Don't try to enumerate PCI adapters if PCI is disabled
If there's no PCI bus, then it's safe to assume that the x86 machine we
run on supports VGA text mode console output with an ISA VGA adapter.
If this is the case, we just instantiate a ISAVGAAdapter object that
assumes this situation and allows us to boot into VGA text mode console.
2022-03-02 18:41:54 +01:00

41 lines
1.1 KiB
C++

/*
* Copyright (c) 2022, Liav A. <liavalb@hotmail.co.il>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Types.h>
#include <Kernel/Bus/PCI/Device.h>
#include <Kernel/Graphics/Console/Console.h>
#include <Kernel/Graphics/FramebufferDevice.h>
#include <Kernel/Graphics/GenericGraphicsAdapter.h>
#include <Kernel/PhysicalAddress.h>
namespace Kernel {
class ISAVGAAdapter final : public VGACompatibleAdapter {
friend class GraphicsManagement;
public:
static NonnullRefPtr<ISAVGAAdapter> initialize();
// Note: We simply don't support old VGA framebuffer modes (like the 320x200 256-colors one)
virtual bool framebuffer_devices_initialized() const override { return false; }
virtual bool try_to_set_resolution(size_t output_port_index, size_t width, size_t height) override;
virtual bool set_y_offset(size_t output_port_index, size_t y) override;
private:
ISAVGAAdapter();
// ^GenericGraphicsAdapter
virtual void initialize_framebuffer_devices() override;
virtual void enable_consoles() override;
virtual void disable_consoles() override;
RefPtr<Graphics::Console> m_framebuffer_console;
};
}