Subject: Re: x.out Xenix 286 binary emulation?
To: Scott Bartram <scottb@orionsoft.com>
From: Greg A. Woods <woods@weird.com>
List: tech-kern
Date: 01/06/2001 02:27:07
[ On Friday, January 5, 2001 at 12:22:17 (-0500), Scott Bartram wrote: ]
> Subject: Re: x.out Xenix 286 binary emulation?
>
> Todd Vierling wrote:
> > 
> > On Fri, 5 Jan 2001, David Maxwell wrote:
> > 
> > : I thought I had asked this before, but I can't find it in the
> > : archives.
> > :
> > : Does anyone have any thoughts on support in binary emulation
> > : for Xenix286 x.out binaries?
> > 
> > Isn't Xenix simply an offshoot of SIII (or was it SVR2)?  This should be
> > pretty easy to do so long as the trap mechanism is there.  Xenix had a very
> > minimal number of useful syscalls....
> 
> It's already there in the COMPAT_IBCS2 code although it may not be
> 100% complete. Back around the 1.3 days, I fixed a bug for someone
> running some old Xenix binaries for which the source was lost.

For Xenix *286*?

Xenix286 predates IBCS2 by a long while and I doubt the IBCS authors
spent much time considering it since they were far more interested in
"modern" SysV/386 at that time (certainly for version 2!).

In any case it seems from sys/compat/ibcs2_exec.h that the only struct
xexec x_cpu flag that's currently defined is XC_386, and the code
currently says:

        if ((xp->x_magic != XOUT_MAGIC) || (xp->x_cpu != XC_386))
                return ENOEXEC;

Note that Xenix286 binaries used either near or far pointers or
sometimes a mix (and with the default Microsoft compiler you always used
near pointers if you could possibly manage to since there was at least a
50% performance penalty for any pointer-intensive operations otherwise).
I suspect this would make the code impossible to execute on an IA-32
class machine in any direct fashion (though I seem to remember that once
upon a time there was some kind of 286 compatability mode in the 386).

-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods@acm.org>      <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>