Hi,
i'm trying to do some programming on freebsd and i can't
find 'asm/io.h'. this must be for security reasons.
so how do i talk to the parallel port?
Thanks,
Dave Seddon
here's the really simple bit of code i'm trying to use:
#include <stdio.h>
#include <unistd.h> /* needed for ioperm() */
#include <asm/io.h> /* for outb() and inb() */
#define DATA 0x378
#define STATUS DATA+1
#define CONTROL DATA+2
int main(void)
{
int x = 0x32;
int y = 0x08;
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(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);
}
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message