1ed8b7fd4SCharles.Forsyth.TL 2ed8b7fd4SCharles.ForsythInferno Ports: Hosted and Native 3ed8b7fd4SCharles.Forsyth.AU 4ed8b7fd4SCharles.ForsythVita Nuova 5ed8b7fd4SCharles.Forsyth27 April 2005 6ed8b7fd4SCharles.ForsythRevised 22 January 2007 7ed8b7fd4SCharles.Forsyth.PP 8ed8b7fd4SCharles.ForsythInferno is a portable environment, encompassing operating system, 9ed8b7fd4SCharles.Forsythlanguages, virtual machine and the tools required to build it. 10ed8b7fd4SCharles.ForsythThis section briefly summarises the state of the ports and compilers 11ed8b7fd4SCharles.Forsythincluded in this release. 12ed8b7fd4SCharles.ForsythDirectory names are relative to the root of the Inferno release tree, 13ed8b7fd4SCharles.Forsythunless otherwise specified by the context. 14ed8b7fd4SCharles.Forsyth.PP 15ed8b7fd4SCharles.ForsythAll components are built using the program 16ed8b7fd4SCharles.Forsyth.CW mk , 17ed8b7fd4SCharles.Forsythbased on `make'-like recipes found in the 18ed8b7fd4SCharles.Forsyth.CW mkfile 19ed8b7fd4SCharles.Forsythin each source directory throughout the Inferno tree. 20ed8b7fd4SCharles.Forsyth.CW Mk 21ed8b7fd4SCharles.Forsythis described by the manual page 22ed8b7fd4SCharles.Forsyth.I mk (10.1) 23ed8b7fd4SCharles.Forsythin Volume 1; a more tutorial discussion, including 24ed8b7fd4SCharles.Forsytha summary of differences with Unix 25ed8b7fd4SCharles.Forsyth.I make , 26ed8b7fd4SCharles.Forsythcan be found in 27ed8b7fd4SCharles.Forsyth.I "Maintaining Files on Plan 9 with Mk" 28aaab9bccSforsythby Hume and Flandrena, 29ed8b7fd4SCharles.Forsythreprinted in this volume. 30ed8b7fd4SCharles.ForsythThe source for 31ed8b7fd4SCharles.Forsyth.CW mk 32ed8b7fd4SCharles.Forsythitself is included in 33ed8b7fd4SCharles.Forsyth.CW utils/mk . 34a724700aSCharles.ForsythIt is included ready-made in the full and source-only distributions, to make life easier. 35a724700aSCharles.ForsythIt must be compiled manually only on the initial port to a new host environment; 36a724700aSCharles.Forsythinstructions for that are given below. 37a724700aSCharles.Forsyth.PP 38ed8b7fd4SCharles.Forsyth.NH 1 39ed8b7fd4SCharles.ForsythThe C compilers 40ed8b7fd4SCharles.Forsyth.PP 41ed8b7fd4SCharles.ForsythAn unusual property of the compiler suites used to compile native 42ed8b7fd4SCharles.ForsythInferno is that there is no difference in configuration or content 43ed8b7fd4SCharles.Forsythbetween a `compiler' (compiling on the same system and processor type as the target) 44ed8b7fd4SCharles.Forsythand a `cross compiler' (compiling on a host that differs from the target), 45ed8b7fd4SCharles.Forsytheven when the host operating systems are quite different. 46ed8b7fd4SCharles.ForsythIndeed, in their ancestral home, Plan 9, it is the default action to compile 47ed8b7fd4SCharles.Forsythinstances of all compilers for all possible target architectures, 48ed8b7fd4SCharles.Forsythas a matter of course. 49ed8b7fd4SCharles.Forsyth.PP 50ed8b7fd4SCharles.ForsythThe main difference between this suite and the original Plan 9 suite is 51ed8b7fd4SCharles.Forsyththat all Plan 9 C extensions have been eliminated from the compiler's own source, 52ed8b7fd4SCharles.Forsythallowing it to be compiled on environments that accurately support 53ed8b7fd4SCharles.ForsythANSI C and a few necessary Posix functions. 54ed8b7fd4SCharles.Forsyth.PP 55ed8b7fd4SCharles.ForsythThe source for the compilers is found in subdirectories of 56ed8b7fd4SCharles.Forsyth.CW utils . 57ed8b7fd4SCharles.ForsythThe compilers are named as follows: 58ed8b7fd4SCharles.Forsyth.RS 59ed8b7fd4SCharles.Forsyth.IP \f50c\fP 8 60ed8b7fd4SCharles.ForsythMIPS compiler for 64-bit little-endian R4000 MIPS (or `\f5spim\fP') 61ed8b7fd4SCharles.Forsyth.IP \f51c\fP 62ed8b7fd4SCharles.Forsyth68000 compiler, usable with the Motorola Dragonball 63ed8b7fd4SCharles.Forsyth.IP \f52c\fP 64ed8b7fd4SCharles.Forsyth680x0 compiler for x >= 2 65ed8b7fd4SCharles.Forsyth.IP \f55c\fP 66ed8b7fd4SCharles.ForsythARM compiler 67ed8b7fd4SCharles.Forsyth.IP \f56c\fP 68ed8b7fd4SCharles.ForsythAMD64 69ed8b7fd4SCharles.Forsyth.IP \f58c\fP 70ed8b7fd4SCharles.ForsythIntel x86 compiler, for x>2 71ed8b7fd4SCharles.Forsyth.IP \f5kc\fP 72ed8b7fd4SCharles.ForsythSun SPARC compiler 73ed8b7fd4SCharles.Forsyth.IP \f5qc\fP 74ed8b7fd4SCharles.ForsythPowerPC compiler 75ed8b7fd4SCharles.Forsyth.IP \f5vc\fP 76ed8b7fd4SCharles.ForsythMIPS R[234]000 in 32-bit big-endian mode 77ed8b7fd4SCharles.Forsyth.RE 78ed8b7fd4SCharles.Forsyth.LP 79ed8b7fd4SCharles.ForsythThe compilers share components, compiled into a library from 80ed8b7fd4SCharles.Forsythsource in the directory 81ed8b7fd4SCharles.Forsyth.CW utils/cc . 82ed8b7fd4SCharles.ForsythThe corresponding assemblers and linkers are found in similarly 83ed8b7fd4SCharles.Forsythnamed directories: 84ed8b7fd4SCharles.Forsyth.CW 2a 85ed8b7fd4SCharles.Forsythand 86ed8b7fd4SCharles.Forsyth.CW 2l 87ed8b7fd4SCharles.Forsythare the assembler and linker for use with 88ed8b7fd4SCharles.Forsyth.CW 2c 89ed8b7fd4SCharles.Forsythfor instance. 90ed8b7fd4SCharles.ForsythNote that this suite is unusual in that the compilers and assemblers produce 91ed8b7fd4SCharles.Forsytha binary assembly language that is finally converted to machine code 92ed8b7fd4SCharles.Forsythby the linker. 93ed8b7fd4SCharles.ForsythThe assembler is used only to write machine-language assist for the operating 94ed8b7fd4SCharles.Forsythsystem, or a run-time routines using instructions not accessible from C, 95ed8b7fd4SCharles.Forsythand is not used by the compiler. 96ed8b7fd4SCharles.ForsythSee the paper ``Plan 9 C compilers'' by Ken Thompson, 97ed8b7fd4SCharles.Forsythreprinted in this volume. 98ed8b7fd4SCharles.Forsyth.PP 99ed8b7fd4SCharles.ForsythWith the exception of the 68000 compiler, all the compilers have been 100ed8b7fd4SCharles.Forsythused extensively to compile Inferno, and most have been used 101ed8b7fd4SCharles.Forsythto compile Plan 9 and all its applications; and we have found them solid. 102ed8b7fd4SCharles.ForsythThe 68000 compiler was used to attempt a port of Inferno to the Motorola 103ed8b7fd4SCharles.ForsythDragonball (in the Palm Pilot). 104ed8b7fd4SCharles.ForsythIt is included here in case someone wishes to have another go. 105ed8b7fd4SCharles.ForsythWe have no experience with it. 106ed8b7fd4SCharles.Forsyth.PP 107ed8b7fd4SCharles.ForsythThe ARM compiler 108ed8b7fd4SCharles.Forsyth.CW 5c 109ed8b7fd4SCharles.Forsythsupports the ARM (Strongarm, PXA) architecture; 110ed8b7fd4SCharles.Forsyththe related compiler 111ed8b7fd4SCharles.Forsyth.CW tc 112ed8b7fd4SCharles.Forsythgenerates ARM's Thumb instructions instead. 113ed8b7fd4SCharles.ForsythThe output of both can be linked together by the ARM loader 114ed8b7fd4SCharles.Forsyth.CW 5l 115ed8b7fd4SCharles.Forsythto achieve ARM-Thumb interworking. 116ed8b7fd4SCharles.Forsyth.CW 5c 117ed8b7fd4SCharles.Forsythhas been used to generate code for the StrongARM SA110 and SA1100 118ed8b7fd4SCharles.Forsythprocessors (the primary 119ed8b7fd4SCharles.Forsythtargets for native Inferno for many years). 120ed8b7fd4SCharles.ForsythThe code generated was greatly improved by Richard Miller. 121ed8b7fd4SCharles.ForsythThe floating-point support is adequate for C programs: the compiler 122ed8b7fd4SCharles.Forsythgenerates ARM floating-point instructions, as implemented on the ARM7500 but 123ed8b7fd4SCharles.Forsythnot on the Strongarm, where they must be emulated. 124ed8b7fd4SCharles.Forsyth.PP 125ed8b7fd4SCharles.ForsythThe PowerPC compiler supports the 32-bit PowerPC architecture only; 126ed8b7fd4SCharles.Forsythit does not support either the 64-bit extensions or the POWER compatibility instructions. 127ed8b7fd4SCharles.ForsythIt has been used for production operating system work on the 405EP, 603, 70x, 821, 823, and 860. 128ed8b7fd4SCharles.ForsythOn the embedded processors such as 405 and 8xx floating-point instructions must be emulated. 129ed8b7fd4SCharles.ForsythInstruction scheduling is not implemented; otherwise the code generated 130ed8b7fd4SCharles.Forsythis similar to that for the other load-store architectures. 131ed8b7fd4SCharles.ForsythThe compiler makes little or no use of unusual PowerPC features such as the 132ed8b7fd4SCharles.Forsythcounter register, several condition code registers, and multiply-accumulate 133ed8b7fd4SCharles.Forsythinstructions, but they are sometimes 134ed8b7fd4SCharles.Forsythused by assembly language routines in the libraries. 135ed8b7fd4SCharles.ForsythThe compiler does replace explicit comparisons by condition-setting instructions. 136ed8b7fd4SCharles.ForsythIts run-time conventions are more efficient than those of the PowerPC ABI. 137ed8b7fd4SCharles.Forsyth.NH 1 138ed8b7fd4SCharles.ForsythApplications 139ed8b7fd4SCharles.Forsyth.PP 140ed8b7fd4SCharles.ForsythDis object files are portable across all variants of Inferno, hosted and native. 141ed8b7fd4SCharles.ForsythThere need be only one copy of the Dis files to serve many different 142ed8b7fd4SCharles.Forsythversions of Inferno; they need not be rebuilt for each platform 143ed8b7fd4SCharles.Forsythand can be shared by different types of host. 144ed8b7fd4SCharles.ForsythLimbo insulates the programmer from all details of 145ed8b7fd4SCharles.Forsyththe particular processor, including byte-ordering, 146ed8b7fd4SCharles.Forsythand consequently the applications themselves are portable. 147ed8b7fd4SCharles.Forsyth.PP 148ed8b7fd4SCharles.ForsythThe source for the applications is found in subdirectories of 149ed8b7fd4SCharles.Forsyth.CW appl : 150ed8b7fd4SCharles.Forsyth.CW appl/cmd 151ed8b7fd4SCharles.Forsythholds the source for most command line applications (that use no graphics); 152ed8b7fd4SCharles.Forsyth.CW appl/wm 153ed8b7fd4SCharles.Forsythcontains the source for most applications that run under 154ed8b7fd4SCharles.Forsyth.I wm (1); 155ed8b7fd4SCharles.Forsyth.CW appl/svc 156ed8b7fd4SCharles.Forsythcontains the source for various system services and file servers; 157ed8b7fd4SCharles.Forsyth.CW appl/mux , 158ed8b7fd4SCharles.Forsyththe source for the interactive television demo 159ed8b7fd4SCharles.Forsyth.I mux (1); 160ed8b7fd4SCharles.Forsyth.CW appl/charon , 161ed8b7fd4SCharles.Forsyththe source for the Charon web browser; and 162ed8b7fd4SCharles.Forsyth.CW appl/acme 163ed8b7fd4SCharles.Forsyththe source for Acme written in Limbo. 164ed8b7fd4SCharles.Forsyth.PP 165ed8b7fd4SCharles.ForsythThe 166ed8b7fd4SCharles.Forsyth.CW mkfile 167ed8b7fd4SCharles.Forsythin each directory can currently only be used by an instance of 168ed8b7fd4SCharles.Forsyth.CW mk 169ed8b7fd4SCharles.Forsythrunning 170ed8b7fd4SCharles.Forsyth.I outside 171ed8b7fd4SCharles.Forsyththe Inferno environment, under the host operating system. 172ed8b7fd4SCharles.ForsythThis complicates its use with 173ed8b7fd4SCharles.Forsyth.I acme (1), 174ed8b7fd4SCharles.Forsythnormally requiring the use of the 175ed8b7fd4SCharles.Forsyth.I os (1) 176ed8b7fd4SCharles.Forsythcommand. 177ed8b7fd4SCharles.ForsythIn a few cases, there is a 178ed8b7fd4SCharles.Forsyth.CW mashfile 179ed8b7fd4SCharles.Forsyththat can be used by 180ed8b7fd4SCharles.Forsyth.I mash-make (1) 181ed8b7fd4SCharles.Forsythto build a Limbo application from within Inferno (native or hosted). 182ed8b7fd4SCharles.ForsythA consistent approach to building applications both inside and outside 183ed8b7fd4SCharles.ForsythInferno is being developed. 184ed8b7fd4SCharles.ForsythIn any case, the resulting Dis files are portable once produced. 185ed8b7fd4SCharles.Forsyth.NH 1 186ed8b7fd4SCharles.ForsythHosted Inferno (emu) 187ed8b7fd4SCharles.Forsyth.PP 188ed8b7fd4SCharles.ForsythThere are currently four main variants of hosted Inferno: Plan 9, Unix (and clones), MacOS X and Windows. 189ed8b7fd4SCharles.ForsythThe source is held in directory 190ed8b7fd4SCharles.Forsyth.CW emu , 191ed8b7fd4SCharles.Forsythwith a subdirectory for each hosted platform: 192*7ef44d65SYaroslav Kolomiiets.CW AIX , 193ed8b7fd4SCharles.Forsyth.CW FreeBSD , 194ed8b7fd4SCharles.Forsyth.CW Irix , 195ed8b7fd4SCharles.Forsyth.CW Linux , 196a724700aSCharles.Forsyth.CW MacOSX , 197a724700aSCharles.Forsyth.CW NetBSD , 198ed8b7fd4SCharles.Forsyth.CW Nt 199ed8b7fd4SCharles.Forsyth(for all Windows platforms, including the Internet Explorer plug-in), 200ed8b7fd4SCharles.Forsyth.CW Plan9 , 201a724700aSCharles.Forsyth.CW Solaris , 202ed8b7fd4SCharles.Forsythand so on. 203ed8b7fd4SCharles.ForsythEach platform directory has a 204ed8b7fd4SCharles.Forsyth.CW mkfile 205ed8b7fd4SCharles.Forsythand one or more configuration files of the form described by 206ed8b7fd4SCharles.Forsyth.I config (6). 207ed8b7fd4SCharles.ForsythAn executable for a particular host type is built on that host type, 208a724700aSCharles.Forsythusing the host's own command interpreter, not under Inferno. 209ed8b7fd4SCharles.ForsythMove to the 210ed8b7fd4SCharles.Forsyth.CW emu 211ed8b7fd4SCharles.Forsythsubdirectory appropriate to that host, 212ed8b7fd4SCharles.Forsythensure the command interpreter's path variable includes 213ed8b7fd4SCharles.Forsyththe directory containing the Inferno 214ed8b7fd4SCharles.Forsyth.CW bin 215ed8b7fd4SCharles.Forsythdirectory for that host 216ed8b7fd4SCharles.Forsyth(eg, 217ed8b7fd4SCharles.Forsyth.CW /home/inferno/Solaris/sparc/bin ), 218ed8b7fd4SCharles.Forsythand run 219ed8b7fd4SCharles.Forsyth.CW mk . 220ed8b7fd4SCharles.Forsyth.PP 221ed8b7fd4SCharles.ForsythLike the native kernels 222ed8b7fd4SCharles.Forsyth.CW emu 223ed8b7fd4SCharles.Forsythrelies on several auxiliary libraries (the source of which 224ed8b7fd4SCharles.Forsythit often shares with the native kernels). 225ed8b7fd4SCharles.ForsythEmu itself is built by the 226ed8b7fd4SCharles.Forsyth.CW mkfile 227ed8b7fd4SCharles.Forsythin the 228ed8b7fd4SCharles.Forsyth.CW emu 229a724700aSCharles.Forsythsubdirectory containing the platform-specific source for the host platform. 230ed8b7fd4SCharles.ForsythEach library has its own 231ed8b7fd4SCharles.Forsyth.CW mkfile ; 232ed8b7fd4SCharles.Forsyththe various components are made in the right order by the 233ed8b7fd4SCharles.Forsyth.CW mkfile 234ed8b7fd4SCharles.Forsythat the root of the Inferno tree. 235ed8b7fd4SCharles.ForsythThe 236ed8b7fd4SCharles.Forsyth.CW mkfile 237ed8b7fd4SCharles.Forsythfor each platform will also invoke 238ed8b7fd4SCharles.Forsyth.CW mk 239ed8b7fd4SCharles.Forsythrecursively to make the appropriate libraries 240ed8b7fd4SCharles.Forsythfor a given configuration. 241ed8b7fd4SCharles.Forsyth.PP 242ed8b7fd4SCharles.ForsythThe Unix emu variant generally is covered by `POSIX' (with common extensions) 243ed8b7fd4SCharles.Forsythbut each Unix port has one file that differs considerably for each port, 244ed8b7fd4SCharles.Forsythnamely \f5emu/\fP\fIplatform\fP\f5/os.c\fP, the differences 245ed8b7fd4SCharles.Forsythcorresponding to the different ways under Unix of implementing kernel-scheduled 246ed8b7fd4SCharles.Forsyththreads efficiently. 247ed8b7fd4SCharles.Forsyth.PP 248ed8b7fd4SCharles.ForsythThere are working emu versions 249ed8b7fd4SCharles.Forsythfor 250*7ef44d65SYaroslav KolomiietsAIX/power, 251ed8b7fd4SCharles.ForsythFreeBSD/386, 252ed8b7fd4SCharles.ForsythIrix/mips, 253ed8b7fd4SCharles.ForsythLinux/386, 254a724700aSCharles.ForsythNetBSD/386, 255a724700aSCharles.ForsythMacOSX/386, 256ed8b7fd4SCharles.ForsythMacOSX/power, 257ed8b7fd4SCharles.ForsythPlan 9, 258ed8b7fd4SCharles.ForsythSolaris/sparc, 259ed8b7fd4SCharles.Forsythand Windows (NT, 2000 and Explorer plug-in). 260ed8b7fd4SCharles.ForsythEach platform typically uses mechanisms specific to the host operating 261ed8b7fd4SCharles.Forsythsystem to implement Inferno's internal thread/process structure. 262ed8b7fd4SCharles.ForsythPOSIX threads have often been found to be insufficient (poorly implemented) 263ed8b7fd4SCharles.Forsython some platforms, and if so are avoided. 264ed8b7fd4SCharles.ForsythSee 265ed8b7fd4SCharles.Forsyth.CW kproc 266ed8b7fd4SCharles.Forsythin 267ed8b7fd4SCharles.Forsyth.CW emu/*/os.c . 268ed8b7fd4SCharles.Forsyth.PP 269ed8b7fd4SCharles.ForsythSource is included for ports to HP/UX (S800 architecture), 270ed8b7fd4SCharles.ForsythSolaris/386, and Unixware, in case someone wishes to take them up now, 271ed8b7fd4SCharles.Forsythbut we have not determined their fitness. 272ed8b7fd4SCharles.Forsyth.PP 273ed8b7fd4SCharles.ForsythThe Plan 9 hosted implementation is unusual in that it supports 274ed8b7fd4SCharles.Forsythseveral processor types: 275ed8b7fd4SCharles.Forsyth.CW 386 , 276ed8b7fd4SCharles.Forsyth.CW mips , 277ed8b7fd4SCharles.Forsyth.CW power 278ed8b7fd4SCharles.Forsyth(Power PC) 279ed8b7fd4SCharles.Forsythand 280ed8b7fd4SCharles.Forsyth.CW sparc . 281ed8b7fd4SCharles.ForsythFurthermore, all versions of 282ed8b7fd4SCharles.Forsyth.CW emu 283ed8b7fd4SCharles.Forsythcan be built on any processor type, in the usual way for Plan 9. 284ed8b7fd4SCharles.Forsyth.PP 285ed8b7fd4SCharles.ForsythOtherwise, as distributed, 286ed8b7fd4SCharles.Forsyth.CW emu 287ed8b7fd4SCharles.Forsythfor a platform can only be built when running on that platform. 288ed8b7fd4SCharles.Forsyth.PP 289ed8b7fd4SCharles.ForsythOne unusual variant makes the whole of Inferno a plug-in for Microsoft's 290ed8b7fd4SCharles.ForsythInternet Explorer, giving the same environment for Inferno applications 291ed8b7fd4SCharles.Forsythrunning in an HTML page as is provided by hosted or native Inferno. 292ed8b7fd4SCharles.ForsythThat is, there is not a distinct `applet' environment with special programming interfaces. 293ed8b7fd4SCharles.ForsythThe source for the various plug-in components is found in 294ed8b7fd4SCharles.Forsyth.CW /tools/plugin 295ed8b7fd4SCharles.Forsythand 296ed8b7fd4SCharles.Forsyth.CW /usr/internet 297ed8b7fd4SCharles.Forsythwithin the Inferno tree; they use the version of 298ed8b7fd4SCharles.Forsyth.I emu 299ed8b7fd4SCharles.Forsythdefined by the configuration file 300ed8b7fd4SCharles.Forsyth.CW /emu/Nt/ie . 301ed8b7fd4SCharles.Forsyth.PP 302a724700aSCharles.ForsythAll the libraries and executables can be built in a tree containing only the source code. 303ed8b7fd4SCharles.ForsythTo do that for a supported variant of hosted Inferno, on Unix or Plan 9, do the following 304ed8b7fd4SCharles.Forsythin the root of the Inferno tree: 305a724700aSCharles.Forsyth.nr Ci 0 +1 306a724700aSCharles.Forsyth.de Xx 307a724700aSCharles.Forsyth.IP \\n+(Ci 308a724700aSCharles.Forsyth.. 309a724700aSCharles.Forsyth.Xx 310a724700aSCharles.ForsythEdit 311a724700aSCharles.Forsyth.CW mkconfig 312a724700aSCharles.Forsythto reflect your host environment, 313a724700aSCharles.Forsythspecifically ROOT (which must be an absolute path name), SYSHOST and OBJTYPE. 314a724700aSCharles.ForsythThe comments in the file should help you choose. 315a724700aSCharles.Forsyth.Xx 316ed8b7fd4SCharles.ForsythRun 317ed8b7fd4SCharles.Forsyth.CW makemk.sh 318ed8b7fd4SCharles.Forsythto rebuild the 319ed8b7fd4SCharles.Forsyth.CW mk 320ed8b7fd4SCharles.Forsythcommand, which is used to build everything else. 321a724700aSCharles.Forsyth.Xx 322ed8b7fd4SCharles.ForsythSet 323ed8b7fd4SCharles.Forsyth.CW PATH 324ed8b7fd4SCharles.Forsyth(or 325ed8b7fd4SCharles.Forsyth.CW path 326ed8b7fd4SCharles.Forsython Plan 9) 327ed8b7fd4SCharles.Forsythto include the 328ed8b7fd4SCharles.Forsyth.CW bin 329ed8b7fd4SCharles.Forsythdirectory for the platform, which will now contain the 330ed8b7fd4SCharles.Forsyth.CW mk 331ed8b7fd4SCharles.Forsythbinary just built. 332ed8b7fd4SCharles.ForsythOn Unix, export 333ed8b7fd4SCharles.Forsyth.CW PATH . 334a724700aSCharles.Forsyth.Xx 335ed8b7fd4SCharles.ForsythThen 336ed8b7fd4SCharles.Forsyth.CW "mk nuke" 337ed8b7fd4SCharles.Forsythto remove any extraneous object files. 338a724700aSCharles.Forsyth.Xx 339ed8b7fd4SCharles.ForsythFinally, 340ed8b7fd4SCharles.Forsyth.CW "mk install" 341ed8b7fd4SCharles.Forsythto create and install the libraries, 342ed8b7fd4SCharles.Forsyth.CW limbo 343ed8b7fd4SCharles.Forsythcompiler, 344ed8b7fd4SCharles.Forsyth.CW emu 345ed8b7fd4SCharles.Forsythfor hosted Inferno, and auxiliary commands. 346ed8b7fd4SCharles.ForsythThe rules do that in an order that ensures that the commands or libraries 347ed8b7fd4SCharles.Forsythneeded by a later stage are built and installed first. 348ed8b7fd4SCharles.Forsyth(Note that a plain 349ed8b7fd4SCharles.Forsyth.CW mk 350ed8b7fd4SCharles.Forsythwill not suffice, because it does not put the results in the search path.) 351ed8b7fd4SCharles.Forsyth.LP 352ed8b7fd4SCharles.ForsythDoing something similar on Windows or Plan 9 currently requires the executable for 353ed8b7fd4SCharles.Forsyth.CW mk 354ed8b7fd4SCharles.Forsythto be available in the search path, 355ed8b7fd4SCharles.Forsythsince there is no equivalent of 356ed8b7fd4SCharles.Forsyth.CW makemk.sh . 357ed8b7fd4SCharles.ForsythOtherwise the procedure is the same. 358ed8b7fd4SCharles.ForsythOn Plan 9, of course, the host system's normal version of 359ed8b7fd4SCharles.Forsyth.CW mk 360ed8b7fd4SCharles.Forsythshould be adequate. 361ed8b7fd4SCharles.Forsyth.NH 1 362ed8b7fd4SCharles.ForsythNative Inferno 363ed8b7fd4SCharles.Forsyth.PP 364ed8b7fd4SCharles.ForsythAs with the different versions of emu, once the native kernel is running, all applications 365ed8b7fd4SCharles.Forsythwork straight away; 366ed8b7fd4SCharles.Forsyththe same applications are used in native and emulated mode, subject to 367ed8b7fd4SCharles.Forsythsuitable devices being available. 368ed8b7fd4SCharles.ForsythBecause the portable compiler suite is used to compile native kernels, 369ed8b7fd4SCharles.Forsythand those compilers are automatically cross-compilers, all native Inferno 370ed8b7fd4SCharles.Forsythimplementations can be built on any host platform. 371ed8b7fd4SCharles.ForsythFurthermore, the build procedures and resulting object files are the same. 372ed8b7fd4SCharles.Forsyth.PP 373ed8b7fd4SCharles.ForsythEarly ports in 1996 were made by Bell Labs to an internal device based on 374ed8b7fd4SCharles.Forsyththe AMD 29000, an early ARM-based `network computer', and Intel-based PCs. 375ed8b7fd4SCharles.ForsythBetween 1997 and 1999, Lucent concentrated mainly on the Strongarm platform 376ed8b7fd4SCharles.Forsyth(SA1100), for various Digital/Intel development boards, 377ed8b7fd4SCharles.Forsythand especially several `web phones', including the Sword Webphone Reference Design. 378ed8b7fd4SCharles.ForsythIt also undertook ports to other devices for experiment, or under contract. 379ed8b7fd4SCharles.Forsyth.PP 380ed8b7fd4SCharles.ForsythVita Nuova Limited also ported the system, both for its own purposes 381ed8b7fd4SCharles.Forsythand under contract to Lucent. 382ed8b7fd4SCharles.ForsythTargets included a small 386-based Internet device, 383ed8b7fd4SCharles.Forsytha set top Internet box using the PowerPC 603e, 384ed8b7fd4SCharles.Forsytha digital television set top box with a Strongarm SA110 and a Teralogic TL750 graphics chip, 385ed8b7fd4SCharles.Forsyththe USR/3Com Edgeserver (in a chassis containing various types of line card), 386ed8b7fd4SCharles.Forsythvarious boards based on the PowerPC 823/821/860, 387ed8b7fd4SCharles.Forsythmany different configurations of IBM PC, 388ed8b7fd4SCharles.Forsythand a Ziatech Pentium-based VME crate. 389ed8b7fd4SCharles.Forsyth.PP 390ed8b7fd4SCharles.ForsythDistribution of most previous and existing ports is restricted by 391ed8b7fd4SCharles.Forsyththe terms on which they were undertaken, 392ed8b7fd4SCharles.Forsythor because they were ports of older Inferno releases and not kept up to date. 393ed8b7fd4SCharles.ForsythWe have included the following as examples in this distribution. 394ed8b7fd4SCharles.Forsyth.SH 395ed8b7fd4SCharles.ForsythThe StrongARM kernel 396ed8b7fd4SCharles.Forsyth.PP 397ed8b7fd4SCharles.ForsythThe source for the StrongARM kernels is split across several directories. 398ed8b7fd4SCharles.ForsythThe directory 399ed8b7fd4SCharles.Forsyth.CW os/sa1110 400ed8b7fd4SCharles.Forsythcontains all code that is generally architecture-specific but platform-independent. 401ed8b7fd4SCharles.ForsythOther directories contain platform-specific code: 402ed8b7fd4SCharles.Forsyth.CW os/cerf1110 403ed8b7fd4SCharles.Forsythfor the Intrinsyc Cerfcube1110, 404ed8b7fd4SCharles.Forsythand 405ed8b7fd4SCharles.Forsyth.CW os/ipaq1110 406ed8b7fd4SCharles.Forsythfor the Compaq (as it then was) IPAQ H3650. 407ed8b7fd4SCharles.ForsythEarlier Webphone ports are tied to hardware that is not generally obtainable 408ed8b7fd4SCharles.Forsythand the ports to those 409ed8b7fd4SCharles.Forsythplatforms included some software (notably modem software) 410ed8b7fd4SCharles.Forsyththat cannot generally be distributed. 411ed8b7fd4SCharles.Forsyth.PP 412ed8b7fd4SCharles.ForsythThere is also a preliminary port to the ARM-based Intel XScale. 413ed8b7fd4SCharles.ForsythThe code common to PXA implementations is in 414ed8b7fd4SCharles.Forsyth.CW os/pxa . 415ed8b7fd4SCharles.ForsythThe initial platform was the Intrinsyc Cerfboard 250; its code is in 416ed8b7fd4SCharles.Forsyth.CW os/cerf250 . 417ed8b7fd4SCharles.ForsythA port to the Gumstix (see 418ed8b7fd4SCharles.Forsyth.CW www.gumstix.com ) 419ed8b7fd4SCharles.Forsythis in progress. 420ed8b7fd4SCharles.Forsyth.PP 421ed8b7fd4SCharles.ForsythThe platform's own bootstrap is used in all cases. 422ed8b7fd4SCharles.ForsythOn the IPAQ, the Linux bootloader from Compaq (HP) Research must 423ed8b7fd4SCharles.Forsythbe loaded onto the device first, following instructions given at 424ed8b7fd4SCharles.Forsyth.CW www.handhelds.org . 425ed8b7fd4SCharles.ForsythSee the 426ed8b7fd4SCharles.Forsyth.CW README 427ed8b7fd4SCharles.Forsythfile in each 428ed8b7fd4SCharles.Forsyth.CW os 429ed8b7fd4SCharles.Forsythsource directory for details. 430ed8b7fd4SCharles.Forsyth.PP 431ed8b7fd4SCharles.ForsythOther ARM-based processors to which Inferno has been ported include 432ed8b7fd4SCharles.Forsyththe ARM-7 evaluator kit (see 433ed8b7fd4SCharles.Forsyth.CW os/ks32 ), 434ed8b7fd4SCharles.Forsythalthough its memory is tight, 435ed8b7fd4SCharles.Forsythand the TI925 including the TI OMAP. 436ed8b7fd4SCharles.ForsythThe latter two ports were to proprietary TI925 implementations, and have not 437ed8b7fd4SCharles.Forsythbeen included, but there is a body of code common to all such platforms that 438ed8b7fd4SCharles.Forsythcould be made available if that were useful. 439ed8b7fd4SCharles.Forsyth.SH 440ed8b7fd4SCharles.ForsythThe PowerPC kernel 441ed8b7fd4SCharles.Forsyth.PP 442ed8b7fd4SCharles.ForsythThe directory 443ed8b7fd4SCharles.Forsyth.CW os/fads 444ed8b7fd4SCharles.Forsythcontains the port of Inferno to the MPC8xx FADS development board. 445ed8b7fd4SCharles.ForsythIt has been used with the MPC821, MPC823 and MPC860 processors. 446ed8b7fd4SCharles.ForsythIt uses code common to MPC8xx processors, found in 447ed8b7fd4SCharles.Forsyth.CW os/mpc . 448ed8b7fd4SCharles.ForsythThe interface to the CPM is provided by 449ed8b7fd4SCharles.Forsyth.CW cpm.c . 450ed8b7fd4SCharles.ForsythThere are drivers for the real time clock, 451ed8b7fd4SCharles.Forsythflash devices (including a Flash Translation Layer driver), 452ed8b7fd4SCharles.Forsythand communications controllers in Ethernet, 453ed8b7fd4SCharles.ForsythUART, and IrDA mode 454ed8b7fd4SCharles.Forsyth(see 455ed8b7fd4SCharles.Forsyth.CW etherscc.c 456ed8b7fd4SCharles.Forsythand 457ed8b7fd4SCharles.Forsyth.CW devuart.c ). 458aaab9bccSforsythThe IrDA has been used for 9P transport between a FADS board 459ed8b7fd4SCharles.Forsythand an IBM Thinkpad 560. 460ed8b7fd4SCharles.ForsythThe file 461ed8b7fd4SCharles.Forsyth.CW screen.c 462ed8b7fd4SCharles.Forsythdrives an 8-bit per pixel LCD (TFT) display panel. 463ed8b7fd4SCharles.ForsythA sample interface to the on-chip video device of the MPC823 (only) 464ed8b7fd4SCharles.Forsythas wired on the FADS board using auxiliary chips can be found in 465ed8b7fd4SCharles.Forsyth.CW devvid.c . 466ed8b7fd4SCharles.ForsythThe York Electronics Centre developed a touch panel for us, 467ed8b7fd4SCharles.Forsythconnected using SPI; 468ed8b7fd4SCharles.Forsyththe driver is 469ed8b7fd4SCharles.Forsyth.CW devtouch.c , 470ed8b7fd4SCharles.Forsythand could be adapted for similar devices. 471ed8b7fd4SCharles.Forsyth.PP 472ed8b7fd4SCharles.ForsythThe bootstrap program for the FADS board is in 473ed8b7fd4SCharles.Forsyth.CW os/boot/mpc , 474ed8b7fd4SCharles.Forsythloosely derived from an older version of 475ed8b7fd4SCharles.Forsyth.CW os/boot/pc . 476ed8b7fd4SCharles.ForsythIt is initially converted to S records that are loaded into flash by MPC8BUG 477ed8b7fd4SCharles.Forsythfrom a PC, and thereafter the images of the boot and kernel images can 478ed8b7fd4SCharles.Forsythbe updated using the flash devices provided by the system itself, 479ed8b7fd4SCharles.Forsythand the utility programs 480ed8b7fd4SCharles.Forsyth.CW qconfig.b 481ed8b7fd4SCharles.Forsythand 482ed8b7fd4SCharles.Forsyth.CW qflash.b 483ed8b7fd4SCharles.Forsythin 484ed8b7fd4SCharles.Forsyth.CW appl/cmd/mpc . 485ed8b7fd4SCharles.Forsyth.PP 486ed8b7fd4SCharles.ForsythAnother port is to the Brightstar Engineering ip-Engine containing an MPC823 487ed8b7fd4SCharles.Forsythand an Altera FPGA. 488ed8b7fd4SCharles.ForsythSee 489ed8b7fd4SCharles.Forsyth.CW os/ipengine . 490ed8b7fd4SCharles.ForsythIt uses common code from 491ed8b7fd4SCharles.Forsyth.CW os/mpc . 492ed8b7fd4SCharles.ForsythThe device driver that loads the FPGA is in 493ed8b7fd4SCharles.Forsyth.CW devfpga.c ; 494ed8b7fd4SCharles.Forsythsee 495ed8b7fd4SCharles.Forsyth.I fpga (3) 496ed8b7fd4SCharles.Forsythfor the interface and 497ed8b7fd4SCharles.Forsyth.I fpgaload (8) 498ed8b7fd4SCharles.Forsythfor a command to do it. 499ed8b7fd4SCharles.ForsythSee the 500ed8b7fd4SCharles.Forsyth.CW README 501ed8b7fd4SCharles.Forsythfile for information on loading the kernel into the flash. 502ed8b7fd4SCharles.Forsyth.PP 503ed8b7fd4SCharles.ForsythThe most recent PowerPC port is to the IBM 405EP, and more specifically 504ed8b7fd4SCharles.Forsythto the Intrinsyc Cerfcube 405EP. 505ed8b7fd4SCharles.ForsythThe source for that port is in 506ed8b7fd4SCharles.Forsyth.CW os/cerf405 ; 507ed8b7fd4SCharles.Forsythlacking another 405EP platform for reference, the source code has not yet 508ed8b7fd4SCharles.Forsythbeen split into that common to all 405EP implementations and that specific 509ed8b7fd4SCharles.Forsythto the Cerfcube, although that would be easy to do. 510ed8b7fd4SCharles.Forsyth.SH 511ed8b7fd4SCharles.ForsythThe x86 kernel 512ed8b7fd4SCharles.Forsyth.PP 513ed8b7fd4SCharles.ForsythThe 514ed8b7fd4SCharles.Forsyth.CW os/pc 515ed8b7fd4SCharles.Forsythdirectory contains the components for ports to 386, 486 and Pentium class machines. 516ed8b7fd4SCharles.ForsythThe main difficulty is device support: in particular 517ed8b7fd4SCharles.Forsythonly a limited set of Ethernet and graphics cards is supported. 518ed8b7fd4SCharles.ForsythWe have used mainly the 3Com and Intel 82557 drivers. 519ed8b7fd4SCharles.ForsythA `generic' PC port is included that has a graphics driver that 520ed8b7fd4SCharles.Forsythshould run on systems that provide a VESA BIOS mode. 521ed8b7fd4SCharles.Forsyth.PP 522ed8b7fd4SCharles.ForsythWe have a (slow) floating-point emulator for the 386 found in 523ed8b7fd4SCharles.Forsyth.CW os/pc/fpi387.c ; 524ed8b7fd4SCharles.Forsythcode to invoke it in trap can be provided on request. 525ed8b7fd4SCharles.Forsyth.PP 526ed8b7fd4SCharles.ForsythThe source for the PC bootstrap program 527ed8b7fd4SCharles.Forsyth.CW 9load 528ed8b7fd4SCharles.Forsythis in 529ed8b7fd4SCharles.Forsyth.CW os/boot/pc . 530ed8b7fd4SCharles.ForsythIt is simply a copy of the current Plan 9 PC bootstrap program, with slight modifications 531ed8b7fd4SCharles.Forsythto allow it to be compiled on many host systems. 532ed8b7fd4SCharles.Forsyth.SH 533ed8b7fd4SCharles.ForsythThe Javastation 1 kernel 534ed8b7fd4SCharles.Forsyth.PP 535ed8b7fd4SCharles.ForsythThe directory 536ed8b7fd4SCharles.Forsyth.CW os/js 537ed8b7fd4SCharles.Forsythhas the first port 538ed8b7fd4SCharles.Forsythto the Sun Javastation 1. 539ed8b7fd4SCharles.ForsythIt was done by Tad Hunt and Eric Van Hensbergen 540ed8b7fd4SCharles.Forsythin a matter of days to demonstrate Inferno at Java One in 1997. 541ed8b7fd4SCharles.ForsythIt boots over the net using TFTP. 542ed8b7fd4SCharles.ForsythJavastations being a bit thin on the ground now, 543ed8b7fd4SCharles.Forsythit is unlikely to be directly usable unless you can find one second hand 544ed8b7fd4SCharles.Forsyth(you might find a Javastation 2 coffee pot, but that is slightly different again). 545ed8b7fd4SCharles.ForsythThat is a pity, because the machine was quite usable running Inferno and 546ed8b7fd4SCharles.ForsythLimbo applications, often surprising those used to the Java-based 547ed8b7fd4SCharles.Forsythoffering on the same platform. 548ed8b7fd4SCharles.ForsythIt is included as an example of a micro-SPARC port. 549ed8b7fd4SCharles.ForsythBeware that 550ed8b7fd4SCharles.Forsyth.CW screen.c 551ed8b7fd4SCharles.Forsythhas not yet been converted for Fourth Edition graphics 552ed8b7fd4SCharles.Forsyth(partly because we no longer have a suitable device for testing). 553ed8b7fd4SCharles.Forsyth.NH 1 554ed8b7fd4SCharles.ForsythSupporting tools 555ed8b7fd4SCharles.Forsyth.PP 556ed8b7fd4SCharles.ForsythThe 557ed8b7fd4SCharles.Forsyth.CW utils 558ed8b7fd4SCharles.Forsythdirectory also contains ANSI C versions of other components of the 559ed8b7fd4SCharles.ForsythPlan 9 development suite, 560ed8b7fd4SCharles.Forsythsuch as 561ed8b7fd4SCharles.Forsyth.CW nm , 562ed8b7fd4SCharles.Forsyth.CW ksize , 563ed8b7fd4SCharles.Forsyth.CW ar , 564ed8b7fd4SCharles.Forsythand of course 565ed8b7fd4SCharles.Forsyththe 566ed8b7fd4SCharles.Forsyth.CW acid 567ed8b7fd4SCharles.Forsythdebugger. 568ed8b7fd4SCharles.ForsythMost rely on 569ed8b7fd4SCharles.Forsyth.CW libmach , 570ed8b7fd4SCharles.Forsytha suite of functions forming a 571ed8b7fd4SCharles.Forsythlibrary to handle the various object and executable files in one place. 572ed8b7fd4SCharles.Forsyth.PP 573ed8b7fd4SCharles.ForsythSome other utilities give a portable 574ed8b7fd4SCharles.Forsythway to express some of the kernel build scripts: 575ed8b7fd4SCharles.Forsyth.CW sed , 576ed8b7fd4SCharles.Forsyth.CW test , 577ed8b7fd4SCharles.Forsyth.CW rm , 578ed8b7fd4SCharles.Forsythand 579ed8b7fd4SCharles.Forsyth.CW mkdir . 580ed8b7fd4SCharles.ForsythOn Plan 9, 581ed8b7fd4SCharles.Forsyth.CW mk 582ed8b7fd4SCharles.Forsythand kernel build scripts use Plan 9's own shell, 583ed8b7fd4SCharles.Forsyth.I rc . 584ed8b7fd4SCharles.ForsythOn Unix systems, they use 585ed8b7fd4SCharles.Forsyth.I sh . 586ed8b7fd4SCharles.ForsythOn Windows, a version of Plan 9's 587ed8b7fd4SCharles.Forsyth.I rc 588ed8b7fd4SCharles.Forsythhas been ported to reduce the number of variants 589ed8b7fd4SCharles.Forsythto two, and keep the system self-contained; its source is in 590ed8b7fd4SCharles.Forsyth.CW utils/rcsh 591ed8b7fd4SCharles.Forsythand installs as 592ed8b7fd4SCharles.Forsyth.CW rcsh.exe . 593