port.ms 15 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 PowerPC compiler
  86. .PP
  87. The PowerPC compiler supports the 32-bit PowerPC architecture only;
  88. it does not support either the 64-bit extensions or the POWER compatibility instructions.
  89. It has been used for production operating system work on the 603, 603e, 604e, 821, 823, and 860,
  90. and experimental work on the 405, 440 and 450.
  91. On the 8xx floating-point instructions must be emulated.
  92. Instruction scheduling is not implemented; otherwise the code generated
  93. is similar to that for the other load-store architectures.
  94. The compiler makes little or no use of unusual PowerPC features such as the
  95. counter register, several condition code registers, and multiply-accumulate
  96. instructions, but they are sometimes
  97. used by assembly language routines in the libraries.
  98. .SH
  99. The ARM compiler
  100. .PP
  101. The ARM compiler is fairly solid; it has been used for some production
  102. operating system work including Inferno and the Plan 9 kernel
  103. for the iPAQ, which uses a StrongArm SA1, and the Sheevaplug,
  104. Guruplug, Dreamplug, Gumstix Overo, Compulab Trimslice and others.
  105. The compiler supports the ARMv4 and later 32-bit architectures;
  106. it does not support the Thumb instruction sets.
  107. It has been used on ARM7500FE, ARM926 and Cortex-A8 and -A9 processors
  108. and the Strongarm SA1 core machines.
  109. The compiler generates instructions for
  110. ARM 7500 FPA floating-point coprocessor 1 by default,
  111. but
  112. .CW 5l
  113. .CW -f
  114. instead generates VFP instructions for coprocessors 10 and 11.
  115. .
  116. .SH
  117. The IBM PC operating system
  118. .PP
  119. The PC version of Plan 9 can boot either from MS-DOS
  120. or directly from a disk created by the
  121. .CW format
  122. command; see
  123. .I prep (8).
  124. Plan 9 runs in 32-bit mode\(emwhich requires a 386 or later model x86 processor\(emand
  125. has an interrupt-driven I/O system, so it does not
  126. use the BIOS (except for a small portion of the boot program and floppy boot block).
  127. This helps performance but limits the set of I/O devices that it can support without
  128. special code.
  129. .PP
  130. Plan 9 supports the ISA, EISA, and PCI buses as well as PCMCIA and PC card devices.
  131. It is infeasible to list all the supported machines, because
  132. the PC-clone marketplace is too volatile and there is
  133. no guarantee that the machine you buy today will contain the
  134. same components as the one you bought yesterday.
  135. (For our lab, we buy components and assemble the machines
  136. ourselves in an attempt to lessen this effect.)
  137. Both IDE/ATA and SCSI disks are supported, and
  138. there is support for large ATA drives.
  139. CD-ROMs are supported two ways, either on the SCSI bus, or as ATA(PI) devices.
  140. The SCSI adapter must be a member of the Mylex Multimaster (old Buslogic BT-*) series
  141. or the Symbios 53C8XX series.
  142. Supported Ethernet cards include the
  143. AMD79C790,
  144. 3COM Etherlink III and 3C589 series,
  145. Lucent Wavelan and compatibles,
  146. NE2000,
  147. WD8003,
  148. WD8013,
  149. SMC Elite and Elite Ultra,
  150. Linksys Combo EthernetCard and EtherFast 10/100,
  151. and a variety of controllers based on the
  152. Intel i8255[789] and Digital (now Intel) 21114x chips.
  153. We mostly use Etherlink III, i8255[789], and 21114x, so those drivers may be more robust.
  154. There must be an explicit Plan 9 driver for peripherals;
  155. it cannot use DOS or Windows drivers.
  156. Also,
  157. Plan 9 cannot exploit special hardware-related features that fall outside of the
  158. IBM PC model,
  159. such as power management,
  160. unless architecture-dependent code is added to the kernel.
  161. For more details see
  162. .I plan9.ini (8).
  163. .PP
  164. Over the years,
  165. Plan 9 has run on a number of VGA cards.
  166. Recent changes to the graphics system have not been
  167. tested on most of the older cards; some effort may be needed to get them working again.
  168. In our lab, most of our machines use the ATI Mach64, S3 ViRGE, or S3 Savage chips,
  169. so such devices are probably
  170. the most reliable.
  171. We also use a few Matrox and TNT cards.
  172. The system requires a hardware cursor.
  173. For more details see
  174. .I vgadb (6)
  175. and
  176. .I vga (8).
  177. The wiki
  178. .CW http://plan9.bell-labs.com/wiki/plan9 ) (
  179. contains the definitive list of cards that are known to work; see the ``supported PC hardware''
  180. page.
  181. .PP
  182. For audio, Plan 9 supports the Sound Blaster 16 and compatibles.
  183. (Note that audio doesn't work under Plan 9 with 8-bit Sound Blasters.)
  184. There is also user-level support for USB audio devices; see
  185. .I usb (4).
  186. .PP
  187. Finally, it's important to have a three-button mouse with Plan 9.
  188. The system currently works only with mice on the PS/2 port or USB.
  189. Serial mouse support should return before long.
  190. .PP
  191. Once you have Plan 9 installed (see the wiki's installation document),
  192. use PXE or a boot disk to load the system. See
  193. .I booting (8),
  194. .I 9boot (8),
  195. and
  196. .I prep (8)
  197. for more information.
  198. .
  199. .SH
  200. The PowerPC operating system
  201. .PP
  202. We have a version of the system that runs on the PowerPC
  203. on a home-grown machine called Viaduct.
  204. The Viaduct minibrick is a small (12x9x3 cm) low-cost embedded
  205. computer consisting of a 50Mhz MPC850, 16MB sdram, 2MB flash,
  206. and two 10Mb Ethernet ports. It is designed for home/SOHO
  207. networking applications such as VPN, firewalls, NAT, etc.
  208. .PP
  209. The kernel has also been ported to the Motorola MTX embedded motherboard;
  210. that port is included in the distribution.
  211. The port only works with a 604e processor (the 603e is substantially different)
  212. and at present only a single CPU is permitted.
  213. .PP
  214. We have ports to the Xilinx Virtex 4 and 5 FPGAs
  215. which use PowerPC 405 and 440 processors, respectively.
  216. .SH
  217. The Compaq iPAQ operating system
  218. .PP
  219. Plan 9 was ported to Compaq's iPAQ Pocket PC,
  220. which uses the StrongArm SA1 processor.
  221. The model we have is a 3630; neighboring models also work.
  222. The kernel can drive a PCMCIA sleeve with a WaveLAN card, but no other PCMCIA
  223. devices have been ported yet.
  224. .PP
  225. The iPAQ runs
  226. .CW rio
  227. with a small keyboard application that allows Palm-style handwriting
  228. input as well as typing with the stylus on a miniature keyboard.
  229. .PP
  230. Fco. J. Ballesteros
  231. .CW nemo@plan9.escet.urjc.es ) (
  232. added support for hibernation, but we haven't been able to
  233. get that to work again in the new kernel; the code is there, however,
  234. for volunteers to play with.
  235. See the file
  236. .CW /sys/src/9/bitsy/Booting101
  237. for information about installing Plan 9 on the iPAQ.
  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. ..