- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Building linux kernel module/Driver in C code?
Operating System - Linux
1753549
Members
5718
Online
108795
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-07-2008 01:36 AM
тАО05-07-2008 01:36 AM
I want to compile and run below code I tried lot as
# gcc -C -W -Wall -D__KERNEL__ -DMODULE -isystem /lib/modules/2.6.23.14-115.fc8/build -v /usr/include/linux/version.h -c hello.c
# gcc -C -E -W -Wall -D__KERNEL__ -DMODULE -isystem /lib/modules/2.6.23.14-115.fc8/build -v /usr/include/linux/version.h -c hello.c
# gcc -C -E -W -Wall -D__KERNEL__ -DMODULE -isystem /lib/modules/2.6.23.14-115.fc8/build -v /usr/include/linux/version.h -c hello.c
# gcc -W -Wall -D__KERNEL__ -DMODULE -isystem /lib/modules/2.6.23.14-115.fc8/build -v /usr/include/linux/version.h -c hello.c
# gcc -W -Wall -D__KERNEL__ -DMODULE -isystem /lib/modules/2.6.23.14-115.fc8/build -v /usr/include/linux/version.h -c hello.c
Its not able to find linux/module.h whereas I have installed linux-source code and able to see same file in include/linux/module.h ?
#include
int init_module(void)
{
printk("<1>Hello, world\n");
return 0;
}
void cleanup_module(void)
{
printk("<1>Goodbye cruel world\n");
}
I tried by Creating Makefile with contents:
obj-m := hello.o
===============================then fired below============
# make -C /lib/modules/`uname -r` M=/Project modules
# make -C /lib/modules/`uname -r` M=/Project modules -c hello.c
# make -C /lib/modules/`uname -r` M=/Project modules hello.c
# make -C /lib/modules/`uname -r` M=/Project modules hello.c
But all failed ...................! Need Help
Is Anybody konwing how to compile Kernel C code I have docs to will send to u guys as per ur request for reference????????
My Linux Version :
uname -r
Linux linuxguru.symantec.com 2.6.23.14-115.fc8 #1 SMP Mon Jan 21 14:20:50 EST 2008 i686 i686 i386 GNU/Linux
# gcc -C -W -Wall -D__KERNEL__ -DMODULE -isystem /lib/modules/2.6.23.14-115.fc8/build -v /usr/include/linux/version.h -c hello.c
# gcc -C -E -W -Wall -D__KERNEL__ -DMODULE -isystem /lib/modules/2.6.23.14-115.fc8/build -v /usr/include/linux/version.h -c hello.c
# gcc -C -E -W -Wall -D__KERNEL__ -DMODULE -isystem /lib/modules/2.6.23.14-115.fc8/build -v /usr/include/linux/version.h -c hello.c
# gcc -W -Wall -D__KERNEL__ -DMODULE -isystem /lib/modules/2.6.23.14-115.fc8/build -v /usr/include/linux/version.h -c hello.c
# gcc -W -Wall -D__KERNEL__ -DMODULE -isystem /lib/modules/2.6.23.14-115.fc8/build -v /usr/include/linux/version.h -c hello.c
Its not able to find linux/module.h whereas I have installed linux-source code and able to see same file in include/linux/module.h ?
#include
int init_module(void)
{
printk("<1>Hello, world\n");
return 0;
}
void cleanup_module(void)
{
printk("<1>Goodbye cruel world\n");
}
I tried by Creating Makefile with contents:
obj-m
===============================then fired below============
# make -C /lib/modules/`uname -r` M=/Project modules
# make -C /lib/modules/`uname -r` M=/Project modules -c hello.c
# make -C /lib/modules/`uname -r` M=/Project modules hello.c
# make -C /lib/modules/`uname -r` M=/Project modules hello.c
But all failed ...................! Need Help
Is Anybody konwing how to compile Kernel C code I have docs to will send to u guys as per ur request for reference????????
My Linux Version :
uname -r
Linux linuxguru.symantec.com 2.6.23.14-115.fc8 #1 SMP Mon Jan 21 14:20:50 EST 2008 i686 i686 i386 GNU/Linux
"Success is matter of law not luck, Make ur own & follow them -Shivkhera[You Can Win] "
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-27-2008 03:12 PM
тАО05-27-2008 03:12 PM
Solution
You might take a look at kerneltrap.org. E.g.: http://kerneltrap.org/node/6955
Linux system administrator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-30-2009 10:36 PM
тАО08-30-2009 10:36 PM
Re: Building linux kernel module/Driver in C code?
I got the solutions
"Success is matter of law not luck, Make ur own & follow them -Shivkhera[You Can Win] "
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP