[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: [LI] Hiding LKM's -- Beta-test



On Tue, Jan 18, 2000 at 09:00:59AM -0800, Arun Sharma wrote:
> In other words, you just want to grab the first argument to the system
> call.

Thanks a lot for replying.
But, I have a doubt. The init_module() in my module would not be called by
a glibc call (or would it). When I load my module, sys_init_module 
(the system call) would be called which in turn may check my module for 
accessibility and other errors before calling my init_module through the
(struct module) { from /usr/src/linux/kernel/module.c -- ver 2.2.13 } by 
the foll. lines

<quote>
        /* Initialize the module.  */
        atomic_set(&mod->uc.usecount,1);
        if (mod->init && mod->init() != 0) {
                atomic_set(&mod->uc.usecount,0);
                error = -EBUSY;
                goto err0;
        }
</quote>

Isnt the mod->init() call being done in kernel space, and would glibc be
involved here?

When the "mod->init()" is called, in the x86 arch., the value of "mod"
happens to be in the EBX register (is this guaranteed?). Where would
this value lie in other architectures.

Also, the value of "mod" seems to have existed in EBX for the 
older kernels also (that is what some documents suggest). So, there might 
be a fixed register for other arch. also.

--vml
Model Engg. College,
Cochin

--------------------------------------------------------------------
The Linux India Mailing List Archives are now available.  Please search
the archive at http://lists.linux-india.org/ before posting your question
to avoid repetition and save bandwidth.