From owner-freebsd-emulation Tue Nov 21 7:43:22 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 116EB37B4D7; Tue, 21 Nov 2000 07:43:15 -0800 (PST) Received: (from dan@localhost) by dan.emsphone.com (8.11.1/8.11.1) id eALFhDJ18349; Tue, 21 Nov 2000 09:43:13 -0600 (CST) (envelope-from dan) Date: Tue, 21 Nov 2000 09:43:13 -0600 From: Dan Nelson To: "Walter C. Pelissero" Cc: emulation@freebsd.org Subject: Re: SVR4 missing syscall Message-ID: <20001121094313.A1118@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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.11i In-Reply-To: <14874.23121.801503.448167@hyde.lpds.sublink.org>; from "Walter C. Pelissero" on Tue Nov 21 11:19:45 GMT 2000 X-OS: FreeBSD 5.0-CURRENT Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Followups to -emulation, please In the last episode (Nov 21), Walter C. Pelissero said: > Dan Nelson writes: > > In the last episode (Nov 20), Walter C. Pelissero said: > > > I'm trying to run a SCO SVR4 executable on FreeBSD but I get a > > > SIGSYS (invalid system call) at the very beginning. Here is the > > > kdump: > > > > > > 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. > Is there any doc that can help me hacking this syscall into the ibcs2 > emulator? > > > You can add hooks from the svr4 emulation code back to the ibcs2 > > code, but the svr4 module was really written for Solaris x86 > > instead of SCO. You'll have to make a lot of changes to get SCO > > binaries to run under it. I tried to get an SCO SVR4 binary to > > work about 6 months ago but gave up and simply got the vendor to > > send me a Linux binary instead. Runs fine under the Linuxulator :) > > Are you telling me that the IBCS emulator is not really working? > Unfortunately I can't ask for a Linux version. Have you ever had a > look at the NetBSD one? Is it usable? If you have access to NetBSD binaries, get them. FreeBSD should be able to run static NetBSD, OpenBSD, and BSD/OS binaries natively; no emulation layer required. The iBCS2 emulator works great; I've run all sorts of SCO 3.2v4.2 binaries on FreeBSD with it. Your problem is that SCO 5.* doesn't use iBCS2 anymore; it uses svr4 binaries. Even more of a problem is that SCO binaries rely heavily on old SCO syscalls. You end up having to link in the whole iBCS2 module, AND recode a bunch of syscalls that are different between Solaris and SCO (since our svr4 emulator was written for Solaris). And you have to do all of this in the dark because SCO doesn't release any information about their kernel. I couldn't even find a list of syscalls and their arguments. I had to grep through include files and try and reverse-engineer everything. If you want more background, take a look at the thread starting at http://www.freebsd.org/cgi/getmsg.cgi?fetch=28280+0+/usr/local/www/db/text/1999/freebsd-emulation/19990509.freebsd-emulation I have patches for a June 30 -current that implement enough SCO stuff to make /bin/sh work (but /bin/ls dies), if you're interested. -- Dan Nelson dnelson@emsphone.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message