1 .\" Copyright Warren Toomey
4 .\" $Date: 2008/05/15 03:20:52 $
11 .Nd run PDP-11 UNIX a.out binaries
24 which contains a PDP-11 UNIX a.out binary from one of the following
25 versions of UNIX: 1st Edition, 2nd Edition, 5th Edition, 6th Edition,
26 7th Edition, 2.9BSD or 2.11BSD. Any arguments after the named
28 are passed as arguments to the a.out binary.
30 User-mode PDP-11 instructions are interpreted and executed by
32 and system calls made by the interpreted a.out binary are performed
33 by making real systems calls to the underlying native operating system.
34 In this way, the interpreted a.out binary can interact with the real
35 files and processes on the system.
39 has been compiled with debugging enabled, the following options are available:
42 Output a line for each instruction emulated which gives:
43 the PC in octal, the instruction in octal, the instruction's name,
44 r0 to r6 in octal, and the values of the N, Z, V and C flags.
46 Output a line for each system call, which gives the name of the system
47 call, possibly a list of arguments, and the value returned by the system
50 Output a line for each
54 giving the value of the new PC. For 2.11BSD overlay binaries, also output
55 a line describing each overlay change.
57 For many of the emulated floating-point instructions, output a line
58 describing the operation.
63 was not compiled with debugging enabled, none of these options exist.
64 Any debugging output is directed to the file
66 in the directory where
68 was started. The debugging output is primarily designed to aid the
71 and so it isn't exhaustive for all instructions, traps or floating-point
73 .Sh ENVIRONMENT VARIABLES
75 requires one environment variable to be set:
77 This variable names the `root' of the emulated filesystem.
81 works with filenames, if the filenames are relative, then they
82 stay relative i.e all files on the system can be named, as long as they are
83 given relative names. However, if the filenames are absolute, i.e they
84 start with a slash, then
86 prepends the value of the environment variable
88 to the filename. Therefore, if you have the 7th Edition files located in
92 % setenv APOUT_ROOT /usr/misc/v7root
93 % apout $APOUT_ROOT/bin/sh
97 then you will be greeted with the 7th Edition Bourne shell prompt as shown:
98 you will still be in the directory where you started
100 but if you cd to /, then you will be taken to
103 Note that you must set
108 There is one other optional environment variable:
109 .Ev APOUT_UNIX_VERSION.
110 This is mainly required for UNIX binaries that use the 0407 header,
111 which was used across several versions of UNIX, each with a different set
112 of system calls. If APOUT_UNIX_VERSION is set,
114 will use the given version when it cannot determine which version of UNIX a
115 binary belongs to. The available values are "V1", "V2", "V3", "V4", "V5", "V6",
116 "V7", "2.9BSD" and "2.11BSD".
118 .Sh EMULATED ENVIRONMENT VARIABLES
119 Initially, PDP-11 binaries run via
121 receive the following set of emulated environment variables:
123 PATH /bin:/usr/bin:/usr/sbin:/usr/ucb:/usr/games:/usr/local/bin:.
128 Emulated programs can, of course, change this emulated environment;
129 they can also fork and exec other PDP-11 binaries, which will inherit the
130 modified emulated environment.
131 .Sh INTERACTION WITH NATIVE PROGRAMS
132 Binaries that are interpreted by
134 can interact with native programs in several ways: through files in the
135 filesystem, and through pipes. For example, you can do the following:
137 % ls -lR | apout $APOUT_ROOT/bin/wc | lpr
138 % apout $APOUT_ROOT/bin/sort < file | uniq > newfile
150 is compiled with the NATIVES preprocessor directive enabled, then native system
151 binaries can be executed as well as PDP-11 binaries. For example:
154 % ln -s `which vi` bin/vi Add vi into the filespace
156 $ ls -l Run the PDP-11 ls
158 $ vi kim.c Run the native vi
159 $ cc -o kim kim.c Compile with the PDP-11 compiler
162 Note that native executable receive the same environment variables inherited
165 process, and not the emulated environment that
167 passes to emulated executables.
169 So as to distinguish from error messages generated by the interpreted PDP-11
172 prepends the word `Apout' to the beginning of its error messages. Below is
173 the list of error messages that
177 Apout - V1 sectosixty too big
178 Apout - can't malloc overlay!
179 Apout - can't switch to empty overlay %d
180 Apout - could not read 1st line of script
181 Apout - couldn't load %s
182 Apout - open_dir couldn't open %s
183 Apout - out of argv space in script
184 Apout - pid %d bad FP register used at PC 0%o
185 Apout - pid %d bpt instruction at PC 0%o
186 Apout - pid %d bus error at PC 0%06o
187 Apout - pid %d emt instruction at PC 0%o
188 Apout - pid %d halt instruction at PC 0%o
189 Apout - pid %d illegal instruction %o at PC 0%o
190 Apout - pid %d iot instruction at PC 0%o
191 Apout - pid %d mark instruction at PC 0%o
192 Apout - pid %d mfpd instruction at PC 0%o
193 Apout - pid %d mtpd instruction at PC 0%o
194 Apout - pid %d segmentation fault at PC 0%06o
195 Apout - pid %d trap instruction at PC 0%o
196 Apout - pid %d unimplemented instruction at PC 0%o
197 Apout - pid %d unknown KE11 register 0%o
198 Apout - pid %d waiti instruction at PC 0%o
199 Apout - the %s syscall is not yet implemented
200 Apout - the 2.11BSD %s syscall is not yet implemented
201 Apout - unknown a.out format 0%o
202 Apout - unknown magic in header: 0x%x
203 Apout - unknown syscall %d at PC 0%o
204 Apout cannot set the environment for the a.out %s
205 Apout not compiled to support 1st Edition binaries
206 Apout not compiled to support 2nd Edition binaries
207 Apout not compiled to support 2.11BSD binaries
210 As far as is known, the emulation of user-mode integer instructions is correct.
211 The emulation of floating-point instructions is seriously deficient:
212 only 32-bit floats are emulated: the extra 32-bits of precision in PDP-11
213 doubles goes unused. None of the FP errors are emulated.
215 The emulation of each of the emulated UNIX environments is mostly,
216 but not fully, complete. Any UNIX system call environment is very
219 must translate from the emulated UNIX environment to the native one, and
220 back. For an authorative description of what is missing from, or deficient
221 in, each of the emulated UNIX environments, see the source files
226 in the source directory for
228 You should also consult the file
230 in the source directory for
233 The latest source for
235 can be obtained via anonymous ftp at minnie.tuhs.org in the directory
236 pub/PDP-11/Sims/Apout. The directory pub/PDP-11/Sims/Apout/UnixBins
237 contains tar archives of a.out binaries from several versions of UNIX.
238 Information on PDP-11 UNIX can be found on the PUPS web page at
239 http://minnie.tuhs.org/PUPS/
243 appeared in 1995, and provided support for 6th and 7th Edition
244 UNIX binaries. In 1998/1999, support was added for 2.11BSD binaries.
245 In 1999/2000, support was added for 1st and 2nd Edition UNIX binaries.