Re: Fwd: Problem in inserting a simple module in kernel 2.6.5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Badari Prasad wrote:



---------- Forwarded message ----------
From: *Badari Prasad* <h.badari@xxxxxxxxx <mailto:h.badari@xxxxxxxxx>>
Date: Dec 28, 2005 2:15 PM
Subject: Re: Problem in inserting a simple module in kernel 2.6.5
To: Fawad Lateef <fawadlateef@xxxxxxxxx <mailto:fawadlateef@xxxxxxxxx>>



On 12/28/05, *Fawad Lateef* <fawadlateef@xxxxxxxxx <mailto:fawadlateef@xxxxxxxxx>> wrote:

    On 12/28/05, Badari Prasad <h.badari@xxxxxxxxx
    <mailto:h.badari@xxxxxxxxx>> wrote:
Hello ,
       I am learning linux kernel module programming in linux
    kernel 2.6.5 (
fedora core 2 ), i have encountered a problem in passing command
    line
parameters to a module, this is the programme in which i
    encountered a
problem,

    <snip>


 Im refering to this site for kernel module programming

http://www.tldp.org/LDP/lkmpg/2.6/html/index.html
 The problem is given in  chapter 2.6 in hte above site

 Please do  help me in this regard, thanks in advance.


    What specific problem you are facing? you havn't mentioned about the
    problem because this code looks fine to me and its same as example
    code of the link you mentioned.

    --
    Fawad Lateef


Hi Fawad ,
This is the error which i got when i tired to compile the code hello-5.c , the same code which i mentioned to day morning,

[root in lkmpg-examples-2.6: 14:04:06]#make
make -C /lib/modules/2.6.5-1.358/build M=/root/WORK/lkmpg-examples-2.6 modules
make[1]: Entering directory `/lib/modules/2.6.5-1.358/build'
  CC [M]  /root/WORK/lkmpg-examples-2.6/hello-5.o
/root/WORK/lkmpg-examples-2.6/hello-5.c:14: error: stray '\342' in program
/root/WORK/lkmpg-examples-2.6/hello-5.c:14: error: stray '\210' in program
/root/WORK/lkmpg-examples-2.6/hello-5.c:14: error: stray '\222' in program
/root/WORK/lkmpg-examples-2.6/hello-5.c:14: error: stray '\342' in program
/root/WORK/lkmpg-examples-2.6/hello-5.c:14: error: stray '\210' in program
/root/WORK/lkmpg-examples-2.6/hello-5.c:14: error: stray '\222' in program
/root/WORK/lkmpg-examples-2.6/hello-5.c:29: error: invalid lvalue in unary `&' /root/WORK/lkmpg-examples-2.6/hello-5.c:29: error: initializer element is not constant /root/WORK/lkmpg-examples-2.6/hello-5.c:29: error: (near initialization for `__param_arr_myintArray.num')
make[2]: *** [/root/WORK/lkmpg-examples-2.6/hello-5.o] Error 1
make[1]: *** [/root/WORK/lkmpg-examples-2.6] Error 2
make[1]: Leaving directory `/lib/modules/2.6.5-1.358/build'
make: *** [all] Error 2

`error: stray '\342' in program' has nothing to do with the program. Looks to me like the program file is corrupted. Do not know if it is actually. Why don't you try re-writing the same in to another file and check? Do not do a `cp' or a `ctrl+c & ctrl+v' or a `left click+mouse drag+right click'. just type it out and check.
and AFAIK, the program does not seem to have any problem.

--
Hiran


and one more doubt in the code , i did not find <linux/moduleparam.h> file in the source code and in the /usr/include/linux directory. Instead of moduleparam.h file i found param.h file, can i include it ,

Thank you,
         Badari.
--
Regards,
         Badari.


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux