diff options
author | Marvin Borner | 2021-04-26 00:43:59 +0200 |
---|---|---|
committer | Marvin Borner | 2021-04-26 00:43:59 +0200 |
commit | 6b71accbaf4be52a1e2d3a696675c5e610a4c9b3 (patch) | |
tree | 4f2aa853d0bbcca23ad51c0a5d76278c536f83c9 /kernel/inc | |
parent | 0fe14a1ff936c38ab9aa7f85219d0c155d276823 (diff) |
Added VMMouse support and improved PS/2 mouse
Diffstat (limited to 'kernel/inc')
-rw-r--r-- | kernel/inc/ps2.h | 16 | ||||
-rw-r--r-- | kernel/inc/vmware.h | 12 |
2 files changed, 26 insertions, 2 deletions
diff --git a/kernel/inc/ps2.h b/kernel/inc/ps2.h index 42d8127..b81d1f8 100644 --- a/kernel/inc/ps2.h +++ b/kernel/inc/ps2.h @@ -8,6 +8,20 @@ #define PS2_ACK 0xfa #define PS2_RESEND 0xfe +#define PS2_TYPE_STANDARD_MOUSE 0x0000 +#define PS2_TYPE_WHEEL_MOUSE 0x0003 +#define PS2_TYPE_BUTTON_MOUSE 0x0004 +#define PS2_TYPE_TRANSLATION_KEYBOARD1 0xab41 +#define PS2_TYPE_TRANSLATION_KEYBOARD2 0xabc1 +#define PS2_TYPE_STANDARD_KEYBOARD 0xab83 + +#define PS2_KEYBOARD(type) \ + ((type) == PS2_TYPE_TRANSLATION_KEYBOARD1 || (type) == PS2_TYPE_TRANSLATION_KEYBOARD2 || \ + (type) == PS2_TYPE_STANDARD_KEYBOARD) +#define PS2_MOUSE(type) \ + ((type) == PS2_TYPE_STANDARD_MOUSE || (type) == PS2_TYPE_WHEEL_MOUSE || \ + (type) == PS2_TYPE_BUTTON_MOUSE) + struct ps2_status { u8 in_full : 1; u8 out_full : 1; @@ -31,8 +45,6 @@ struct ps2_config { u8 ps2_read_data(void); u8 ps2_write_data(u8 byte); -struct ps2_status ps2_read_status(void); -u8 ps2_write_command(u8 byte); u8 ps2_write_device(u8 device, u8 data); void ps2_detect(void); diff --git a/kernel/inc/vmware.h b/kernel/inc/vmware.h new file mode 100644 index 0000000..243c624 --- /dev/null +++ b/kernel/inc/vmware.h @@ -0,0 +1,12 @@ +// MIT License, Copyright (c) 2021 Marvin Borner + +#ifndef VMWARE_H +#define VMWARE_H + +#include <def.h> + +u8 vmware_detect(void); +u8 vmware_mouse_detect(void); +void vmware_mouse_install(u8 device); + +#endif |