summaryrefslogtreecommitdiff
path: root/Kernel/Bus
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2022-09-16 13:17:02 +0300
committerLinus Groh <mail@linusgroh.de>2022-09-20 19:05:13 +0100
commit252c92d565120eeaa1a5dd4b52c006120afdde09 (patch)
tree5e63881aba4cff318b1cf257678251f68a81b605 /Kernel/Bus
parentb28202e35612e62b9b7a328273770477e25a0f52 (diff)
downloadserenity-252c92d565120eeaa1a5dd4b52c006120afdde09.zip
Kernel/Graphics: Introduce support for QEMU isa-vga device
This device is supposed to be used in microvm and ISA-PC machine types, and we assume that if we are able to probe for the QEMU BGA version of 0xB0C5, then we have an existing ISA Bochs VGA adapter to utilize. To ensure we don't instantiate the driver for non isa-vga devices, we try to ensure that PCI is disabled because hardware IO test probe failed so we can be sure that we use this special handling code only in the QEMU microvm and ISA-PC machine types. Unfortunately, this means that if for some reason the isa-vga device is attached for the i440FX or Q35 machine types, we simply are not able to drive the device in such setups at all. To determine the amount of VRAM being available, we read VBE register at offset 0xA. That register holds the amount of VRAM divided by 64K, so we need to multiply the value in our code to use the actual VRAM size value again. The isa-vga device requires us to hardcode the framebuffer physical address to 0xE0000000, and that address is not expected to change in the future as many other projects rely on the isa-vga framebuffer to be present at that physical memory address.
Diffstat (limited to 'Kernel/Bus')
-rw-r--r--Kernel/Bus/PCI/Access.cpp5
-rw-r--r--Kernel/Bus/PCI/Access.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/Kernel/Bus/PCI/Access.cpp b/Kernel/Bus/PCI/Access.cpp
index 4c89d5c6b3..95d0162d73 100644
--- a/Kernel/Bus/PCI/Access.cpp
+++ b/Kernel/Bus/PCI/Access.cpp
@@ -40,6 +40,11 @@ bool Access::is_initialized()
return (s_access != nullptr);
}
+bool Access::is_hardware_disabled()
+{
+ return g_pci_access_io_probe_failed;
+}
+
bool Access::is_disabled()
{
return g_pci_access_is_disabled_from_commandline || g_pci_access_io_probe_failed;
diff --git a/Kernel/Bus/PCI/Access.h b/Kernel/Bus/PCI/Access.h
index 7f91d50e4e..51d7776b5e 100644
--- a/Kernel/Bus/PCI/Access.h
+++ b/Kernel/Bus/PCI/Access.h
@@ -30,6 +30,7 @@ public:
static Access& the();
static bool is_initialized();
static bool is_disabled();
+ static bool is_hardware_disabled();
void write8_field(Address address, u32 field, u8 value);
void write16_field(Address address, u32 field, u16 value);