Newsgroups: comp.os.minix
Subject: Re: minix and linux
References: <38AD5A76.FDEA282@free.fr>
Organization: Rochester Institute of Technology, Rochester, NY
From: aje9383@osfmail.isc.rit.edu (Andrew Erickson)
NNTP-Posting-Host: grace.isc.rit.edu
X-Original-NNTP-Posting-Host: grace.isc.rit.edu
Message-ID: <38ad8d53@news.isc.rit.edu>
Date: 18 Feb 2000 13:20:03 -0500
X-Trace: 18 Feb 2000 13:20:03 -0500, grace.isc.rit.edu
Lines: 38
XPident: aje9383
X-Original-NNTP-Posting-Host: 129.21.4.100
XPident: Unknown
Path: news.adfa.oz.au!clarion.carno.net.au!news0.optus.net.au!news1.optus.net.au!optus!intgwpad.nntp.telstra.net!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.nyu.edu!news-nysernet-16.sprintlink.net!news.sprintlink.net!news.isc.rit.edu!aje9383
Xref: news.adfa.oz.au comp.os.minix:34748

In article <38AD5A76.FDEA282@free.fr>, Axel R. <axel584@free.fr> wrote:
>Hi all,
>I'm a minix beginner and I would like known if we can compile programme
>for minix under linux (with a cross-compiler)
>If Yes, how do this ?

Yes, but...setting things up to do so is not at all simple.  I will try
to summarize the major steps, but I may very well omit one or more.

1.  Copy all the library source files in Minix to Linux.  (For the very
    pendantic, you don't need a couple--the ones which exist solely for
    internal compiler support under Minix--but sorting it out is hardly
    worthwhile, IMHO.)  Also copy all the Minix header files.

2.  Create an archive library (*not* a shared library) from the library
    source files just copied.  You will almost certainly have to change
    the format of the assembly files; the minix assembler is unusual.

3.  Compile and link your user programs against these libraries.  IIRC,
    the Linux ld can be convinced to create Minix executables.  Despite
    being stated as a single step, this is actually a bit tricky to get
    right.  You must be sure the Minix headers are used, not those from
    Linux.  You must also be sure the Minix libc is used, not that from
    Linux.  (Some Linux libraries may be usable; most probably aren't.)

4.  Copy the executable to Minix.

Note that libraries created under Linux aren't directly compatible with
those used by Minix; the archive library file format is different.

Another approach, perhaps somewhat easier, is to compile to assembly in
Linux and the assemble and link in Minix.  I used that approach to make
a working copy of C68 for MacMinix, and it wasn't too hard.

>Thank for the answer.

Good luck,
Andrew Erickson
