1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:37:44 +00:00

Kernel: Fix crash when switching to console 5 & 6

The changes in commit 20743e8 removed the s_max_virtual_consoles
constant and hardcoded the number of consoles to 4. But in
PS2KeyboardDevice the keyboard shortcuts for switching to consoles were
hardcoded to 6.

I reintroduced the constant and added it in both places.
This commit is contained in:
Sebastian Zaha 2021-05-31 18:42:21 +02:00 committed by GitHub
parent b3746f9745
commit 77044dd383
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View file

@ -70,7 +70,7 @@ void PS2KeyboardDevice::irq_handle_byte_read(u8 byte)
default:
if (m_modifiers & Mod_Alt) {
switch (ch) {
case 0x02 ... 0x07: // 1 to 6
case 0x02 ... 0x01 + ConsoleManagement::s_max_virtual_consoles:
g_io_work->queue([this, ch]() {
ConsoleManagement::the().switch_to(ch - 0x02);
});