From: tobias@gambas-buch.de (Tobias Boege)
To: kernelnewbies@lists.kernelnewbies.org
Subject: do_initcalls
Date: Tue, 19 Mar 2013 22:26:09 +0100 [thread overview]
Message-ID: <20130319212609.GE1457@aurora> (raw)
In-Reply-To: <20130319013159.GA25595@debian.localdomain>
On Tue, 19 Mar 2013, ishare wrote:
> > /**
> > * module_init() - driver initialization entry point
> > * @x: function to be run at kernel boot time or module insertion
> > *
> > * module_init() will either be called during do_initcalls() (if
> > * builtin) or at module insertion time (if a module). There can only
> > * be one per module.
> > */
>
> Does this mean it chould not be called during do_initcalls if I config it as a module ?
>
do_initcalls() is done at boot time. If you insert a module into the running
kernel, how could its init function be called at boot time?
> If this ,how to change it to be builtin module?
>
Whether it is compiled as a module or not is a configuration issue. (Please,
CMIIW).
> what is called module insertion time? Is that time I explicitely call some insert function?
>
I hope I got your question right (no, I hope I didn't but anyway here's my
answer to it): module insertion time is precisely the time a module is
inserted. You'd normally use modprobe or suchlike for this task.
As the comment above states, the function registered via module_init() is
called by the kernel's dynamic linker at this point.
I suggest to afford some of the well-known books on the Linux kernel. I
believe you can't avoid to do so when trying around with the kernel.
Regards,
Tobi
prev parent reply other threads:[~2013-03-19 21:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-17 14:41 do_initcalls ishare
2013-03-17 15:11 ` do_initcalls Tobias Boege
2013-03-18 1:10 ` do_initcalls ishare
2013-03-18 16:35 ` do_initcalls Tobias Boege
2013-03-19 1:31 ` do_initcalls ishare
2013-03-19 21:26 ` Tobias Boege [this message]
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=20130319212609.GE1457@aurora \
--to=tobias@gambas-buch.de \
--cc=kernelnewbies@lists.kernelnewbies.org \
/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;
as well as URLs for NNTP newsgroup(s).