473,419 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,419 software developers and data experts.

LINUX Modules

53
I have worked with this program of inserting a module to LINUX Kernel.
/*hellomodule.c*/
#define MODULE

int init_module(void){
printk("<1>Hello Module\n");
return 0;
}

void cleanup_module(void){
printk("<1>Goodbye\n");
}

I compiled the program with command

root# gcc -c hellomodule.c

I got the ouput file as hellomodule.o

And i failed in using the command,

root# insmod ./hellomodule.o

It is showing an error,

The file is not in module format and No module formats.

Whether we have any specific directories to put this modules?
How can i successfully install a module to the kernel?
Im using REDHAT EL - 4
Aug 21 '07 #1
1 950
svlsr2000
181 Expert 100+
I have worked with this program of inserting a module to LINUX Kernel.
/*hellomodule.c*/
#define MODULE

int init_module(void){
printk("<1>Hello Module\n");
return 0;
}

void cleanup_module(void){
printk("<1>Goodbye\n");
}

I compiled the program with command

root# gcc -c hellomodule.c

I got the ouput file as hellomodule.o

And i failed in using the command,

root# insmod ./hellomodule.o

It is showing an error,

The file is not in module format and No module formats.

Whether we have any specific directories to put this modules?
How can i successfully install a module to the kernel?
Im using REDHAT EL - 4
Can you post the kernel version your are using.
Can you post the output of this command
$ Uname -r
If you are using kenel 2.6 this is not the way to build modules.
Have a look at understanding linux device drivers book for more details of building the mofule. In 2.6.x kernels module linkage is done by kernel and it would be something like hello.ko and not hello.o
Aug 21 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: David ROBERT | last post by:
Hello, I need to read data from a MS Access database. The program (reader) is installed on a linux box and is written in python langage. The database is MS Access 2002 installed on a Win XP box...
4
by: Logan | last post by:
Several people asked me for the following HOWTO, so I decided to post it here (though it is still very 'alpha' and might contain many (?) mistakes; didn't test what I wrote, but wrote it - more or...
7
by: Erik Johnson | last post by:
I am trying to upgrade my Python installation. After downloading sources and building Python 2.3.4, I am unable to use the command history editing feature in the interactive interpreter (where the...
7
by: Edward Diener | last post by:
I can install Python 2.4 on the Fedora 3 Linux system, but after I do a number of Linux utilities and commands, like yum, stop working because they were dependent on the Python 2.3 installation....
2
by: RU | last post by:
Hi, I am working on a porting project to port C/C++ application from unixware C++, AT&T Standard components to g++ with STL on Linux. This application has been working properly on...
4
by: Fabian Braennstroem | last post by:
Hi, I am pretty new to python and will use it mainly in combination with scientific packages. I am running ubuntu breezy right now and see that some packages are out of date. Do you have any...
1
by: Sorin Schwimmer | last post by:
Hi All, After a disaster in which I lost my whole harddrive, I decided to install the newest everything that I use. I put the latest Gentoo Linux, with gcc 4.1.1, installed tcl/tk 8.4.14 and...
8
by: Prateek | last post by:
Hello, I'm trying to package my python program into a linux executable using cx_freeze. The goal is that the user should require python on their system. I've managed to make the binaries on...
1
by: kodaliece | last post by:
Hi, I am new to this PHP and linux OS as well. I am trying to install to Apache 2.2.8 and PHP 5.2.5 and do some PHP coding. I've installed Apache and tested it. Its working fine. Then, I...
5
by: John Ladasky | last post by:
Hi folks, Running Python 2.5 on both a Windows XP laptop, and an Ubuntu Linux 7.04 desktop. I've gotten tired of maintaining multiple copies of my personal modules that I use over and over. ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.