Date: Fri, 18 Apr 1997 11:58:37 +0930 (CST) From: Michael Smith <msmith@atrad.adelaide.edu.au> To: brett@lariat.org (Brett Glass) Cc: dk+@ua.net, freebsd-hardware@freebsd.org Subject: Re: talk to I/O Devices. Message-ID: <199704180228.LAA20954@genesis.atrad.adelaide.edu.au> In-Reply-To: <3.0.1.32.19970417092103.0070f97c@lariat.org> from Brett Glass at "Apr 17, 97 09:21:03 am"
next in thread | previous in thread | raw e-mail | index | archive | help
Brett Glass stands accused of saying: > 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? It doesn't. The suggestion was to look at mmopen, not the other functions. opening /dev/mem sets the IOPL bit in a process' flags, which allows it to perform I/O instructions without taking a fault. Until very recently, there was no means for any restriction to be placed on this, access was all-or-nothing. Jonathan Lemon and Peter Wemm have been working on some changes which will allow a process to be granted restricted I/O access. > --Brett -- ]] Mike Smith, Software Engineer msmith@gsoft.com.au [[ ]] Genesis Software genesis@gsoft.com.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control. (ph) +61-8-8267-3493 [[ ]] Unix hardware collector. "Where are your PEZ?" The Tick [[
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704180228.LAA20954>