From owner-freebsd-hardware Thu Apr 17 13:10:25 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id NAA01445 for hardware-outgoing; Thu, 17 Apr 1997 13:10:25 -0700 (PDT) Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id NAA01434 for ; Thu, 17 Apr 1997 13:10:21 -0700 (PDT) Received: from current1.whistle.com (current1.whistle.com [207.76.205.22]) by alpo.whistle.com (8.8.5/8.8.4) with SMTP id NAA27657; Thu, 17 Apr 1997 13:05:55 -0700 (PDT) Message-ID: <33568294.2781E494@whistle.com> Date: Thu, 17 Apr 1997 13:05:40 -0700 From: Julian Elischer Organization: Whistle Communications X-Mailer: Mozilla 3.0Gold (X11; I; FreeBSD 2.2-CURRENT i386) MIME-Version: 1.0 To: Brett Glass CC: dk+@ua.net, freebsd-hardware@FreeBSD.org Subject: Re: talk to I/O Devices. References: <3.0.1.32.19970417092103.0070f97c@lariat.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-hardware@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk Brett Glass wrote: > > At 11:54 PM 4/16/97 -0700, Dmitry Kohmanyuk wrote: > > >> Fascinating. What does opening this "file" actually do? (I can't find it > >> in the source.) > > > >look at /sys/i386/i386/mem.c:mmopen() and others in that file. > > Just looked at it, and it appears that this file opens the I/O space > as a random-access device. But accessing ports this way would slow > code down so dramatically that it could be useless for many > control applications! Also, the sample code in previous messages in > this thread seems to indicate that one can read and write directly. > How is this done? > > --Brett no, openning /dev/io doesn't do anything except set a bit on your process descriptor that allows your process to do IO instructions directly.. otherwise inb() and outb() are priveleged instructions and will cause an access fault.