From aaa8760d09f6a54ea2ee4f9a201e0697f3901868 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Tue, 26 Aug 2025 23:41:44 +0300 Subject: [PATCH] Kernel: Don't wait for ps2 timeout when flushing buffer This speeds up boot time by a second :dd: --- kernel/kernel/Input/PS2/Controller.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/kernel/Input/PS2/Controller.cpp b/kernel/kernel/Input/PS2/Controller.cpp index 2b928ce0..815aef7f 100644 --- a/kernel/kernel/Input/PS2/Controller.cpp +++ b/kernel/kernel/Input/PS2/Controller.cpp @@ -468,8 +468,8 @@ namespace Kernel::Input TRY(send_command(PS2::Command::DISABLE_SECOND_PORT)); // Flush The Output Buffer - while (!read_byte().is_error()) - continue; + while (IO::inb(m_command_port) & PS2::Status::OUTPUT_STATUS) + IO::inb(m_data_port); // Set the Controller Configuration Byte TRY(send_command(PS2::Command::READ_CONFIG));