reactos/drivers/input/i8042prt
Hermès Bélusca-Maïto 4795177ced
[DRIVERS] Fix misusages of the RTL_REGISTRY_OPTIONAL flag.
See https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-rtlqueryregistryvalues

The RTL_REGISTRY_OPTIONAL applies to the first parameter of the
RtlQueryRegistryValues() function, not to the Flags member of the
table entries. However, a RTL_QUERY_REGISTRY_REQUIRED flag exists
to mark values whose existence is NOT optional.

Problematic usage was introduced in the following modules:
drivers/input/i8042prt: Commit e7e959fb0 (r30000)
drivers/input/kbdclass: Commit 5a77f871d (r18911)
drivers/input/mouclass: Commit aeeab7d1f (r18906)
drivers/input/sermouse: Commit 3f348259c (r19100)
rosapps/drivers/green : Commit c8a90f769 (r21165)
2024-12-14 19:12:11 +01:00
..
CMakeLists.txt [I8042PRT] Add service registry entry for the driver 2021-01-04 16:50:31 +03:00
createclose.c Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00
guid.c Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00
hwhacks.c [I8042PRT] Add Dell Latitude D410 to the hack list (#5246) 2023-04-18 10:03:16 +02:00
i8042prt.c [I8042PRT][RAMDISK] Fix usage of the RegistryPath in DriverEntry 2021-01-04 17:19:12 +03:00
i8042prt.h [DRIVERS] Use IoForwardIrpSynchronously in drivers 2022-01-05 02:17:56 +03:00
i8042prt.rc Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00
i8042prt_reg.inf [I8042PRT] Add service registry entry for the driver 2021-01-04 16:50:31 +03:00
keyboard.c [I8042PRT] Remove dead commented-out code; Allow sending ROS-specific commands to the kernel debugger since KD64 also support them. 2019-11-17 23:21:55 +01:00
misc.c [DRIVERS] Use IoForwardIrpSynchronously in drivers 2022-01-05 02:17:56 +03:00
mouse.c Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00
pnp.c [DRIVERS] Use IoForwardIrpSynchronously in drivers 2022-01-05 02:17:56 +03:00
ps2pp.c Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00
README.txt Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00
readwrite.c Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00
registry.c [DRIVERS] Fix misusages of the RTL_REGISTRY_OPTIONAL flag. 2024-12-14 19:12:11 +01:00

Intel 8042 port driver

This directory contains a driver for Intels 8042 and compatible controllers.
It is based on the information in the DDK documentation on MSDN. It is intended
to be compatible with keyboard and mouse drivers written for Windows. It is
not based on the i8042prt example driver that's included with the DDK.

The directory contains these files:

createclose.c: open/close devices functionnality

i8042prt.c: Main controller functionality, things shared by keyboards and mice

keyboard.c: keyboard functionality: detection, interrupt handling

misc.c: misc things, mostly related to Irp passing

mouse.c: mouse functionality: detection, interrupt handling, packet parsing for
         standard ps2 and microsoft mice

pnp.c: Plug&Play functionnality

ps2pp.c: logitech ps2++ mouse packat parsing (basic)

readwrite.c: read/write to the i8042 controller

registry.c: registry reading

setup.c: add keyboard support during the 1st stage setup

i8042prt.rc: obvious


Some parts of the driver make little sense. This is because it implements
an interface that has evolved over a long time, and because the ps/2
'standard' is really awful.

Things to add:

- Better AT (before ps2) keyboard handling
- SiS keyboard controller detection
- Mouse identification
- General robustness: reset mouse if things go wrong
- Handling all registry settings
- ACPI

Things not to add:

- Other mouse protocols, touchpad handling etc. : Write a filter driver instead
- Keyboard lights handling: Should be in win32k
- Keyboard scancode translation: Should be in win32k

Things requiring work elsewhere:

- Debugger interface (TAB + key):
  Currently this interface wants translated keycodes, which are not
  implemented by this driver. As it just uses a giant switch with
  hardcoded cases, this should not be hard to fix.

- Class drivers:
  The class drivers should be able to handle reads for more than one packet
  at a time (kbdclass should, mouclass does not). Win32k should send such
  requests.


I put a lot of work in making it work like Microsofts driver does, so third party drivers can work. Please keep it that way.


Links:

Here's a link describing most of the registry settings:

http://www.microsoft.com/resources/documentation/Windows/2000/server/reskit/en-us/Default.asp?url=/resources/documentation/Windows/2000/server/reskit/en-us/regentry/31493.asp

PS/2 protocol documentation:

http://www.win.tue.nl/~aeb/linux/kbd/scancodes.html

It also contains a link to a description of the ps2++ protocol, which has
since disappeared. Archive.org still has it.