Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Jun 2003 21:23:47 +0930
From:      Malcolm Kay <malcolm.kay@internode.on.net>
To:        Bernard Dugas <bernard.dugas@is-production.com>, freebsd-questions@freebsd.org
Subject:   Re: how to talk to the serial and parallel ports through a C
Message-ID:  <200306112123.47587.malcolm.kay@internode.on.net>
In-Reply-To: <3EE65F83.9A1890FA@is-production.com>
References:  <20030609175804.043AA37B405@hub.freebsd.org> <3EE65F83.9A1890FA@is-production.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <sys/io.h> and <stdio.h> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200306112123.47587.malcolm.kay>