1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
|
.TH EMU 1E
.SH NAME
emu \- Inferno emulator
.SH SYNOPSIS
.B emu
[
.BI \-g Xsize x Ysize
]
[
.BR \-c [0-9]
]
[
.BI -d " daemon"
]
[
.BR \-m [0-9]
]
.RB [ \-s ]
[
.BI \-p pool = maxsize
]
[
.BI \-f font
]
[
.BI \-r rootpath
]
.RB [ \-7 ]
[
.RB \-C channel
]
[
.RB \-S
]
[
.B -v
]
[
.I cmd
.RI [ " arg ... " ]
]
.SH DESCRIPTION
.I Emu
provides the Inferno emulation environment.
The emulator runs as an application under the
machine's native operating system, and
provides system services and a Dis virtual machine for Inferno applications.
.PP
.I Emu
starts an Inferno initialisation program
.BR /dis/emuinit.dis ,
whose path name is interpreted in the
Inferno file name space,
not in
the native operating system's name space.
It in turn invokes the shell
.BR /dis/sh.dis
by default or the optional
.I cmd
and its arguments.
If the
.B \-d
option is specified,
.I emu
instead invokes
.BR daemon ,
turning the
.I emu
instance into an Inferno service process on the network,
running the given
.I daemon
service or services.
.PP
The emulator supports the following options:
.TP
.BI \-c n
Unless specified otherwise by the module (see
.B wm/rt
in
.IR wm-misc (1)),
.I emu
uses an interpreter to execute Dis instructions.
Setting
.I n
to 1 (the default value is 0)
makes the default behaviour
to compile Dis
into native instructions when a module is loaded,
resulting in faster execution but larger run-time size.
Setting
.I n
to values larger than 1 enables increasingly detailed traces of the compiler.
.TP
.BI \-d
Run
.I emu
as a server.
.TP
.BI \-g Xsize x Ysize
Define screen width and height in pixels.
The default values are 640x480 and the minimum values are 64x48.
Values smaller than the minimum or greater than the
available display size are ignored.
.TP
.BI \-f font
Specify the default font for the
.B tk
module.
The path is interpreted in the Inferno name space.
If unspecified, the
.B font
variable has value
.BR /fonts/lucm/unicode.9.font .
.TP
.BI \-r rootpath
Specify the host system directory that
.I emu
will serve as its root.
The default value is
.B /usr/inferno
on most systems, but
.BR \einferno
on Windows.
.TP
.B \-s
Specify how the emulator deals with traps reported by the operating system.
By default, they suspend execution of the offending thread within the virtual machine
abstraction.
The
.B \-s
option causes
.I emu
itself to trap, permitting debugging of the
broken host operating system process that results when a trap occurs.
(This is intended to allow debugging of
.IR emu ,
not Inferno applications.)
.TP
.BI \-p pool = maxsize
Specify the maximum size in bytes of the named memory allocation pool.
The pools
are:
.RS
.TP \w'imagexxx'u
.B main
the general malloc arena
.TP
.B heap
the Dis virtual machine heap
.TP
.B image
image storage for the display
.RE
.TP
.B \-7
When host graphics is provided by X11, request a 7-bit colour map;
use this option only if X11 refused to allow
.I emu
to configure the normal (default) 8-bit Inferno colour map.
.TP
.B \-C channel
Use the given channel for the display if possible. For example, k8 gives
8 bit greyscale. See
.IR image (6)
for the full range of channel descriptors.
.TP
.B \-S
Force stylus input behaviour for Tk mouse events:
motion events are received only when a button is down
(just as a stylus produces no events until it touches the screen).
This option only affects the behaviour of Tk mouse events, it does not
affect the behaviour of
.B /dev/pointer
as described in
.IR cons (3).
.TP
.B \-v
Print version data: edition and revision date.
.PP
Options may also be set in the host operating system's environment variable
.BR EMU ;
they are overridden by options supplied on the command line.
.PP
.I Emu
finds the host system directory that will serve as its Inferno root directory
as the last value found as follows:
it is the value built-in to the executable, by default; or
the value of the host system's environment variable
.BR INFERNO ;
or the value of the environment variable
.BR ROOT ;
or the value of a
.B -r
option in the environment variable
.BR EMU ;
or the
.I rootpath
set by a
.B -r
option to the
.I emu
command itself.
.SH EXAMPLE
To start
.B wm/logon
directly:
.IP
.EX
EMU='-g800x600 -c1'
emu /dis/wm/wm.dis wm/logon -u inferno
.EE
.SH FILES
.TF /dis/emuinit.dis
.TP
.B /dis/emuinit.dis
The default initialisation program.
.TP
.B /dis/sh.dis
The default Inferno shell.
.SH SOURCE
.B /emu
.SH "SEE ALSO"
.IR limbo (1),
.IR wm-misc (1)
|