6 #include <native/task.h>
7 #include <native/timer.h>
8 #include <native/intr.h>
16 void keyboard_handler(void *arg
)
19 rt_intr_create(&intr
, "keyboard handler", KBDIRQ
, I_PROPAGATE
);
22 rt_printf("#Kbd interrupt %d\n",
23 kps
+= rt_intr_wait(&intr
, TM_INFINITE
));
27 int main(int argc
, char* argv
[])
29 /* Perform auto-init of rt_print buffers if the task doesn't do so */
30 rt_print_auto_init(1);
32 /* Avoids memory swapping for this program */
33 mlockall(MCL_CURRENT
| MCL_FUTURE
);
35 rt_task_create(&task
, "task", 0, 50, 0);
36 rt_task_start(&task
, &keyboard_handler
, 0);
38 rt_printf("CRTL+C to stop\n");