Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 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 Routerboard 450G operating system
223
.PP
224
This is a CPU kernel that runs on the Mikrotik Routerboard RB450G,
225
which contains a MIPS 24K CPU
226
(the Atheros 7161), which implements the MIPS32R2 architecture.
227
It has 256MB of RAM and a serial port.
228
The CPU lacks the 64-bit instructions of previous MIPS systems (e.g.,
229
SGI Challenge and Carrera).
230
There is no hardware floating-point, so we emulate the instructions.
231
Only the first of the five Gigabit Ethernet ports is currently supported;
232
the other four are connected via an internal switch.
233
To avoid a bug in the CPU (erratum 48), we run the caches write-through,
234
rather than write-back, and compiled
235
.CW /mips
236
with a
237
.I vl
238
modified to emit enough NOPs to avoid three consecutive store instructions
239
(see
240
.CW /sys/src/cmd/vl/noop.c
241
to enable this).
242
.
243
.SH
244
The PowerPC operating system
245
.PP
246
We have a version of the system that runs on the PowerPC
247
on a home-grown machine called Viaduct.
248
The Viaduct minibrick is a small (12x9x3 cm) low-cost embedded
249
computer consisting of a 50Mhz MPC850, 16MB sdram, 2MB flash,
250
and two 10Mb Ethernet ports.  It is designed for home/SOHO
251
networking applications such as VPN, firewalls, NAT, etc.
252
.PP
253
The kernel has also been ported to the Motorola MTX embedded motherboard;
254
that port is included in the distribution.
255
The port only works with a 604e processor (the 603e is substantially different)
256
and at present only a single CPU is permitted.
257
.PP
258
We have ports to the Xilinx Virtex 4 and 5 FPGAs
259
which use PowerPC 405 and 440 processors, respectively.
260
.
261
.SH
262
The Marvell Kirkwood operating system
263
.PP
264
This is an ARM kernel for the ARM926EJ-S processor
265
and it emulates ARM 7500 floating-point and
266
CAS (compare-and-swap) instructions.
267
It is known to run on the Sheevaplug, Guruplug, Dreamplug
268
and Openrd-client boards.
269
It is derived from a port of native Inferno to the Sheevaplug
270
by Salva Peir\f(JpĆ³\fP and Mechiel Lukkien.
271
There are many features of the Kirkwood system-on-a-chip
272
that it does not exploit.
273
There are currently drivers for up to two
274
Gigabit Ethernet interfaces,
275
USB and the console serial port;
276
we hope to add crypto acceleration, and a video driver for the Openrd-client.
277
.SH
278
The Marvell PXA168 operating system
279
.PP
280
This is an ARM kernel for the ARM-v5-architecture processor in the
281
Marvell PXA168 system-on-a-chip
282
and it emulates ARM 7500 floating-point and
283
CAS (compare-and-swap) instructions.
284
It is known to run on the Guruplug Display.
285
There are many features of the system-on-a-chip
286
that it does not exploit.
287
There are currently drivers for
288
a Fast Ethernet interface,
289
and the console serial port;
290
we hope to add crypto acceleration, and a video driver.
291
.SH
292
The TI OMAP35 operating system
293
.PP
294
This is an ARM kernel for the Cortex-A8 processor
295
and it emulates ARM 7500 floating-point and
296
CAS (compare-and-swap) instructions.
297
It is known to run on the IGEPv2 board and the Gumstix Overo,
298
and might eventually run on the Beagleboard, once USB is working.
299
There are many features of the OMAP system-on-a-chip that it does not exploit.
300
Initially, there are drivers for the SMSC 9221 100Mb/s Ethernet
301
interface in the IGEPv2 and Overo,
302
and the console serial port;
303
we hope to add USB, flash memory and video drivers.
304
.SH
305
The Nvidia Tegra2 operating system
306
.PP
307
This is an ARM kernel for the dual Cortex-A9 processors
308
in the Nvidia Tegra2 system-on-a-chip
309
and it emulates ARM 7500 floating-point and
310
CAS (compare-and-swap) instructions, but
311
the hardware includes VFP3 floating-point.
312
It runs on the Compulab Trimslice.
313
There are many features of the system-on-a-chip that it does not exploit.
314
Initially, there are drivers for the Ethernet interface
315
and the console serial port;
316
we hope to add USB, flash memory and video drivers.
317
.SH
318
The Broadcom 2835 operating system
319
.PP
320
This consists of terminal and CPU kernels for the ARM1176 processor
321
in the Broadcom 2835 system-on-a-chip.
322
The hardware includes VFP2 floating-point.
323
It runs on the Raspberry Pi Models A and B.
324
Since it relies upon USB Ethernet and the Plan 9 USB Ethernet
325
driver doesn't implement multicast, this port can't speak IPv6.
326
.
327
.ig
328
.SH
329
The file server
330
.PP
331
The file server runs on only a handful of distinct machines.
332
It is a stand-alone program, distantly related to the CPU server
333
code, that runs no user code: all it does is serve files on
334
network connections.
335
It supports only SCSI disks, which can be interleaved for
336
faster throughput.
337
A DOS file on
338
an IDE drive can hold the configuration information.
339
See
340
.I fsconfig (8)
341
for an explanation of how
342
to configure a file server.
343
.PP
344
To boot a file server, follow the directions for booting a CPU server
345
using the file name
346
.CW 9\f2machtype\fPfs
347
where
348
.I machtype
349
is
350
.CW pc ,
351
etc. as appropriate.
352
We are releasing only the PC version.
353
.SH
354
The IBM PC file server
355
.PP
356
Except for the restriction to SCSI disks,
357
the PC file server has the same hardware requirements as
358
the regular PC operating system.
359
However, only a subset of the supported SCSI (Adaptec 1542, Mylex Multimaster,
360
and Symbios 53C8XX) and Ethernet (Digital 2114x,
361
Intel 8255x, and 3Com) controllers
362
may be
363
used.
364
Any of the boot methods described in
365
.I 9load (8)
366
will work.
367
.PP
368
To boot any PC, the file
369
.CW 9load
370
must reside on a MS-DOS formatted floppy, IDE disk,
371
or SCSI disk.
372
However, PCs have no non-volatile RAM in which the
373
file server can store its configuration information, so the system
374
stores it in a file on an MS-DOS file system instead.
375
This file, however, cannot live on a SCSI disk, only a floppy or IDE.
376
(This restriction avoids a lot of duplicated interfaces in the
377
system.)
378
Thus the file server cannot be all-SCSI.
379
See
380
.I plan9.ini (8)
381
for details about the
382
.I nvr
383
variable and specifying the console device.
384
.SH
385
Backup
386
.PP
387
Our main file server is unlikely to be much like yours.
388
It is a PC with 128 megabytes
389
of cache memory, 56 gigabytes of SCSI magnetic
390
disk, and a Hewlett-Packard SureStore Optical 1200ex
391
magneto-optical jukebox, with 1.2 terabytes of storage.
392
This driver runs the SCSI standard jukebox protocol.
393
We also have a driver for a (non-standard)
394
SONY WDA-610
395
Writable Disk Auto Changer (WORM),
396
which stores almost 350 gigabytes of data.
397
.PP
398
The WORM is actually the prime storage; the SCSI disk is just
399
a cache to improve performance.
400
Early each morning the system constructs on WORM an image of
401
the entire system as it appears that day.  Our backup system
402
is therefore just a file server that lets
403
you look at yesterday's (or last year's) file system.
404
.PP
405
If you don't have a magneto-optical jukebox,
406
you might consider attaching a CD-R jukebox or even just
407
using a single WORM drive and managing the dumps a little less
408
automatically.  This is just a long way of saying that the
409
system as distributed has no explicit method of backup other
410
than through the WORM jukebox.
411
.PP
412
Not everyone can invest in such expensive hardware, however.
413
Although it wouldn't be as luxurious,
414
it would be possible to use
415
.I mkfs (8)
416
to build regular file system archives and use
417
.I scuzz (8)
418
to stream them to a SCSI 8mm tape drive.
419
.CW Mkext
420
could then extract them.
421
Another alternative is to use
422
.I dump9660
423
(see
424
.I mk9660 (8)),
425
which stores incremental backups on CD images
426
in the form of a dump hierarchy.
427
.PP
428
It is also possible to treat a regular disk, or even a part of a disk,
429
as a fake WORM, which can then be streamed to tape when it fills.
430
This is a bad idea for a production system but a good way to
431
learn about the WORM software.
432
Again, see
433
.I fsconfig (8)
434
for details.
435
..