Re: implementing linux mmap2 syscall

2002-04-24 Thread Kenneth Culver
Alright, so I got tired of trying to figure out if glibc is doing something wierd or wrong so I downloaded the source for it, and I'm looking at it now... (for version 2.2.2 which is what we have on FreeBSD's linux_base-7) and here's what I'm seeing: pushl %ebp pushl %ebx pushl %e

Re: implementing linux mmap2 syscall

2002-04-24 Thread Kenneth Culver
> yeah, I did that already, and have been running with that since yesterday > :-P > > still not working right though... I think it has something to do with that > nargs thing... I'm checking that out now... > Ehh, apparently sy_narg is getting set correctly too: struct linux_mmap2_args {

Re: implementing linux mmap2 syscall

2002-04-24 Thread Peter Wemm
Kenneth Culver wrote: > > > > Brandon S Allbery KF8NH writes: > > > On Wed, 2002-04-24 at 10:41, Andrew Gallatin wrote: > > > > Maybe the argument isn't where you expect it to be, but is there. > > > > Can you make a test program which calls mmap2 with its 6th arg as > > > > something unique l

Re: implementing linux mmap2 syscall

2002-04-24 Thread Kenneth Culver
> RCS file: /home/ncvs/src/sys/i386/linux/linux_sysvec.c,v > retrieving revision 1.99 > diff -u -2 -r1.99 linux_sysvec.c > --- linux_sysvec.c 4 Apr 2002 17:49:46 - 1.99 > +++ linux_sysvec.c 24 Apr 2002 23:57:23 - > @@ -711,4 +711,5 @@ > args[3] = tf->tf_esi; >

Re: implementing linux mmap2 syscall

2002-04-24 Thread Kenneth Culver
> Here's where it happens: > sys/i386/linux/linux_sysvec.c > > 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; >

Re: implementing linux mmap2 syscall

2002-04-24 Thread Peter Wemm
Kenneth Culver wrote: > > I'm actually still not seeing a match between what's in truss, and what's > > in my printed-out args, but it seems to be working anyway... > > > Argh, it's not working again... It was working on an install of ms office, > but it won't work on some old windows game.. (win

Re: implementing linux mmap2 syscall

2002-04-24 Thread Kenneth Culver
> I'm actually still not seeing a match between what's in truss, and what's > in my printed-out args, but it seems to be working anyway... > Argh, it's not working again... It was working on an install of ms office, but it won't work on some old windows game.. (winex) and it's still not setting t

Re: implementing linux mmap2 syscall

2002-04-24 Thread Kenneth Culver
> > > libc sets it before it enters the kernel. Then on kernel entry we save > > > ebp in the trapframe. > > > > So in the case of linux emulation, the glibc that we're using in the > > linux-ulator isn't setting it properly? I'm using the linux_base-7 port > > for this, so as far as I can tell,

Re: implementing linux mmap2 syscall

2002-04-24 Thread Kenneth Culver
> > libc sets it before it enters the kernel. Then on kernel entry we save > > ebp in the trapframe. > > So in the case of linux emulation, the glibc that we're using in the > linux-ulator isn't setting it properly? I'm using the linux_base-7 port > for this, so as far as I can tell, it should wo

Re: implementing linux mmap2 syscall

2002-04-24 Thread John Baldwin
On 24-Apr-2002 Kenneth Culver wrote: >> >> Brandon S Allbery KF8NH writes: >> > On Wed, 2002-04-24 at 10:41, Andrew Gallatin wrote: >> > > Maybe the argument isn't where you expect it to be, but is there. >> > > Can you make a test program which calls mmap2 with its 6th arg as >> > > somethin

Re: implementing linux mmap2 syscall

2002-04-24 Thread John Baldwin
On 24-Apr-2002 Kenneth Culver wrote: >> libc sets it before it enters the kernel. Then on kernel entry we save >> ebp in the trapframe. > > So in the case of linux emulation, the glibc that we're using in the > linux-ulator isn't setting it properly? I'm using the linux_base-7 port > for this,

Re: implementing linux mmap2 syscall

2002-04-24 Thread Kenneth Culver
> libc sets it before it enters the kernel. Then on kernel entry we save > ebp in the trapframe. So in the case of linux emulation, the glibc that we're using in the linux-ulator isn't setting it properly? I'm using the linux_base-7 port for this, so as far as I can tell, it should work... assum

Re: implementing linux mmap2 syscall

2002-04-24 Thread Kenneth Culver
> > Brandon S Allbery KF8NH writes: > > On Wed, 2002-04-24 at 10:41, Andrew Gallatin wrote: > > > Maybe the argument isn't where you expect it to be, but is there. > > > Can you make a test program which calls mmap2 with its 6th arg as > > > something unique like 0xdeadbeef? Then print out (i

Re: implementing linux mmap2 syscall

2002-04-24 Thread Kenneth Culver
I tried printing out everything in the trapframe in hex and nothing looke remotely right. Ken On 24 Apr 2002, Brandon S Allbery KF8NH wrote: > On Wed, 2002-04-24 at 10:41, Andrew Gallatin wrote: > > Maybe the argument isn't where you expect it to be, but is there. > > Can you make a test progra

Re: implementing linux mmap2 syscall

2002-04-24 Thread Andrew Gallatin
Brandon S Allbery KF8NH writes: > On Wed, 2002-04-24 at 10:41, Andrew Gallatin wrote: > > Maybe the argument isn't where you expect it to be, but is there. > > Can you make a test program which calls mmap2 with its 6th arg as > > something unique like 0xdeadbeef? Then print out (in hex :) th

Re: implementing linux mmap2 syscall

2002-04-24 Thread Brandon S Allbery KF8NH
On Wed, 2002-04-24 at 10:41, Andrew Gallatin wrote: > Maybe the argument isn't where you expect it to be, but is there. > Can you make a test program which calls mmap2 with its 6th arg as > something unique like 0xdeadbeef? Then print out (in hex :) the trapframe > from the linux prepsyscall rout

Re: implementing linux mmap2 syscall

2002-04-24 Thread Andrew Gallatin
Kenneth Culver writes: > 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) <...> > Does anyone who actually knows assembly have any ideas? This is the linux sigtramp

Re: implementing linux mmap2 syscall

2002-04-23 Thread Kenneth Culver
> 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] =

Re: implementing linux mmap2 syscall

2002-04-23 Thread Kenneth Culver
> > > > 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 corre