boot 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. .TH BOOT 8
  2. .SH NAME
  3. boot \- connect to the root file server
  4. .SH SYNOPSIS
  5. .B /boot
  6. [
  7. .B -fkm
  8. ]
  9. [
  10. .BI -u username
  11. ]
  12. [
  13. .IB method ! fs-addr
  14. ]
  15. .SH DESCRIPTION
  16. .PP
  17. .I Boot
  18. is the first program run after a kernel has been loaded.
  19. It connects to the file server that will serve the
  20. root, performs any authentication needed to
  21. connect to that server, and
  22. .IR exec (2)'s
  23. the
  24. .IR init (8)
  25. program.
  26. It is started by the kernel, never run directly by the user. See
  27. .IR booting (8)
  28. for information about the process of loading the kernel (and
  29. .IR boot )
  30. into memory.
  31. .PP
  32. Once loaded, the kernel initializes its data structures and devices.
  33. It sets the two environment variables
  34. .B /env/cputype
  35. and
  36. .B /env/terminal
  37. to describe the processor.
  38. It then binds a place-holder file server,
  39. .IR root (3),
  40. onto
  41. .B /
  42. and crafts an initial process whose sole function is to
  43. .IR exec (2)
  44. .BR /boot ,
  45. a binary which is compiled into
  46. .IR root (3).
  47. .PP
  48. The command line passed depends
  49. on the information passed from boot ROM
  50. to kernel.
  51. Machines that boot directly from ROM (that is, most machines other than PCs)
  52. pass the boot line given to the ROM directly to
  53. .IR boot .
  54. .PP
  55. On the PC, each line in the DOS file
  56. .B plan9.ini
  57. of the form
  58. .IB name = value
  59. is passed to the boot program as an environment
  60. variable with the same name and value.
  61. The command line is
  62. .IP
  63. .B /386/9dos
  64. .IB method ! server
  65. .PP
  66. (The first argument is ignored by
  67. .IR boot .)
  68. .I Boot
  69. must determine the file
  70. .I server
  71. to use
  72. and a
  73. .I method
  74. with which to connect to it.
  75. Typically this will name a file server on the network,
  76. or state that the root file system is on local disk and name the partition.
  77. The complete list of methods is given below.
  78. .PP
  79. .I Boot
  80. must also set a user name to be used
  81. as the owner of devices and all console
  82. processes and an encryption key to be used
  83. when challenged.
  84. .I Boot
  85. will prompt for these.
  86. .PP
  87. Method and address are prompted for first.
  88. The prompt lists all valid methods, with the default in brackets, for example:
  89. .IP
  90. .EX
  91. root is from (il, local!#S/sdC0/fs)[il]:
  92. .EE
  93. .PP
  94. A newline picks the default.
  95. Other possible responses are
  96. .I method
  97. or
  98. .IB method ! address\f1.
  99. To aid in automatic reboot, the default is automatically
  100. taken on CPU servers if nothing is typed within 15 seconds.
  101. .PP
  102. The other interactions depend on whether the system
  103. is a
  104. terminal or a CPU server.
  105. .SS Terminal
  106. .PP
  107. The terminal must have a
  108. .I username
  109. to set.
  110. If none is specified with the
  111. .B -u
  112. option,
  113. .I boot
  114. will prompt for one on the console:
  115. .IP
  116. .EX
  117. user:
  118. .EE
  119. .PP
  120. The user will also be prompted for a password to
  121. be used as an encryption key on each
  122. .IR attach (5):
  123. .IP
  124. .EX
  125. password:
  126. .EE
  127. .PP
  128. With most
  129. .I methods
  130. .I boot
  131. can now connect to the file server.
  132. However, with the serial line
  133. .I methods
  134. .B 9600
  135. and
  136. .BR 19200 ,
  137. the actual mechanics of setting up the complete connection
  138. are too varied to put into the boot program.
  139. Instead
  140. .I boot
  141. lets the user set up the connection.
  142. It prints a prompt on the console and then simulates
  143. a dumb terminal between the user and the serial line:
  144. .IP
  145. .EX
  146. Connect to file system now, type ctrl-d when done.
  147. (Use the view or down arrow key to send a break)
  148. .EE
  149. .PP
  150. The user can now type at the modem to
  151. dial the number. What is typed depends on
  152. the modem and is beyond this discussion.
  153. .PP
  154. When the user types a control-D,
  155. .I boot
  156. stops simulating a terminal and starts the file
  157. system protocol over the serial line.
  158. .PP
  159. Once connected,
  160. .I boot
  161. mounts
  162. the root file system before
  163. .B /
  164. and makes the connection available as
  165. .B #s/boot
  166. for subsequent processes to
  167. .B mount
  168. (see
  169. .IR bind (2)).
  170. .I Boot
  171. completes by
  172. .IR exec (2)'ing
  173. .B /$objtype/init
  174. .BR -t .
  175. If the
  176. .B -m
  177. option is given it is also passed as an option to
  178. .IR init .
  179. If the environment variable
  180. .B init
  181. is set (via
  182. .IR plan9.ini (8)),
  183. it is used as a command line to exec instead.
  184. .PP
  185. If the kernel has been built with the cache file system,
  186. .IR cfs (4),
  187. the local disk partition
  188. .BI /dev/sd XX /cache
  189. (where
  190. .B XX
  191. is a unit specifier)
  192. exists, and the root file system is from a remote server,
  193. then the kernel will insert a user level cache
  194. process between the remote server and the local namespace
  195. that caches all remote accesses on the local partition.
  196. The
  197. .B -f
  198. flag commands
  199. .B cfs
  200. to reformat the cache partition.
  201. .SS CPU Servers
  202. .PP
  203. The user owning devices and console processes on CPU servers
  204. and that user's domain and encryption key are
  205. read from NVRAM on all machines except PC's.
  206. PC's keep the information in the disk partition
  207. .BI /dev/sd XX /nvram\f1.
  208. If a
  209. .B -k
  210. option is given or if no stored information is found
  211. .I boot
  212. will prompt for all three items and store them.
  213. .IP
  214. .EX
  215. password:
  216. authid: bootes
  217. authdom: research.bell-labs.com
  218. .EE
  219. .PP
  220. The key is used for mutual authentication of the server and its clients.
  221. The domain and id identify the owner of the key.
  222. .PP
  223. Once connected,
  224. .I boot
  225. behaves as on the terminal except for
  226. .IR exec (2)'ing
  227. .B /$objtype/init
  228. .BR -c .
  229. .SS Booting Methods
  230. .PP
  231. The methods available to any system depend on what was
  232. compiled into the kernel.
  233. The complete list of booting methods are listed below.
  234. .TP 8
  235. .B il
  236. connect via Ethernet using the IL protocol.
  237. .TP 8
  238. .B tcp
  239. connect via Ethernet using the TCP protocol.
  240. This method is used only if the initial file server
  241. is on a Unix system.
  242. .TP 8
  243. .B local
  244. connect to the local file system.
  245. .PP
  246. For the
  247. .B il
  248. and
  249. .B tcp
  250. methods,
  251. the address must be a numeric IP address.
  252. If no address is specified,
  253. a file server address will be found from another
  254. system on the network using the BOOTP protocol and
  255. the Plan 9 vendor-specific fields.
  256. .SH FILES
  257. .B #s/boot
  258. .SH SOURCE
  259. .B /sys/src/9/boot
  260. .SH "SEE ALSO"
  261. .IR root (3),
  262. .IR dhcpd (8),
  263. .IR init (8)