mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:47:35 +00:00
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.
This commit is contained in:
parent
15315be55c
commit
fafa339264
10 changed files with 197 additions and 72 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il>
|
||||
* Copyright (c) 2021-2022, Liav A. <liavalb@hotmail.co.il>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -15,43 +15,21 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
class VGACompatibleAdapter : public GenericGraphicsAdapter
|
||||
, public PCI::Device {
|
||||
class VGACompatibleAdapter : public GenericGraphicsAdapter {
|
||||
public:
|
||||
static NonnullRefPtr<VGACompatibleAdapter> initialize_with_preset_resolution(PCI::DeviceIdentifier const&, PhysicalAddress, size_t framebuffer_width, size_t framebuffer_height, size_t framebuffer_pitch);
|
||||
static NonnullRefPtr<VGACompatibleAdapter> initialize(PCI::DeviceIdentifier const&);
|
||||
|
||||
virtual bool framebuffer_devices_initialized() const override { return !m_framebuffer_device.is_null(); }
|
||||
|
||||
virtual bool modesetting_capable() const override { return false; }
|
||||
virtual bool double_framebuffering_capable() const override { return false; }
|
||||
|
||||
virtual bool vga_compatible() const override final { return true; }
|
||||
|
||||
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;
|
||||
virtual bool try_to_set_resolution(size_t, size_t, size_t) override { return false; }
|
||||
virtual bool set_y_offset(size_t, size_t) override { return false; }
|
||||
|
||||
ErrorOr<ByteBuffer> get_edid(size_t output_port_index) const override;
|
||||
ErrorOr<ByteBuffer> get_edid(size_t) const override { return Error::from_errno(ENOTSUP); }
|
||||
|
||||
protected:
|
||||
explicit VGACompatibleAdapter(PCI::Address);
|
||||
VGACompatibleAdapter() = default;
|
||||
|
||||
private:
|
||||
VGACompatibleAdapter(PCI::Address, PhysicalAddress, size_t framebuffer_width, size_t framebuffer_height, size_t framebuffer_pitch);
|
||||
|
||||
// ^GenericGraphicsAdapter
|
||||
virtual void initialize_framebuffer_devices() override;
|
||||
|
||||
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<FramebufferDevice> m_framebuffer_device;
|
||||
RefPtr<Graphics::Console> m_framebuffer_console;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue