Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Apr 1999 19:25:29 +0930 (CST)
From:      Mark Newton <newton@atdot.dotat.org>
To:        freebsd-svr4@atdot.dotat.org
Cc:        freebsd-emulation@freebsd.org
Subject:   Re: [freebsd-svr4] Anyone working on SCO ELF binary emulation?
Message-ID:  <199904260955.TAA21511@atdot.dotat.org>
In-Reply-To: <19990424231519.A25153@dan.emsphone.com> from "Dan Nelson" at Apr 24, 99 11:15:20 pm

next in thread | previous in thread | raw e-mail | index | archive | help
Dan Nelson wrote:

 > I have the duty of making the latest MicroFocus COBOL compiler run
 > on FreeBSD, and was wondering if anyone has had any luck getting
 > SCO/ELF binaries to run under emulation on -current. 

Yup, in certain limited cases.  It still needs work, though.  Interested
in helping out? :-)

 > MicroFocus has
 > binaries for SCO 3.2v4.2 which I'm sure will work, but I wanted to see
 > how hard it would be to get the current 5.0.4 binaries to work on BSD.
 > What I've done so far is just made the xenix syscall jump into the ibcs
 > xenix code, since even the latest SCO binaries want to call obsolete
 > xenix syscalls.  /bin/sh works, almost.  The COBOL installer program
 > runs until it tries to execute the 'pwd' command.  It segfaults after
 > doing an fstat on ".."
 >   6068 sh       CALL  svr4_sys_open(0xbfbfd1a9,0x80,0x280ac28c)
 >   6068 sh       NAMI  ".."
 >   6068 sh       RET   svr4_sys_open 3
 >   6068 sh       CALL  svr4_sys_fcntl(0x3,0x2,0x1)
 >   6068 sh       RET   svr4_sys_fcntl 0
 >   6068 sh       CALL  svr4_sys_fstat(0x3,0xbfbfc960)
 >   6068 sh       RET   svr4_sys_fstat 0
 >   6068 sh       PSIG  SIGSEGV caught handler=0x804b220 mask=0x0 code=0xc

Hang on, are we talking about xenix or SCO here?  Your ktrace output
includes svr4_sys_* routines (which come from the ELF svr4 emulator),
but you're talking about ibcs2 stuff above.

 > Right at the start of the program's execution, it makes a sysarch()
 > syscall with subfunction 114. 

Most SysVR4 programs do something similar.  I think it's actually ld.so.1
that's doing it.

 > SCO's documentation lists it as
 > SI86GETFEATURES, but of course doesn't say what the arguments are, or
 > what I should be returning.  My guess is that my failure to return
 > valid info for this syscall is what's making 'pwd' fail.

Doubtful.  FreeBSD's emulation should work in total ignorance of
what sysarch() returns (although sysarch() is emulated, so if that
isn't the case then values can be fudged which stop executables
from crashing).

 > With the lack of documenation SCO provides, I'm surprised the ibcs/coff
 > emulation code got wirrten at all.

Tell me about it.  SysVR4 ELF is only marginally better.

   - mark

--------------------------------------------------------------------
I tried an internal modem,                    newton@atdot.dotat.org
     but it hurt when I walked.                          Mark Newton
----- Voice: +61-4-1620-2223 ------------- Fax: +61-8-82231777 -----


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-emulation" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199904260955.TAA21511>