Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Apr 1996 14:46:44 +0200 (MET DST)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        hackers@freebsd.org
Subject:   soft disable of peripherals ?
Message-ID:  <199604041246.OAA03800@labinfo.iet.unipi.it>

next in thread | raw e-mail | index | archive | help
At times, there is the need to use I/O ports in strange ways, e.g.
such in the case of the user-space quickcam driver: a user process
directly drives the bits of the port. In order to this safely, the
port should not be handled by the standard driver of the OS. For
the parallel port, it often suffices to do "lptcontrol -p". For
the serial port, there is no such a thing, so one has to reboot
with "-c" and disable the port.

I think it would be useful to have a general mechanism which could
temporarily disable/reenable a given I/O port. As a minimum, it
should check that noone is using the port at the moment, make the
interrupt service routine just return, possibly set the port in
some known state, and prohibiting access (other than "enable") to
the port while disabled. Reenabling the port could just run some
"init" routine for the specific port.
If one wants to go further down this road, there might even be a set of
ioctl to gain direct access to the registers of the port without having
to open /dev/io.

Is there any interest to implement such a feature ? I believe the ioctl
which implements the enable/disable should be the same for all drivers.
This does not mean that all drivers must implement it.

As an example, just having it on the parallel and serial port would be
ok (both ports are often used by HW hackers to drive the strangest
devices attached to them).

	Cheers
	Luigi
====================================================================
Luigi Rizzo                     Dip. di Ingegneria dell'Informazione
email: luigi@iet.unipi.it       Universita' di Pisa
tel: +39-50-568533              via Diotisalvi 2, 56126 PISA (Italy)
fax: +39-50-568522              http://www.iet.unipi.it/~luigi/
====================================================================



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