Re: A newbie question about linux driver

Jens.Toerring_at_physik.fu-berlin.de
Date: 10/31/03


Date: 31 Oct 2003 16:33:35 GMT

Bruce Ding <dss_store@yahoo.com> wrote:
> I am now turning to programming of linux driver. But I have some
> difficulty in understanding the exact role of a driver. The driver
> should have two interfaces: the higher to interact with kernel level,
> and the lower is to work with the hardware.

Well, I wouldn't go as far as call these interfaces...

> The question is:
> 1, To what extent the driver is expected to do to manipulate the
> hardware? Are the callable APIs already provided with hardware? If so,
> are they chip dependent or the whole hardware set dependent?

Most of what a duriver does is manipulating the hardware and keeping
information about state the hardware is in. How this is to be done
is completely dependend on the hardware. It usually consists mostly
of writing and reading registers of the hardware. You normally need
all the information from the maker of the piece of hardware about
when and where to read and write to achieve certain effects. You
often get (at least if you're lucky, otherwise things get really
tedious or are even hopeless) a list of the registers and the bits
in the registers, telling you what they are meant for. Often there's
additional information about timing requirements and the sequence
you have to write to or read from registers.

> 2, Similiar: what kind of interface has been provided by kernel? In
> gerneral, How much work does the driver need to do to meet that
> interface?

The "interface" is mostly the functions in the kernel you can call
plus the kernel data that you may need to check or even modify.
Thus your question doesn't make too much sense to me, sorry.

> Or, where can I find the websites, books .......

If you don't already have it get yourself the book by Rubini and
Corbet, "Linux Device Drivers", O'Reilly, ISBN 0-596-00008-1. You
can find a PDF version of the book on the O'Reilly website, so
you can check if it suits your needs before you buy it.

                                Regards, Jens

-- 
      _  _____  _____
     | ||_   _||_   _|        Jens.Toerring@physik.fu-berlin.de
  _  | |  | |    | |
 | |_| |  | |    | |          http://www.physik.fu-berlin.de/~toerring
  \___/ens|_|homs|_|oerring


Relevant Pages

  • [opensuse] openSUSE 10.3 not detecting SATA HD
    ... the sata_sis driver. ... I've tried turning off ACPI in bios and acpi=off which ... openSUSE 10.2 and all my hardware is working fine. ... info.product = 'USB Raw Device Access' ...
    (SuSE)
  • Re: [spi-devel-general] Accelerometer, Gyros and ADCs etc within the kernel.
    ... data from spi to a desktop machine. ... ARM (and cleans up an awful lot of hardware interfaces!) ... say the HW SPI is pushed down to some lower level driver. ... interfaces. ...
    (Linux-Kernel)
  • Re: 2008 SBS no longer boots
    ... driver issue initially, the fact that it seems to happen randomly now ... weird with a hardware problem that consistently doesn't get through boot ... other customer, even a 2 week old one, the problem immediately returned. ... There was a time when a server was fired up with a specialized OS and had a battery of tests run against each component to purposefully stress it. ...
    (microsoft.public.windows.server.sbs)
  • Re: Linux, X, ld, gcc, linking, shared libraries and stuff
    ... >> because, originally, video cards / system RAM could NOT afford to have ... > GL actually "copies" everything, but it's done by the graphics card, so ... > anyway if it's not hardware accelerated. ... installed the proper driver, then it zooms around the screen... ...
    (alt.lang.asm)
  • Re: 2008 SBS no longer boots
    ... Any thermal issues and a lot of other hardware problems should show up ... Happen to know a tool to determine driver load order by just having the ... other customer, even a 2 week old one, the problem immediately returned. ... There was a time when a server (even one that had been "burned ...
    (microsoft.public.windows.server.sbs)