mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-11 05:32:59 +00:00
As we removed the support of VBE modesetting that was done by GRUB early on boot, we need to determine if we can modeset the resolution with our drivers, and if not, we should enable text mode and ensure that SystemServer knows about it too. Also, SystemServer should first check if there's a framebuffer device node, which is an indication that text mode was not even if it was requested. Then, if it doesn't find it, it should check what boot_mode argument the user specified (in case it's self-test). This way if we try to use bochs-display device (which is not VGA compatible) and request a text mode, it will not honor the request and will continue with graphical mode. Also try to print critical messages with mininum memory allocations possible. In LibVT, We make the implementation flexible for kernel-specific methods that are implemented in ConsoleImpl class.
51 lines
1.6 KiB
C++
51 lines
1.6 KiB
C++
/*
|
|
* Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/String.h>
|
|
#include <AK/Types.h>
|
|
#include <Kernel/Graphics/Console/Console.h>
|
|
#include <Kernel/Graphics/GraphicsDevice.h>
|
|
#include <Kernel/Graphics/RawFramebufferDevice.h>
|
|
#include <Kernel/PCI/DeviceController.h>
|
|
#include <Kernel/PhysicalAddress.h>
|
|
|
|
namespace Kernel {
|
|
|
|
class VGACompatibleAdapter : public GraphicsDevice
|
|
, public PCI::DeviceController {
|
|
AK_MAKE_ETERNAL
|
|
public:
|
|
static NonnullRefPtr<VGACompatibleAdapter> initialize_with_preset_resolution(PCI::Address, PhysicalAddress, size_t framebuffer_width, size_t framebuffer_height, size_t framebuffer_pitch);
|
|
static NonnullRefPtr<VGACompatibleAdapter> initialize(PCI::Address);
|
|
|
|
virtual bool framebuffer_devices_initialized() const override { return !m_framebuffer_device.is_null(); }
|
|
|
|
protected:
|
|
explicit VGACompatibleAdapter(PCI::Address);
|
|
|
|
private:
|
|
VGACompatibleAdapter(PCI::Address, PhysicalAddress, size_t framebuffer_width, size_t framebuffer_height, size_t framebuffer_pitch);
|
|
|
|
// ^GraphicsDevice
|
|
virtual void initialize_framebuffer_devices() override;
|
|
virtual Type type() const override { return Type::VGACompatible; }
|
|
|
|
virtual void enable_consoles() override;
|
|
virtual void disable_consoles() override;
|
|
|
|
protected:
|
|
PhysicalAddress m_framebuffer_address;
|
|
size_t m_framebuffer_width { 0 };
|
|
size_t m_framebuffer_height { 0 };
|
|
size_t m_framebuffer_pitch { 0 };
|
|
|
|
RefPtr<RawFramebufferDevice> m_framebuffer_device;
|
|
RefPtr<Graphics::Console> m_framebuffer_console;
|
|
};
|
|
|
|
}
|