mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
Kernel: Allow the user to specify the virtual console when booting
This commit is contained in:
parent
99eab4667a
commit
ab52108982
Notes:
sideshowbarker
2024-07-18 18:00:31 +09:00
Author: https://github.com/supercomputer7
Commit: ab52108982
Pull-request: https://github.com/SerenityOS/serenity/pull/6277
Reviewed-by: https://github.com/ElectrodeYT
Reviewed-by: https://github.com/awesomekling
4 changed files with 17 additions and 2 deletions
|
@ -5,8 +5,10 @@
|
|||
*/
|
||||
|
||||
#include <AK/Singleton.h>
|
||||
#include <Kernel/CommandLine.h>
|
||||
#include <Kernel/Debug.h>
|
||||
#include <Kernel/Graphics/GraphicsManagement.h>
|
||||
#include <Kernel/Panic.h>
|
||||
#include <Kernel/TTY/ConsoleManagement.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
@ -39,7 +41,11 @@ UNMAP_AFTER_INIT void ConsoleManagement::initialize()
|
|||
m_consoles.append(VirtualConsole::create(index));
|
||||
}
|
||||
// Note: By default the active console is the first one.
|
||||
m_active_console = m_consoles[0];
|
||||
auto tty_number = kernel_command_line().switch_to_tty();
|
||||
if (tty_number > m_consoles.size()) {
|
||||
PANIC("Switch to tty value is invalid: {} ", tty_number);
|
||||
}
|
||||
m_active_console = m_consoles[tty_number];
|
||||
ScopedSpinLock lock(m_lock);
|
||||
m_active_console->set_active(true);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue