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