gabriel rosenkoetter on Thu, 11 Apr 2002 01:54:54 -0400


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Re: GUI Mail? In UNIX?!?


On Thu, Apr 11, 2002 at 12:56:44AM -0400, kevin mudrick wrote:
> NetBSD has some sort of compatibility layer to allow native linux apps to
> run on it?  Neat!  Are you going to talk about this at your presentation?
> Or am I mistaken here?

You're not misunderstanding, and I'll be glad to talk about it next
Thursday. (Any other requests? Haven't written up my notes yet...)

As of some 2.2 Linux kernel, NetBSD/i386 emulation of Linux apps
had them running faster than Linux (all we do is emulate the
syscalls, it's pretty simple, conceptually). Don't know whether
that's still true (or whether it was ever more than negligible).

Incidentally, Linux isn't the only binary file format for which
the i386 port of NetBSD has binary emulation. This is better referred
to as binary compatibility, really (since it's not like the binaries
are running under any kind of virtual machine, just that the syscalls
are emulated). NetBSD's ld actually handles all binaries as a COMPAT
function in the kernel (including NetBSD ELF binaries, which are
what we install by default on most ports these days).

Here's the list straight from the i386 GENERIC kernel config (comment
characters mean exactly what you think they do):

options         COMPAT_NOMID    # compatibility with 386BSD, BSDI, NetBSD 0.8,
options         COMPAT_09       # NetBSD 0.9,
options         COMPAT_10       # NetBSD 1.0,
options         COMPAT_11       # NetBSD 1.1,
options         COMPAT_12       # NetBSD 1.2,
options         COMPAT_13       # NetBSD 1.3,
options         COMPAT_14       # NetBSD 1.4,
options         COMPAT_15       # NetBSD 1.5,
options         COMPAT_43       # and 4.3BSD
options         COMPAT_SVR4     # binary compatibility with SVR4
options         COMPAT_IBCS2    # binary compatibility with SCO and ISC
options         COMPAT_LINUX    # binary compatibility with Linux
options         COMPAT_FREEBSD  # binary compatibility with FreeBSD
#options        COMPAT_MACH     # binary compatibility with Mach binaries
#options        COMPAT_PECOFF   # kernel support to run Win32 apps

The MACH and PECOFF stuff may not work perfectly without a little
haggling. (WINE on NetBSD makes use of COMPAT_PECOFF, last I
checked, and it only works about as well as WINE does anywhere.)

Note that the list on other ports is significantly shorter... macppc
only has Linux compatibility, and it was imperfect last time I
tried; sparc has SunOS 4.x and SunOS 5.x (Solaris); sparc64
(UltraSparc processors) has 32-bit (but not 64-bit) SunOS 5.x. (We
lack 64-bit Solaris compatibility because it's actually pretty hard
to come by 64-bit binaries for Solaris. gcc can't make them, and
only a couple of the binaries Sun ships are actually 64-bit. Things
like Oracle 9i are... but they're kind of expensive and rather
complex to use to test syscall emulation.)

Not sure if ports like next68k have any at all (though it'd be
pretty cool if it did, since NeXTStep's Display PostScript stuff
really rocks).

Getting, perhaps, ahead of myself here...

-- 
gabriel rosenkoetter
gr@eclipsed.net

Attachment: pgpa3a24CKHU5.pgp
Description: PGP signature