Forum Discussion

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

Linux device driver and Interrupt

I have made my own sopc component with interrupt. This component are going to be used on an cyclone 2, with web server.

Do I need to write a device driver in to uClinux to communicate with this component?

I have a 300 page book here on how to write device driver to linux.

Is uClinux like Linux when it comes to drivers?

As I have understood there are posibly to acess the I/O port simply by an user program, but is it possible to get the Interrupt to work with an user program?

(Okey, I maybe have the possibility to poll a flag or something, but I don't want the program to use cpu on that).

Does anybody know about information on how to write device driver to uClinux?

(code examples, tutorial, howto)

How much time do I need to do the different things? I only have one month on me, to get this part up and running on an developmentboard. (This is one part of an bigger project)

Would it be an better alternative to use MicroC/OS-II, is it much easier to use. Does it have CGI?

Sorry for bad english.

3 Replies

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

    --- Quote Start ---

    originally posted by doofus64@Feb 11 2006, 03:43 AM

    i have made my own sopc component with interrupt. this component are going to be used on an cyclone 2, with web server.

    do i need to write a device driver in to uclinux to communicate with this component?

    i have a 300 page book here on how to write device driver to linux.

    is uclinux like linux when it comes to drivers?

    --- Quote End ---

    Yes, uClinux is a MMU-less Linux.

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    As I have understood there are posibly to acess the I/O port simply by an user program, but is it possible to get the Interrupt to work with an user program?

    (Okey, I maybe have the possibility to poll a flag or something, but I don&#39;t want the program to use cpu on that).[/b]

    --- Quote End ---

    You can poll, but you can not handle interrupt in user space.

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    Does anybody know about information on how to write device driver to uClinux?

    (code examples, tutorial, howto)[/b]

    --- Quote End ---

    You have the right book, and read it from the beginning.

    You can look at the kernel sources and doc. You can find some tutorial on the web, too.

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    How much time do I need to do the different things? I only have one month on me, to get this part up and running on an developmentboard. (This is one part of an bigger project)[/b]

    --- Quote End ---

    Follow my buildroot quide, you should be able to set up and run hello world module example in hours. It will take some time longer to learn to write driver, but it is not so difficult to get something working.

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    Would it be an better alternative to use MicroC/OS-II, is it much easier to use. Does it have CGI?[/b]

    --- Quote End ---

    You&#39;d better use uClinux.

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    Sorry for bad english.[/b]

    --- Quote End ---

    Don&#39;t worry.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    Can I add device driver after the kernel is compiled?[/b]

    --- Quote End ---

    Yes, you can. But you have to copy the compiled object to your rootfs, and no module dependency list will take care of it. So this is not prefered.

    You should follow what we do in the hello world module.