Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

How to setup a driver on uClinux ?

Hi all !

I am using Microtronix uCLinux 1.4, Board Cyclone 1C12 Eval edition.

When developing a driver, I did not find any commands of module installing:

- make

- insmod

- rmmod

- su

- Would you tell me about what steps I must do to setup a driver ( compile, load, use, unload )?

- Is there any versions of uCLinux (from Microtronix) supporting these features ?

Thank you,

OneNet

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hello absolutebeginner ,

    I am really curious on the link you provided since I could not view it (I have tried on many other browsers ). PLease check again.

    Thank you,

    OnetNet
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I'm so sorry about the broken link...

    it links to my question how to build .ko file

    question about building a module (http://www.niosforum.com/forum/index.php?act=st&f=18&t=2411)

    if it still doesn't work, you can find it on page 3 in the uclinux section of this forum.

    for testing you'll have to transfer your module in your niossystem of course.

    Here is a little example, how to use the commands. Lets assume your module name is 'Hello_Kernel':

    first

    busybox insmod Hello_Kernel"

    insert your module

    then you'll need make it visible in your filesystem:

    mknod "Hello_Kernel" c a b"

    a and b are the major and minor numbers defined in your module code. So put will have to put the numbers instead of a and b. c is an option !

    to access the module in your user application program

    use the open(...) command. The name of the module to be opened is "Hello_Kernel".

    ---

    you unload your module with rmmod.

    i recommend to read 'Linux device drivers- 3rd Edition' by Corbet & Rubini. Its published by O'reilly. there is also an online version. The online version covers an older kernel. But i don't have the link right now.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    it must be

    mknod Hello_Kernel c a b

    and

    busybox insmod Hello_Kernel.ko

    without the character "

    sorry, i'm in hurry today
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi absolutebeginner !

    Thank you very much for your help.

    It's very clear !

    Thanks again,