port.ms 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. .HTML "The Various Ports
  2. .TL
  3. The Various Ports
  4. .PP
  5. This document collects comments about the various
  6. architectures supported by Plan 9.
  7. The system tries to hide most of the differences between machines,
  8. so the machines as seen by a Plan 9
  9. user look different from how they are perceived through commercial software.
  10. Also, because we are a small group, we couldn't do everything:
  11. exploit every optimization, support every model,
  12. drive every device.
  13. This document records what we
  14. .I have
  15. done.
  16. The first section discusses the compiler/assembler/loader suite for each machine.
  17. The second talks about
  18. the operating system implemented on each of the various
  19. machines.
  20. .
  21. .SH
  22. The MIPS compiler
  23. .PP
  24. This compiler generates code for the R2000, R3000, and R4000 machines configured
  25. to be big-endians. The compiler generates no R4000-specific instructions
  26. although the assembler and loader support the new user-mode instructions.
  27. There are options to generate code for little-endian machines.
  28. Considering its speed, the Plan 9 compiler generates good code,
  29. but the commercial
  30. MIPS compiler with all the stops pulled out consistently beats it
  31. by 20% or so, sometimes more. Since ours compiles about 10 times
  32. faster and we spend most of our time compiling anyway,
  33. we are content with the tradeoff.
  34. .PP
  35. The compiler is solid: we've used it for several big projects and, of course,
  36. all our applications run under it.
  37. The behavior of floating-point programs is much like on the 68040:
  38. the operating system emulates where necessary to get past non-trapping
  39. underflow and overflow, but does not handle gradual underflow or
  40. denormalized numbers or not-a-numbers.
  41. .SH
  42. The SPARC compiler
  43. .PP
  44. The SPARC compiler is also solid and fast, although we haven't
  45. used it for a few years, due to a lack of current hardware. We have seen it do
  46. much better than GCC with all the optimizations, but on average
  47. it is probably about the same.
  48. .PP
  49. We used to run some old SPARC machines with no multiply or divide instructions,
  50. so the compiler
  51. does not produce them by default.
  52. Instead it calls internal subroutines.
  53. A loader flag,
  54. .CW -M ,
  55. causes the instructions to be emitted. The operating system has
  56. trap code to emulate them if necessary, but the traps are slower than
  57. emulating them in user mode.
  58. In any modern lab, in which SPARCS have the instructions, it would be worth enabling the
  59. .CW -M
  60. flag by default.
  61. .PP
  62. The floating point story is the same as on the MIPS.
  63. .SH
  64. The Intel i386 compiler
  65. .PP
  66. This is really an
  67. .I x 86
  68. compiler, for
  69. .I x >2.
  70. It works only
  71. if the machine is in 32-bit protected mode.
  72. It is solid and generates tolerable code; it is our main compiler these days.
  73. .PP
  74. Floating point is well-behaved, but the compiler assumes i387-compatible
  75. hardware to execute
  76. the instructions. With 387 hardware,
  77. the system does the full IEEE 754 job, just like
  78. the MC68881. By default, the libraries don't use the 387 built-ins for
  79. transcendentals.
  80. If you want them,
  81. build the code in
  82. .CW /sys/src/libc/386/387 .
  83. .
  84. .SH
  85. The AMD64 compiler
  86. .PP
  87. The AMD64 compiler has been used to build 64-bit variants of Plan 9.
  88. It seems to be reasonably solid.
  89. .
  90. .SH
  91. The PowerPC compiler
  92. .PP
  93. The PowerPC compiler supports the 32-bit PowerPC architecture only;
  94. it does not support either the 64-bit extensions or the POWER compatibility instructions.
  95. It has been used for production operating system work on the 603, 603e, 604e, 821, 823, and 860,
  96. and experimental work on the 405, 440 and 450.
  97. On the 8xx floating-point instructions must be emulated.
  98. Instruction scheduling is not implemented; otherwise the code generated
  99. is similar to that for the other load-store architectures.
  100. The compiler makes little or no use of unusual PowerPC features such as the
  101. counter register, several condition code registers, and multiply-accumulate
  102. instructions, but they are sometimes
  103. used by assembly language routines in the libraries.
  104. .
  105. .SH
  106. The PowerPC64 compiler
  107. .PP
  108. The PowerPC64 compiler supports the 64-bit PowerPC architecture only.
  109. It has been lightly used on IBM's Blue Gene machines.
  110. .
  111. .SH
  112. The ARM compiler
  113. .PP
  114. The ARM compiler is fairly solid; it has been used for some production
  115. operating system work including Inferno and the Plan 9 kernel
  116. for the iPAQ, which uses a StrongArm SA1, and the Sheevaplug,
  117. Guruplug, Dreamplug, Gumstix Overo, Compulab Trimslice and others.
  118. The compiler supports the ARMv4 and later 32-bit architectures;
  119. it does not support the Thumb instruction sets.
  120. It has been used on ARM7500FE, ARM926 and Cortex-A8 and -A9 processors
  121. and the Strongarm SA1 core machines.
  122. The compiler generates instructions for
  123. ARM 7500 FPA floating-point coprocessor 1 by default,
  124. but
  125. .CW 5l
  126. .CW -f
  127. instead generates VFP instructions for coprocessors 10 and 11.
  128. .
  129. .SH
  130. The IBM PC operating system
  131. .PP
  132. The PC version of Plan 9 can boot via PXE
  133. or directly from a disk created by the
  134. .CW format
  135. command; see
  136. .I prep (8).
  137. Plan 9 runs in 32-bit mode\(emwhich requires a 386 or later model x86 processor\(emand
  138. has an interrupt-driven I/O system, so it does not
  139. use the BIOS (except for a small portion of the boot program and floppy boot block).
  140. This helps performance but limits the set of I/O devices that it can support without
  141. special code.
  142. .PP
  143. Plan 9 supports the ISA, EISA, and PCI buses as well as PCMCIA and PC card devices.
  144. It is infeasible to list all the supported machines, because
  145. the PC-clone marketplace is too volatile and there is
  146. no guarantee that the machine you buy today will contain the
  147. same components as the one you bought yesterday.
  148. (For our lab, we buy components and assemble the machines
  149. ourselves in an attempt to lessen this effect.)
  150. IDE/ATA, SATA and SCSI disks are supported.
  151. CD-ROMs are supported two ways, either on the SCSI bus, or as ATA(PI) devices.
  152. The SCSI adapter must be a member of the Mylex Multimaster (old Buslogic BT-*) series
  153. or the Symbios 53C8XX series.
  154. .PP
  155. Supported Ethernet cards include the
  156. AMD79C790,
  157. 3COM Etherlink III and 3C589 series,
  158. Lucent Wavelan and compatibles,
  159. NE2000,
  160. WD8003,
  161. WD8013,
  162. Realtek 8139,
  163. SMC Elite and Elite Ultra,
  164. Linksys Combo EthernetCard and EtherFast 10/100,
  165. and a variety of controllers based on the
  166. Intel i8255[789] and Digital (now Intel) 21114x chips.
  167. We support Gigabit Ethernet via
  168. Realtek 8110S/8169S,
  169. and
  170. Intel 8254[013467], 8256[36], and 8257[1-79] controllers.
  171. We support 10-Gigabit Ethernet via
  172. Intel's 8259[89],
  173. and
  174. Myricom's 10g-pcie-8a.
  175. We mostly use Intel and Realtek gigabit controllers,
  176. so those drivers may be more robust.
  177. .PP
  178. There must be an explicit Plan 9 driver for peripherals;
  179. it cannot use DOS or Windows drivers.
  180. Plan 9 cannot exploit special hardware-related features that fall outside of the
  181. IBM PC model,
  182. such as power management,
  183. unless architecture-dependent code is added to the kernel.
  184. For more details see
  185. .I plan9.ini (8).
  186. .PP
  187. Over the years,
  188. Plan 9 has run on a number of VGA cards.
  189. Recent changes to the graphics system have not been
  190. tested on most of the older cards; some effort may be needed to get them working again.
  191. In our lab, most of our machines use the ATI or Nvidia chips,
  192. so such devices are probably
  193. the most reliable.
  194. The system requires a hardware cursor.
  195. For more details see
  196. .I vgadb (6)
  197. and
  198. .I vga (8).
  199. The wiki
  200. .CW http://plan9.bell-labs.com/wiki/plan9 ) (
  201. contains the definitive list of cards that are known to work; see the ``supported PC hardware''
  202. page.
  203. .PP
  204. For audio, Plan 9 supports the Sound Blaster 16 and compatibles.
  205. (Note that audio doesn't work under Plan 9 with 8-bit Sound Blasters.)
  206. There is also user-level support for USB audio devices; see
  207. .I usb (4).
  208. .PP
  209. Finally, it's important to have a three-button mouse with Plan 9.
  210. The system currently works only with mice on the PS/2 port or USB.
  211. Serial mouse support should return before long.
  212. .PP
  213. Once you have Plan 9 installed (see the wiki's installation document),
  214. use PXE or a boot disk to load the system. See
  215. .I booting (8),
  216. .I 9boot (8),
  217. and
  218. .I prep (8)
  219. for more information.
  220. .
  221. .SH
  222. The PowerPC operating system
  223. .PP
  224. We have a version of the system that runs on the PowerPC
  225. on a home-grown machine called Viaduct.
  226. The Viaduct minibrick is a small (12x9x3 cm) low-cost embedded
  227. computer consisting of a 50Mhz MPC850, 16MB sdram, 2MB flash,
  228. and two 10Mb Ethernet ports. It is designed for home/SOHO
  229. networking applications such as VPN, firewalls, NAT, etc.
  230. .PP
  231. The kernel has also been ported to the Motorola MTX embedded motherboard;
  232. that port is included in the distribution.
  233. The port only works with a 604e processor (the 603e is substantially different)
  234. and at present only a single CPU is permitted.
  235. .PP
  236. We have ports to the Xilinx Virtex 4 and 5 FPGAs
  237. which use PowerPC 405 and 440 processors, respectively.
  238. .SH
  239. The Marvell Kirkwood operating system
  240. .PP
  241. This is an ARM kernel for the ARM926EJ-S processor
  242. and it emulates ARM 7500 floating-point and
  243. CAS (compare-and-swap) instructions.
  244. It is known to run on the Sheevaplug, Guruplug, Dreamplug
  245. and Openrd-client boards.
  246. It is derived from a port of native Inferno to the Sheevaplug
  247. by Salva Peir\f(Jpó\fP and Mechiel Lukkien.
  248. There are many features of the Kirkwood system-on-a-chip
  249. that it does not exploit.
  250. There are currently drivers for up to two
  251. Gigabit Ethernet interfaces,
  252. USB and the console serial port;
  253. we hope to add crypto acceleration, and a video driver for the Openrd-client.
  254. .SH
  255. The Marvell PXA168 operating system
  256. .PP
  257. This is an ARM kernel for the ARM-v5-architecture processor in the
  258. Marvell PXA168 system-on-a-chip
  259. and it emulates ARM 7500 floating-point and
  260. CAS (compare-and-swap) instructions.
  261. It is known to run on the Guruplug Display.
  262. There are many features of the system-on-a-chip
  263. that it does not exploit.
  264. There are currently drivers for
  265. a Fast Ethernet interface,
  266. and the console serial port;
  267. we hope to add crypto acceleration, and a video driver.
  268. .SH
  269. The TI OMAP35 operating system
  270. .PP
  271. This is an ARM kernel for the Cortex-A8 processor
  272. and it emulates ARM 7500 floating-point and
  273. CAS (compare-and-swap) instructions.
  274. It is known to run on the IGEPv2 board and the Gumstix Overo,
  275. and might eventually run on the Beagleboard, once USB is working.
  276. There are many features of the OMAP system-on-a-chip that it does not exploit.
  277. Initially, there are drivers for the SMSC 9221 100Mb/s Ethernet
  278. interface in the IGEPv2 and Overo,
  279. and the console serial port;
  280. we hope to add USB, flash memory and video drivers.
  281. .SH
  282. The Nvidia Tegra2 operating system
  283. .PP
  284. This is an ARM kernel for the dual Cortex-A9 processors
  285. in the Nvidia Tegra2 system-on-a-chip
  286. and it emulates ARM 7500 floating-point and
  287. CAS (compare-and-swap) instructions, but
  288. the hardware includes VFP3 floating-point.
  289. It runs on the Compulab Trimslice.
  290. There are many features of the system-on-a-chip that it does not exploit.
  291. Initially, there are drivers for the Ethernet interface
  292. and the console serial port;
  293. we hope to add USB, flash memory and video drivers.
  294. .SH
  295. The Broadcom 2835 operating system
  296. .PP
  297. This is terminal and CPU kernels for the ARM1176 processor
  298. in the Broadcom 2835 system-on-a-chip.
  299. The hardware includes VFP2 floating-point.
  300. It runs on the Raspberry Pi Model B.
  301. .
  302. .ig
  303. .SH
  304. The file server
  305. .PP
  306. The file server runs on only a handful of distinct machines.
  307. It is a stand-alone program, distantly related to the CPU server
  308. code, that runs no user code: all it does is serve files on
  309. network connections.
  310. It supports only SCSI disks, which can be interleaved for
  311. faster throughput.
  312. A DOS file on
  313. an IDE drive can hold the configuration information.
  314. See
  315. .I fsconfig (8)
  316. for an explanation of how
  317. to configure a file server.
  318. .PP
  319. To boot a file server, follow the directions for booting a CPU server
  320. using the file name
  321. .CW 9\f2machtype\fPfs
  322. where
  323. .I machtype
  324. is
  325. .CW pc ,
  326. etc. as appropriate.
  327. We are releasing only the PC version.
  328. .SH
  329. The IBM PC file server
  330. .PP
  331. Except for the restriction to SCSI disks,
  332. the PC file server has the same hardware requirements as
  333. the regular PC operating system.
  334. However, only a subset of the supported SCSI (Adaptec 1542, Mylex Multimaster,
  335. and Symbios 53C8XX) and Ethernet (Digital 2114x,
  336. Intel 8255x, and 3Com) controllers
  337. may be
  338. used.
  339. Any of the boot methods described in
  340. .I 9load (8)
  341. will work.
  342. .PP
  343. To boot any PC, the file
  344. .CW 9load
  345. must reside on a MS-DOS formatted floppy, IDE disk,
  346. or SCSI disk.
  347. However, PCs have no non-volatile RAM in which the
  348. file server can store its configuration information, so the system
  349. stores it in a file on an MS-DOS file system instead.
  350. This file, however, cannot live on a SCSI disk, only a floppy or IDE.
  351. (This restriction avoids a lot of duplicated interfaces in the
  352. system.)
  353. Thus the file server cannot be all-SCSI.
  354. See
  355. .I plan9.ini (8)
  356. for details about the
  357. .I nvr
  358. variable and specifying the console device.
  359. .SH
  360. Backup
  361. .PP
  362. Our main file server is unlikely to be much like yours.
  363. It is a PC with 128 megabytes
  364. of cache memory, 56 gigabytes of SCSI magnetic
  365. disk, and a Hewlett-Packard SureStore Optical 1200ex
  366. magneto-optical jukebox, with 1.2 terabytes of storage.
  367. This driver runs the SCSI standard jukebox protocol.
  368. We also have a driver for a (non-standard)
  369. SONY WDA-610
  370. Writable Disk Auto Changer (WORM),
  371. which stores almost 350 gigabytes of data.
  372. .PP
  373. The WORM is actually the prime storage; the SCSI disk is just
  374. a cache to improve performance.
  375. Early each morning the system constructs on WORM an image of
  376. the entire system as it appears that day. Our backup system
  377. is therefore just a file server that lets
  378. you look at yesterday's (or last year's) file system.
  379. .PP
  380. If you don't have a magneto-optical jukebox,
  381. you might consider attaching a CD-R jukebox or even just
  382. using a single WORM drive and managing the dumps a little less
  383. automatically. This is just a long way of saying that the
  384. system as distributed has no explicit method of backup other
  385. than through the WORM jukebox.
  386. .PP
  387. Not everyone can invest in such expensive hardware, however.
  388. Although it wouldn't be as luxurious,
  389. it would be possible to use
  390. .I mkfs (8)
  391. to build regular file system archives and use
  392. .I scuzz (8)
  393. to stream them to a SCSI 8mm tape drive.
  394. .CW Mkext
  395. could then extract them.
  396. Another alternative is to use
  397. .I dump9660
  398. (see
  399. .I mk9660 (8)),
  400. which stores incremental backups on CD images
  401. in the form of a dump hierarchy.
  402. .PP
  403. It is also possible to treat a regular disk, or even a part of a disk,
  404. as a fake WORM, which can then be streamed to tape when it fills.
  405. This is a bad idea for a production system but a good way to
  406. learn about the WORM software.
  407. Again, see
  408. .I fsconfig (8)
  409. for details.
  410. ..