Hello Jilong Kuang,
am I right that you're using Genode on x86 as your PS2 interrupts are
1 and 12? Looking at your code it looks like you're not configuring
the PS2 hardware at all, in fact you leave it as initialized by the
BIOS. Therefore, the mouse port is disabled and the mouse is not
initialized and as expected you see no interrupts from it.
For the keyboard, I could reproduce your reported behavior very easily
with the attached patch. You have to click into the Qemu window very
fast before Genode is booted, but then you will be able to see the
interrupts logged / _max_handle decremented if the mouse is moved. As
soon as the code stops to handle hardware events (_max_handle == 0)
the interrupts occur again right after unmasking on wait_for_irq().
This is expected as we did not handle the event and programmed the PS2
device.
For your simple interrupt tests it may be easier to write a simple
UART driver as PS2 is more complex than UARTs. Genode on Fiasco.OC
uses the first UART via the kernel. So, I need to have a second serial
interface.
Regards
--
Christian Helmuth
Genode Labs
http://www.genode-labs.com/ · http://genode.org/
https://twitter.com/GenodeLabs · /ˈdʒiː.nəʊd/
Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
diff --git a/os/src/drivers/input/ps2/irq_handler.h b/os/src/drivers/input/ps2/irq_handler.h
index fc20612..5981835 100644
--- a/os/src/drivers/input/ps2/irq_handler.h
+++ b/os/src/drivers/input/ps2/irq_handler.h
@@ -26,12 +26,16 @@ class Irq_handler : Genode::Thread<4096>
Genode::Irq_connection _irq;
Input_driver &_input_driver;
+ unsigned _max_handle;
+ int _irq_number;
+
public:
Irq_handler(int irq_number, Input_driver &input_driver)
:
_irq(irq_number),
- _input_driver(input_driver)
+ _input_driver(input_driver),
+ _max_handle(128), _irq_number(irq_number)
{
start();
}
@@ -40,6 +44,15 @@ class Irq_handler : Genode::Thread<4096>
{
while (1) {
_irq.wait_for_irq();
+
+ if (_max_handle == 0) {
+ PDBG("IRQ %d", _irq_number);
+ continue;
+ } else {
+ --_max_handle;
+ PDBG("IRQ %d _max_handle = %d", _irq_number, _max_handle);
+ }
+
while (_input_driver.event_pending())
_input_driver.handle_event();
}
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012
_______________________________________________
Genode-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/genode-main