FedoraForum.org - Fedora Support Forums and Community
Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Join Date
    Jun 2007
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Trying to compile the 'lm' part of the GATOS driver.

    I've been trying to compile this module forever. It's the 'lm' part of the gatos driver. When I try to run the makefile, it gives me this error:

    include/linux/pci.h: In function ‘pci_register_driver’:
    include/linux/pci.h:595: error: ‘KBUILD_MODNAME’ undeclared

    here is the makefile:

    ######### makefile #########

    ifneq ($(KERNELRELEASE),)

    KM_OBJS=km.o km_v4l.o km_memory.o radeon.o mach64.o rage128.o
    KM_API_OBJS=km_api.o km_api_data.o km_memory.o

    km_drv-objs := ${KM_OBJS}
    km_api_drv-objs := ${KM_API_OBJS}

    obj-m += km_drv.o
    obj-m += km_api_drv.o

    EXTRA_CFLAGS += -DLINUX_2_6

    else

    KDIR := /lib/modules/$(shell uname -r)/build
    PWD := $(shell pwd)

    all:
    $(MAKE) -C $(KDIR) M=$(PWD) modules

    clean:
    $(MAKE) -C $(KDIR) M=$(PWD) clean

    install:
    $(MAKE) -C $(KDIR) M=$(PWD) modules_install

    ######### end of makefile #########

    Here is the output of 'make V=1'

    make -f scripts/Makefile.build obj=/root/Desktop/km
    gcc -m32 -Wp,-MD,/root/Desktop/km/.km_memory.o.d -nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.1.2/include -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Os -pipe -msoft-float -mregparm=3 -freg-struct-return -mpreferred-stack-boundary=2 -march=i686 -mtune=generic -mtune=generic -ffreestanding -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -Iinclude/asm-i386/mach-generic -Iinclude/asm-i386/mach-default -fomit-frame-pointer -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -DLINUX_2_6 -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(km_memory)" -c -o /root/Desktop/km/.tmp_km_memory.o /root/Desktop/km/km_memory.c

    I thought the 'obj-m +=' declared the KBUILD_MODNAME varable, but I really don't understand this kbuild stuff. I'm running fedora core 7 (2.6.21). Thanks for readin

  2. #2
    stevea Guest
    I'm not sure myself, except KBUILD_MODNAME is newly introduced to the Linux kernel. It wasn't in 2.6.18 but it is in 2.6.21.

    Make sure you've installed the 'kernel-devel' package.


    This term KBUILD_MODNAME appears in the 2.6.21 kernel in include files and appears to equate to
    the module name (duh!). I would have thought it would be defined when Makefile.build includes
    Makefile.lib, but apparently not in your case.


    Try revising the Makefile by adding this line .....

    MODULE := km_drv.ko
    after the "else" line.
    I*think* km_drv.ko is the .ko name but adjust if I have it wrong.

    Then I do this I get ... the following defines in the gcc compile
    -DMODULE -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(km_drv)" -D"KBUILD_MODNAME=KBUILD_STR(km_drv)"

  3. #3
    stevea Guest
    BTW - please post or message me if you get this working. The gatos stuff has apparently been abandoned - tho' it's a lot of code and the only means of using a lot of ATI features.

    I find it extremely confusing on the Gatos site to see what is real and what is ancient and what is unfinished. Needs a howto badly.

  4. #4
    Join Date
    Jun 2007
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    MODULE := km_drv.ko didn't work But I'm getting some success with putting the line

    CFLAGS_km_memory.o = -D"KBUILD_MODNAME=KBUILD_STR(km_memory)"

    in. But I don't know what to use in the KBUILD_STR(here) part. Do I use km_memory, km_drv.ko, all generate errors.

    Oh yes -- yep, got kernel-devel, and the kernel source (recompiled). I had to to get this far. Thanks for the reply.

  5. #5
    Join Date
    Jun 2007
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, I'm using CFLAGS_km_memory.o = -D"KBUILD_MODNAME=KBUILD_STR(km_memory_drv)", hope that works. Here's the next hurdle, in one of the headers it declares a varable of the type 'poll_table" which I guess was in /linux/spinlock.h at on point in time. Any clue which header file needs to be included?

  6. #6
    Join Date
    Jun 2007
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, hit a brick wall. Apparently, one of the .c files uses the function 'MODULE_PARM' which is not used with kernel 2.6.21. Any ideas?

    Here are the lines that need to be replaced:

    MODULE_PARM(km_debug, "i");
    MODULE_PARM(km_debug_overruns, "i");
    MODULE_PARM(km_buffers, "i");

    I know MODULE_PARM got replaced with module_param, but the syntax was changed.
    Last edited by LinGreg; 25th June 2007 at 08:31 PM.

  7. #7
    forumsusers Guest
    I have the same problem in our drivers. Have not tried adding the CFLAGS yet. But will do so. Apparently what is happening (at least with our drivers) is that one module is being compiled several times into different kernel extensions and it is now required to have KBUILD_MODNAME for each and every module or at least that's what I interpreted. I was quite surprised not to find a lot of people with the same problem. Apparently not many people have 2.6.21 yet.

    LinGreg, please let me know if you find a solution and will do so too if I come across anything.

    Thanks

  8. #8
    Join Date
    Jun 2007
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The CFLAGS_ seamed to work. I was actually able to compiling it, after a bunch to changes though. I needed to change some of the older headers to the newer ones. Replaced MODULE_PARM function with module_param. The drivers compiled and installed fine, but it didn't recognize my card. I think it wasn't supported. I'm going to make a post with the modified code.

  9. #9
    Join Date
    Jun 2007
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Got the km part Gatos drivers compiled and installed!

    I finally got the km driver (from Gatos) compiled and installed. I got a /proc/km folder, so I think I did something right. But, the driver still won't recognize my card! I think it just isn't supported (on the website it did say the radeon 9600 wasn't supported yet). I had to change to the source code a bit to get it to compile on Fedora core 7. If anyone has a older card, you can try this driver and see if it works (please post your results if you do ). Here is the modified driver:

    http://webfiles.uci.edu/gmartine/km/...odified.tar.gz

    You'll need to download and compile of kernel source code. Make two links from /usr/src/linux and /lib/modules/$(uname -r)/build to the directory where your source code is. For me, it was

    ln -s /usr/src/redhat/BUILD/kernel-2.6.21/linux-2.6.21.$(uname -m) /usr/src/linux
    ln -s /usr/src/redhat/BUILD/kernel-2.6.21/linux-2.6.21.$(uname -m) /lib/modules/$(uname -r)/build

    Then in the km directory, run 'make', 'make test', then 'make install'

  10. #10
    bob's Avatar
    bob is offline Administrator -- On Leave
    Join Date
    Jul 2004
    Location
    Colton, NY; Junction of Heaven & Earth (also Routes 56 & 68).
    Age
    81
    Posts
    25,251
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I merged the two threads since anyone looking for solutions in the future would miss info with details in two areas.
    Linux & Beer - That TOTALLY Computes!
    Registered Linux User #362651


    Don't use any of my solutions on working computers or near small children.

  11. #11
    stevea Guest
    Try a "make V=1 install" and you'll see the build fails to resolve a symbol and the insmod fails too.
    It's some pci_.... call that should be a "register module" call.
    tried that and still got nowhere.
    More to follow as time allows.

  12. #12
    ramack Guest
    I've been trying to get my ATI AIW Radeon 7500 (yeah, get a supported card, ha) and came across this thread.

    I incorporated the symbolic links suggested, but I am still getting an error. The results are below. The error has to do with config.h not being located. Any suggestions for a solution?

    Thanks,

    Rich

    ***Code and results below***

    # make test
    make -C /lib/modules/2.6.22.17-14-bigsmp/build M=/home/ramack/Desktop/gatos/km/km modules
    make[1]: Entering directory `/usr/src/linux-2.6.22.17-14-obj/i386/bigsmp'
    make -C ../../../linux-2.6.22.17-14 O=../linux-2.6.22.17-14-obj/i386/bigsmp modules
    CC [M] /home/ramack/Desktop/gatos/km/km/km_api.o
    /home/ramack/Desktop/gatos/km/km/km_api.c:22:26: error: linux/config.h: No such file or directory
    make[4]: *** [/home/ramack/Desktop/gatos/km/km/km_api.o] Error 1
    make[3]: *** [_module_/home/ramack/Desktop/gatos/km/km] Error 2
    make[2]: *** [modules] Error 2
    make[1]: *** [modules] Error 2
    make[1]: Leaving directory `/usr/src/linux-2.6.22.17-14-obj/i386/bigsmp'
    make: *** [all] Error 2

  13. #13
    Join Date
    May 2008
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    I compiled km-0.6.1-modified.tar.gz(LinGreg) and several error ocurred
    But some code change and compile well.

    First,
    ln -s /usr/src/(kernel source directory)/include/linux/autoconf.h \
    /usr/src/(kernel source directory)/include/linux/config.h
    Second,
    km.c line 287,
    SA_SHIRQ changed to IRQF_SHARED
    Third,
    km.c line 645,
    printk(KERN_DEBUG "Register aperture is 0x%08lx 0x%08lx\n", pci_resource_start(dev, 2), pci_resource_len(dev, 2));
    delete.
    Fourth,
    km.c line 1109,
    function, pci_module_init chang to function, pci_register_driver.

    Then compile km module and compile avview, avview run well.
    I use radeon9000pro and, fedora7 kernel2.6.23.15-80.fc7.
    Thanks to LinGreg.
    other people compile like me and run well,
    then notify 'run well' this forum.

  14. #14
    buhochileno Guest
    Quote Originally Posted by crosx
    I compiled km-0.6.1-modified.tar.gz(LinGreg) and several error ocurred
    But some code change and compile well.

    First,
    ln -s /usr/src/(kernel source directory)/include/linux/autoconf.h \
    /usr/src/(kernel source directory)/include/linux/config.h
    Second,
    km.c line 287,
    SA_SHIRQ changed to IRQF_SHARED
    Third,
    km.c line 645,
    printk(KERN_DEBUG "Register aperture is 0x%08lx 0x%08lx\n", pci_resource_start(dev, 2), pci_resource_len(dev, 2));
    delete.
    Fourth,
    km.c line 1109,
    function, pci_module_init chang to function, pci_register_driver.

    Then compile km module and compile avview, avview run well.
    I use radeon9000pro and, fedora7 kernel2.6.23.15-80.fc7.
    Thanks to LinGreg.
    other people compile like me and run well,
    then notify 'run well' this forum.
    Hi: ...I happly discover that without to much effor I have my AIW7500 allmost workin in my new fedora 10!!!, tvout working, remote control working, and avview with some source from a opensuse guy...So, I just want to try the km module to check if I can use other v4l apps to record from the card...
    I follow your instructions to build the km module..but get stock here:

    make
    make -C /lib/modules/2.6.27.5-117.fc10.i686/build M=/home/buho/Desktop/km modules
    make[1]: Entering directory `/usr/src/kernels/2.6.27.5-117.fc10.i686'
    CC [M] /home/buho/Desktop/km/km_api.o
    /home/buho/Desktop/km/km_api.c: In function ‘km_api_init_module’:
    /home/buho/Desktop/km/km_api.c:589: error: ‘proc_root’ undeclared (first use in this function)
    /home/buho/Desktop/km/km_api.c:589: error: (Each undeclared identifier is reported only once
    /home/buho/Desktop/km/km_api.c:589: error: for each function it appears in.)
    /home/buho/Desktop/km/km_api.c: In function ‘km_api_cleanup_module’:
    /home/buho/Desktop/km/km_api.c:616: error: ‘proc_root’ undeclared (first use in this function)
    make[2]: *** [/home/buho/Desktop/km/km_api.o] Error 1
    make[1]: *** [_module_/home/buho/Desktop/km] Error 2
    make[1]: Leaving directory `/usr/src/kernels/2.6.27.5-117.fc10.i686'
    make: *** [all] Error 2

    ...any ideas?, fedora 10 kernel that i'm using is: 2.6.27.5-117.fc10.i686

    thanks ..

    Mauricio

  15. #15
    stevea Guest
    proc_root disappeared sometime between 2.6.18 and 2.6.26.
    Your driver needs to be modified.

Page 1 of 2 12 LastLast

Similar Threads

  1. Kernel Compilation drivers being compiled I do not have.
    By bvknapp in forum Installation, Upgrades and Live Media
    Replies: 1
    Last Post: 27th March 2007, 12:36 PM
  2. Compiled and installed python 2.5
    By Dedasen in forum Using Fedora
    Replies: 4
    Last Post: 1st February 2007, 02:49 PM
  3. Replies: 6
    Last Post: 28th March 2006, 01:50 AM
  4. Replies: 10
    Last Post: 27th May 2005, 01:25 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •