#include #include #include #include #define IOBASE 0x378 char singleStates[] = { 0x8, 0x4, 0x2, 0x1, 0x8, 0x4, 0x2, 0x1 }; char doubleStates[] = { 0xC, 0x6, 0x3, 0x9, 0xC, 0x6, 0x3, 0x9 }; char halfStates[] = { 0x8, 0xC, 0x4, 0x6, 0x2, 0x3, 0x1, 0x9 }; int main(int argc, char **argv) { int i; if(ioperm(IOBASE, 3, 1)) { perror("ioperm(1)"); return -1; } while(-1) { for(i = 7; i > -1; i--) { outb(doubleStates[i], IOBASE); usleep(1); //for(j = 0; j < 1000000; j++); } } /* not reached */ if(ioperm(IOBASE, 3, 0)) { perror("ioperm(0)"); return -1; } return 0; }