On Mon, May 18, 2009 at 3:37 PM, Robert P. J. Day <[email protected]>wrote:

> On Mon, 18 May 2009, Vipul Jain wrote:
>
> > I am using Ubuntu 9.0.4 and currently building out of the source
> > tree, infact I am using the existing Ubuntu hearder files to build
> > my sample driver. Do I really need to get the source tree for
> > building modules?
>
>   if you want to build modules out of tree, you will need at least
> *part* of the kernel source tree, since you have to compile your
> module against the kernel header files.  you can have the entire
> source tree, or you might be able to get away with just the part of
> the tree that includes the build infrastructure and header files.

Can you please tell me how to get this kind of setup? What changes should I
make in my make file?

Regards,
Vipul.


>
> some distros have pre-defined packages for that called something like
> "kernel-devel".  in any event, you will need at least that part of the
> kernel source tree.
>
> > Secondly, I am not sure where to run make prepare_modules can you
> > please specify the exact location.
>
>   run that from the top of your kernel source tree -- that will prep
> the tree just enough to allow modules to be built against it.
>
> rday
>
> p.s. it's "make modules_prepare", not "make prepare_modules".  i
> guess i can make that wiki page clearer.
>
> http://www.crashcourse.ca/wiki/index.php/Writing_your_first_kernel_module
>
> --
>
> > ========================================================================
> > Robert P. J. Day                               Waterloo, Ontario,
> > CANADA
> >
> >        Linux Consulting, Training and Annoying Kernel Pedantry.
> >
> > Web page:
> >  http://crashcourse.ca
> > Linked In:
> > http://www.linkedin.com/in/rpjday
> > Twitter:
> > http://twitter.com/rpjday
> > ========================================================================
> >
> >
> >
> >
>
> ========================================================================
> Robert P. J. Day                               Waterloo, Ontario, CANADA
>
>        Linux Consulting, Training and Annoying Kernel Pedantry.
>
> Web page:                                          http://crashcourse.ca
> Linked In:                             http://www.linkedin.com/in/rpjday
> Twitter:                                       http://twitter.com/rpjday
> ========================================================================
>

Reply via email to