On Wednesday 21 February 2007 15:36, Baruch Even wrote:
> > kprobe is what i was looking for. Actually, jprobe so i cal also view the
> > function parameters i am attaching to. The problem is that kprobe does
> > not appear on the uml(user mode linux) list in menuconfig which probably
> > means it is not supported there. -> i need to compile a real kernel or
> > use vmware or something like that. I prefer to continue to use uml.
> > Let's say i do wish to change the kernel code. How do i add a code that
> > will refer to my module once it is loaded? I.e. i wish to add a stub in
> > that function in the kernel that will call a function in my module if it
> > is up.
>
> The way to do it is hard and fraught with peril, it will require
> assembly programming which I'm not sure I'll be able to do myself, but
> can try to pass the idea.
>
> What you need is to put a trampoline of sorts at the start of the
> function, this is similar to what kprobe does, the difference would be
> that kprobe places an int3 and you'll need to place a direct call to
> your replacing method. At the end of your function you need to call the
> original method, either bby temporarily restoring the original location
> or by copying it to another place and running it there.
>
> I think it will be easier to run under qemu/kvm than do this.

I think you misunderstood me. I did not mean something fancy like that. What i 
meant was that for this point of time i do wish to change the kernel code. 
I.e. there is no need to hack like kprobe. I just want to call my function in 
my module from the kernel function. I.e. something like:
kernel_func(parms...){
...
  If (my_module is in memory){
    my_module->my_func(params...);
  }
...
}

Later, after some dev time, for the non uml kernel, i will use kprobe tactics.

>
> Baruch

-- 
Regards,
        Tzahi.
--
Tzahi Fadida
Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info
WARNING TO SPAMMERS:  see at 
http://members.lycos.co.uk/my2nis/spamwarning.html

================================================================To unsubscribe, 
send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to