Re: really newbie: compiling a module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Wed, Jul 29, 2009 at 7:31 PM, Mulyadi Santosa <mulyadi.santosa@xxxxxxxxx> wrote:
On Wed, Jul 29, 2009 at 8:55 PM, Gergely Buday<gbuday@xxxxxxxxx> 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?
Please read all the articles by robert meant for newbie here . That should be able to answer your question 
http://linux.com/search/kernel%2Bnewbie%2Bcorner/%252F?ordering=oldest&searchphrase=exact&limit=20 
--
regards,

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

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ




--
Regards,
~Sid~


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux