[ Sale_123 @ 01.02.2008. 04:41 ] @
Pokusavam da kompajliram prvi primjer iz knjige Linux Device Drivers Third Edition i dobijam sledecu problem prilikom kompajliranja. Source sam instalirao i pokusao sam na ubuntu-u 7.10 i na opensuse 10.3 i imam isti problem. Obe masine se vrte na virtualnoj masini vmware.

Code:
[email protected]:~/drivers> make -C /usr/src/linux-2.6.22.5-31 M=`pwd` driver1
make: Entering directory `/usr/src/linux-2.6.22.5-31'
gcc -m32 -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -Werror-implicit-function-declaration -fno-strict-aliasing -fno-common -Os -pipe -msoft-float -mregparm=3 -freg-struct-return -mpreferred-stack-boundary=2  -march=i586 -mtune=generic -ffreestanding -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -Iinclude/asm-i386/mach-generic -Iinclude/asm-i386/mach-default -fomit-frame-pointer -g  -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -D__KERNEL__ -Iinclude  -include include/linux/autoconf.h  -m elf_i386  /home/sasa/drivers/driver1.c   -o driver1
[b]cc1: error: unrecognized command line option "-m"[/b]
make: *** [driver1] Error 1
make: Leaving directory `/usr/src/linux-2.6.22.5-31'


driver1.c
Code:
#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENCE("Dual BSD/GPL");

static int hello_init (void)
{
        printk(KERN_ALERT "Hello, world\n");
        return 0;
}

static void hello_exit (void)
{
        printk(KERN_ALERT "Goodbye, cruel world\n");
}

module_init(hello_init);
module_exit(hello_exit);


makefile
Code:
obj-m := driver1.o
module-objs := driver1.o


[ Sale_123 @ 01.02.2008. 15:17 ] @
Pocetnicka greska.
Imjesto make .... driver1 treba ici make .... modules.