[PARPORT] ECP, DMA, driver writing

From: Richard Bonomo (bonomo@sal.wisc.edu)
Date: Thu Jun 22 2000 - 18:21:01 EDT

  • Next message: Peter Roach: "[PARPORT] Parallel ZIP drive problem."


    I am struggling with writing a device driver to
    pull data into the parallel port in ECP mode.
    I am attempting to read in a continuing stream
    of data (uncontrolled) and read into into a
    LARGE RAM buffer.

    I have tested the concept using a priviledged,
    user-space program and polling, and have found
    that the throughput is adequate.

    As we want the process to be interrupt-driven,
    I am forced to write a device driver to
    accomplish this.

    This takes some time, as I have never written
    a device driver before, nor am I experienced
    at Linux. Consequently, the great bulk of
    my effort is being expended on learning how
    to do things.

    I cannot help but think that this sort of thing
    is already commonly done, so I thought I'd
    see if there is already working device code
    out there that I can get my hands on, and also
    ask a few questions:

    In brief, I put the port in ECP input mode,
    then at some point (say after a status bit
    is toggled by the connected device), allow
    the hanshake to take over.

    I then want to read the data into a multi-megabyte
    buffer in high memory (32 to 128 M, for example),
    and then allow a user program to retrieve these
    data in smaller hunks (using a read call to the
    device driver most likely) for inspection and
    analysis. Does software already exist for this?

    Other questions:

    1. Can the parallel port use DMA into high memory
    nowadays? I have the impression that parallel
    ports using DMA are restricted to ISA address
    space on current Intel platforms running Linux.
    And thus to the lower 16 MB of physical memory.
    Is this correct?

    2. If I reserve upper memory using the "mem=32m"
    (or whatever size) option at boot, is a simple
    call to ioremap all that is necessary to make
    the space available to the kernel? Is there any
    reason I cannot use a pointer to the physical
    address when accessing from the kernel?

    3. If DMA direct to high memory is not possible
    (or is not advisable to avoid tying the bus
    up for extended periods), is there likely any advantage
    to DMA to a very small buffer in lower memory
    and then a copy to a high memory buffer over
    doing an interrupt-driven programmed i/o directly
    to a buffer in very high memory?
    I am running on an Intel platform with a
    SE440-BX2 motherboard, using Redhat Linux 6.1
    (linux kernel 2.2.12).

    Thank you!

    Rich B.

    Richard Bonomo
    UW Space Astronomy Laboratory
    ph: (608) 263-4683

    -- 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 : Thu Jun 22 2000 - 18:23:34 EDT