> Kenneth Culver writes:
>  > OK, I found another problem, here it is:
>  >
>  > static void
>  > linux_prepsyscall(struct trapframe *tf, int *args, u_int *code, caddr_t
>  > *params)
>  > {
>  >    args[0] = tf->tf_ebx;
>  >    args[1] = tf->tf_ecx;
>  >    args[2] = tf->tf_edx;
>  >    args[3] = tf->tf_esi;
>  >    args[4] = tf->tf_edi;
>  >    *params = NULL;         /* no copyin */
>  > }
>  >
>  > Basically, linux_mmap2 takes 6 args, and this looks here like only 5 args are
>  > making it in... I checked this because the sixth argument to linux_mmap2() in
>  > truss was showing 0x6, but when I printed out that arg from the kernel, it
>  > was showing 0x0. Am I correct here?
>  >
>  > Ken
>
> Yes.  According to http://john.fremlin.de/linux/asm/, linux used to
> parse only 5 args but now it parses six.  Try adding:
>         args[5] = tf->tf_ebp;
>
> Drew
>
>
OK, I THINK I found what calls the actual kernel syscall handler, and
sets it's args first, but I'm not sure:

from linux_locore.s

NON_GPROF_ENTRY(linux_sigcode)
        call    *LINUX_SIGF_HANDLER(%esp)
        leal    LINUX_SIGF_SC(%esp),%ebx        /* linux scp */
        movl    LINUX_SC_GS(%ebx),%gs
        movl    %esp, %ebx                      /* pass sigframe */
        push    %eax                            /* fake ret addr */
        movl    $LINUX_SYS_linux_sigreturn,%eax /* linux_sigreturn() */
        int     $0x80                           /* enter kernel with args
*/
0:      jmp     0b
        ALIGN_TEXT

I think the stuff above copies the args, and whatnot, but I'm not really
sure where it does this exactly...

It calls LINUX_SIGF_HANDLER, which then calls %esp's sf_handler function.
That is where I draw a blank, I don't know which function this is calling,
and can't find where it's being set. I think this might be what I want to
change though. :-P

Does anyone who actually knows assembly have any ideas?

Ken


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to