public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Love <rml@tech9.net>
To: Raghava Raju <vraghava_raju@yahoo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Basic question..
Date: 01 Aug 2001 17:04:51 -0400	[thread overview]
Message-ID: <996699893.1420.7.camel@phantasy> (raw)
In-Reply-To: <20010801204401.21619.qmail@web20009.mail.yahoo.com>
In-Reply-To: <20010801204401.21619.qmail@web20009.mail.yahoo.com>

On 01 Aug 2001 13:44:01 -0700, Raghava Raju wrote:
>         I am new to kernel programming. I have
>    just written a module consisting of init and
> cleanup
>    functions. I call init function of the module in
>    kernel initialization function. So when system
>    comes up, it shows that it entered module init 
>    function(printk in "init" print some string), but 
>    when I do lsmod it is not there in  list of 
>    modules. But if I do insmod module, the module is
>    listed in lsmod output. So is it that calling init
>    module and insmod are not equivalent?

this is correct. calling the init function from within the kernel is not
the same as using insmod.  calling the init function is just that --
calling some linked-in function from within the kernel.

if you want to load a module from within the kernel, what you want is:
#include<linux/kmod.h>
int request_module(const char * module_name);

you will need kmod compiled in.

however, i suppose this is not what you want.  if you want to load your
code into the kernel -- statically linked -- then its not a module.  its
a member of the kernel.  have fun, enjoy the place.

if you want it to be a module, then its seperate, and you should load it
via insmod/modprobe/kmod.

-- 
Robert M. Love
rml at ufl.edu
rml at tech9.net


  parent reply	other threads:[~2001-08-01 21:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-01 20:44 Basic question Raghava Raju
2001-08-01 20:55 ` Richard B. Johnson
2001-08-01 21:04 ` Robert Love [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-07-16  1:08 nejhdeh
2002-07-16 12:47 ` Erik Mouw
2002-07-18 22:31 nejhdeh
2002-07-25 12:53 ` Bill Davidsen
2002-08-23  1:44 ` nejhdeh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=996699893.1420.7.camel@phantasy \
    --to=rml@tech9.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vraghava_raju@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox