INSTALL1.ms 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. .\" this is an extract of port.ms: change that too if needed
  2. .pl 9999
  3. .SH
  4. Installing hosted Inferno from source
  5. .SH
  6. Overview
  7. .PP
  8. Like the native kernels
  9. .CW emu
  10. relies on several auxiliary libraries (the source of which
  11. it often shares with the native kernels).
  12. Emu itself is built by the
  13. .CW mkfile
  14. in the
  15. .CW emu
  16. subdirectory containing the platform-specific source for the host platform.
  17. Each library has its own
  18. .CW mkfile ;
  19. the various components are made in the right order by the
  20. .CW mkfile
  21. at the root of the Inferno tree.
  22. The
  23. .CW mkfile
  24. for each platform will also invoke
  25. .CW mk
  26. recursively to make the appropriate libraries
  27. for a given configuration.
  28. .PP
  29. The Unix emu variant generally is covered by `POSIX' (with common extensions)
  30. but each Unix port has one file that differs considerably for each port,
  31. namely \f5emu/\fP\fIplatform\fP\f5/os.c\fP, the differences
  32. corresponding to the different ways under Unix of implementing kernel-scheduled
  33. threads efficiently.
  34. .PP
  35. There are working emu versions
  36. for
  37. FreeBSD/386,
  38. Irix/mips,
  39. Linux/386,
  40. NetBSD/386,
  41. MacOSX/386,
  42. MacOSX/power,
  43. Plan 9,
  44. Solaris/sparc,
  45. and Windows (NT, 2000 and Explorer plug-in).
  46. Each platform typically uses mechanisms specific to the host operating
  47. system to implement Inferno's internal thread/process structure.
  48. POSIX threads have often been found to be insufficient (poorly implemented)
  49. on some platforms, and if so are avoided.
  50. See
  51. .CW kproc
  52. in
  53. .CW emu/*/os.c .
  54. .PP
  55. Source is included for ports to HP/UX (S800 architecture),
  56. Solaris/386, and Unixware, in case someone wishes to take them up now,
  57. but we have not determined their fitness.
  58. .PP
  59. The Plan 9 hosted implementation is unusual in that it supports
  60. several processor types:
  61. .CW 386 ,
  62. .CW mips ,
  63. .CW power
  64. (Power PC)
  65. and
  66. .CW sparc .
  67. Furthermore, all versions of
  68. .CW emu
  69. can be built on any processor type, in the usual way for Plan 9.
  70. .PP
  71. Otherwise, as distributed,
  72. .CW emu
  73. for a platform can only be built when running on that platform.
  74. .PP
  75. One unusual variant makes the whole of Inferno a plug-in for Microsoft's
  76. Internet Explorer, giving the same environment for Inferno applications
  77. running in an HTML page as is provided by hosted or native Inferno.
  78. That is, there is not a distinct `applet' environment with special programming interfaces.
  79. The source for the various plug-in components is found in
  80. .CW /tools/plugin
  81. and
  82. .CW /usr/internet
  83. within the Inferno tree; they use the version of
  84. .I emu
  85. defined by the configuration file
  86. .CW /emu/Nt/ie .
  87. .SH
  88. Build steps
  89. .PP
  90. All the libraries and executables can be built in a tree containing only the source code.
  91. To do that for a supported variant of hosted Inferno, on Unix or Plan 9, do the following
  92. in the root of the Inferno tree:
  93. .nr Ci 0 +1
  94. .de Xx
  95. .IP \\n+(Ci
  96. ..
  97. .Xx
  98. Edit
  99. .CW mkconfig
  100. to reflect your host environment,
  101. specifically ROOT (which must be an absolute path name), SYSHOST and OBJTYPE.
  102. The comments in the file should help you choose.
  103. .Xx
  104. Run
  105. .CW makemk.sh
  106. to rebuild the
  107. .CW mk
  108. command, which is used to build everything else.
  109. .Xx
  110. Set
  111. .CW PATH
  112. (or
  113. .CW path
  114. on Plan 9)
  115. to include the
  116. .CW bin
  117. directory for the platform, which will now contain the
  118. .CW mk
  119. binary just built.
  120. On Unix, export
  121. .CW PATH .
  122. .Xx
  123. Then
  124. .CW "mk nuke"
  125. to remove any extraneous object files.
  126. .Xx
  127. Finally,
  128. .CW "mk install"
  129. to create and install the libraries,
  130. .CW limbo
  131. compiler,
  132. .CW emu
  133. for hosted Inferno, and auxiliary commands.
  134. The rules do that in an order that ensures that the commands or libraries
  135. needed by a later stage are built and installed first.
  136. (Note that a plain
  137. .CW mk
  138. will not suffice, because it does not put the results in the search path.)
  139. .LP
  140. Doing something similar on Windows or Plan 9 currently requires the executable for
  141. .CW mk
  142. to be available in the search path,
  143. since there is no equivalent of
  144. .CW makemk.sh .
  145. Otherwise the procedure is the same.
  146. On Plan 9, of course, the host system's normal version of
  147. .CW mk
  148. should be adequate.