Subject: Re: "real" OpenBSD compat - how hard would it be?
To: Jason Thorpe <thorpej@wasabisystems.com>
From: Alaric B. Snell <alaric@alaric-snell.com>
List: port-i386
Date: 03/20/2003 11:38:24
On Thursday 20 March 2003 01:05, Jason Thorpe wrote:
> On Wednesday, March 19, 2003, at 08:36  AM, Urban Boquist wrote:
> > So, it seems that the days when you could just take any OpenBSD (i386)
> > binary and run it on NetBSD (i386) and it would Just Work are
> > definitely over.
> >
> > Does anyone have any idea on how much work a real kernel level
> > compat/openbsd would be?
>
> Hard, because OpenBSD, in their infinite wisdom, decided to not change
> their a.out magic number when they began to diverge.  There is no way
> to tell an OpenBSD a.out binary from a NetBSD a.out binary.

Can we ask 'em to fix this?

A suggested minimum-disruption approach could be:

1) Make their kernel start accepting both the NetBSD magic number and the new 
OpenBSD magic number for executables

2) Wait a couple of revisions for it to settle in

3) Make their compilers output code with OpenBSD magic numbers

3a) We start using the OpenBSD magic number engage OpenBSD emulation mode

4) Maybe, after a while, make their kernel stop accepting the NetBSD one as 
an OpenBSD binary and either complain or invoke NetBSD emulation

As an interim fix for us, how about a version of exec() that accepts a 
parameter telling which emulation to use, regardless of magic numbers in 
binaries? Then you can write a little tool that accepts a platform name and a 
command line, and executes that command with the chosen emulation, enabling 
one to put wrapper scripts around current OpenBSD binaries.

Or a tool to patch an OpenBSD executable to mark it as not being NetBSD any 
more by poking the magic number...

ABS

>          -- Jason R. Thorpe <thorpej@wasabisystems.com>

-- 
A city is like a large, complex, rabbit
 - ARP