RT_INTR intr;
rt_intr_create(&intr, "lpt1 handler", LPT1IRQ, 0);
rt_task_set_periodic(NULL, TM_NOW, 1e5);
+ rt_printf("Sending\n");
unsigned int i;
for(i = 0; i<SAMPLES; i++){
times[i] = rt_timer_read();
- outb(inb(0x37A) & 0xEF, 0x37A);
- outb(inb(0x37A) | 0x01, 0x37A);
+ outb(inb(0x378) & 0xEF, 0x378);
+ outb(inb(0x378) | 0x01, 0x378);
// Signal other machine
rt_intr_wait(&intr, TM_INFINITE);
times[i] = rt_timer_read()-times[i];
fprintf(file, "%u,%llu\n", i, times[i]);
}
fclose(file);
+ rt_printf("Done, you can press CRTL+C now\n");
}
int main(int argc, char* argv[])
mlockall(MCL_CURRENT | MCL_FUTURE);
ioperm(0x37A, 1, 1);
+ ioperm(0x378, 1, 1);
outb(inb(0x37A) | 0x01, 0x37A);
+ outb(inb(0x378) | 0x01, 0x378);
rt_task_create(&task, "task", 0, 50, 0);
rt_task_start(&task, &lpt1_handler, 0);
- sleep(5);
+ pause();
+ outb(inb(0x37A) & 0xEF, 0x37A);
}