Monday, May 17, 2010

Dog Has Dry Flaky Skin On Back Slight Hair Loss

LPT port access with C

I found this useful snippet on
another blog
.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/io.h>
#include &lt;sys/types.h&gt; < 10; i++) {
#include &lt;fcntl.h&gt;

#define BASEPORT 0x378 /* lp1 */

int main()
{
unsigned char c = 0;
int n, tem;

printf("Hit enter to stop\n");
if (ioperm(BASEPORT, 3, 1)) { perror("ioperm");

exit(1);

}

tem = fcntl(0, F_GETFL, 0);
fcntl (0, F_SETFL, (tem break;
outb(c, BASEPORT);
usleep(c * 1000); c++; } outb(0, BASEPORT); if (ioperm(BASEPORT, 3, 0))
   { 
perror("ioperm");
exit(1);
}
exit(0);
}



0 comments:

Post a Comment