Date: Wed, 24 Apr 2002 09:41:28 -0400 (EDT) From: Andrew Gallatin <gallatin@cs.duke.edu> To: Kenneth Culver <culverk@alpha.yumyumyum.org> Cc: freebsd-hackers@freebsd.org, <freebsd-current@freebsd.org> Subject: Re: implementing linux mmap2 syscall Message-ID: <15558.46600.351433.784766@grasshopper.cs.duke.edu> In-Reply-To: <20020423181748.W31638-100000@alpha.yumyumyum.org> References: <15557.27747.802212.659760@grasshopper.cs.duke.edu> <20020423181748.W31638-100000@alpha.yumyumyum.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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, or signal trampoline. It is used to wrap a signal handler. Eg, the kernel "calls" it (by returning to it) when it delivers a signal. It calls the apps signal handler. When the handler returns, it calls the linux sigreturn system call. This has essentially nothing to do with system calls. The system call entry point on x86 is int0x80_syscall, which is labled: /* * Call gate entry for FreeBSD ELF and Linux/NetBSD syscall (int 0x80) <..> This then calls syscall2(), which calls the linux prepsyscall. 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 routine & see if you can find the deadbeef. Drew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15558.46600.351433.784766>