xref: /inferno-os/INSTALL (revision e99c80a3fa429c1ccca6953976c7a40e23441e63)
1a68c9668SCharles.ForsythInstalling hosted Inferno from source
2a68c9668SCharles.Forsyth
3*a724700aSCharles.ForsythOverview
4a68c9668SCharles.Forsyth
55fded916SCharles.Forsyth     Like the native kernels  emu relies on  several  auxil-
6a68c9668SCharles.Forsythiary libraries (the source of which it often shares with the
75fded916SCharles.Forsythnative kernels).  Emu itself is built by the  mkfile in the
8*a724700aSCharles.Forsythemu subdirectory containing the platform-specific source for
9*a724700aSCharles.Forsyththe host platform.  Each library has its own    mkfile;  the
10*a724700aSCharles.Forsythvarious  components  are  made  in  the  right order by the
11*a724700aSCharles.Forsythmkfile at the root of the Inferno tree.   The    mkfile  for
12*a724700aSCharles.Forsytheach  platform  will also invoke  mk recursively to make the
13*a724700aSCharles.Forsythappropriate libraries for a given configuration.
14a68c9668SCharles.Forsyth
15a68c9668SCharles.Forsyth     The Unix emu variant generally is  covered  by  `POSIX'
16a68c9668SCharles.Forsyth(with  common  extensions)  but  each Unix port has one file
17a68c9668SCharles.Forsyththat   differs   considerably   for   each   port,    namely
18a68c9668SCharles.Forsythemu/platform/os.c, the differences corresponding to the dif-
19a68c9668SCharles.Forsythferent ways  under  Unix  of  implementing  kernel-scheduled
20a68c9668SCharles.Forsyththreads efficiently.
21a68c9668SCharles.Forsyth
22a68c9668SCharles.Forsyth     There  are  working  emu  versions   for   FreeBSD/386,
23*a724700aSCharles.ForsythIrix/mips,  Linux/386, NetBSD/386, MacOSX/386, MacOSX/power,
24*a724700aSCharles.ForsythPlan 9, Solaris/sparc, and Windows (NT,  2000  and  Explorer
25*a724700aSCharles.Forsythplug-in).   Each platform typically uses mechanisms specific
26*a724700aSCharles.Forsythto the host operating system to implement Inferno's internal
27*a724700aSCharles.Forsyththread/process  structure.   POSIX  threads  have often been
28*a724700aSCharles.Forsythfound to be insufficient (poorly implemented) on some  plat-
29*a724700aSCharles.Forsythforms, and if so are avoided.  See  kproc in  emu/*/os.c.
30a68c9668SCharles.Forsyth
31a68c9668SCharles.Forsyth     Source is included for ports to HP/UX  (S800  architec-
32a68c9668SCharles.Forsythture),  Solaris/386, and Unixware, in case someone wishes to
33a68c9668SCharles.Forsythtake them up now, but we have not determined their fitness.
34a68c9668SCharles.Forsyth
35a68c9668SCharles.Forsyth     The Plan 9 hosted implementation is unusual in that  it
365fded916SCharles.Forsythsupports several processor types:  386,  mips,  power (Power
375fded916SCharles.ForsythPC) and  sparc.  Furthermore, all versions of   emu  can  be
38a68c9668SCharles.Forsythbuilt on any processor type, in the usual way for Plan 9.
39a68c9668SCharles.Forsyth
405fded916SCharles.Forsyth     Otherwise, as distributed,  emu for a platform can only
41a68c9668SCharles.Forsythbe built when running on that platform.
42a68c9668SCharles.Forsyth
43*a724700aSCharles.ForsythBuild steps
44a68c9668SCharles.Forsyth
45*a724700aSCharles.Forsyth     All the libraries and executables can  be  built  in  a
46*a724700aSCharles.Forsythtree containing only the source code.  To do that for a sup-
47*a724700aSCharles.Forsythported variant of hosted Inferno, on Unix or Plan 9, do  the
48*a724700aSCharles.Forsythfollowing in the root of the Inferno tree:
49*a724700aSCharles.Forsyth
50*a724700aSCharles.Forsyth1    Edit    mkconfig  to  reflect  your  host  environment,
51*a724700aSCharles.Forsyth     specifically  ROOT  (which  must  be  an  absolute path
52*a724700aSCharles.Forsyth     name), SYSHOST and OBJTYPE.  The comments in  the  file
53*a724700aSCharles.Forsyth     should help you choose.
54*a724700aSCharles.Forsyth
55*a724700aSCharles.Forsyth2    Run  makemk.sh to rebuild the   mk  command,  which  is
56a68c9668SCharles.Forsyth     used to build everything else.
57a68c9668SCharles.Forsyth
58*a724700aSCharles.Forsyth3    Set  PATH (or  path on Plan 9)  to  include  the    bin
59a68c9668SCharles.Forsyth     directory for the platform, which will now contain the
605fded916SCharles.Forsyth     mk binary just built.  On Unix, export  PATH.
61a68c9668SCharles.Forsyth
62*a724700aSCharles.Forsyth4    Then  mk nuke to remove any extraneous object files.
63a68c9668SCharles.Forsyth
64*a724700aSCharles.Forsyth5    Finally,    mk  install  to  create  and  install   the
655fded916SCharles.Forsyth     libraries,    limbo  compiler,  emu for hosted Inferno,
66a68c9668SCharles.Forsyth     and auxiliary commands.  The rules do that in an  order
67a68c9668SCharles.Forsyth     that ensures that the commands or libraries needed by a
68a68c9668SCharles.Forsyth     later stage are built and installed first.  (Note  that
695fded916SCharles.Forsyth     a  plain   mk will not suffice, because it does not put
70a68c9668SCharles.Forsyth     the results in the search path.)
71a68c9668SCharles.Forsyth
72a68c9668SCharles.ForsythDoing something similar  on  Windows  or  Plan  9  currently
735fded916SCharles.Forsythrequires  the  executable  for    mk  to be available in the
745fded916SCharles.Forsythsearch path, since there is no  equivalent  of    makemk.sh.
75a68c9668SCharles.ForsythOtherwise  the procedure is the same.  On Plan 9, of course,
765fded916SCharles.Forsyththe host system's normal version of  mk should be adequate.
77