pkgsrc-Users archive

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

Re: Where to host ChezScheme boot images

    Date:        Tue, 16 May 2017 15:47:26 +0200
    From:        Aleksej Lebedev <>
    Message-ID:  <>

  | And it is very portable: the boot image for a new platform can be 
  | cross-compiled.
  | That's what I'm about to do: compile boot image for BSDs on Linux (or 
  | Mac OS, doesn't matter).

First, what does a boot image for BSD really mean, which system architecture,
or does that not matter?

But to claim that you run on NetBSD you really need to support i386,
adm64, sparc64 (and sparc 32 bit) ARM (incl 64 bit), and MIPS at a very
minimum, support for Motorola 68K based systems, VAX, PowerPC and more
would be nice as well.    Just supporting one (or two) of those isn't
really very good.

The standard solution to this problem is to port your system to a new
(very simple) architecture that you can define yourself (or you can pick
one that already exists).   You make your compiler generate code for that
architecture.   Then you write a (usually quite simple) interpreter for
that architecture in some programming language that is widely supported.
When I first saw this done, that was fortran...  (the original, not
one of the modern vamped up things.)   These days, probably C (or perl,
or python, or java, or ...)

Then that interpreter interprets your compiler (most probably very slowly)
and you feed that slow compiler its own source code to compile, and
generate executables for the system you really want to run on (doing that
part of the compiler porting to a new architecture/system is the hard
part, but that is the same whatever mechanism you use to compile this
code, cross compiling, or via the simple bootstrap architecture.)

Even if after you have done that you have to compile it one more time,
if the version that runs on the virtual machine is cut down too much,
or just too slow, to compile everything that you really want compiled
that's OK, you can go through as mant steps of gradually bigger compilers
compiling even bigger ones until you are done.

But this way no-one ever needs to trust some binary blob that they
cannot read in order to get started.


Home | Main Index | Thread Index | Old Index