summaryrefslogtreecommitdiff
path: root/Kernel/init.cpp
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2020-04-09 23:57:20 +0300
committerAndreas Kling <kling@serenityos.org>2020-04-09 23:43:30 +0200
commit9bb4a6ecf64a5e86d7afb27d897c35796ee34a55 (patch)
tree4513fd1c0694fb339d07dd4d6e26694802b9b000 /Kernel/init.cpp
parent4d44a3bdfe7518b6ddede60ed5527cf79093bc9d (diff)
downloadserenity-9bb4a6ecf64a5e86d7afb27d897c35796ee34a55.zip
Kernel: Create BXVGA device if found in the PCI bus
Diffstat (limited to 'Kernel/init.cpp')
-rw-r--r--Kernel/init.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/Kernel/init.cpp b/Kernel/init.cpp
index 53cabdaf86..dae4574262 100644
--- a/Kernel/init.cpp
+++ b/Kernel/init.cpp
@@ -169,14 +169,24 @@ void init_stage2()
if (kernel_command_line().contains("text_debug")) {
dbg() << "Text mode enabled";
} else {
- if (multiboot_info_ptr->framebuffer_type == 1 || multiboot_info_ptr->framebuffer_type == 2) {
- new MBVGADevice(
- PhysicalAddress((u32)(multiboot_info_ptr->framebuffer_addr)),
- multiboot_info_ptr->framebuffer_pitch,
- multiboot_info_ptr->framebuffer_width,
- multiboot_info_ptr->framebuffer_height);
- } else {
+ bool bxvga_found = false;
+ PCI::enumerate_all([&](const PCI::Address&, PCI::ID id) {
+ if (id.vendor_id == 0x1234 && id.device_id == 0x1111)
+ bxvga_found = true;
+ });
+
+ if (bxvga_found) {
new BXVGADevice;
+ } else {
+ if (multiboot_info_ptr->framebuffer_type == 1 || multiboot_info_ptr->framebuffer_type == 2) {
+ new MBVGADevice(
+ PhysicalAddress((u32)(multiboot_info_ptr->framebuffer_addr)),
+ multiboot_info_ptr->framebuffer_pitch,
+ multiboot_info_ptr->framebuffer_width,
+ multiboot_info_ptr->framebuffer_height);
+ } else {
+ new BXVGADevice;
+ }
}
}