Find the answer to your Linux question:
Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 22
hai mr.vijay, i am working on suse linux 10.1 as earlier i mentioned the problems do you have any idea in resolving these errors please let me know .waiting for ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #11
    Just Joined!
    Join Date
    Mar 2007
    Posts
    41

    hai mr.vijay, i am working on suse linux 10.1 as earlier i mentioned the problems do you have any idea in resolving these errors please let me know .waiting for your kind reply

  2. #12
    Just Joined!
    Join Date
    Mar 2007
    Posts
    41
    hai mr.vijay, could u help me for this problem, the problem not yet solved

  3. #13
    Just Joined!
    Join Date
    Mar 2007
    Posts
    10
    Hello Umesh,

    With 2.6 kernel there are some changes and you should incorparate those in your program. Your program is written for 2.4, check the 3 rd edition of driver book by rubini for the changes. The way initialization and cleanup routine is written differs here..not much. I haven't tried compiling the old program in 2.6 kernel..so don't know whether it works fine with the 2.6 kernel..this just a suggestion, you can try.

    First check whether you have built in kernel source tree in /usr/src/linux<version> if not compile the kernel again. All distrubutions by default don't install the kernel source tree. you have to choose that option.

    Regards

  4. #14
    Just Joined!
    Join Date
    Mar 2007
    Posts
    41
    sir ,

    i tried it from the following link

    http://www.novell.com/coolsolutions/feature/11254.html

    errors are following
    linux-k1il:/home/sample # export KBUILD_MODULES KBUILD_BUILTIN
    linux-k1il:/home/sample # export KBUILD_CHEECKSRC KBUILD_SRC KBUILD_EXTMOD
    linux-k1il:/home/sample # gcc -D__KERNEL__ -DMODULE -DMODVERSIONS -O2 -Wall -I /usr/src/linux-2.6.16.21-0.25/include -o client3.o -c client3.c
    In file included from /usr/src/linux-2.6.16.21-0.25/include/asm/processor.h:18,
    from /usr/src/linux-2.6.16.21-0.25/include/asm/thread_info.h:17,
    from /usr/src/linux-2.6.16.21-0.25/include/linux/thread_info.h:21,
    from /usr/src/linux-2.6.16.21-0.25/include/linux/preempt.h:10,
    from /usr/src/linux-2.6.16.21-0.25/include/linux/spinlock.h:50,
    from /usr/src/linux-2.6.16.21-0.25/include/linux/capability.h:45,
    from /usr/src/linux-2.6.16.21-0.25/include/linux/sched.h:7,
    from /usr/src/linux-2.6.16.21-0.25/include/linux/module.h:10,
    from client3.c:1:
    /usr/src/linux-2.6.16.21-0.25/include/asm/system.h: In function ‘__set_64bit_var’:
    /usr/src/linux-2.6.16.21-0.25/include/asm/system.h:210: warning: dereferencing type-punned pointer will break strict-aliasing rules
    /usr/src/linux-2.6.16.21-0.25/include/asm/system.h:210: warning: dereferencing type-punned pointer will break strict-aliasing rules
    In file included from /usr/src/linux-2.6.16.21-0.25/include/linux/rwsem.h:27,
    from /usr/src/linux-2.6.16.21-0.25/include/asm/semaphore.h:42,
    from /usr/src/linux-2.6.16.21-0.25/include/linux/sched.h:20,
    from /usr/src/linux-2.6.16.21-0.25/include/linux/module.h:10,
    from client3.c:1:
    /usr/src/linux-2.6.16.21-0.25/include/asm/rwsem.h: In function ‘__down_read’:
    /usr/src/linux-2.6.16.21-0.25/include/asm/rwsem.h:106: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    /usr/src/linux-2.6.16.21-0.25/include/asm/rwsem.h: In function ‘__down_write’:
    /usr/src/linux-2.6.16.21-0.25/include/asm/rwsem.h:158: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    /usr/src/linux-2.6.16.21-0.25/include/asm/rwsem.h: In function ‘__up_read’:
    /usr/src/linux-2.6.16.21-0.25/include/asm/rwsem.h:195: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    /usr/src/linux-2.6.16.21-0.25/include/asm/rwsem.h:189: warning: unused variable ‘tmp’
    /usr/src/linux-2.6.16.21-0.25/include/asm/rwsem.h: In function ‘__up_write’:
    /usr/src/linux-2.6.16.21-0.25/include/asm/rwsem.h:221: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    /usr/src/linux-2.6.16.21-0.25/include/asm/rwsem.h: In function ‘__downgrade_write’:
    /usr/src/linux-2.6.16.21-0.25/include/asm/rwsem.h:246: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    In file included from /usr/src/linux-2.6.16.21-0.25/include/linux/sched.h:20,
    from /usr/src/linux-2.6.16.21-0.25/include/linux/module.h:10,
    from client3.c:1:
    /usr/src/linux-2.6.16.21-0.25/include/asm/semaphore.h: In function ‘down’:
    /usr/src/linux-2.6.16.21-0.25/include/asm/semaphore.h:105: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    /usr/src/linux-2.6.16.21-0.25/include/asm/semaphore.h: In function ‘down_interruptible’:
    /usr/src/linux-2.6.16.21-0.25/include/asm/semaphore.h:130: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    /usr/src/linux-2.6.16.21-0.25/include/asm/semaphore.h: In function ‘down_trylock’:
    /usr/src/linux-2.6.16.21-0.25/include/asm/semaphore.h:155: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    /usr/src/linux-2.6.16.21-0.25/include/asm/semaphore.h: In function ‘up’:
    /usr/src/linux-2.6.16.21-0.25/include/asm/semaphore.h:179: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’

    another thing is that when i compile the sample code inside /usr/src/linux-2.6.16.21-0.25/drivers ... it is getting compiled but when i try to insert it into kernal following is the error

    linux-k1il:/usr/src/linux-2.6.16.21-0.25/drivers/usb/serial # insmod ezusb.o
    insmod: error inserting 'ezusb.o': -1 Invalid module format

    even then i copied the object file to lib/modules/2.6.16.21-0.25-smp/kernel/drivers/usb/serial
    i got the same error what might be the reason ?i use suse linux 10.1 on intel dual core
    any path is required , please guide me waiting for your valuable suggestions thank you

  5. #15
    Just Joined!
    Join Date
    Aug 2006
    Location
    india
    Posts
    57
    hi guys,
    1. u need the source to compile any module,have u downloaded the source from kernel.org
    2.check if ur build in /lib/modules is broken (if so ur having a precompiled kernel)
    u cant insert module with that it will return -1
    because build will luk in /usr/src for kernel souce.
    To my knowledge ur using a precompiled kernel & u dont have source

    check to the above & revert back for further doubts.

  6. #16
    Just Joined!
    Join Date
    Mar 2007
    Posts
    41
    Hi Mr.Raja, I initially created a folder under /home and tried the following program specified as per the link
    http://www.novell.com/coolsolutions/feature/11254.html
    and got the following errors
    linux-k1il:/home/sample # export KBUILD_MODULES KBUILD_BUILTIN
    linux-k1il:/home/sample # export KBUILD_CHEECKSRC KBUILD_SRC KBUILD_EXTMOD
    linux-k1il:/home/sample # gcc -D__KERNEL__ -DMODULE -DMODVERSIONS -O2 -Wall -I /usr/src/linux-2.6.16.21-0.25/include -o client3.o -c client3.c
    In file included from /usr/src/linux-2.6.16.21-0.25/include/asm/processor.h:18,
    from /usr/src/linux-2.6.16.21-0.25/include/asm/thread_info.h:17,
    from /usr/src/linux-2.6.16.21-0.25/include/linux/thread_info.h:21,
    from /usr/src/linux-2.6.16.21-0.25/include/linux/preempt.h:10,
    from /usr/src/linux-2.6.16.21-0.25/include/linux/spinlock.h:50,
    from /usr/src/linux-2.6.16.21-0.25/include/linux/capability.h:45,
    from /usr/src/linux-2.6.16.21-0.25/include/linux/sched.h:7,
    from /usr/src/linux-2.6.16.21-0.25/include/linux/module.h:10,
    from client3.c:1:
    /usr/src/linux-2.6.16.21-0.25/include/asm/system.h: In function ‘__set_64bit_var’:
    /usr/src/linux-2.6.16.21-0.25/include/asm/system.h:210: warning: dereferencing type-punned pointer will break strict-aliasing rules
    /usr/src/linux-2.6.16.21-0.25/include/asm/system.h:210: warning: dereferencing type-punned pointer will break strict-aliasing rules
    In file included from /usr/src/linux-2.6.16.21-0.25/include/linux/rwsem.h:27,
    from /usr/src/linux-2.6.16.21-0.25/include/asm/semaphore.h:42,
    from /usr/src/linux-2.6.16.21-0.25/include/linux/sched.h:20,
    from /usr/src/linux-2.6.16.21-0.25/include/linux/module.h:10,
    from client3.c:1:
    /usr/src/linux-2.6.16.21-0.25/include/asm/rwsem.h: In function ‘__down_read’:
    /usr/src/linux-2.6.16.21-0.25/include/asm/rwsem.h:106: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    /usr/src/linux-2.6.16.21-0.25/include/asm/rwsem.h: In function ‘__down_write’:
    /usr/src/linux-2.6.16.21-0.25/include/asm/rwsem.h:158: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    /usr/src/linux-2.6.16.21-0.25/include/asm/rwsem.h: In function ‘__up_read’:
    /usr/src/linux-2.6.16.21-0.25/include/asm/rwsem.h:195: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    /usr/src/linux-2.6.16.21-0.25/include/asm/rwsem.h:189: warning: unused variable ‘tmp’
    /usr/src/linux-2.6.16.21-0.25/include/asm/rwsem.h: In function ‘__up_write’:
    /usr/src/linux-2.6.16.21-0.25/include/asm/rwsem.h:221: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    /usr/src/linux-2.6.16.21-0.25/include/asm/rwsem.h: In function ‘__downgrade_write’:
    /usr/src/linux-2.6.16.21-0.25/include/asm/rwsem.h:246: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    In file included from /usr/src/linux-2.6.16.21-0.25/include/linux/sched.h:20,
    from /usr/src/linux-2.6.16.21-0.25/include/linux/module.h:10,
    from client3.c:1:
    /usr/src/linux-2.6.16.21-0.25/include/asm/semaphore.h: In function ‘down’:
    /usr/src/linux-2.6.16.21-0.25/include/asm/semaphore.h:105: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    /usr/src/linux-2.6.16.21-0.25/include/asm/semaphore.h: In function ‘down_interruptible’:
    /usr/src/linux-2.6.16.21-0.25/include/asm/semaphore.h:130: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    /usr/src/linux-2.6.16.21-0.25/include/asm/semaphore.h: In function ‘down_trylock’:
    /usr/src/linux-2.6.16.21-0.25/include/asm/semaphore.h:155: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
    /usr/src/linux-2.6.16.21-0.25/include/asm/semaphore.h: In function ‘up’:
    /usr/src/linux-2.6.16.21-0.25/include/asm/semaphore.h:179: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’

    another way i tried is
    File name : Makefile



    obj-m += client3.o

    all:

    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

    clean:

    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

    output is
    make −C /lib/modules/2.6.16.21-0.25-smp/build M=/home/sample modules
    make[1]: Entering directory `/home/sample'
    make[1]: *** No rule to make target `−C'. Stop.
    make[1]: Leaving directory `/home/sample'
    make: *** [all] Error 2

    and under usr/src/linux-2.6.16.21-0.25/drivers/

    created a directory and copied the source and added Makfile in it and compiled it compiled without any errors and while inserting into the kernel got the following output

    linux-k1il:/usr/src/linux-2.6.16.21-0.25/drivers/usb/serial # insmod client3.o
    insmod: error inserting 'client3.o': -1 Invalid module format

    Is there anyother way for compile procedure. i use suse linux 10.1 running on Pentium D (Dual core), where i am going wrong please guide me.As you told to download the kernel i never found kernels in the kernel.org and the kernel i use is linux-2.6.16.21-0.25
    please guide me where i am going wrong.thanks in advance,waiting for your valuable suggestions

  7. #17
    Just Joined!
    Join Date
    Aug 2006
    Location
    india
    Posts
    57
    luk in this same kernel forum for the following in page 2

    "Modules insertion in My kernel... (Multi-page thread 1 2)
    winifred_mit - The Linux Kernel "

    there cyberinstructer helped me step by step

    """""just tell whether in /lib/modules "build" is broken or pointing to some /usr/src""""

    ///// google kernel.org
    get to kernel archives & u will see latest stable version 2.6.21 or .20
    download it along with F,V options beside for patch
    then configure the kernel(make config) ,make the modules(make modules),"make install" to have ur latest 2.6.21 run at boot time
    but careful keep ur 2.6.15 source safe (if u have)

  8. #18
    Just Joined!
    Join Date
    Mar 2007
    Posts
    41
    hi raja, please see the following

    linux-k1il:/lib/modules # ls
    2.6.16.21-0.13-smp 2.6.16.21-0.13-xen 2.6.16.21-0.25-smp 2.6.16.21-0.25-xen
    linux-k1il:/lib/modules # cd 2.6.16.21-0.25-smp/
    linux-k1il:/lib/modules/2.6.16.21-0.25-smp # ls
    build modules.alias modules.dep modules.inputmap modules.ofmap modules.seriomap modules.unsupported source
    kernel modules.ccwmap modules.ieee1394map modules.isapnpmap modules.pcimap modules.symbols modules.usbmap weak-updates
    linux-k1il:/lib/modules/2.6.16.21-0.25-smp/build # ls
    arch .config include include2 .kernelrelease Makefile Module.symvers scripts
    linux-k1il:/lib/modules/2.6.16.21-0.25-smp/build #
    then what else to see in the build, please clarify

  9. #19
    Just Joined!
    Join Date
    Aug 2006
    Location
    india
    Posts
    57
    MYKERNEL=`uname -r`

    ifneq ($(KERNELRELEASE),)
    # call from kernel build system

    obj-m := hello.o

    else

    KERNELDIR ?= /lib/modules/$(MYKERNEL)/build
    PWD := $(shell pwd)

    default:
    $(MAKE) -C $(KERNELDIR) M=$(PWD) modules

    endif

    clean:
    rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions

    depend .depend dep:
    $(CC) $(CFLAGS) -M *.c > .depend


    ifeq (.depend,$(wildcard .depend))
    include .depend
    endif

    try this makefile brother ,i have fedora 2.6.15 for which i dont have source i saw in x-windows /lib/modules which is containing build when i looked into its properties it was written that link is broken
    for u it should say "entering /usr/src" so i still doubt build

  10. #20
    Just Joined!
    Join Date
    Aug 2006
    Location
    india
    Posts
    57
    [root@localhost hello]# make
    make -C /lib/modules/2.6.20/build M=/home/rajasekhar/hello modules
    make[1]: Entering directory `/usr/src/kernels/linux-2.6.20.4'
    Building modules, stage 2.
    MODPOST 1 modules
    make[1]: Leaving directory `/usr/src/kernels/linux-2.6.20.4'
    echo /lib/modules/2.6.20/build
    /lib/modules/2.6.20/build

    [root@localhost hello]# ls
    hello hello.c hello.ko hello.mod.c hello.mod.o hello.o Makefile Module.symvers test test.c ///SUCESSFULLY GOT OBJ FILE

    [root@localhost hello]# insmod hello.ko
    insmod: error inserting 'hello.ko': -1 Invalid module format
    1.why i got -1 when inserting the module because i compiled the module with 2.6.20 for which i have source & tried to insmod form a precompiled 2.6.15 kernel(I HAVE DOWNLOADED 2.6.20 FROM KERNEL.ORG)
    2.see my make it made the build to enter /usr/src/2.6.20 source ..where is ur make entering .....not able to luk for source code at all how will it compile

Page 2 of 3 FirstFirst 1 2 3 LastLast

Posting Permissions

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