compiling driver in Linux.

Discussion in 'NZ Computing' started by cowboyz, May 5, 2005.

  1. cowboyz

    cowboyz Guest

    What am I actually trying to do?
    Does Linux use drivers in the same way Windows does?
    What does source code look like and does it have a common extension?

    The below is pure assumption. Please feel free to correct any and all
    errors in my thinking.

    I have a package which contains *.o files which are object files which are
    loaded on the kernel and interact with the hardware directly.

    *.h files are binary and library files used to compile the object file.
    *.ini files are user data config files.
    Makefile* files are a set of instructions to be executed to build the object
    file.

    Thats it for now I think I just found something useful and have to switch
    back to Xandros.
    cowboyz, May 5, 2005
    #1
    1. Advertising

  2. cowboyz

    cowboyz Guest

    cowboyz wrote:

    > What am I actually trying to do?
    > Does Linux use drivers in the same way Windows does?
    > What does source code look like and does it have a common extension?
    >
    > The below is pure assumption. Please feel free to correct any and all
    > errors in my thinking.
    >
    > I have a package which contains *.o files which are object files which are
    > loaded on the kernel and interact with the hardware directly.
    >
    > *.h files are binary and library files used to compile the object file.
    > *.ini files are user data config files.
    > Makefile* files are a set of instructions to be executed to build the
    > object file.
    >
    > Thats it for now I think I just found something useful and have to switch
    > back to Xandros.



    This is kind of interesting.

    cowboyz2100:/test/sm200d-2.4_bin/sm200d_2.4_bin# X -version

    This is a pre-release version of XFree86, and is not supported in any
    way. Bugs may be reported to and patches submitted
    to . Before reporting bugs in pre-release versions,
    please check the latest version in the XFree86 CVS repository
    (http://www.XFree86.Org/cvs).

    XFree86 Version 4.3.0.1 (Debian 4.3.0.4-2 20031027181615 root@localhost)
    Release Date: 15 August 2003
    X Protocol Version 11, Revision 0, Release 6.6
    Build Operating System: Linux 2.4.19-x1 i686 [ELF]
    Build Date: 27 October 2003
    Before reporting problems, check http://www.XFree86.Org/
    to make sure that you have the latest version.
    Module Loader present
    OS Kernel: Linux version 2.4.24-x1 (root@build-kunstable) (gcc version 3.3.2
    20031005 (Debian prerelease)) #1 SMP Fri Feb 20 16:30:52 EST 2004 T
    cowboyz2100:/test/sm200d-2.4_bin/sm200d_2.4_bin#

    Note the 2.4.19-x1 in the Build operating system and teh 2.4.24-x1 in the OS
    kernel.

    Could this be why my ultra driver I am trying to build says it is
    x.x.x.x.19? instead of x.x.x.x.24?

    What would be easier? Upgrading the Build operating system to x.x.x.24 or
    downgrading the OS to x.x.x.x.19?
    cowboyz, May 5, 2005
    #2
    1. Advertising

  3. cowboyz

    Peter Guest

    cowboyz wrote:
    > What am I actually trying to do?
    > Does Linux use drivers in the same way Windows does?
    > What does source code look like and does it have a common extension?


    The package you downloaded ( a .gz file or similar) should contain
    instructions and explanations. Read these carefully, in my experience they
    are very good but must be read carefully. There are some differences
    between packages.

    >
    > *.h files are binary and library files used to compile the object file.
    > *.ini files are user data config files.
    > Makefile* files are a set of instructions to be executed to build the
    > object file.


    .h files are header files
    .c files are c source files
    config files might be called config
    makefile is build instructions for that package (used by the make utility)


    HTH

    Peter
    Peter, May 5, 2005
    #3
  4. cowboyz

    Peter Guest

    cowboyz wrote:
    > This is kind of interesting.
    >
    > cowboyz2100:/test/sm200d-2.4_bin/sm200d_2.4_bin# X -version


    > Note the 2.4.19-x1 in the Build operating system and teh 2.4.24-x1 in the
    > OS kernel.


    The build operating system is what was used to build the binary, and this
    doesn't always have to be the same as the running kernel.
    For example, following from Mandriva LE2005 ...

    $ X -version

    X Window System Version 6.8.2
    Release Date: 9 February 2005
    X Protocol Version 11, Revision 0, Release 6.8.2
    Build Operating System: Linux 2.6.10-3mdksmp i686 [ELF]
    Current Operating System: Linux tycho.karina 2.6.11-6mdk #1 Tue Mar 22
    16:04:32 CET 2005 i686
    Build Date: 06 April 2005
    Before reporting problems, check http://wiki.X.Org
    to make sure that you have the latest version.
    Module Loader present




    HTH

    Peter
    Peter, May 5, 2005
    #4
  5. cowboyz

    cowboyz Guest

    Peter wrote:

    > cowboyz wrote:
    >> This is kind of interesting.
    >>
    >> cowboyz2100:/test/sm200d-2.4_bin/sm200d_2.4_bin# X -version

    >
    >> Note the 2.4.19-x1 in the Build operating system and teh 2.4.24-x1 in the
    >> OS kernel.

    >
    > The build operating system is what was used to build the binary, and this
    > doesn't always have to be the same as the running kernel.
    > For example, following from Mandriva LE2005 ...
    >
    > $ X -version
    >
    > X Window System Version 6.8.2
    > Release Date: 9 February 2005
    > X Protocol Version 11, Revision 0, Release 6.8.2
    > Build Operating System: Linux 2.6.10-3mdksmp i686 [ELF]
    > Current Operating System: Linux tycho.karina 2.6.11-6mdk #1 Tue Mar 22
    > 16:04:32 CET 2005 i686
    > Build Date: 06 April 2005
    > Before reporting problems, check http://wiki.X.Org
    > to make sure that you have the latest version.
    > Module Loader present
    >
    >
    >
    >
    > HTH
    >
    > Peter



    I am trying to compile a ihug ultra driver.
    The docs are very weak and assume everything will go to plan.

    I have tried many many things but it always comes out complaining that it is
    compiled for 2.4.19 If I force the insmod then it locks the whole system
    up.

    I was reading earlier some guy who was working at ihug who ported the 2.2
    driver to 2.4 but was complaining about not having the source from
    tellemann. The discussion was based around trying to get it to work with
    2.6 which they couldn't do.

    Every download I have come across has drivers for 2.2.1 2.2.2 2.2.3 and so
    on for a heap of them but only one driver listed as 2.4.x I assumed it
    would compile for the last number in the version when installed but it
    doesn't want to.

    So far I have found a modified driver for 2.4.0 and 2.4.19 (which is the one
    I built) but neither work at all.

    If I delete the object files I can recreate them using make but it always
    comes out as 2.4.19 and I can't figure out how to get it to be nice to me.
    cowboyz, May 5, 2005
    #5
  6. cowboyz

    steve Guest

    cowboyz wrote:

    On Linux, you can either compile a driver into a monolithic kernel (it's
    part of the kernel - which you would need to re-compile completely) or you
    can compile it as a module - which you can load or unload as required
    without re-compiling the kernel.

    Modules are better IMHO.

    > Thats it for now I think I just found something useful and have to switch
    > back to Xandros.


    Compiling programs in Linux is usually very easy.

    You get the tarball (<file.name.tar.gz>)

    You un-tar it:

    tar -zxvf file.name.tar.gz

    You open a command prompt (console / xterm) and change directory into the
    into the folder that was created when you un-tarred the source.

    You will find a file called "Configure", so you:

    From a command prompt, enter:

    ../Configure

    It will check stuff and may ask you a question or two.....when it
    succesfully completes without errors, you then do the "make" which you
    normally do by simply entering:

    make

    Then.....if that goes OK, you (if required) change to root and run:

    make install

    ....which will normally put the compiled programs into the folders they need
    to be in for them to run properly system-wide. If the program is not
    intended to be used system-wide.....then you probably don't have to do this
    step at all.

    So - summery:

    1. get the tarball and expand it.
    2. ./Configure
    3. make
    4. (as root) make install

    With Xandros, you need to do some special things just ONCE in order to be
    able to compile kernel-level software.
    steve, May 5, 2005
    #6
  7. cowboyz

    Shane Guest


    > So - summery:
    >
    > 1. get the tarball and expand it.
    > 2. ./Configure
    > 3. make
    > 4. (as root) make install
    >
    > With Xandros, you need to do some special things just ONCE in order to be
    > able to compile kernel-level software.


    er if I can just add a pedantic note
    cat README and cat INSTALL (if they exist) should be your first move after
    entering the decompressed directorys.
    I have also noted that everyone seems to be installing a new kernel from
    source to build this damn thing, when all that should be needed is the
    kernel HEADERS
    is there anychance that either cowboyz or lance can point us to a copy of
    this tarball so someone can look through it and see what (if anything) can
    be done?

    --
    Hardware, n.: The parts of a computer system that can be kicked

    The best way to get the right answer on usenet is to post the wrong one.
    Shane, May 5, 2005
    #7
  8. cowboyz

    cowboyz Guest

    Shane wrote:

    >
    >> So - summery:
    >>
    >> 1. get the tarball and expand it.
    >> 2. ./Configure
    >> 3. make
    >> 4. (as root) make install
    >>
    >> With Xandros, you need to do some special things just ONCE in order to be
    >> able to compile kernel-level software.

    >
    > er if I can just add a pedantic note
    > cat README and cat INSTALL (if they exist) should be your first move after
    > entering the decompressed directorys.
    > I have also noted that everyone seems to be installing a new kernel from
    > source to build this damn thing, when all that should be needed is the
    > kernel HEADERS
    > is there anychance that either cowboyz or lance can point us to a copy of
    > this tarball so someone can look through it and see what (if anything) can
    > be done?
    >



    I think this is just one of those special cases.

    After playing with Xandros I am a bigger fan of Linux than I ever was using
    Mandrake.

    The file I am playing with the most and got the furtherest with is


    ftp://ftp.ihug.co.nz/ultra/Legacy_Ultra_Drivers/Linux Drivers/SM200Dxx%2
    (Linux%20Drivers)/Linux%20Kernel%202.4%20Drivers/sm200d-2.01-linux24.tar.gz

    is it the header file (ie. sm2_drv.h) that determines the file version of
    the object file?
    cowboyz, May 5, 2005
    #8
  9. cowboyz

    Peter Guest

    cowboyz wrote:
    > I am trying to compile a ihug ultra driver.
    > The docs are very weak and assume everything will go to plan.


    What can you tell us about the ultra device; make, model, chipset, etc?
    What package are you installing? Where did you get it from? (Maybe someone
    knows if it is the correct driver, or maybe someone can look at that
    package and make some more sense of it.)


    > I have tried many many things but it always comes out complaining that it
    > is compiled for 2.4.19


    What is the exact error message of this complaint?


    I don't know about the ultra device, but in my experience, these are the
    pieces of info you will probably need to sort it out.

    HTH

    Peter
    Peter, May 5, 2005
    #9
  10. cowboyz

    cowboyz Guest

    Shane wrote:

    >
    >> So - summery:
    >>
    >> 1. get the tarball and expand it.
    >> 2. ./Configure
    >> 3. make
    >> 4. (as root) make install
    >>
    >> With Xandros, you need to do some special things just ONCE in order to be
    >> able to compile kernel-level software.

    >
    > er if I can just add a pedantic note
    > cat README and cat INSTALL (if they exist) should be your first move after
    > entering the decompressed directorys.
    > I have also noted that everyone seems to be installing a new kernel from
    > source to build this damn thing, when all that should be needed is the
    > kernel HEADERS
    > is there anychance that either cowboyz or lance can point us to a copy of
    > this tarball so someone can look through it and see what (if anything) can
    > be done?
    >


    Oh yeah, slip of the keyboard when setting up Knode and I've given away my
    real name!

    What a shame
    cowboyz, May 5, 2005
    #10
  11. cowboyz

    steve Guest

    Shane wrote:

    >
    >> So - summery:
    >>
    >> 1. get the tarball and expand it.
    >> 2. ./Configure
    >> 3. make
    >> 4. (as root) make install
    >>
    >> With Xandros, you need to do some special things just ONCE in order to be
    >> able to compile kernel-level software.

    >
    > er if I can just add a pedantic note
    > cat README and cat INSTALL (if they exist) should be your first move after
    > entering the decompressed directorys.
    > I have also noted that everyone seems to be installing a new kernel from
    > source to build this damn thing, when all that should be needed is the
    > kernel HEADERS
    > is there anychance that either cowboyz or lance can point us to a copy of
    > this tarball so someone can look through it and see what (if anything) can
    > be done?


    On Xandros, you have to install the kernel source package if the source
    you're compiling needs to include some kernel code or use those headers.

    There is a wee procedure you need to go through to even get the kernel
    headers. Xandros make folks do this because they do not want newbies
    messing up their system...which they can't do easily if they aren't able to
    install and set up the kernel sources.

    Coyboyz appears to have the right setup procedure. Maybe he typed a command
    in wrong....or maybe the source he's using just won't work.
    steve, May 5, 2005
    #11
  12. cowboyz

    Robert Cooze Guest

    Peter wrote:
    > cowboyz wrote:
    >
    >>I am trying to compile a ihug ultra driver.
    >>The docs are very weak and assume everything will go to plan.

    >
    >
    > What can you tell us about the ultra device; make, model, chipset, etc?
    > What package are you installing? Where did you get it from? (Maybe someone
    > knows if it is the correct driver, or maybe someone can look at that
    > package and make some more sense of it.)
    >
    >
    >
    >>I have tried many many things but it always comes out complaining that it
    >>is compiled for 2.4.19

    >
    >
    > What is the exact error message of this complaint?
    >
    >
    > I don't know about the ultra device, but in my experience, these are the
    > pieces of info you will probably need to sort it out.
    >
    > HTH
    >
    > Peter
    >

    Not shure if this is a help the card is made by telman it is one of
    those closed source things I think all development stoped arround the
    2.2.xx kernals. The grurus In Ihug were doing it on there own time. and
    there seemed to be a genral lac of enthusiasiam from Ihug. there were a
    Ver 1 driver and a Ver 2 Driver the version 2 was better but it needed
    hacking of the make file to make it work. The last time I tryed
    compiling the driver on a modern kernal (year back) there were many gcc
    related problems. I stoped worring and left the card in a e-smith box
    running 2.2.19. went back to regular dialup a little later and much
    happier.

    --
    http://cooze.co.nz home of the RecyclerMan aka Robert Cooze

    / __/ / / / / /__ / / ___/ / __/ / / / |/ / /__ /
    / / / /_/ / / /_/ / _-' / __/ / / / /_/ / / /| / _-'
    ___\ ____/ ____/ /___/ /____/ /_/ ___\ ____/ /_/ /_/ |_/ /___/
    Robert Cooze, May 5, 2005
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Yura
    Replies:
    0
    Views:
    1,261
  2. Rindler Sigurd

    Compiling digitzed dictionary

    Rindler Sigurd, Jul 19, 2003, in forum: Computer Support
    Replies:
    0
    Views:
    417
    Rindler Sigurd
    Jul 19, 2003
  3. heynowkling
    Replies:
    0
    Views:
    506
    heynowkling
    Apr 26, 2005
  4. dotcom

    Compiling Squid-2.5.STABLE8 on Fedora Core 3

    dotcom, Jun 6, 2005, in forum: Computer Support
    Replies:
    13
    Views:
    1,209
    dotcom
    Jun 17, 2005
  5. angelbrown

    .NET stops compiling some aspx pages

    angelbrown, Sep 4, 2006, in forum: Software
    Replies:
    0
    Views:
    1,330
    angelbrown
    Sep 4, 2006
Loading...

Share This Page