Commit Graph
235 Commits
Author SHA1 Message Date
KJK::Hyperion b16ac9683a - Remove WINE-isms from KeDeviceQueue code
- Fix memory corruption that happened pretty much everytime you pressed a key or moved the mouse -- reponsible for countless crashes, including the famous ASSERT during 1-stage setup.
 - Remove anti-memory-corruption-workaround from VFAT
 - Note: If you're going to do use device queues in your driver, please learn how. Kthxbye.
Patch by Alex Ionescu <[email protected]>
_____

Alex,
 Marry me,
KJK::Hyperion
XOXOXO

See issue #3116 for more details.

svn path=/trunk/; revision=33633
2008-05-22 11:46:46 +00:00
Hervé Poussineau 28e9a590db Fix indentation, to match mouclass one.
svn path=/trunk/; revision=33431
2008-05-11 10:03:52 +00:00
Filip Navara a173ef04c2 A driver-supplied Cancel routine is called with the cancel spin lock held, it must be released on IRP completion. Patch by R.T.Sivakumar <[email protected]>.
svn path=/trunk/; revision=33429
2008-05-11 09:47:57 +00:00
Andrew Munger c4db2ba2dc A driver-supplied Cancel routine is called with the cancel spin lock held, it must be released on IRP completion.
This was inverted in mouclass. Fix by Samuel Serapión.

svn path=/trunk/; revision=33089
2008-04-21 12:10:55 +00:00
Colin Finck a5fd44c475 First detect the mouse and then the keyboard as it was done in the old i8042prt driver.
If we do it the other way round, some systems throw away settings like the keyboard translation, when detecting the mouse.

All known keyboard and mouse detection problems should be fixed now! :-)

See issue #2790 for more details.

svn path=/trunk/; revision=32795
2008-03-31 15:52:30 +00:00
Colin Finck 47034d9d29 - Remove much deprecated code for the mouse initialization (had been imported from the ancient psaux.sys driver, which was removed in _r14938_)
Do a much simpler initialization instead:
    * The "Get ID" command was used for detecting whether a mouse is present.
      But it just handled normal mice, IntelliMice and IntelliMice Explorer, although there can be many more possible values for other mice. (see for example http://www.win.tue.nl/~aeb/linux/kbd/scancodes-13.html#mcf2).
      Also this command isn't available on all systems.
      Furthermore we already do a MOUSE_LINE_TEST in i8042BasicDetect, which is the more reliable method to test whether a mouse is plugged in. Therefore this "Get ID" command can be simply removed.
    * The whole mouse initialization process now boils down to enabling the mouse itself and in the controller
    * All in all, some more mice should be detected now.
- Give i8042IsrWritePort a boolean return value and pass the results of the i8042Write calls
- Replace two i8042Write calls for writing to the mouse by one i8042IsrWritePort call where possible
- Remove the unused KBD_LINE_TEST define

This change was tested under QEMU, VMware and on one real system.

svn path=/trunk/; revision=32790
2008-03-31 12:40:31 +00:00
Colin Finck 73dc6b939b - The implementation of the "Mouse Reset" command differs much from chip to chip.
While most return an ACK or NACK as the first byte to indicate, whether a mouse is plugged in or not, some systems (like ECS K7S5A Pro, SiS735 chipset) always return an ACK and 0xAA.
  Only the last byte indicates the status of the actual mouse. It is either sent as 0x00 or not.

  Therefore only get the first two bytes in a loop and issue just one i8042ReadDataWait command for the last byte.
  This reduced the "black screen time" in 1st stage setup (after loading the drivers and before showing the language selection screen) from 45 seconds to 3 seconds on my K7S5A Pro system.
  I also tested this change with three other systems, with and without mouse, and they are still detected properly.
- Wait 50 microseconds, when we got no data after the Mouse Reset and before trying it again.
  This way, the implementation doesn't depend on the system speed.
- Break the loop, when the CTRL_SELF_TEST command completed successfully.
- Remove the return values from i8042DetectKeyboard and i8042DetectMouse.
  We just used them for outputting debug info if no keyboard or mouse was detected. But this info is already printed by the procedures themselves.
  This way, I could also drop one variable in i8042DetectMouse :-)

svn path=/trunk/; revision=32725
2008-03-20 12:21:34 +00:00
Hervé Poussineau 7450d083e3 Fix indentation
svn path=/trunk/; revision=32719
2008-03-18 12:28:33 +00:00
Colin Finck 9050d4be23 - Simplify the code for connecting the interrupts.
Don't use three code pathes (keyboard; mouse; keyboard & mouse) anymore and don't check again in EnableInterrupts(), which devices are present.
  Instead prepare the flags for i8042ChangeMode() already in StartProcedure() and pass them later.
- Constify the result of CTRL_SELF_TEST (0x55) as KBD_SELF_TEST_OK.
- Add a bug number as a reference for the system flag setting.

svn path=/trunk/; revision=32718
2008-03-18 12:00:29 +00:00
Colin Finck ce3bf93548 Revert r32706, unfortunately this wasn't the problem (according to reports from two users)
svn path=/trunk/; revision=32715
2008-03-18 09:14:38 +00:00
Hervé Poussineau 1cdbc02cc8 Don't fail if CCB_SYSTEM_FLAG can't be set
svn path=/trunk/; revision=32706
2008-03-17 10:30:58 +00:00
Colin Finck 3ad8ee1191 Don't define NDEBUG in the .rbuild file, but before the inclusion of debug.h (like we have it for all ROS components)
svn path=/trunk/; revision=32494
2008-02-26 16:00:00 +00:00
Colin Finck 3b1a6d89ac Don't return if no keyboard or mouse is present. Instead continue detecting the devices.
The returns were replaced by INFO's for debug output. Fireball or hpoussin, please review if this fix is ok or if we need to add some more handling for these cases.

See issue #2790 for more details.

svn path=/trunk/; revision=32483
2008-02-25 21:59:19 +00:00
Aleksey Bragin dbc44341a9 - Make i8042Flush flush both output and input buffers.
- Make i8042Flush apply only KBD_OBF flag (applying MOU_OBF leads to an infinite loop trying to flush the buffer).
- Fix a bug in i8042Write, where instead of waiting by polling a PollingIterations times (~10000), it was using ResendIterations (=3), thus giving 8042 very small chance of processing the data.
- Make i8042BasicDetect resend CTRL_SELF_TEST sequence, if controller asks so. Maximum resend iterations are limited by ResendIterations variable.
- Reinsert debug-messages hack, since this is an early-loading driver, and it's not possible to break in to KDBG to change debug filter values.
- As a result, keyboard and mouse work on real hardware again.
See issue #3036 for more details.

svn path=/trunk/; revision=32153
2008-02-06 09:46:38 +00:00
Hervé Poussineau 8f6a9bb877 Add missing \n
svn path=/trunk/; revision=31713
2008-01-11 11:35:44 +00:00
Hervé Poussineau 36598431fe Add debug trace
svn path=/trunk/; revision=31663
2008-01-08 07:28:45 +00:00
Hervé Poussineau 8fbe89bbba Use kernel facilities to change debug level at runtime
svn path=/trunk/; revision=31639
2008-01-07 12:57:32 +00:00
Hervé Poussineau 3a0687218d Use kernel facilities to change debug level at runtime
svn path=/trunk/; revision=31482
2007-12-28 21:10:07 +00:00
Hervé Poussineau 65987f47f6 Remove hack, as we can use 'filter' command in kdbg instead
svn path=/trunk/; revision=31442
2007-12-26 10:21:35 +00:00
Hervé Poussineau ea47043b29 Try to fix INFO_, TRACE_, WARN_ ERROR_ macros
svn path=/trunk/; revision=31440
2007-12-25 21:34:07 +00:00
Hervé Poussineau 7fd1284a89 Use kernel facilities to change debug level at runtime
svn path=/trunk/; revision=31287
2007-12-16 21:12:54 +00:00
Hervé Poussineau 546ed0b8d6 CTRL+SCROLL LOCK+SCROLL LOCK should only work with right control key
svn path=/trunk/; revision=30996
2007-12-04 14:55:49 +00:00
Christoph von Wittich db79be2e33 fix memory corruption
svn path=/trunk/; revision=30672
2007-11-22 14:06:12 +00:00
Christoph von Wittich 485fb49bc0 fix msvc build by replacing DDKAPI with NTAPI (both __stdcall)
fix some format strings

svn path=/trunk/; revision=30667
2007-11-22 11:27:17 +00:00
Hervé Poussineau 4dc31c38a9 Enable mouse before resetting it
svn path=/trunk/; revision=30499
2007-11-16 11:05:22 +00:00
Hervé Poussineau aa3c97709d Reset mouse to detect its type
See issue #2817 for more details.

svn path=/trunk/; revision=30470
2007-11-15 20:13:49 +00:00
Hervé Poussineau fae0c09e4b Report STATUS_NOT_SUPPORTED when IOCTL is not supported
svn path=/trunk/; revision=30068
2007-11-02 13:01:15 +00:00
Hervé Poussineau 426db02b5b Support IRP cancellation
svn path=/trunk/; revision=30066
2007-11-02 12:36:50 +00:00
Hervé Poussineau e7e959fb0d Change i8042prt to a PnP driver
Support power keys
Support ctrl+scroll+scroll on debug builds
Add support for driver filters
Take care of more registry settings
A lot of other changes

svn path=/trunk/; revision=30000
2007-10-31 08:58:04 +00:00
Hervé Poussineau aabdae9d56 No need to define __USE_W32API
svn path=/trunk/; revision=29815
2007-10-23 08:12:28 +00:00
Daniel Reimer ae7da04787 Delete all Trailing spaces in code.
svn path=/trunk/; revision=29690
2007-10-19 23:21:45 +00:00
Hervé Poussineau 340b2adbee Do not define __REACTOS__ twice
svn path=/trunk/; revision=29423
2007-10-06 19:18:55 +00:00
Hervé Poussineau a4c436a3a3 Rename 'base' to 'installbase' for CdFile, InstallFile and Bootstrap
Patch by Marc Piulachs, marc dot piulachs at codexchange dot net
See issue #2706 for more details.

svn path=/trunk/; revision=29330
2007-10-01 14:19:27 +00:00
Hervé Poussineau 4b912ebbbc Clean up .rbuild files and make them xml compliant
Inspired by bug 2627

svn path=/trunk/; revision=29036
2007-09-14 17:07:53 +00:00
Hervé Poussineau ebb26326a5 Remove some debug messages
scsiport.c: Do not try to open Device subkey if we don't have a service key
cmhardwr.c: Write BIOS information only if we succeeded to open the key

svn path=/trunk/; revision=28217
2007-08-07 11:45:30 +00:00
Christoph von Wittich 676da8d7b8 fix gcc build
svn path=/trunk/; revision=27437
2007-07-06 21:36:43 +00:00
Christoph von Wittich a9c2017b33 fix some PREfast issues
svn path=/trunk/; revision=27436
2007-07-06 21:33:51 +00:00
Christoph von Wittich ea6b02f501 -some minor changes to be able to build the driver with PREfast
-declare I8042InterruptService* routines as KSERVICE_ROUTINE

svn path=/trunk/; revision=27430
2007-07-06 18:14:23 +00:00
Christoph von Wittich 9f79a749af Never call IoCompleteRequest while holding a spin lock. Attempting to complete an IRP while holding a spin lock can cause deadlocks.
svn path=/trunk/; revision=27429
2007-07-06 17:14:24 +00:00
Hervé Poussineau 1cf915a077 ZeroMemory the correct amount of bytes
svn path=/trunk/; revision=27398
2007-07-05 07:05:05 +00:00
Christoph von Wittich 7f02b7b93c ZeroMemory the correct amount of bytes
svn path=/trunk/; revision=27397
2007-07-05 01:24:57 +00:00
Christoph von Wittich 9699e0506c ZeroMemory the correct amount of bytes
svn path=/trunk/; revision=27396
2007-07-05 01:22:40 +00:00
Aleksey Bragin 43fb21136e - Ignore incorrect responses to ACK and just retry sending data until either ACK is read, or max number of iterations is reached. This fixes the keyboard/mouse detection problems when running ReactOS inside VMWare.
svn path=/trunk/; revision=27274
2007-06-25 11:55:51 +00:00
Hervé Poussineau f5d19e8198 It doesn't seem required to be called once with a NULL PDO.
Force this call, as it is where we initialize the keyboard/mouse

svn path=/trunk/; revision=27001
2007-06-04 20:22:07 +00:00
Hervé Poussineau 6b63d35926 Use a tag when allocating/freeing some memory
svn path=/trunk/; revision=26990
2007-06-04 09:25:04 +00:00
Dmitry Gorbachev 6784ecd342 Detect i8042 IRQs by edge. This should fix endless loop in i8042 driver on
machines with VIA and ALI chipsets. (See bug report #2159.) Thanks Peter K. 
and other testers for help.

svn path=/trunk/; revision=26366
2007-04-16 23:03:41 +00:00
Aleksey Bragin 93f480d223 Fix HalGetInterruptVector() calls. Should enable input devices after 26188 fix.
svn path=/trunk/; revision=26193
2007-03-28 17:14:16 +00:00
Hervé Poussineau 87bde6d032 Add a variable to change the name of the ReactOS directory on bootcd.
If a non default name is chosen, the cdrom is created, but it is unusable as freeldr doesn't find txtsetup.inf

svn path=/trunk/; revision=26131
2007-03-18 14:33:17 +00:00
Hervé Poussineau 0423e310b2 Fix warnings
svn path=/trunk/; revision=26128
2007-03-18 00:27:02 +00:00
Hervé Poussineau 4670093f37 Fix default data sent to RtlQueryRegistryValues
svn path=/trunk/; revision=26124
2007-03-17 20:53:05 +00:00