Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 07 Nov 2000 11:55:22 -0800
From:      "Howard Blue" <hblue@oaklandnet.com>
To:        questions@FreeBSD.org
Subject:   C Programming using FreeBSD
Message-ID:  <3A085E29.4BA73D22@oaklandnet.com>

next in thread | raw e-mail | index | archive | help
How to use outb( ) and inb( ) with gcc and FreeBSD?

The following program compiles and run in linux but it does not compile
using FreeBSD. It compiles in linux using: gcc -O2 prog1.c -o prog. It
dos NOT
compile using FreeBSD because of the include file "asm/io.h".

#include <stdio.h>
#include <unistd.h>
#include <asm/io.h>

#define BASEPORT 0x378 /* lpt port. */

int main()
{
/* Getting accesss to io port. */
if (ioperm(BASEPORT, 3, 1) {perror("ioperm"); exit(1);}

again:
    outb(0, BASEPORT);
    sleep(1);
    outb(0xFF, BASEPORT);
    sleep(1);
    printf("Testing...\n");\
goto again;
}

What changes would be necessary for a simillar program to work with
FreeBSD?

email: blujazz@earthlink.net.

Thanks.



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A085E29.4BA73D22>