LINUX programming

Moderators: ITA
Number of threads: 1339
Number of posts: 2924

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Please Help needed to compile my first kernel program Posted by rachilmeth on 14 Jan 2010 at 9:35 PM
Please Help needed to compile my first kernel program

I have compile & install new kernel 2.6.32.3 on path: /root/linux2.6.32.3/
I have written small program [shown below] at path: /root/abc/

I already compile & install kernel 2.6.32.3 on fedora 10 machine & check /boot/grub/menu1.st entry it is there.

My program giving an error when I "make"
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

uname: extra operand `.r'
Try `uname --help' for more information.
uname: extra operand `.r'
Try `uname --help' for more information.
make: Nothing to be done for `all'.


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

My Kernel Program

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/*
* hello.1.c . The simplest kernel module.
*/
#include </root/linux-2.6.32.3/include/linux/module.h> /* Needed by all modules */
#include </root/linux-2.6.32.3/include/linux/kernel.h> /* Needed for KERN_INFO */

int init_module(void)
{
printk(KERN_INFO "Hello world 1.\n");
/*
* A non 0 return means init_module failed; module can't be loaded.
*/
return 0;
}

void cleanup_module(void)
{
printk(KERN_INFO "Goodbye world 1.\n");
}

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Makefile look like

obj.m += hello.1.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

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++~
myemail id : rachilmeth@googlemail.com
~





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.