SLIDE 3 TU Dresden Slide 5
Fiasco-UX Keyboard Driver
- Fiasco-UX provides keyboard and mouse input
through graphical console
– Interrupt 1 to signal input event – Ring buffer with list of input events:
typedef struct input_ev { long long time; /* event timestamp */ unsigned short type; /* type: 1 … key event * (includes mouse buttons) * 2 … mouse move */ unsigned short code; /* key: keycode * move: 0 … X direction * 1 … Y direction */ unsigned int value; /* key: 1 … button pressed * 0 … button released * move: distance */ } input_ev_t;
TU Dresden Slide 6
Attach Keyboard Interrupt
#include <l4/sys/ipc.h> #include <l4/rmgr/librmgr.h> l4_threadid_t irq_id; l4_msgdope_t result; l4_umword_t dummy; int ret; /* attach interrupt */ l4_make_taskid_from_irq(INPUT_IRQ_NUM, &irq_id); ret = l4_ipc_receive(irq_id, 0, &dummy, &dummy, L4_IPC_TIMEOUT(0,0,0,1,0,0), &result); if (ret != L4_IPC_RETIMEOUT) /* error … */ /* interrupt handler loop */ while(1) { /* send 0, 0 to IRQ to enable it wait for interrupt */ ret = l4_ipc_{call|replay_and_wait}(irq_id, L4_IPC_SHORT_MSG, 0, 0, L4_IPC_SHORT_MSG, &dummy, &dummy, L4_IPC_NEVER, &result); /* handle interrupt */ … }