[comp.os.os9] Porting Unix software to OS/9

mc1@torch.UUCP (Mark Cook) (06/20/89)

Apologies if this question has been asked before but I'm new to the net.
What I need to know is, has anyone out there tried to port Unix software
to OS/9 and, if so, what was involved.

For example, how did you achieve the effects of a Unix fork() call ? Is
is possible to implement an arrangement similar to sockets ? How close
in form is OS/9 to Unix ? How many of the system calls are similar ?
Are the filesystems similar ? Are there any commercially available
libraries that can help ?

I realise this is a big question but any answers (however large or small)
will be gratefully received.  Thanks.


Mark Cook, Torch Technology Ltd, Cambridge, UK  +44 223 841000

dibble@cs.rochester.edu (Peter C. Dibble) (06/24/89)

If you are porting to OS-9/6809, you can expect hard work.  The Microware 6809
C compiler is K&R compliant, not UNIX-like.  If you are porting to 
OS-9/68000, and you have the latest Microware C compiler, the port may
take no effort at all.

For perspective:
  I ported hack several years ago with an almost 6809-like version of
  the C compiler.  It took more than a week of evenings.

  I ported Bison, flex, egrep, and gnu awk in less than an hour each.
  One of them, probably Bison, involved about 5 minutes of messing with
  the make file, and that was all.

Low-level stuff like fork and settty's take some effort, (the ioctls were
a problem for ports of sz/rz and pcom) but most programs don't do stuff like
that.

So.  Advice:
  *  Get the latest compiler.  The one they just released  is best.
  *  There are some UNIX-compatibility libraries around.  I don't use them
	 much, but they do make ports a bit faster.
  *  If the programs include _very_ long lines, or macros that expand to
	 very long lines, do something about it.  The C preprocessor and
	 the compiler will both crash unpleasantly if you feed them oversized
	 lines.
  *  Get the varargs package for OS-9 or look for all functions that take
	 a variable number of arguments and "do something" about them.

Ask about the software you mean to port.  One of us may already
have ported it.

Peter

jejones@mcrware.UUCP (James Jones) (07/06/89)

In article <373@torch.UUCP> mc1@torch.UUCP (Mark Cook) writes:
>Are there any commercially available
>libraries that can help [with porting Unix software to OS-9]?

Sigh.  When I first posted a reply to this, I forgot about TOP.  There is
a group of European OS-9 users who have ported various software to OS-9,
and who have written a set of functions that appear to duplicate the
function of some Unix library functions.  I believe they posted said
functions to comp.os.os9 a while back--I have them, though Mr. Cook may
find it easier to get them more directly from TOP in Munich.  TOP stuff
appears to have a GNUoid copyleft attached.

For the record, a disclaimer--I haven't used these functions, so I can't
vouch for them.  (Not to denigrate them, either, just trying to make sure
folks know what's what.)

	James Jones