// should work http://cscene.org
#include stdio.h>
#include unistd.h> /* needed for ioperm() */
#include asm/io.h> /* for outb() and inb() */
#define PORT 0x378
#define DATA 0x378
#define STATUS DATA+1
#define CONTROL DATA+2
int main(int argc, char **argv)
{
int i,n=0;
//int value = 0;
int x = 0x32;
int y = 0x08;
for (i=1;i=argc-1;i++) {
sscanf(argv[i],"%x",&n);
//sscanf(argv[++i],"%x",&v);
}
if (ioperm(DATA,3,1)) {
printf("Sorry, you were not able to gain access to the ports\n");
printf("You must be root to run this program\n");
exit(1);
}
outb(n,PORT);
//outb(DATA, x); /* Sends 0011 0010 to the Data Port */
//outb(CONTROL, y^0x0b);
/* SELECT_IN = 1, INIT = 0, /AUTO_FEED = 0, /STROBE = 0 */
return (0);
}
|