2003-01-01 17:11:02

by Albert Kajakas

[permalink] [raw]
Subject: 3rdparty modules for 2.5.53


Hello!
I have a problem with compiling modules for 2.5.
i wrote a module for 2.4. For 2.5 (51,52,53) it compiles nicely, but insmod complains about invalid format. I have the latest module init tools of Rusty installed. I'm usin gcc 3.2. Do i have to use any special compiler/linker options or defines or whatever to generate a working module ? what could be the problem ? Even a simple hello-world module doesnt work. Although, i have a working 2.5.53 modular kernel that was built using same tools.

best,
Al.
-- everyday.com --
Kuidas elad, Eesti tudeng?
Osale T?nis Paltsu esseekonkursil ?li?pilastele,
auhinnafond 10 000 kr. http://www.palts.ee/?id=756
H?id p?hi soovides, T?nis Palts



2003-01-01 18:16:14

by Sam Ravnborg

[permalink] [raw]
Subject: Re: 3rdparty modules for 2.5.53

On Wed, Jan 01, 2003 at 07:19:24PM +0200, Albert Kajakas wrote:
>
> Hello!
> I have a problem with compiling modules for 2.5.
> i wrote a module for 2.4. For 2.5 (51,52,53) it compiles nicely, but insmod complains about invalid format. I have the latest module init tools of Rusty installed. I'm usin gcc 3.2. Do i have to use any special compiler/linker options or defines or whatever to generate a working module ? what could be the problem ? Even a simple hello-world module doesnt work. Although, i have a working 2.5.53 modular kernel that was built using same tools.
>

Try to folllow this reciept posted by Kai G.
-------------
Well, you can do

cd my_module
echo "obj-m := my_module.o" > Makefile
vi my_module.c
make -C <path/to/kernel/src> SUBDIRS=$PWD modules

That's not too bad (and basically works for 2.4 as well)
---------------

Sam

2003-01-01 18:48:04

by Andi Kleen

[permalink] [raw]
Subject: Re: 3rdparty modules for 2.5.53

Albert Kajakas <[email protected]> writes:

> Hello!
> I have a problem with compiling modules for 2.5.

I recently tracked down the same problem.

Add a -DKBUILD_MODNAME="yourname" compile option to one of the files,
the new loader requires a module name section. It should be only set
once for each module.

In addition make sure you're using the new style module_init/module_exit
macros instead of init_module/cleanup_module.

-Andi

P.S.: I agree that the error reporting sucks for this one. It would
be better if the kernel loader give some kind of text message back.

2003-01-01 22:24:21

by Albert Kajakas

[permalink] [raw]
Subject: Re: 3rdparty modules for 2.5.53


Thanks!

it i postponed development for weeks just because i switched to 2.5 and i couldn't solve the stupid problem.


al.
>Albert Kajakas <[email protected]> writes:
>
>> Hello!
>> I have a problem with compiling modules for 2.5.
>
>I recently tracked down the same problem.
>
>Add a -DKBUILD_MODNAME="yourname" compile option to one of the files,
>the new loader requires a module name section. It should be only set
>once for each module.
>
>In addition make sure you're using the new style module_init/module_exit
>macros instead of init_module/cleanup_module.
>
>-Andi
>
>P.S.: I agree that the error reporting sucks for this one. It would
>be better if the kernel loader give some kind of text message back.
>
>

-- everyday.com --
Kuidas elad, Eesti tudeng?
Osale T?nis Paltsu esseekonkursil ?li?pilastele,
auhinnafond 10 000 kr. http://www.palts.ee/?id=756
H?id p?hi soovides, T?nis Palts


2003-01-01 22:25:51

by Bjoern A. Zeeb

[permalink] [raw]
Subject: Re: 3rdparty modules for 2.5.53

On 1 Jan 2003, Andi Kleen wrote:

[new modules thing]

> P.S.: I agree that the error reporting sucks for this one. It would
> be better if the kernel loader give some kind of text message back.

I think we mainly lack of documentation. anybody really followed and
understood this thing or perhaps the author ;-) should
write a/update modules.txt for 'module writers' not for users:

- how to update old style to new style; what needs to be changed ?
- what needs to be done to build own modules outside kernel tree ?
- skeleton for new modules
- dos and dont's

Did I miss s.th. ?

--
Bjoern A. Zeeb bzeeb at Zabbadoz dot NeT
56 69 73 69 74 http://www.zabbadoz.net/