Re: [PARPORT] new ppdev operations

From: Uwe Bonnes (bon@elektron.ikp.physik.tu-darmstadt.de)
Date: Tue Jun 19 2001 - 13:45:47 EDT

  • Next message: Tim Waugh: "Re: [PARPORT] new ppdev operations"

    >>>>> "Tim" == Tim Waugh <twaugh@redhat.com> writes:

        Tim> On Tue, Jun 19, 2001 at 07:01:21PM +0200, Uwe Bonnes wrote:
    >> I don't want an emulated port, I want to allow the emulated program
    >> to access the hardware. It could be done by running the emulation
    >> program with root access and do the inb() and outb() direct, but
    >> that's not good for the savefy of the system.

        Tim> It sounds like you want a way of restricting the I/O regions that
        Tim> /dev/port has access to, rather than using ppdev to bypass itself.
        Tim> Like:

        Tim> struct region reg = { base: 0x378, extent: 3 }; int port = open
        Tim> ("/dev/port", O_RDWR); int ecr = open ("/dev/port", O_RDWR); ioctl
        Tim> (port, RESTRICT, &reg); reg.base += 0x400; ioctl (ecr, RESTRICT,
        Tim> &reg); drop_privs(); ...

        Tim> I can see the use for that kind of thing.

    This sounds interesting, but has following drawbacks:
    - either the emulation program needs to run as root
    - or /dev/ports need to be accessible for non root users
    - another program might access /dev/lpx while the emulation program forwards
    parallel port accesses to offset 0x378 of /dev/port

    Accessing the parallel port via the ppdev has the advantage that the
    parallel port resource is still handles by the kernel.

    What was the rational that the PPRECONTROL/PPWECONTROL/PPRFIFO/PPWFIFO iocts
    were removed?

    Bye

    -- 
    Uwe Bonnes                bon@elektron.ikp.physik.tu-darmstadt.de
    

    Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------

    -- To unsubscribe, send mail to: linux-parport-request@torque.net -- -- with the single word "unsubscribe" in the body of the message. --



    This archive was generated by hypermail 2b29 : Tue Jun 19 2001 - 13:47:41 EDT