[[EMAIL PROTECTED]]
> I want to know where all i have to make entries in the source code of
> linux so that while building the Linux kernel i can include my device
> driver in the kernel.

There are files in many of the directories of the kernel called
'Config.in'.  Find an appropriate one and add an entry for your driver.
Consult the file Documentation/kbuild/config-language.txt for the
formal definition of this file format, which is based on but NOT
equivalent to shell syntax.

> 1. Where I have to write Makefile so that make utility can know to 
> execute this Makefile. This Makefile is required for to create 
> node.   /dev/<mydev>

Normally you do not create device files when building the kernel --
because the kernel may be (and in fact often is) built on a machine
other than the target where it will run.

Your best bet is to include the necessary 'mknod' command in your
documentation - the help entry, or a README that the help entry refers
to.  You really cannot rely on any sort of post-install script running,
except the module installation stuff in the main Makefile (but that's
no place to put mknod commands either).

> 2. Where i have to put my device driver source code.

Find a subdirectory under the kernel source - probably something under
'drivers'.  If you only have one or two files that compile into your
driver, just drop it into a directory with similar stuff.  If it's
several files, you may wish to create your own subdirectory, which is a
bit more complicated because you have to write your own makefile
instead of just adding a line or two to an existing one.

> 3. Where i have to make entry so that "make Xconfig" can have this 
> entry so that while configuring kernel it should appear.

See comment above about 'Config.in' files.  Also note that if you want
to provide a help text for the option, the file to do that is
'Config.help', which should be in the same directory as the Config.in
you are editing.

If you have trouble hacking the appropriate Config.in, Config.help and
Makefile files, please post a link to your current driver and we can
help you.  (Since you are talking about linking the driver statically
into the kernel, I know you are releasing it under the GPL anyway, as
per license requirements.)

> More over Still where and what entier i have to make in the source
> file to statically include my device driver in the kernel.

Depends on what type of driver.  If it's a network driver, you have to
add an entry to drivers/net/Space.c.  For a SCSI card driver, you do
something funky with including the scsi_module.c template.  For most
other drivers, you can just add the declaration

  module_init(your_init_function);

and that will be called automatically during boot.  You will need
<linux/init.h>.

                    *          *          *

A little grepping could have told you pretty much all of the above.
The source is your friend.  HTH,

Peter

_______________________________________________
kbuild-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/kbuild-devel

Reply via email to