1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:04:57 +00:00
serenity/Kernel/API
Liav A bfffe88de5 Kernel/HID: Untie the PS2 protocol, i8042 hardware and generic devices
For a very long time, the kernel had only support for basic PS/2 devices
such as the PS2 AT keyboard and regular PS2 mouse (with a scroll wheel).

To adapt to this, we had very simple abstractions in place, essentially,
the PS2 devices were registered as IRQ handlers (IRQ 1 and 12), and when
an interrupt was triggered, we simply had to tell the I8042Controller to
fetch a byte for us, then send it back to the appropriate device for
further processing and queueing of either a key event, or a mouse packet
so userspace can do something meaningful about it.

When we added the VMWare mouse integration feature it was easily adapted
to this paradigm, requiring small changes across the handling code for
these devices.

This patch is a major cleanup for any future advancements in the HID
subsystem.
It ensures we do things in a much more sane manner:
- We stop using LockRefPtrs. Currently, after the initialization of the
  i8042 controller, we never have to change RefPtrs in that class, as we
  simply don't support PS2 hotplugging currently.
  Also, we remove the unnecessary getters for keyboard and mouse devices
  which also returned a LockRefPtr.
- There's a clear separation between PS2 devices and the actual device
  nodes that normally exist in /dev. PS2 devices are not polled, because
  when the user uses these devices, they will trigger an IRQ which when
  is handled, could produce either a MousePacket or KeyEvent, depending
  on the device state.
  The separation is crucial for buses that are polled, for example - USB
  is a polled bus and will not generate an IRQ for HID devices.
- There's a clear separation in roles of each structure. The PS2 devices
  which are attached to a I8042Controller object are managing the device
  state, while the generic MouseDevice and KeyboardDevice manage all
  related tasks of a CharacterDevice, as well as interpreting scan code
  events and mouse relative/absolute coordinates.
2023-04-09 18:11:37 +02:00
..
POSIX Kernel+Userland: Make some of the POSIX types larger 2023-04-04 10:33:42 +02:00
Device.h Kernel: Mark serenity_dev_ functions as static 2022-03-18 11:59:35 +00:00
DeviceEvent.h Kernel/Devices: Introduce the Device Control Device 2022-01-23 00:38:02 +00:00
Graphics.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
InodeWatcherEvent.h Kernel+LibC: Move name length constants to Kernel/API from limits.h 2023-01-21 10:43:59 -07:00
InodeWatcherFlags.h Kernel: Implement multi-watch InodeWatcher :^) 2021-05-12 22:38:20 +02:00
Ioctl.h Kernel+Userland: Move LibC/sys/ioctl_numbers to Kernel/API/Ioctl.h 2023-01-21 10:43:59 -07:00
kcov.h Kernel+Userland: Unify declarations for KCOV in Kernel/API/kcov.h 2023-02-24 20:35:45 +01:00
KeyCode.h Kernel/HID: Untie the PS2 protocol, i8042 hardware and generic devices 2023-04-09 18:11:37 +02:00
MemoryLayout.h Kernel: Move userspace virtual address range base to 0x10000 2021-12-22 00:02:36 -08:00
MousePacket.h Kernel: Add horizontal mouse scroll support 2022-01-20 10:37:52 +01:00
prctl_numbers.h Kernel: Merge {get,set}_process_name syscalls to the prctl syscall 2023-03-15 20:10:48 +01:00
serenity_limits.h Kernel: Bump maximum pthread stack size to 32MiB 2022-12-11 19:55:37 -07:00
Syscall.h Kernel: Mark sys$msync as not needing the big lock 2023-04-06 20:30:03 +03:00
SyscallString.h Kernel: Stop requiring working malloc for syscall.h includes 2022-05-02 12:44:34 +02:00
TimePage.h Kernel: Add CLOCK_MONOTONIC_COARSE to the kernel time page 2021-08-10 21:51:05 +02:00
ttydefaults.h Kernel: Move TYPEDEF_* TTY macros to API/ttydefaults.h file 2023-03-01 19:36:53 -07:00
ttydefaultschars.h Kernel: Move TYPEDEF_* TTY macros to API/ttydefaults.h file 2023-03-01 19:36:53 -07:00
Unveil.h Kernel+LibCore+LibC: Implement support for forcing unveil on exec 2022-11-26 12:42:15 -07:00
VirGL.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
VirtualMemoryAnnotations.h Kernel/Memory: Add option to annotate region mapping as immutable 2022-12-16 01:02:00 -07:00