Re: Linux 2.6 kernel module compilation without using KBUILD

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

 



> 
> My intention is  to just understand whole  
> process of making kernel module.

The short story....
kbuild knows that .o files listed with obj-m are modules.
So if you have:
   obj-m := foo.o

the kbuild will know that it has to build a module named foo.o.
If foo.o consist of composite objects then kbuild
is told so using:
    foo-y := bar.o baz.o

So in this case kbuild will build bar.o and baz.o and
use these for the resulting module named foo.

When building baz.o kbuild uses make to search for the source file.
First it look for baz.c - if it fails it look for baz.s
Does both fail kbuild give up (there are some corner cases but ignore that).

When foo.o is ready is uses some linker magic to link in version information
and the end result is foo.ko.

foo.ko has a number of unresolved symbols that are:
1) during build time checked if kernel or other modules define them
2) during load time they are resolved

The above is general stuff - if you need more details please be specific.

	Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux