*BSD News Article 34611


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!munnari.oz.au!constellation!news.uoknor.edu!ns1.nodak.edu!netnews.nwnet.net!news.clark.edu!spool.mu.edu!howland.reston.ans.net!europa.eng.gtefsd.com!newsxfer.itd.umich.edu!nntp.cs.ubc.ca!torn!uunet.ca!uunet.ca!fw.novatel.ca!sidney.novatel.ca!hpeyerl
From: hpeyerl@sidney.novatel.ca (Herb Peyerl)
Newsgroups: comp.os.386bsd.misc
Subject: Re: Barriers to NetBSD/FreeBSD binary compatibility?
Date: 18 Aug 1994 13:44:40 GMT
Organization: NovAtel Communications Ltd.
Lines: 59
Message-ID: <32vok8$kab@fw.novatel.ca>
References: <32okpu$17u@spool.cs.wisc.edu>
NNTP-Posting-Host: sidney.novatel.ca
X-Newsreader: TIN [version 1.2 PL1]

Jon Cargille (jcargill@grilled.cs.wisc.edu) wrote:

: Can someone outline the reasons behind the lack of binary
: compatibility between NetBSD and FreeBSD?

: The "ports" collection for FreeBSD is very nice, but I've heard that
: they won't run for NetBSD users.

Hi Jon;

this is what I discovered after playing with some of the things on the
CDROM.

First; the thing that keeps NetBSD from actaully recognizing FreeBSD
binaries is the fact that NetBSD switched to having the a_midmag flag
in network-byte-order: (from <sys/exec_aout.h>)

struct exec {
        u_long  a_midmag;       /* htonl(flags<<26 | mid<<16 | magic) */

Which to me makes an incredible amount of sense so that machines can
recognize binaries from other machines.  The world becomes less Intel-
centric this way.

So; taking a FreeBSD binary; fixing the a.out header to conform to
NetBSD; and running the code might work.  But if it's compiled shared;
then you have shared-library numbers to deal with.  Should you decide to
try FreeBSD libraries, you have to change the a.out header on those as
well.  I tried this and when running the binary; in some cases was 
getting errors such as "Bad System Call" and other indicators of non-
compatibility.  Assuming you try to change the version numbers on your 
NetBSD libraries; you're asking for trouble of a different sort.

In effect; I gave up.  I declared NetBSD and FreeBSD two completely
different operating systems and decided to try taking everything
by the horns and compiling the sources.

This proved less than successful since I'd chosen (stupidly) to try
compiling the FreeBSD packages under NetBSD but the ports are *very*
FreeBSD specific and require a great deal of massaging to make work
correctly.  Things like the 'cdio' structure in <sys/cdio.h> are
different, the sound-drivers are different, etc etc etc.

: Seriously, I think everyone would benefit if NetBSD and FreeBSD could
: both run the same binaries.  But from what I understand, they can't. 

I'm disappointed that FreeBSD and NetBSD are so different even though
I recognize why this has happened and understand it...

My choice of OS is obviously NetBSD but it seems I lose because all of
the available ported packages are done for FreeBSD.  In fact; I still 
haven't managed to spend the right amount of time to make things like TeX
work properly under NetBSD. 'LaTeX' dies, 'dvips' dies, and 'xdvik' 
doesn't work right.

--
hpeyerl@novatel.ca                           |  NovAtel Communications Ltd.
hpeyerl@fsa.ca                               | <nothing I say matters anyway>
 "A sucking chest wound is nature's way of telling you to slow down."