Hi,
On Fri, Jul 20, 2012 at 2:25 PM, Shakthi Kannan <[email protected]>wrote:

> Hi,
>
> --- On Fri, Jul 20, 2012 at 1:09 PM, Rahul Gaur <[email protected]>
> wrote:
> | I am also starting with the device drivers,can you help me understanding
> | the behavior of the Makefile.
> \--
>
> You can start with my presentation:
>
>   http://shakthimaan.com/downloads.html#dum-ka-biryani-make-for-each-other
>
> Also go through the Makefile manual for specific details.
>
> ---
>
 Yes,already going through it.

| I am not able to understand what is it doing...if I comment the above line
> | of code it does not show any error but there is no object file..
> \--
>
> As I mentioned earlier, tried to give detailed steps as to what you
> are doing. You have to post the exact output, and tell us in detail
> what you did.
>
> Which distro are you using? You might want to install the kernel-devel
> (header files) package to build the driver sources.
>
> SK
>



>
--
> Shakthi Kannan
> http://www.shakthimaan.com
>
> --
> Mailing list guidelines and other related articles:
> http://lug-iitd.org/Footer
>


Well, I am able to compile the examples successfully, here is the output
I am using fedora 17.

> make -C /lib/modules/3.4.4-5.fc17.x86_64/build
> M=/home/aregee/workspace/dev_driver/device-drivers-2.6/ex1-hello-world
> modules
> make[1]: Entering directory `/usr/src/kernels/3.4.4-5.fc17.x86_64'
>   CC [M]
>  /home/aregee/workspace/dev_driver/device-drivers-2.6/ex1-hello-world/hello.o
>   Building modules, stage 2.
>   MODPOST 1 modules
>   CC
>  
> /home/aregee/workspace/dev_driver/device-drivers-2.6/ex1-hello-world/hello.mod.o
>   LD [M]
>  /home/aregee/workspace/dev_driver/device-drivers-2.6/ex1-hello-world/hello.ko
>
make[1]: Leaving directory `/usr/src/kernels/3.4.4-5.fc17.x86_64'


I am able to load the hello.ko module and remove it successfully.

I wanted to know to what is the significance of obj-m..

> aregee@linuxstation ex1-hello-world$ cat Makefile
>
> #obj-m += hello.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
>
>  rm -f *~
>
>


> aregee@linuxstation ex1-hello-world$ make
> make -C /lib/modules/3.4.4-5.fc17.x86_64/build
> M=/home/aregee/workspace/dev_driver/device-drivers-2.6/ex1-hello-world
> modules
> make[1]: Entering directory `/usr/src/kernels/3.4.4-5.fc17.x86_64'
>   Building modules, stage 2.
>   MODPOST 0 modules
> make[1]: Leaving directory `/usr/src/kernels/3.4.4-5.fc17.x86_64'


Thanks for your reference,I got my answers now..


---------------------------------------------------------------------------------------------------------
*Rahul Gaur*
*irc : iamaregee2*
*blogs : *aregee.wordpress.com ,  <http://sanencynicalwriter.wordpress.com/>
http://sanencynicalwriter.wordpress.com/
*fb:* http://facebook.com/iamaregee
*github: *https://github.com/aregee

-- 
Mailing list guidelines and other related articles: http://lug-iitd.org/Footer

Reply via email to