Re: Information abt creating a sample device driver

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

 



one of the ways of doing it wud be:

make a Makefile with this one line :

obj-m := hello.o

Complie ur module using:

make -C /path/to/your/kernel_source/ SUBDIRS=$PWD modules

this should make all the required files. The one you'd want would
be "hello.ko" (kernel modules in 2.6 have this new format). You can
"insmod" this...it should work.

HTH,
-mandeep

On Thu, 2005-01-20 at 11:07, K S Sandeep wrote:
> Hello everybody,
> 
>  i am new to device driver programming. I have created a sample hello
> world!! program for 2.6 kernel and named the file as hello.c.
> 
>  i compiled it with Gcc as $gcc -c hello.c to get hello.o
> 
> then i tried isnerting the module as $insmod hello.o it gives me some
> error messages saying that the module created is of invalid type.
> 
>  can i just do a normal compilation or do i need to create a makefile
> and add some additional information into it.
> 
> 
> Thanks in advance
> sandeep
> 
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/
> 

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[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