summaryrefslogtreecommitdiff
path: root/Kernel/init.cpp
diff options
context:
space:
mode:
authorFlorian Angermeier <florian.angermeier+git@postfach.or.at>2020-07-15 04:13:29 +0200
committerAndreas Kling <kling@serenityos.org>2020-07-17 00:36:50 +0200
commitd8fa8c5f8278ff89da6a8433f32bd9a564aaa3ad (patch)
treed5e281f03644db012dd7657ded99f49b668a9dac /Kernel/init.cpp
parent971a42a816300e3d0e58c5d8d0e54ef0e67fa46f (diff)
downloadserenity-d8fa8c5f8278ff89da6a8433f32bd9a564aaa3ad.zip
Kernel: Ensure there are all VirtualConsoles properly initialized
It is possible to switch to VirtualConsoles 1 to 4 via the shortcut ALT + [1-4]. Therefor the array of VirtualConsoles should be guaranteed to be initialized. Also add an constant for the maximum number of VirtualConsoles to guarantee consistency.
Diffstat (limited to 'Kernel/init.cpp')
-rw-r--r--Kernel/init.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Kernel/init.cpp b/Kernel/init.cpp
index 06eaf2c2cd..b096f616bf 100644
--- a/Kernel/init.cpp
+++ b/Kernel/init.cpp
@@ -144,7 +144,9 @@ extern "C" [[noreturn]] void init()
VirtualConsole::initialize();
tty0 = new VirtualConsole(0);
- new VirtualConsole(1);
+ for (unsigned i = 1; i < s_max_virtual_consoles; i++) {
+ new VirtualConsole(i);
+ }
VirtualConsole::switch_to(0);
Process::initialize();