On Tue, 22 Feb 2005 11:21:05 -0600, coin <[EMAIL PROTECTED]> wrote:

Estoy tratando de compilar el cl�sico m�dulo hola mundo y este es el c�digo:

#include <linux/module.h>
#include <linux/config.h>
#include <linux/init.h>

MODULE_LICENSE("GPL");
static int __init name_of_initialization_routine(void) {
       printk("<1>Hello, world\n");
   return 0;
}
static void __exit name_of_cleanup_routine(void) {
       printk("<1>Goodbye cruel world\n");
}
module_init(name_of_initialization_routine);
module_exit(name_of_cleanup_routine);

Y lo compile con esta instruccion:
# gcc -D__KERNEL__ -DMODULE -I/usr/src/kernel-source-2.6.8/include/
-O2 -c hello1.c

Y me dio buenos resultados pues genero el .o pero cuando le doy :
# insmod ./hello.o

me sale:
insmod: error inserting './hello1.o': -1 Invalid module format

�en que parte estar� lo invalido?
Gracias

Tendr� algo que ver el el archivo resultante es un archivo objeto y este no es compatible con el formato de m�dulo ?


-- Saludetes

OM
Is � an to�rneach a scanr�onn ach an tintreach a mhara�onn
Powered by Debian GNU/Linux Woody - kernel 2.4.18


-- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Responder a