1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:28:11 +00:00

Kernel/Devices: Use try_create_device helper for ConsoleDevice

This commit is contained in:
Liav A 2021-09-16 22:23:25 +03:00 committed by Idan Horowitz
parent 5e8dcb9ca7
commit fd4397a430
8 changed files with 43 additions and 26 deletions

View file

@ -7,6 +7,7 @@
#include <AK/Singleton.h>
#include <Kernel/CommandLine.h>
#include <Kernel/Debug.h>
#include <Kernel/Devices/DeviceManagement.h>
#include <Kernel/Graphics/GraphicsManagement.h>
#include <Kernel/Panic.h>
#include <Kernel/Sections.h>
@ -48,7 +49,8 @@ UNMAP_AFTER_INIT void ConsoleManagement::initialize()
for (size_t index = 0; index < s_max_virtual_consoles; index++) {
// FIXME: Better determine the debug TTY we chose...
if (index == 1) {
m_consoles.append(VirtualConsole::create_with_preset_log(index, ConsoleDevice::the().logbuffer()));
VERIFY(DeviceManagement::the().is_console_device_attached());
m_consoles.append(VirtualConsole::create_with_preset_log(index, DeviceManagement::the().console_device().logbuffer()));
continue;
}
m_consoles.append(VirtualConsole::create(index));