On Wed, Jul 29, 2009 at 8:55 PM, Gergely Buday<[email protected]> wrote:
> Dear kernel experts,
>
> I try to compile a module from Linux Device Drivers, 3rd edition:
>
> ---
> #include <linux/init.h>
> #include <linux/module.h>
> MODULE_LICENSE("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);
> ---
>
> I got a makefile from
>
> http://www.tldp.org/LDP/lkmpg/2.6/html/x181.html
>
> namely
>
> obj-m += helloworld.o
>
> all:
>        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
>
> clean:
>        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
>
> but that does not work on my system. What makefile should I use and
> where should I put my helloworld.c?

what error messages did you see?

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer
blog: the-hydra.blogspot.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to