From owner-freebsd-emulation Tue Nov 21 7:53:28 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (Postfix) with ESMTP id E061337B4C5 for ; Tue, 21 Nov 2000 07:53:25 -0800 (PST) Received: (from dan@localhost) by dan.emsphone.com (8.11.1/8.11.1) id eALFrNT29450; Tue, 21 Nov 2000 09:53:23 -0600 (CST) (envelope-from dan) Date: Tue, 21 Nov 2000 09:53:23 -0600 From: Dan Nelson To: "Walter C. Pelissero" Cc: emulation@FreeBSD.ORG Subject: Re: SVR4 missing syscall Message-ID: <20001121095323.A23358@dan.emsphone.com> References: <14873.23011.159826.718978@hyde.lpds.sublink.org> <20001120130301.A10520@dan.emsphone.com> <14874.23121.801503.448167@hyde.lpds.sublink.org> <20001121094313.A1118@dan.emsphone.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.11i In-Reply-To: <20001121094313.A1118@dan.emsphone.com>; from "Dan Nelson" on Tue Nov 21 09:43:13 GMT 2000 X-OS: FreeBSD 5.0-CURRENT Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org In the last episode (Nov 21), Dan Nelson said: > In the last episode (Nov 21), Walter C. Pelissero said: > > Dan Nelson writes: > > > In the last episode (Nov 20), Walter C. Pelissero said: > > > > Which call is it about? I see an "old.lstat" but I couldn't > > > > find any reference in the kernel source tree. Is there any doc > > > > I could read to see if I can hack this syscall in the emulator? > > > > > > old.lstat is syscall #40, which is the ibcs2_xenix syscall on SCO. > > > > May I ask you where you got this information from? I was grep-ing > > around in the kernel source tree but I couldn't figure out that > > this old.lstat is syscall #40, let alone that it was a Xenix > > syscall. > > Take a look at /sys/kern/syscalls.master. Any syscall with the word > "old" in it has been phased out and gets a COMPAT flag. So you would > look for a "COMPAT ... lstat" line, which happens to be #40. Oops; I only half-finished the explanation. Now that you know it's syscall #40, you then have to look up syscall #40 in /sys/compat/svr4/syscalls.master . It reads "40 UNIMPL SVR4 xenix". Your next step is to check the iBCS2 code to see if IT has implemented syscall 40. /sys/i386/ibcs2/syscalls.master lists syscall 40 as 40 STD SCO { int ibcs2_xenix(int a1, int a2, int a3, int a4, int a5); } Bingo. Copy that line over to the svr4 syscalls.master file, tweak some other files to make the ibcs2_xenix function visible to the svr4 module, make svr4 depend on ibcs2, and you're done. With that syscall. Now run your program again, and figure out what makes it crash now :). -- Dan Nelson dnelson@emsphone.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message