1
0

port.ms 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. .TL
  2. The Various Ports
  3. .PP
  4. This document collects comments about the various
  5. architectures supported by Plan 9.
  6. The system tries to hide most of the differences between machines,
  7. so the machines as seen by a Plan 9
  8. user look different from how they are perceived through commercial software.
  9. Also, because we are a small group, we couldn't do everything:
  10. exploit every optimization, support every model,
  11. drive every device.
  12. This document records what we
  13. .I have
  14. done.
  15. The first section discusses the compiler/assembler/loader suite for each machine.
  16. The second talks about
  17. the operating system implemented on each of the various
  18. machines.
  19. .SH
  20. The Motorola MC68020 compiler
  21. .PP
  22. This is the oldest compiler of the bunch. Relative to its
  23. competitors\(emcommercial compilers for the same machine\(emit generates
  24. quite good code.
  25. It assumes at least a 68020 architecture: some of the addressing
  26. modes it generates are not on the 68000 or 68010.
  27. .PP
  28. We also use this compiler for the 68040. Except for a few
  29. instructions and registers available only from assembly language,
  30. the only user-visible difference between these machines is in
  31. floating point. Our 68020s all have 68881 or 68882 floating
  32. point units attached, so to execute floating point programs we
  33. depend on there being appropriate hardware.
  34. Unfortunately, the 68040 is not quite so thorough in its implementation
  35. of the IEEE 754 standard or in its provision of built-in instructions
  36. for the
  37. transcendental functions. The latter was easy to get around: we
  38. don't use them on the 68020 either, but we do have a library,
  39. .CW -l68881 ,
  40. that you can use if you need the performance (which can be
  41. substantial:
  42. .CW astro
  43. runs twice as fast).
  44. We don't use this library by default because we want to run the same
  45. binaries on both machines and don't want to emulate
  46. .CW FCOSH
  47. in the operating system.
  48. .PP
  49. The problem with IEEE is nastier. We didn't really want to deal
  50. with gradual underflow and all that, especially since we had
  51. half a dozen machines we'd need to do it on, so on the 68040
  52. we implement non-trapping underflow as truncation to zero and
  53. do nothing about denormalized numbers and not-a-numbers.
  54. This means the 68020
  55. and the 68040 are not precisely compatible.
  56. .SH
  57. The Motorola MC68000 compiler
  58. .PP
  59. This compiler is a stripped-down version of the MC68020 compiler
  60. built for an abortive port to the Dragonball processor on the Palm Pilot.
  61. It generates position-independent code whose overall quality is much
  62. poorer than the code for the MC68020.
  63. .SH
  64. The MIPS compiler
  65. .PP
  66. This compiler generates code for the R2000, R3000, and R4000 machines configured
  67. to be big-endians. The compiler generates no R4000-specific instructions
  68. although the assembler and loader support the new user-mode instructions.
  69. There is no support for little-endian machines.
  70. (A little-endian port exists, but is not included in the distribution.
  71. Contact us if you need it.)
  72. Considering its speed, the Plan 9 compiler generates good code,
  73. but the commercial
  74. MIPS compiler with all the stops pulled out consistently beats it
  75. by 20% or so, sometimes more. Since ours compiles about 10 times
  76. faster and we spend most of our time compiling anyway,
  77. we are content with the tradeoff.
  78. .PP
  79. The compiler is solid: we've used it for several big projects and, of course,
  80. all our applications run under it.
  81. The behavior of floating-point programs is much like on the 68040:
  82. the operating system emulates where necessary to get past non-trapping
  83. underflow and overflow, but does not handle gradual underflow or
  84. denormalized numbers or not-a-numbers.
  85. .SH
  86. The SPARC compiler
  87. .PP
  88. The SPARC compiler is also solid and fast, although we haven't
  89. used it for a few years, due to a lack of current hardware. We have seen it do
  90. much better than GCC with all the optimizations, but on average
  91. it is probably about the same.
  92. .PP
  93. We used to run some old SPARC machines with no multiply or divide instructions,
  94. so the compiler
  95. does not produce them by default.
  96. Instead it calls internal subroutines.
  97. A loader flag,
  98. .CW -M ,
  99. causes the instructions to be emitted. The operating system has
  100. trap code to emulate them if necessary, but the traps are slower than
  101. emulating them in user mode.
  102. In any modern lab, in which SPARCS have the instructions, it would be worth enabling the
  103. .CW -M
  104. flag by default.
  105. .PP
  106. The floating point story is the same as on the MIPS.
  107. .SH
  108. The Intel i386 compiler
  109. .PP
  110. This is really an
  111. .I x 86
  112. compiler, for
  113. .I x >2.
  114. It works only
  115. if the machine is in 32-bit protected mode.
  116. It is solid and generates tolerable code; it is our main compiler these days.
  117. .PP
  118. Floating point is well-behaved, but the compiler assumes i387-compatible
  119. hardware to execute
  120. the instructions. With 387 hardware,
  121. the system does the full IEEE 754 job, just like
  122. the MC68881. By default, the libraries don't use the 387 built-ins for
  123. transcendentals.
  124. If you want them,
  125. build the code in
  126. .CW /sys/src/libc/386/387 .
  127. .SH
  128. The Intel i960 compiler
  129. .PP
  130. This compiler was built as a weekend hack to let us get the Cyclone
  131. boards running. It has only been used to run one program\(emthe on-board
  132. code in the Cyclone\(emand is therefore likely to be buggy.
  133. There are a number of obvious optimizations to the code that have
  134. never been attempted.
  135. For example, the compiler does not support pipelining.
  136. The code runs in little-endian mode.
  137. .SH
  138. The DEC Alpha compiler
  139. .PP
  140. The Alpha compiler is based on a port done by David Hogan while
  141. studying at the Basser Department of Computer Science, University of Sydney.
  142. It has been used to build a running version of the operating system, but has
  143. not been stressed as much as some of the other compilers.
  144. .PP
  145. Although the Alpha is a 64-bit architecture, this compiler treats
  146. .CW int s,
  147. .CW long s
  148. and pointers as 32 bits. Access to the 64-bit operations is available through the
  149. .CW vlong
  150. type, as with the other architectures.
  151. .PP
  152. The compiler assumes that the target CPU supports the optional byte and
  153. word memory operations (the ``BWX'' extension).
  154. If you have an old system, you can generate code without using the extension
  155. by passing the loader the
  156. .CW -x
  157. option.
  158. .PP
  159. There are a number of optimizations that the Alpha Architecture Handbook
  160. recommends, but this compiler does not do. In particular, there is currently
  161. no support for the code alignment and code scheduling optimizations.
  162. .PP
  163. The compiler tries to conform to IEEE, but some Alpha CPUs do not implement
  164. all of the rounding and trapping modes in silicon. Fixing this problem requires
  165. some software emulation code in the kernel; to date, this has not been attempted.
  166. .SH
  167. The PowerPC compiler
  168. .PP
  169. The PowerPC compiler supports the 32-bit PowerPC architecture only;
  170. it does not support either the 64-bit extensions or the POWER compatibility instructions.
  171. It has been used for production operating system work on the 603, 603e, 604e, 821, 823, and 860.
  172. On the 8xx floating-point instructions must be emulated.
  173. Instruction scheduling is not implemented; otherwise the code generated
  174. is similar to that for the other load-store architectures.
  175. The compiler makes little or no use of unusual PowerPC features such as the
  176. counter register, several condition code registers, and multiply-accumulate
  177. instructions, but they are sometimes
  178. used by assembly language routines in the libraries.
  179. .SH
  180. The Acorn ARM compiler
  181. .PP
  182. The ARM compiler is fairly solid; it has been used for some production
  183. operating system work including Inferno and the Plan 9 kernel
  184. for the iPAQ, which uses a StrongArm SA1.
  185. The compiler supports the ARMv4 architecture;
  186. it does not support the Thumb instruction set.
  187. It has been used on ARM7500FE processors and the Strongarm SA1 core machines.
  188. The compiler generates instructions for the ARM floating-point coprocessor.
  189. .SH
  190. The AMD 29000 compiler
  191. .PP
  192. This compiler was used to port an operating system to an AMD 29240 processor.
  193. The project is long abandoned, but the compiler lives on.
  194. .SH
  195. The Carrera operating system
  196. .PP
  197. We used to have a number of MIPS R4400 PC-like devices called Carreras,
  198. with custom-built frame buffers, that we used as terminals.
  199. They're almost all decommissioned now, but we're including the source as a reference
  200. in case someone wants to get another MIPS-based system running.
  201. .SH
  202. The IBM PC operating system
  203. .PP
  204. The PC version of Plan 9 can boot either from MS-DOS
  205. or directly from a disk created by the
  206. .CW format
  207. command; see
  208. .I prep (8).
  209. Plan 9 runs in 32-bit mode\(emwhich requires a 386 or later model x86 processor\(emand
  210. has an interrupt-driven I/O system, so it does not
  211. use the BIOS (except for a small portion of the boot program and floppy boot block).
  212. This helps performance but limits the set of I/O devices that it can support without
  213. special code.
  214. .PP
  215. Plan 9 supports the ISA, EISA, and PCI buses as well as PCMCIA and PC card devices.
  216. It is infeasible to list all the supported machines, because
  217. the PC-clone marketplace is too volatile and there is
  218. no guarantee that the machine you buy today will contain the
  219. same components as the one you bought yesterday.
  220. (For our lab, we buy components and assemble the machines
  221. ourselves in an attempt to lessen this effect.)
  222. Both IDE/ATA and SCSI disks are supported, and
  223. there is support for large ATA drives.
  224. CD-ROMs are supported two ways, either on the SCSI bus, or as ATA(PI) devices.
  225. The SCSI adapter must be a member of the Mylex Multimaster (old Buslogic BT-*) series
  226. or the Symbios 53C8XX series.
  227. Supported Ethernet cards include the
  228. AMD79C790,
  229. 3COM Etherlink III and 3C589 series,
  230. Lucent Wavelan and compatibles,
  231. NE2000,
  232. WD8003,
  233. WD8013,
  234. SMC Elite and Elite Ultra,
  235. Linksys Combo EthernetCard and EtherFast 10/100,
  236. and a variety of controllers based on the
  237. Intel i8255[789] and Digital (now Intel) 21114x chips.
  238. We mostly use Etherlink III, i8255[789], and 21114x, so those drivers may be more robust.
  239. There must be an explicit Plan 9 driver for peripherals;
  240. it cannot use DOS or Windows drivers.
  241. Also,
  242. Plan 9 cannot exploit special hardware-related features that fall outside of the
  243. IBM PC model,
  244. such as power management,
  245. unless architecture-dependent code is added to the kernel.
  246. For more details see
  247. .I plan9.ini (8).
  248. .PP
  249. Over the years,
  250. Plan 9 has run on a number of VGA cards.
  251. Recent changes to the graphics system have not been
  252. tested on most of the older cards; some effort may be needed to get them working again.
  253. In our lab, most of our machines use the ATI Mach64, S3 ViRGE, or S3 Savage chips,
  254. so such devices are probably
  255. the most reliable.
  256. We also use a few Matrox and TNT cards.
  257. The system requires a hardware cursor.
  258. For more details see
  259. .I vgadb (6)
  260. and
  261. .I vga (8).
  262. The wiki
  263. .CW http://plan9.bell-labs.com/wiki/plan9 ) (
  264. contains the definitive list of cards that are known to work; see the ``supported PC hardware''
  265. page.
  266. .PP
  267. For audio, Plan 9 supports the Sound Blaster 16 and compatibles.
  268. (Note that audio doesn't work under Plan 9 with 8-bit Sound Blasters.)
  269. There is also user-level support for USB audio devices; see
  270. .I usb (4).
  271. .PP
  272. Finally, it's important to have a three-button mouse with Plan 9.
  273. The system currently works only with mice on the PS/2 port or USB.
  274. Serial mouse support should return before long.
  275. .PP
  276. Once you have Plan 9 installed (see the wiki's installation document)
  277. run the program
  278. .CW ld
  279. from DOS
  280. or use a boot disk. See
  281. .I booting (8),
  282. .I 9load (8),
  283. and
  284. .I prep (8)
  285. for more information.
  286. .SH
  287. The Alpha PC operating system
  288. .PP
  289. Plan 9 runs on the Alpha PC 164.
  290. The Alpha port has not been used as much as the others,
  291. and should be considered a preliminary release.
  292. .PP
  293. The port uses the OSF/1 flavor
  294. of PALcode, and should be booted from the SRM firmware (booting
  295. from ARC is not supported).
  296. Supported devices are a subset of the PC ones; currently
  297. this includes DECchip 2114x-based ethernet cards, S3 VGA cards,
  298. Sound Blaster 16-compatible audio, floppy drives, and ATA hard disks.
  299. .PP
  300. The system has to be booted via tftp.
  301. See
  302. .I booting (8)
  303. for details.
  304. .SH
  305. The PowerPC operating system
  306. .PP
  307. We have a version of the system that runs on the PowerPC
  308. on a home-grown machine called Viaduct.
  309. The Viaduct minibrick is a small (12x9x3 cm) low-cost embedded
  310. computer consisting of a 50Mhz MPC850, 16MB sdram, 2MB flash,
  311. and two 10Mb Ethernet ports. It is designed for home/SOHO
  312. networking applications such as VPN, firewalls, NAT, etc.
  313. .PP
  314. The kernel has also been ported to the Motorola MTX embedded motherboard;
  315. that port is included in the distribution.
  316. The port only works with a 604e processor (the 603e is substantially different)
  317. and at present only a single CPU is permitted.
  318. .SH
  319. The Compaq iPAQ operating system
  320. .PP
  321. Plan 9 was ported to Compaq's iPAQ Pocket PC,
  322. which uses the StrongArm SA1 processor.
  323. The model we have is a 3630; neighboring models also work.
  324. The kernel can drive a PCMCIA sleeve with a WaveLAN card, but no other PCMCIA
  325. devices have been ported yet.
  326. .PP
  327. The iPAQ runs
  328. .CW rio
  329. with a small keyboard application that allows Palm-style handwriting
  330. input as well as typing with the stylus on a miniature keyboard.
  331. .PP
  332. Fco. J. Ballesteros
  333. .CW nemo@plan9.escet.urjc.es ) (
  334. added support for hibernation, but we haven't been able to
  335. get that to work again in the new kernel; the code is there, however,
  336. for volunteers to play with.
  337. See the file
  338. .CW /sys/src/9/bitsy/Booting101
  339. for information about installing Plan 9 on the iPAQ.
  340. .SH
  341. The file server
  342. .PP
  343. The file server runs on only a handful of distinct machines.
  344. It is a stand-alone program, distantly related to the CPU server
  345. code, that runs no user code: all it does is serve files on
  346. network connections.
  347. It supports only SCSI disks, which can be interleaved for
  348. faster throughput.
  349. A DOS file on
  350. an IDE drive can hold the configuration information.
  351. See
  352. .I fsconfig (8)
  353. for an explanation of how
  354. to configure a file server.
  355. .PP
  356. To boot a file server, follow the directions for booting a CPU server
  357. using the file name
  358. .CW 9\f2machtype\fPfs
  359. where
  360. .I machtype
  361. is
  362. .CW pc ,
  363. etc. as appropriate.
  364. We are releasing only the PC version.
  365. .SH
  366. The IBM PC file server
  367. .PP
  368. Except for the restriction to SCSI disks,
  369. the PC file server has the same hardware requirements as
  370. the regular PC operating system.
  371. However, only a subset of the supported SCSI (Adaptec 1542, Mylex Multimaster,
  372. and Symbios 53C8XX) and Ethernet (Digital 2114x,
  373. Intel 8255x, and 3Com) controllers
  374. may be
  375. used.
  376. Any of the boot methods described in
  377. .I 9load (8)
  378. will work.
  379. .PP
  380. To boot any PC, the file
  381. .CW 9load
  382. must reside on a MS-DOS formatted floppy, IDE disk,
  383. or SCSI disk.
  384. However, PCs have no non-volatile RAM in which the
  385. file server can store its configuration information, so the system
  386. stores it in a file on an MS-DOS file system instead.
  387. This file, however, cannot live on a SCSI disk, only a floppy or IDE.
  388. (This restriction avoids a lot of duplicated interfaces in the
  389. system.)
  390. Thus the file server cannot be all-SCSI.
  391. See
  392. .I plan9.ini (8)
  393. for details about the
  394. .I nvr
  395. variable and specifying the console device.
  396. .SH
  397. Backup
  398. .PP
  399. Our main file server is unlikely to be much like yours.
  400. It is a PC with 128 megabytes
  401. of cache memory, 56 gigabytes of SCSI magnetic
  402. disk, and a Hewlett-Packard SureStore Optical 1200ex
  403. magneto-optical jukebox, with 1.2 terabytes of storage.
  404. This driver runs the SCSI standard jukebox protocol.
  405. We also have a driver for a (non-standard)
  406. SONY WDA-610
  407. Writable Disk Auto Changer (WORM),
  408. which stores almost 350 gigabytes of data.
  409. .PP
  410. The WORM is actually the prime storage; the SCSI disk is just
  411. a cache to improve performance.
  412. Early each morning the system constructs on WORM an image of
  413. the entire system as it appears that day. Our backup system
  414. is therefore just a file server that lets
  415. you look at yesterday's (or last year's) file system.
  416. .PP
  417. If you don't have a magneto-optical jukebox,
  418. you might consider attaching a CD-R jukebox or even just
  419. using a single WORM drive and managing the dumps a little less
  420. automatically. This is just a long way of saying that the
  421. system as distributed has no explicit method of backup other
  422. than through the WORM jukebox.
  423. .PP
  424. Not everyone can invest in such expensive hardware, however.
  425. Although it wouldn't be as luxurious,
  426. it would be possible to use
  427. .I mkfs (8)
  428. to build regular file system archives and use
  429. .I scuzz (8)
  430. to stream them to a SCSI 8mm tape drive.
  431. .CW Mkext
  432. could then extract them.
  433. Another alternative is to use
  434. .I dump9660
  435. (see
  436. .I mk9660 (8)),
  437. which stores incremental backups on CD images
  438. in the form of a dump hierarchy.
  439. .PP
  440. It is also possible to treat a regular disk, or even a part of a disk,
  441. as a fake WORM, which can then be streamed to tape when it fills.
  442. This is a bad idea for a production system but a good way to
  443. learn about the WORM software.
  444. Again, see
  445. .I fsconfig (8)
  446. for details.