Basics - Linux

This is a discussion on Basics - Linux ; Hi all, I wanted to learn device driver in linux. can any body let me know from where i have to start. what basic knowlege i required to develop device driver. regards...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Basics

  1. Basics

    Hi all,

    I wanted to learn device driver in linux. can any body let me know from
    where i have to start. what basic knowlege i required to develop device
    driver.

    regards


  2. Re: Basics

    Hiya,

    > I wanted to learn device driver in linux. can any body let me know from
    > where i have to start. what basic knowlege i required to develop device
    > driver.


    Try:

    http://tldp.org/LDP/lkmpg/2.6/html/index.html

    Cheers,
    --
    John McCallum
    Emerson Network Power - Embedded Computing,
    Edinburgh, UK

    For email, leave the web and we're not so small.

  3. Re: Basics

    vasadia.linux@gmail.com wrote:

    > I wanted to learn device driver in linux. can any body let me know from
    > where i have to start. what basic knowlege i required to develop device
    > driver.


    http://lwn.net/Kernel/LDD3/

    Also, you should read "Linux Kernel Development", by Robert Love.

    Chris

  4. Re: Basics


    John McCallum wrote:
    > Try:
    > http://tldp.org/LDP/lkmpg/2.6/html/index.html


    I just read the book according to the above link. I copy the Example
    2-1. "hello-1.c - The simplest kernel module." and Example 2-2.
    "Makefile for a basic kernel module (a simple Makefile for compiling
    a module named hello-1.c)". After I execute the make command, there
    are errors occur. How can I make the first exercise on kernel compile?

    $ kernelversion
    2.4
    $ make
    make -C /lib/modules/2.4.27-2-386/build M=/home/jhl modules
    make: *** /lib/modules/2.4.27-2-386/build: No such file or directory.
    Stop.
    make: *** [all] Error 2
    $

    I also read "Linux Kernel Development" by Robert Love, but I don't
    think I have got more on kernel programming. I think Linux Kernel
    programming may be more hardware / device dependent and a little
    boring. Working on the abstract layer of C and C library may be more
    approachable. Am I right?

    lovecreatesbeauty


  5. Re: Basics

    "None" writes:

    > John McCallum wrote:
    >> Try:
    >> http://tldp.org/LDP/lkmpg/2.6/html/index.html

    >
    > I just read the book according to the above link. I copy the Example
    > 2-1. "hello-1.c - The simplest kernel module." and Example 2-2.
    > "Makefile for a basic kernel module (a simple Makefile for compiling
    > a module named hello-1.c)". After I execute the make command, there
    > are errors occur. How can I make the first exercise on kernel compile?
    >
    > $ kernelversion
    > 2.4
    > $ make
    > make -C /lib/modules/2.4.27-2-386/build M=/home/jhl modules
    > make: *** /lib/modules/2.4.27-2-386/build: No such file or directory.
    > Stop.
    > make: *** [all] Error 2
    > $
    >
    > I also read "Linux Kernel Development" by Robert Love, but I don't
    > think I have got more on kernel programming. I think Linux Kernel


    if you cant compile the examples above then you didnt get anything out
    of reading that book. In fact I'd go as far as to say it went totally
    over your head.

    Do you understand make files? Linux src hierarchy? Have you got the
    correct kernel src and linked it into /usr/src?

    > programming may be more hardware / device dependent and a little
    > boring. Working on the abstract layer of C and C library may be more
    > approachable. Am I right?


    Of course. kernels, modules and device drivers are for guys who know
    their stuff back to front.

    >
    > lovecreatesbeauty
    >


    --

  6. Re: Basics

    Hadron Quark wrote:
    >
    > if you cant compile the examples above then you didnt get anything out
    > of reading that book. In fact I'd go as far as to say it went totally
    > over your head.


    It's just the first glance at the book. There is not a build
    executable, i.e. /lib/modules/$(shell uname -r)/build in my Linux box.

    > Do you understand make files? Linux src hierarchy? Have you got the
    > correct kernel src and linked it into /usr/src?


    On another machine, some days ago, I updated the kernel from 2.4 to
    2.6. The kernel source is got from kernel.org. I don't remember if the
    source is linked to /usr/src. And the version number are determined by
    the macro $(shell uname -r), that sample code was not tied to a
    specific version, right?

    > Of course. kernels, modules and device drivers are for guys who know
    > their stuff back to front.


    So, I think some ordinary C applications will be good to me; I just can
    not go into more details into the different sorts of hardware, and just
    do the work based on the abstract of C language and C standard library.
    Is it a positive attitude?

    lovecreatesbeauty


  7. Re: Basics

    On 3 Jul 2006 07:57:31 -0700, None wrote:

    > John McCallum wrote:


    >> http://tldp.org/LDP/lkmpg/2.6/html/index.html


    > $ make
    > make -C /lib/modules/2.4.27-2-386/build M=/home/jhl modules
    > make: *** /lib/modules/2.4.27-2-386/build: No such file or directory.
    > Stop.
    > make: *** [all] Error 2
    > $


    Well, is /lib/modules/2.4.27-2-386/build a symlink pointing to a valid
    kernel source tree? Step #0 of building a kernel module is to have a
    configured source tree.


    > Working on the abstract layer of C and C library may be more
    > approachable. Am I right?


    If you don't know why you need a kernel module, then probably you don't
    need one at all.


    --
    -| Bob Hauck
    -| A proud member of the unhinged moonbat horde.
    -| http://www.haucks.org/

+ Reply to Thread