From: dopefishh Date: Fri, 2 Oct 2015 11:11:50 +0000 (+0200) Subject: update slave X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=74fe0b92952ea755f615e2d9cde9889687b3bc70;p=des2015.git update slave --- diff --git a/mart/ex10/ex10dslave.c b/mart/ex10/ex10dslave.c index e1ed89f..0430588 100644 --- a/mart/ex10/ex10dslave.c +++ b/mart/ex10/ex10dslave.c @@ -17,14 +17,11 @@ RT_TASK task; void taskf(void *arg) { RT_INTR intr; - rt_printf("success creation: %d\n", rt_intr_create(&intr, "lpt1 handler", LPT1IRQ, I_PROPAGATE)); + rt_intr_create(&intr, "lpt1 handler", LPT1IRQ, I_PROPAGATE); while(1){ - rt_printf("Waiting for interrupt\n"); rt_intr_wait(&intr, TM_INFINITE); - rt_printf("Setting bit to 0\n"); - outb(inb(0x378) & 0xEF, 0x378); - rt_printf("Setting bit to 1\n"); + outb(inb(0x378) & 0xFE, 0x378); outb(inb(0x378) | 0x01, 0x378); } } @@ -35,9 +32,9 @@ int main(int argc, char* argv[]) mlockall(MCL_CURRENT | MCL_FUTURE); ioperm(0x37A, 1, 1); + outb(inb(0x37A) | 0x10, 0x37A); ioperm(0x378, 1, 1); - outb(inb(0x37A) | 0x01, 0x37A); -// outb(inb(0x378) | 0x01, 0x378); + outb(inb(0x378) | 0x01, 0x378); rt_task_create(&task, "task", 0, 50, 0); rt_task_start(&task, &taskf, 0);