1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:07:36 +00:00

Kernel: Check i8042 existence before trying to use it

If we don't do so, we just hang forever because we assume there's i8042
controller in the system, which is not a valid assumption for modern PC
hardware.
This commit is contained in:
Liav A 2022-02-10 10:19:28 +02:00 committed by Idan Horowitz
parent f1f0770d68
commit dc41a0b830
2 changed files with 39 additions and 0 deletions

View file

@ -144,6 +144,11 @@ private:
u8 do_wait_then_read(u8 port);
void drain_output_buffer();
// Note: These functions exist only for the initialization process of the controller
void do_write(u8 port, u8 data);
u8 do_read(u8 port);
bool check_existence();
Spinlock m_lock;
bool m_first_port_available { false };
bool m_second_port_available { false };