mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* System calls effect after booting phase ??
@ 2004-12-29 11:25 selvakumar nagendran
  2004-12-29 12:05 ` Valdis.Kletnieks
  0 siblings, 1 reply; 4+ messages in thread
From: selvakumar nagendran @ 2004-12-29 11:25 UTC (permalink / raw)
  To: linux-kernel

Hi,
  I intercepted a few system calls pertaining to file
operations like open,close,pipe etc. Now, I
implemented this stuff in a loadable kernel module. I
am collecting some data from it like which process
currently access a pipe,file etc. I have displayed
them using printk. 
  Now, I want to store them in a table. But I want
this operation to be started right after the initial
booting phase itself part of the loading kernel
itself. What should I do to add my module into the
already compiled kernel image just like a standard
kernel module?

Thanks,
selva

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: System calls effect after booting phase ??
  2004-12-29 11:25 System calls effect after booting phase ?? selvakumar nagendran
@ 2004-12-29 12:05 ` Valdis.Kletnieks
  2004-12-30  4:11   ` Re : " selvakumar nagendran
  2005-01-21  4:28   ` selvakumar nagendran
  0 siblings, 2 replies; 4+ messages in thread
From: Valdis.Kletnieks @ 2004-12-29 12:05 UTC (permalink / raw)
  To: selvakumar nagendran; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

On Wed, 29 Dec 2004 03:25:10 PST, selvakumar nagendran said:

>   Now, I want to store them in a table. But I want
> this operation to be started right after the initial
> booting phase itself part of the loading kernel
> itself. What should I do to add my module into the
> already compiled kernel image just like a standard
> kernel module?

Possibility 1:
Load them from an initrd image while booting.  If you're already
using an initrd, and this is "early enough", you just need to put the
module into the initrd, and make sure the /linuxrc or whatever script
does an insmod for it.  This has the advantage of working for out-of-tree
modules.

Possibility 2:
Build them into the kernel.  For in-tree modules, this is done with
a bit of Kconfig/Makefile magic. In the Kconfig file, you can define
a CONFIG_FOO variable, and then in the Makefile, do this:

obj-$(CONFIG_FOO) += foo.o

So if CONFIG_FOO is set to 'y' (build into kernel), it gets
added to the obj-y target list and then linked in.  If it's set to
'm' (module) or 'n' (don't build at all), it's added to the obj-m or obj-n
targets, which then aren't linked into the kernel.

Not sure how you'd go about building an out-of-tree module into the kernel,
or if that's even supposed to be possible...

[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re : Re: System calls effect after booting phase ??
  2004-12-29 12:05 ` Valdis.Kletnieks
@ 2004-12-30  4:11   ` selvakumar nagendran
  2005-01-21  4:28   ` selvakumar nagendran
  1 sibling, 0 replies; 4+ messages in thread
From: selvakumar nagendran @ 2004-12-30  4:11 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: linux-kernel

Thank u for the help,
 
     In the kconfig.tk file, under which section
should we add the line CONFIG_FOO. Will u plz
elaborate the process?

Thanks,
selva

--- Valdis.Kletnieks@vt.edu wrote:

> On Wed, 29 Dec 2004 03:25:10 PST, selvakumar
> nagendran said:
> 
> >   Now, I want to store them in a table. But I want
> > this operation to be started right after the
> initial
> > booting phase itself part of the loading kernel
> > itself. What should I do to add my module into the
> > already compiled kernel image just like a standard
> > kernel module?
> 
> Possibility 1:
> Load them from an initrd image while booting.  If
> you're already
> using an initrd, and this is "early enough", you
> just need to put the
> module into the initrd, and make sure the /linuxrc
> or whatever script
> does an insmod for it.  This has the advantage of
> working for out-of-tree
> modules.
> 
> Possibility 2:
> Build them into the kernel.  For in-tree modules,
> this is done with
> a bit of Kconfig/Makefile magic. In the Kconfig
> file, you can define
> a CONFIG_FOO variable, and then in the Makefile, do
> this:
> 
> obj-$(CONFIG_FOO) += foo.o
> 
> So if CONFIG_FOO is set to 'y' (build into kernel),
> it gets
> added to the obj-y target list and then linked in. 
> If it's set to
> 'm' (module) or 'n' (don't build at all), it's added
> to the obj-m or obj-n
> targets, which then aren't linked into the kernel.
> 
> Not sure how you'd go about building an out-of-tree
> module into the kernel,
> or if that's even supposed to be possible...
> 

> ATTACHMENT part 2 application/pgp-signature 




		
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* System calls effect after booting phase ??
  2004-12-29 12:05 ` Valdis.Kletnieks
  2004-12-30  4:11   ` Re : " selvakumar nagendran
@ 2005-01-21  4:28   ` selvakumar nagendran
  1 sibling, 0 replies; 4+ messages in thread
From: selvakumar nagendran @ 2005-01-21  4:28 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: linux-kernel

--- Valdis.Kletnieks@vt.edu wrote:

> Possibility 1:
> Load them from an initrd image while booting.  If
> you're already
> using an initrd, and this is "early enough", you
> just need to put the
> module into the initrd, and make sure the /linuxrc
> or whatever script
> does an insmod for it.  This has the advantage of
> working for out-of-tree
> modules.

 Now, I am using an initrd image. How can I load my
module there? In which file, should I insert the
corresponding line? Can u tell me more regarding this
on how to do it? I am using kernel 2.4.28. should I
have to recompile the whole kernel once again? 

Thanks,
selva




		
__________________________________ 
Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 
http://my.yahoo.com 
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-01-21  4:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-29 11:25 System calls effect after booting phase ?? selvakumar nagendran
2004-12-29 12:05 ` Valdis.Kletnieks
2004-12-30  4:11   ` Re : " selvakumar nagendran
2005-01-21  4:28   ` selvakumar nagendran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®