Ver código fonte

Kernel/Graphics: Indicate initialization failed if no device was found

Liav A 4 anos atrás
pai
commit
c6ffee7f18
1 arquivos alterados com 5 adições e 0 exclusões
  1. 5 0
      Kernel/Graphics/GraphicsManagement.cpp

+ 5 - 0
Kernel/Graphics/GraphicsManagement.cpp

@@ -16,6 +16,7 @@
 #include <Kernel/Graphics/VGACompatibleAdapter.h>
 #include <Kernel/IO.h>
 #include <Kernel/Multiboot.h>
+#include <Kernel/Panic.h>
 #include <Kernel/VM/AnonymousVMObject.h>
 
 namespace Kernel {
@@ -140,6 +141,10 @@ UNMAP_AFTER_INIT bool GraphicsManagement::initialize()
         }
         display_adapter->initialize_framebuffer_devices();
     });
+    if (m_graphics_devices.is_empty()) {
+        dbgln("No graphics adapter was initialized.");
+        return false;
+    }
     return true;
 }