From owner-freebsd-questions Fri Apr 19 07:50:49 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id HAA09734 for questions-outgoing; Fri, 19 Apr 1996 07:50:49 -0700 (PDT) Received: from fslg8.fsl.noaa.gov (fslg8.fsl.noaa.gov [137.75.131.171]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id HAA09694 for ; Fri, 19 Apr 1996 07:50:04 -0700 (PDT) Received: by fslg8.fsl.noaa.gov (5.57/Ultrix3.0-C) id AA05057; Fri, 19 Apr 96 14:48:15 GMT Message-Id: <9604191448.AA05057@fslg8.fsl.noaa.gov> Received: by emu.fsl.noaa.gov (1.40.112.3/16.2) id AA248415361; Fri, 19 Apr 1996 08:49:21 -0600 Date: Fri, 19 Apr 1996 08:49:21 -0600 From: Sean Kelly To: eeg@telecom.at Cc: freebsd-questions@freebsd.org In-Reply-To: <317764B2.6DCC0261@telecom.at> (message from Hollerer on Fri, 19 Apr 1996 12:02:26 +0200) Subject: Re: How can I read/write from/to an I/O-port? Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >>>>> "Franz" == Hollerer writes: Franz> Under Linux a /dev/port exits to write/read to/from an Franz> I/O-port. Does a similar /dev/??? exits under FreeBSD or Franz> must I write a little device driver for this? It exists. First, open /dev/io. Then use inb() and outb() functions to read and write to the I/O ports: #include ... int data; int fd = open("/dev/io", O_RDWR); data = inb(0x2a8); outb(0x3e8, 16); close(fd); Looking at the kernel code, it looks like the inb() and outb() functions are temporary. In the future, I think you'll open /dev/io, then mmap() or use lseek() and read()/write() to read and write the ports. But someone on the core team will confirm/deny this. -- Sean Kelly NOAA Forecast Systems Laboratory kelly@fsl.noaa.gov Boulder Colorado USA http://www-sdd.fsl.noaa.gov/~kelly/