Re: SANE standard,

becka@rz.uni-duesseldorf.de
Tue, 8 Dec 1998 14:26:06 +0100 (MET)

Hi

> > 2. For those that can do IO-port-only access, abstraction is as simple as
> > sanei_io_[in/out][b/w/l](IO_address[,data_out]);.

> Where are these functions definded? I can't find them anywhere in the
> include/sane/ directory.

They aren't yet. I "proposed" - or rather made them up - while writing.
Suggestions are welcome.

> > 3. Installing SANE suid root is no good idea. I would thus prefer to go
> > via /dev/port on Linux, which can be given appropriate permissions.

> Hmmm, could you explain this in more detail? What do you mean by "via
> /dev/port"?

Hmm - that might not apply to you, as you detail below, but for those few
devices that use pretty simple IO-style access, one could go via the special
file /dev/port which does io-instructions via read()/write() calls.
This allows to reduce the permission problem from being root to having
access to /dev/port. This is still a security problem, but less critical
with respect to reading files one shouldn't and such and harder to
exploit.

> I thought about writing a linux kernel driver for the direct hardware
> dependend parts of the interface which then would be accessable vi
> /dev/something and ioctl calls, but I don't either know if this was a
> good idea (one more program layer) nor if this is allowed according to
> platform independence.

On Linux you will _have_ to do this for most proprietary ISA cards, so
portability isn't "available" here at all.

> On the other hand, the hard stuff would be nicely encapsulated. Comments?

Yes. For most ISA HW I see no other way. There might be a few cards that
in theory could use what I suggested, but I don't think it is worth the
bother.

> In my case, the question is which direct io port handling routines am I
> allowed to use.

The question is: Is IO port access all you need ?

In that case we might want to make up a usermode scheme for it to keep
it somewhat portable.

However most hardware won't work with that anyway. You will need DMA, IRQ
or maintain tight timings.

CU, Andy

-- 
Andreas Beck              |  Email :  <Andreas.Beck@ggi-project.org>

--
Source code, list archive, and docs: http://www.mostang.com/sane/
To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com