Commit Graph

13 Commits

Author SHA1 Message Date
Andreas Kling
431e7bf085 PS2MouseDevice: Add current buffer size to debug logging. 2019-02-12 09:22:55 +01:00
Andreas Kling
a537d78ac0 Kernel: Drivers for PS/2 mouse and keyboard kept stealing from each other.
We need to look at the i8042 status register to see if the packets in the
PS/2 controller's output buffer are mouse or keyboard packets.

This fixes occasionally surprising inputs while using both devices.
2019-02-07 07:58:26 +01:00
Andreas Kling
dc20f00872 PS2MouseDevice: Try to synchronize the data reporting stream.
Turns out this was the reason QEMU wouldn't boot us.
2019-01-17 02:13:21 +01:00
Andreas Kling
4fef895eda Rework WindowServer to use select() in its main event loop.
The system can finally idle without burning CPU. :^)

There are some issues with scheduling making the mouse cursor sloppy
and unresponsive that need to be dealt with.
2019-01-16 17:20:58 +01:00
Andreas Kling
09ba129bcf Use a CircularQueue for the PS/2 mouse driver. 2019-01-16 01:52:39 +01:00
Andreas Kling
bd3e77cc16 Pass the process to CharacterDevice::read/write.
This is much nicer than grabbing directly at 'current' inside a read().
2019-01-16 00:20:38 +01:00
Andreas Kling
08bfe518f9 Rename CharacterDevice::has_data_available_for_reading() -> can_read(). 2019-01-16 00:10:13 +01:00
Andreas Kling
b0e3f73375 Start refactoring the windowing system to use an event loop.
Userspace programs can now open /dev/gui_events and read a stream of GUI_Event
structs one at a time.

I was stuck on a stupid problem where we'd reenter Scheduler::yield() due to
having one of the has_data_available_for_reading() implementations using locks.
2019-01-14 14:42:49 +01:00
Andreas Kling
fd4e86460b Make PS2MouseDevice behave more like a proper character device.
Get rid of the goofy MouseClient interface and have the GUI event loop just
read mouse data from the character device.

The previous approach was awful as it was sending us into random GUI code
in the mouse interrupt handler.
2019-01-12 05:23:16 +01:00
Andreas Kling
0e6c19ffa6 Reduce PS2MouseDevice debug spam in every dang mouse interrupt. 2019-01-12 03:20:48 +01:00
Andreas Kling
e5e295052f Hook up the PS2MouseDevice to the AbstractScreen+WindowManager.
Render the mouse cursor by xor'ing the pixels. I don't know anything about
hardware cursors yet and this way we don't need to recompose the window
hierarchy every time you move the mouse. :^)
2019-01-11 03:52:09 +01:00
Andreas Kling
31667b47a5 Teach PS2MouseDevice to read the left and right buttons. 2019-01-11 02:45:06 +01:00
Andreas Kling
e740f1195a Add a simple PS/2 mouse device.
It's not hooked up to anything just yet, but it does read movement deltas.
2019-01-11 02:28:53 +01:00