From owner-freebsd-questions@FreeBSD.ORG Wed Jun 11 04:53:51 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4246A37B401 for ; Wed, 11 Jun 2003 04:53:51 -0700 (PDT) Received: from smtp0.adl1.internode.on.net (smtp0.adl1.internode.on.net [203.16.214.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3686B43FCB for ; Wed, 11 Jun 2003 04:53:50 -0700 (PDT) (envelope-from malcolm.kay@internode.on.net) Received: from beta.home (ppp2159.sa.padsl.internode.on.net [150.101.28.110]) h5BBrlCT057151; Wed, 11 Jun 2003 21:23:48 +0930 (CST) Content-Type: text/plain; charset="iso-8859-1" From: Malcolm Kay Organization: At home To: Bernard Dugas , freebsd-questions@freebsd.org Date: Wed, 11 Jun 2003 21:23:47 +0930 User-Agent: KMail/1.4.3 References: <20030609175804.043AA37B405@hub.freebsd.org> <3EE65F83.9A1890FA@is-production.com> In-Reply-To: <3EE65F83.9A1890FA@is-production.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200306112123.47587.malcolm.kay@internode.on.net> Subject: Re: how to talk to the serial and parallel ports through a C X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2003 11:53:51 -0000 On Wed, 11 Jun 2003 08:15, Bernard Dugas wrote: > Hi, > > I also did some programming on serial port to control pins with a c > program under linux, but I didn't found any simple way to port it under > freebsd. Any hint ? > > For instance, I need the equivalent of : > inb(adr) > outb(val,adr) > iopl(n) > ioperm(adr) > > from and in linux. > The i/o space in FreeBSD is normally reserved for management=20 by the kernel. In my opinion this makes it a real hosted OS rather than some mickey mouse thing. However if a process run by root opens /dev/io then while it is held open the process can make direct access to i/o ports. Nice for experimenting with software, but for production it is better to write a kernel module for special driver requirements. Are you sure the standard serial driver interfaces are not suitable=20 for your needs -- they are very flexible. Malcolm