Browse Source

[contrib] Add contrib/vm, containing utilities from old contrib/bochs

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 13 years ago
parent
commit
041f01e601

+ 6
- 0
contrib/vm/.gitignore View File

@@ -0,0 +1,6 @@
1
+bochsout.txt
2
+parport.out
3
+ne2k-tx.log
4
+ne2k-txdump.txt
5
+bochs
6
+qemu

+ 7
- 0
contrib/vm/Makefile View File

@@ -0,0 +1,7 @@
1
+all : serial-console.1
2
+
3
+%.1 : %
4
+	pod2man $< > $@
5
+
6
+clean :
7
+	rm -f serial-console.1

+ 15
- 0
contrib/vm/bochs-writable-ROM-patch View File

@@ -0,0 +1,15 @@
1
+--- memory/memory.cc	18 Oct 2008 18:10:14 -0000	1.71
2
++++ memory/memory.cc	21 Oct 2008 19:47:07 -0000
3
+@@ -172,7 +172,11 @@
4
+             break;
5
+
6
+           case 0x0:   // Writes to ROM, Inhibit
7
+-            BX_DEBUG(("Write to ROM ignored: address 0x" FMT_PHY_ADDRX ", data %02x", a20addr, *data_ptr));
8
++            if ((a20addr & 0xfffe0000) == 0x000e0000) {
9
++	      BX_DEBUG(("Write to ROM ignored: address 0x" FMT_PHY_ADDRX ", data %02x", a20addr, *data_ptr));
10
++	    } else {
11
++	      BX_MEM_THIS rom[(a20addr & EXROM_MASK) + BIOSROMSZ] = *data_ptr;
12
++            }
13
+             break;
14
+
15
+           default:

+ 750
- 0
contrib/vm/bochsrc.txt View File

@@ -0,0 +1,750 @@
1
+# You may now use double quotes around pathnames, in case
2
+# your pathname includes spaces.
3
+
4
+#=======================================================================
5
+# CONFIG_INTERFACE
6
+#
7
+# The configuration interface is a series of menus or dialog boxes that
8
+# allows you to change all the settings that control Bochs's behavior.
9
+# There are two choices of configuration interface: a text mode version
10
+# called "textconfig" and a graphical version called "wx".  The text
11
+# mode version uses stdin/stdout and is always compiled in.  The graphical
12
+# version is only available when you use "--with-wx" on the configure
13
+# command.  If you do not write a config_interface line, Bochs will
14
+# choose a default for you.
15
+#
16
+# NOTE: if you use the "wx" configuration interface, you must also use
17
+# the "wx" display library.
18
+#=======================================================================
19
+#config_interface: textconfig
20
+#config_interface: wx
21
+
22
+#=======================================================================
23
+# DISPLAY_LIBRARY
24
+#
25
+# The display library is the code that displays the Bochs VGA screen.  Bochs
26
+# has a selection of about 10 different display library implementations for
27
+# different platforms.  If you run configure with multiple --with-* options,
28
+# the display_library command lets you choose which one you want to run with.
29
+# If you do not write a display_library line, Bochs will choose a default for
30
+# you.
31
+#
32
+# The choices are:
33
+#   x              use X windows interface, cross platform
34
+#   win32          use native win32 libraries
35
+#   carbon         use Carbon library (for MacOS X)
36
+#   beos           use native BeOS libraries
37
+#   macintosh      use MacOS pre-10
38
+#   amigaos        use native AmigaOS libraries
39
+#   sdl            use SDL library, cross platform
40
+#   svga           use SVGALIB library for Linux, allows graphics without X11
41
+#   term           text only, uses curses/ncurses library, cross platform
42
+#   rfb            provides an interface to AT&T's VNC viewer, cross platform
43
+#   wx             use wxWidgets library, cross platform
44
+#   nogui          no display at all
45
+#
46
+# NOTE: if you use the "wx" configuration interface, you must also use
47
+# the "wx" display library.
48
+#
49
+# Specific options:
50
+# Some display libraries now support specific option to control their
51
+# behaviour. See the examples below for currently supported options.
52
+#=======================================================================
53
+#display_library: amigaos
54
+#display_library: beos
55
+#display_library: carbon
56
+#display_library: macintosh
57
+#display_library: nogui
58
+#display_library: rfb, options="timeout=60" # time to wait for client
59
+#display_library: sdl, options="fullscreen" # startup in fullscreen mode
60
+#display_library: term
61
+#display_library: win32, options="legacyF12" # use F12 to toggle mouse
62
+#display_library: wx
63
+#display_library: x
64
+
65
+#=======================================================================
66
+# ROMIMAGE:
67
+# The ROM BIOS controls what the PC does when it first powers on.
68
+# Normally, you can use a precompiled BIOS in the source or binary
69
+# distribution called BIOS-bochs-latest. The ROM BIOS is usually loaded
70
+# starting at address 0xf0000, and it is exactly 64k long.
71
+# You can also use the environment variable $BXSHARE to specify the
72
+# location of the BIOS.
73
+# The usage of external large BIOS images (up to 512k) at memory top is
74
+# now supported, but we still recommend to use the BIOS distributed with
75
+# Bochs. Now the start address can be calculated from image size.
76
+#=======================================================================
77
+romimage: file=bochs/bios/BIOS-bochs-latest, address=0xe0000
78
+#romimage: file=mybios.bin, address=0xfff80000 # 512k at memory top
79
+#romimage: file=mybios.bin # calculate start address from image size
80
+
81
+#=======================================================================
82
+# CPU:
83
+# This defines cpu-related parameters inside Bochs:
84
+#
85
+#  COUNT:
86
+#  Set the number of processors:cores per processor:threads per core
87
+#  when Bochs is compiled for SMP emulation.
88
+#  Bochs currently supports up to 8 threads running simultaniosly.
89
+#  If Bochs is compiled without SMP support, it won't accept values
90
+#  different from 1.
91
+#
92
+#  RESET_ON_TRIPLE_FAULT:
93
+#  Reset the CPU when triple fault occur (highly recommended) rather than
94
+#  PANIC. Remember that if you trying to continue after triple fault the
95
+#  simulation will be completely bogus !
96
+#
97
+#  IPS:
98
+#  Emulated Instructions Per Second.  This is the number of IPS that bochs
99
+#  is capable of running on your machine. You can recompile Bochs with
100
+#  --enable-show-ips option enabled, to find your workstation's capability.
101
+#  Measured IPS value will then be logged into your log file or status bar
102
+#  (if supported by the gui).
103
+#
104
+#  IPS is used to calibrate many time-dependent events within the bochs
105
+#  simulation.  For example, changing IPS affects the frequency of VGA
106
+#  updates, the duration of time before a key starts to autorepeat, and
107
+#  the measurement of BogoMips and other benchmarks.
108
+#
109
+#  Examples:
110
+#  Machine                                         Mips
111
+# ________________________________________________________________
112
+#  2.1Ghz Athlon XP with Linux 2.6/g++ 3.4         12 to 15 Mips
113
+#  1.6Ghz Intel P4 with Win2000/g++ 3.3             5 to  7 Mips
114
+#  650Mhz Athlon K-7 with Linux 2.4.4/egcs-2.91.66  2 to  2.5 Mips
115
+#  400Mhz Pentium II with Linux 2.0.36/egcs-1.0.3   1 to  1.8 Mips
116
+#=======================================================================
117
+cpu: count=1, ips=10000000, reset_on_triple_fault=1
118
+
119
+#=======================================================================
120
+# MEGS
121
+# Set the number of Megabytes of physical memory you want to emulate.
122
+# The default is 32MB, most OS's won't need more than that.
123
+# The maximum amount of memory supported is 2048Mb.
124
+#=======================================================================
125
+#megs: 256
126
+#megs: 128
127
+#megs: 64
128
+megs: 32
129
+#megs: 16
130
+#megs: 8
131
+
132
+#=======================================================================
133
+# OPTROMIMAGE[1-4]:
134
+# You may now load up to 4 optional ROM images. Be sure to use a
135
+# read-only area, typically between C8000 and EFFFF. These optional
136
+# ROM images should not overwrite the rombios (located at
137
+# F0000-FFFFF) and the videobios (located at C0000-C7FFF).
138
+# Those ROM images will be initialized by the bios if they contain
139
+# the right signature (0x55AA) and a valid checksum.
140
+# It can also be a convenient way to upload some arbitrary code/data
141
+# in the simulation, that can be retrieved by the boot loader
142
+#=======================================================================
143
+#optromimage1: file=optionalrom.bin, address=0xd0000
144
+#optromimage2: file=optionalrom.bin, address=0xd1000
145
+#optromimage3: file=optionalrom.bin, address=0xd2000
146
+#optromimage4: file=optionalrom.bin, address=0xd3000
147
+optromimage1: file=../../src/bin/pnic.rom, address=0xd0000
148
+#optromimage1: file=../../src/bin/rtl8029.rom, address=0xd0000
149
+
150
+#optramimage1: file=/path/file1.img, address=0x0010000
151
+#optramimage2: file=/path/file2.img, address=0x0020000
152
+#optramimage3: file=/path/file3.img, address=0x0030000
153
+#optramimage4: file=/path/file4.img, address=0x0040000
154
+
155
+#=======================================================================
156
+# VGAROMIMAGE
157
+# You now need to load a VGA ROM BIOS into C0000.
158
+#=======================================================================
159
+#vgaromimage: file=bios/VGABIOS-elpin-2.40
160
+vgaromimage: file=bochs/bios/VGABIOS-lgpl-latest
161
+#vgaromimage: file=bios/VGABIOS-lgpl-latest-cirrus
162
+
163
+#=======================================================================
164
+# VGA:
165
+# Here you can specify the display extension to be used. With the value
166
+# 'none' you can use standard VGA with no extension. Other supported
167
+# values are 'vbe' for Bochs VBE and 'cirrus' for Cirrus SVGA support.
168
+#=======================================================================
169
+#vga: extension=cirrus
170
+#vga: extension=vbe
171
+vga: extension=none
172
+
173
+#=======================================================================
174
+# FLOPPYA:
175
+# Point this to pathname of floppy image file or device
176
+# This should be of a bootable floppy(image/device) if you're
177
+# booting from 'a' (or 'floppy').
178
+#
179
+# You can set the initial status of the media to 'ejected' or 'inserted'.
180
+#   floppya: 2_88=path, status=ejected             (2.88M 3.5" floppy)
181
+#   floppya: 1_44=path, status=inserted            (1.44M 3.5" floppy)
182
+#   floppya: 1_2=path, status=ejected              (1.2M  5.25" floppy)
183
+#   floppya: 720k=path, status=inserted            (720K  3.5" floppy)
184
+#   floppya: 360k=path, status=inserted            (360K  5.25" floppy)
185
+#   floppya: 320k=path, status=inserted            (320K  5.25" floppy)
186
+#   floppya: 180k=path, status=inserted            (180K  5.25" floppy)
187
+#   floppya: 160k=path, status=inserted            (160K  5.25" floppy)
188
+#   floppya: image=path, status=inserted           (guess type from image size)
189
+#
190
+# The path should be the name of a disk image file.  On Unix, you can use a raw
191
+# device name such as /dev/fd0 on Linux.  On win32 platforms, use drive letters
192
+# such as a: or b: as the path.  The parameter 'image' works with image files
193
+# only. In that case the size must match one of the supported types.
194
+#=======================================================================
195
+#floppya: 1_44=/dev/fd0, status=inserted
196
+#floppya: image=../1.44, status=inserted
197
+#floppya: 1_44=/dev/fd0H1440, status=inserted
198
+#floppya: 1_2=../1_2, status=inserted
199
+#floppya: 1_44=a:, status=inserted
200
+#floppya: 1_44=a.img, status=inserted
201
+#floppya: 1_44=/dev/rfd0a, status=inserted
202
+floppya: 1_44=../../src/bin/pnic.dsk, status=inserted
203
+
204
+#=======================================================================
205
+# FLOPPYB:
206
+# See FLOPPYA above for syntax
207
+#=======================================================================
208
+#floppyb: 1_44=b:, status=inserted
209
+floppyb: 1_44=b.img, status=inserted
210
+
211
+#=======================================================================
212
+# ATA0, ATA1, ATA2, ATA3
213
+# ATA controller for hard disks and cdroms
214
+#
215
+# ata[0-3]: enabled=[0|1], ioaddr1=addr, ioaddr2=addr, irq=number
216
+#
217
+# These options enables up to 4 ata channels. For each channel
218
+# the two base io addresses and the irq must be specified.
219
+#
220
+# ata0 and ata1 are enabled by default with the values shown below
221
+#
222
+# Examples:
223
+#   ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
224
+#   ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15
225
+#   ata2: enabled=1, ioaddr1=0x1e8, ioaddr2=0x3e0, irq=11
226
+#   ata3: enabled=1, ioaddr1=0x168, ioaddr2=0x360, irq=9
227
+#=======================================================================
228
+ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
229
+ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15
230
+ata2: enabled=0, ioaddr1=0x1e8, ioaddr2=0x3e0, irq=11
231
+ata3: enabled=0, ioaddr1=0x168, ioaddr2=0x360, irq=9
232
+
233
+#=======================================================================
234
+# ATA[0-3]-MASTER, ATA[0-3]-SLAVE
235
+#
236
+# This defines the type and characteristics of all attached ata devices:
237
+#   type=       type of attached device [disk|cdrom]
238
+#   mode=       only valid for disks [flat|concat|external|dll|sparse|vmware3]
239
+#   mode=       only valid for disks [undoable|growing|volatile]
240
+#   path=       path of the image
241
+#   cylinders=  only valid for disks
242
+#   heads=      only valid for disks
243
+#   spt=        only valid for disks
244
+#   status=     only valid for cdroms [inserted|ejected]
245
+#   biosdetect= type of biosdetection [none|auto], only for disks on ata0 [cmos]
246
+#   translation=type of translation of the bios, only for disks [none|lba|large|rechs|auto]
247
+#   model=      string returned by identify device command
248
+#   journal=    optional filename of the redolog for undoable and volatile disks
249
+#
250
+# Point this at a hard disk image file, cdrom iso file, or physical cdrom
251
+# device.  To create a hard disk image, try running bximage.  It will help you
252
+# choose the size and then suggest a line that works with it.
253
+#
254
+# In UNIX it may be possible to use a raw device as a Bochs hard disk,
255
+# but WE DON'T RECOMMEND IT.  In Windows there is no easy way.
256
+#
257
+# In windows, the drive letter + colon notation should be used for cdroms.
258
+# Depending on versions of windows and drivers, you may only be able to
259
+# access the "first" cdrom in the system.  On MacOSX, use path="drive"
260
+# to access the physical drive.
261
+#
262
+# The path is always mandatory. For flat hard disk images created with
263
+# bximage geometry autodetection can be used (cylinders=0 -> cylinders are
264
+# calculated using heads=16 and spt=63). For other hard disk images and modes
265
+# the cylinders, heads, and spt are mandatory.
266
+#
267
+# Default values are:
268
+#   mode=flat, biosdetect=auto, translation=auto, model="Generic 1234"
269
+#
270
+# The biosdetect option has currently no effect on the bios
271
+#
272
+# Examples:
273
+#   ata0-master: type=disk, mode=flat, path=10M.sample, cylinders=306, heads=4, spt=17
274
+#   ata0-slave:  type=disk, mode=flat, path=20M.sample, cylinders=615, heads=4, spt=17
275
+#   ata1-master: type=disk, mode=flat, path=30M.sample, cylinders=615, heads=6, spt=17
276
+#   ata1-slave:  type=disk, mode=flat, path=46M.sample, cylinders=940, heads=6, spt=17
277
+#   ata2-master: type=disk, mode=flat, path=62M.sample, cylinders=940, heads=8, spt=17
278
+#   ata2-slave:  type=disk, mode=flat, path=112M.sample, cylinders=900, heads=15, spt=17
279
+#   ata3-master: type=disk, mode=flat, path=483M.sample, cylinders=1024, heads=15, spt=63
280
+#   ata3-slave:  type=cdrom, path=iso.sample, status=inserted
281
+#=======================================================================
282
+#ata0-master: type=disk, mode=flat, path="30M.sample", cylinders=615, heads=6, spt=17
283
+#ata0-slave: type=cdrom, path=D:, status=inserted
284
+#ata0-slave: type=cdrom, path=/dev/cdrom, status=inserted
285
+#ata0-slave: type=cdrom, path="drive", status=inserted
286
+#ata0-slave: type=cdrom, path=/dev/rcd0d, status=inserted
287
+
288
+#=======================================================================
289
+# BOOT:
290
+# This defines the boot sequence. Now you can specify up to 3 boot drives.
291
+# You can either boot from 'floppy', 'disk' or 'cdrom'
292
+# legacy 'a' and 'c' are also supported
293
+# Examples:
294
+#   boot: floppy
295
+#   boot: disk
296
+#   boot: cdrom
297
+#   boot: c
298
+#   boot: a
299
+#   boot: cdrom, floppy, disk
300
+#=======================================================================
301
+#boot: floppy
302
+#boot: disk
303
+
304
+#=======================================================================
305
+# CLOCK:
306
+# This defines the parameters of the clock inside Bochs:
307
+#
308
+#  SYNC:
309
+#  TO BE COMPLETED (see Greg explanation in feature request #536329)
310
+#
311
+#  TIME0:
312
+#  Specifies the start (boot) time of the virtual machine. Use a time
313
+#  value as returned by the time(2) system call. If no time0 value is
314
+#  set or if time0 equal to 1 (special case) or if time0 equal 'local',
315
+#  the simulation will be started at the current local host time.
316
+#  If time0 equal to 2 (special case) or if time0 equal 'utc',
317
+#  the simulation will be started at the current utc time.
318
+#
319
+# Syntax:
320
+#  clock: sync=[none|slowdown|realtime|both], time0=[timeValue|local|utc]
321
+#
322
+# Example:
323
+#   clock: sync=none,     time0=local       # Now (localtime)
324
+#   clock: sync=slowdown, time0=315529200   # Tue Jan  1 00:00:00 1980
325
+#   clock: sync=none,     time0=631148400   # Mon Jan  1 00:00:00 1990
326
+#   clock: sync=realtime, time0=938581955   # Wed Sep 29 07:12:35 1999
327
+#   clock: sync=realtime, time0=946681200   # Sat Jan  1 00:00:00 2000
328
+#   clock: sync=none,     time0=1           # Now (localtime)
329
+#   clock: sync=none,     time0=utc         # Now (utc/gmt)
330
+#
331
+# Default value are sync=none, time0=local
332
+#=======================================================================
333
+#clock: sync=none, time0=local
334
+
335
+
336
+#=======================================================================
337
+# FLOPPY_BOOTSIG_CHECK: disabled=[0|1]
338
+# Enables or disables the 0xaa55 signature check on boot floppies
339
+# Defaults to disabled=0
340
+# Examples:
341
+#   floppy_bootsig_check: disabled=0
342
+#   floppy_bootsig_check: disabled=1
343
+#=======================================================================
344
+#floppy_bootsig_check: disabled=1
345
+floppy_bootsig_check: disabled=0
346
+
347
+#=======================================================================
348
+# LOG:
349
+# Give the path of the log file you'd like Bochs debug and misc. verbiage
350
+# to be written to. If you don't use this option or set the filename to
351
+# '-' the output is written to the console. If you really don't want it,
352
+# make it "/dev/null" (Unix) or "nul" (win32). :^(
353
+#
354
+# Examples:
355
+#   log: ./bochs.out
356
+#   log: /dev/tty
357
+#=======================================================================
358
+#log: /dev/null
359
+log: bochsout.txt
360
+
361
+#=======================================================================
362
+# LOGPREFIX:
363
+# This handles the format of the string prepended to each log line.
364
+# You may use those special tokens :
365
+#   %t : 11 decimal digits timer tick
366
+#   %i : 8 hexadecimal digits of cpu current eip (ignored in SMP configuration)
367
+#   %e : 1 character event type ('i'nfo, 'd'ebug, 'p'anic, 'e'rror)
368
+#   %d : 5 characters string of the device, between brackets
369
+#
370
+# Default : %t%e%d
371
+# Examples:
372
+#   logprefix: %t-%e-@%i-%d
373
+#   logprefix: %i%e%d
374
+#=======================================================================
375
+#logprefix: %t%e%d
376
+
377
+#=======================================================================
378
+# LOG CONTROLS
379
+#
380
+# Bochs now has four severity levels for event logging.
381
+#   panic: cannot proceed.  If you choose to continue after a panic,
382
+#          don't be surprised if you get strange behavior or crashes.
383
+#   error: something went wrong, but it is probably safe to continue the
384
+#          simulation.
385
+#   info: interesting or useful messages.
386
+#   debug: messages useful only when debugging the code.  This may
387
+#          spit out thousands per second.
388
+#
389
+# For events of each level, you can choose to crash, report, or ignore.
390
+# TODO: allow choice based on the facility: e.g. crash on panics from
391
+#       everything except the cdrom, and only report those.
392
+#
393
+# If you are experiencing many panics, it can be helpful to change
394
+# the panic action to report instead of fatal.  However, be aware
395
+# that anything executed after a panic is uncharted territory and can
396
+# cause bochs to become unstable.  The panic is a "graceful exit," so
397
+# if you disable it you may get a spectacular disaster instead.
398
+#=======================================================================
399
+panic: action=ask
400
+error: action=report
401
+info: action=report
402
+debug: action=ignore
403
+#pass: action=fatal
404
+
405
+#=======================================================================
406
+# DEBUGGER_LOG:
407
+# Give the path of the log file you'd like Bochs to log debugger output.
408
+# If you really don't want it, make it /dev/null or '-'. :^(
409
+#
410
+# Examples:
411
+#   debugger_log: ./debugger.out
412
+#=======================================================================
413
+#debugger_log: /dev/null
414
+#debugger_log: debugger.out
415
+debugger_log: -
416
+
417
+#=======================================================================
418
+# COM1, COM2, COM3, COM4:
419
+# This defines a serial port (UART type 16550A). In the 'term' you can specify
420
+# a device to use as com1. This can be a real serial line, or a pty.  To use
421
+# a pty (under X/Unix), create two windows (xterms, usually).  One of them will
422
+# run bochs, and the other will act as com1. Find out the tty the com1
423
+# window using the `tty' command, and use that as the `dev' parameter.
424
+# Then do `sleep 1000000' in the com1 window to keep the shell from
425
+# messing with things, and run bochs in the other window.  Serial I/O to
426
+# com1 (port 0x3f8) will all go to the other window.
427
+# Other serial modes are 'null' (no input/output), 'file' (output to a file
428
+# specified as the 'dev' parameter), 'raw' (use the real serial port - under
429
+# construction for win32), 'mouse' (standard serial mouse - requires
430
+# mouse option setting 'type=serial' or 'type=serial_wheel') and 'socket'
431
+# (connect a networking socket).
432
+#
433
+# Examples:
434
+#   com1: enabled=1, mode=null
435
+#   com1: enabled=1, mode=mouse
436
+#   com2: enabled=1, mode=file, dev=serial.out
437
+#   com3: enabled=1, mode=raw, dev=com1
438
+#   com3: enabled=1, mode=socket, dev=localhost:8888
439
+#=======================================================================
440
+#com1: enabled=1, mode=term, dev=/dev/ttyp9
441
+
442
+
443
+#=======================================================================
444
+# PARPORT1, PARPORT2:
445
+# This defines a parallel (printer) port. When turned on and an output file is
446
+# defined the emulated printer port sends characters printed by the guest OS
447
+# into the output file. On some platforms a device filename can be used to
448
+# send the data to the real parallel port (e.g. "/dev/lp0" on Linux, "lpt1" on
449
+# win32 platforms).
450
+#
451
+# Examples:
452
+#   parport1: enabled=1, file="parport.out"
453
+#   parport2: enabled=1, file="/dev/lp0"
454
+#   parport1: enabled=0
455
+#=======================================================================
456
+parport1: enabled=1, file="parport.out"
457
+
458
+#=======================================================================
459
+# SB16:
460
+# This defines the SB16 sound emulation. It can have several of the
461
+# following properties.
462
+# All properties are in the format sb16: property=value
463
+# midi: The filename is where the midi data is sent. This can be a
464
+#       device or just a file if you want to record the midi data.
465
+# midimode:
466
+#      0=no data
467
+#      1=output to device (system dependent. midi denotes the device driver)
468
+#      2=SMF file output, including headers
469
+#      3=output the midi data stream to the file (no midi headers and no
470
+#        delta times, just command and data bytes)
471
+# wave: This is the device/file where wave output is stored
472
+# wavemode:
473
+#      0=no data
474
+#      1=output to device (system dependent. wave denotes the device driver)
475
+#      2=VOC file output, incl. headers
476
+#      3=output the raw wave stream to the file
477
+# log:  The file to write the sb16 emulator messages to.
478
+# loglevel:
479
+#      0=no log
480
+#      1=resource changes, midi program and bank changes
481
+#      2=severe errors
482
+#      3=all errors
483
+#      4=all errors plus all port accesses
484
+#      5=all errors and port accesses plus a lot of extra info
485
+# dmatimer:
486
+#      microseconds per second for a DMA cycle.  Make it smaller to fix
487
+#      non-continuous sound.  750000 is usually a good value.  This needs a
488
+#      reasonably correct setting for the IPS parameter of the CPU option.
489
+#
490
+# For an example look at the next line:
491
+#=======================================================================
492
+
493
+#sb16: midimode=1, midi=/dev/midi00, wavemode=1, wave=/dev/dsp, loglevel=2, log=sb16.log, dmatimer=600000
494
+
495
+#=======================================================================
496
+# VGA_UPDATE_INTERVAL:
497
+# Video memory is scanned for updates and screen updated every so many
498
+# virtual seconds.  The default is 40000, about 25Hz. Keep in mind that
499
+# you must tweak the 'cpu: ips=N' directive to be as close to the number
500
+# of emulated instructions-per-second your workstation can do, for this
501
+# to be accurate.
502
+#
503
+# Examples:
504
+#   vga_update_interval: 250000
505
+#=======================================================================
506
+vga_update_interval: 300000
507
+
508
+# using for Winstone '98 tests
509
+#vga_update_interval:  100000
510
+
511
+#=======================================================================
512
+# KEYBOARD_SERIAL_DELAY:
513
+# Approximate time in microseconds that it takes one character to
514
+# be transfered from the keyboard to controller over the serial path.
515
+# Examples:
516
+#   keyboard_serial_delay: 200
517
+#=======================================================================
518
+keyboard_serial_delay: 250
519
+
520
+#=======================================================================
521
+# KEYBOARD_PASTE_DELAY:
522
+# Approximate time in microseconds between attempts to paste
523
+# characters to the keyboard controller. This leaves time for the
524
+# guest os to deal with the flow of characters.  The ideal setting
525
+# depends on how your operating system processes characters.  The
526
+# default of 100000 usec (.1 seconds) was chosen because it works
527
+# consistently in Windows.
528
+#
529
+# If your OS is losing characters during a paste, increase the paste
530
+# delay until it stops losing characters.
531
+#
532
+# Examples:
533
+#   keyboard_paste_delay: 100000
534
+#=======================================================================
535
+keyboard_paste_delay: 100000
536
+
537
+#=======================================================================
538
+# MOUSE:
539
+# This option prevents Bochs from creating mouse "events" unless a mouse
540
+# is  enabled. The hardware emulation itself is not disabled by this.
541
+# You can turn the mouse on by setting enabled to 1, or turn it off by
542
+# setting enabled to 0. Unless you have a particular reason for enabling
543
+# the mouse by default, it is recommended that you leave it off.
544
+# You can also toggle the mouse usage at runtime (control key + middle
545
+# mouse button on X11, SDL, wxWidgets and Win32).
546
+# With the mouse type option you can select the type of mouse to emulate.
547
+# The default value is 'ps2'. The other choices are 'imps2' (wheel mouse
548
+# on PS/2), 'serial', 'serial_wheel' (one com port requires setting
549
+# 'mode=mouse') and 'usb' (3-button mouse - one of the USB ports must be
550
+# connected with the 'mouse' device - requires PCI and USB support).
551
+#
552
+# Examples:
553
+#   mouse: enabled=1
554
+#   mouse: enabled=1, type=imps2
555
+#   mouse: enabled=1, type=serial
556
+#   mouse: enabled=0
557
+#=======================================================================
558
+mouse: enabled=0
559
+
560
+#=======================================================================
561
+# private_colormap: Request that the GUI create and use it's own
562
+#                   non-shared colormap.  This colormap will be used
563
+#                   when in the bochs window.  If not enabled, a
564
+#                   shared colormap scheme may be used.  Not implemented
565
+#                   on all GUI's.
566
+#
567
+# Examples:
568
+#   private_colormap: enabled=1
569
+#   private_colormap: enabled=0
570
+#=======================================================================
571
+private_colormap: enabled=0
572
+
573
+#=======================================================================
574
+# fullscreen: ONLY IMPLEMENTED ON AMIGA
575
+#             Request that Bochs occupy the entire screen instead of a
576
+#             window.
577
+#
578
+# Examples:
579
+#   fullscreen: enabled=0
580
+#   fullscreen: enabled=1
581
+#=======================================================================
582
+#fullscreen: enabled=0
583
+#screenmode: name="sample"
584
+
585
+#=======================================================================
586
+# ne2k: NE2000 compatible ethernet adapter
587
+#
588
+# Examples:
589
+# ne2k: ioaddr=IOADDR, irq=IRQ, mac=MACADDR, ethmod=MODULE, ethdev=DEVICE, script=SCRIPT
590
+#
591
+# ioaddr, irq: You probably won't need to change ioaddr and irq, unless there
592
+# are IRQ conflicts.
593
+#
594
+# mac: The MAC address MUST NOT match the address of any machine on the net.
595
+# Also, the first byte must be an even number (bit 0 set means a multicast
596
+# address), and you cannot use ff:ff:ff:ff:ff:ff because that's the broadcast
597
+# address.  For the ethertap module, you must use fe:fd:00:00:00:01.  There may
598
+# be other restrictions too.  To be safe, just use the b0:c4... address.
599
+#
600
+# ethdev: The ethdev value is the name of the network interface on your host
601
+# platform.  On UNIX machines, you can get the name by running ifconfig.  On
602
+# Windows machines, you must run niclist to get the name of the ethdev.
603
+# Niclist source code is in misc/niclist.c and it is included in Windows
604
+# binary releases.
605
+#
606
+# script: The script value is optional, and is the name of a script that
607
+# is executed after bochs initialize the network interface. You can use
608
+# this script to configure this network interface, or enable masquerading.
609
+# This is mainly useful for the tun/tap devices that only exist during
610
+# Bochs execution. The network interface name is supplied to the script
611
+# as first parameter
612
+#
613
+# If you don't want to make connections to any physical networks,
614
+# you can use the following 'ethmod's to simulate a virtual network.
615
+#   null: All packets are discarded, but logged to a few files.
616
+#   arpback: ARP is simulated. Disabled by default.
617
+#   vde:  Virtual Distributed Ethernet
618
+#   vnet: ARP, ICMP-echo(ping), DHCP and read/write TFTP are simulated.
619
+#         The virtual host uses 192.168.10.1.
620
+#         DHCP assigns 192.168.10.2 to the guest.
621
+#         TFTP uses the ethdev value for the root directory and doesn't
622
+#         overwrite files.
623
+#
624
+#=======================================================================
625
+# ne2k: ioaddr=0x240, irq=9, mac=fe:fd:00:00:00:01, ethmod=fbsd, ethdev=en0 #macosx
626
+# ne2k: ioaddr=0x240, irq=9, mac=b0:c4:20:00:00:00, ethmod=fbsd, ethdev=xl0
627
+# ne2k: ioaddr=0x240, irq=9, mac=b0:c4:20:00:00:00, ethmod=linux, ethdev=eth0
628
+# ne2k: ioaddr=0x240, irq=9, mac=b0:c4:20:00:00:01, ethmod=win32, ethdev=MYCARD
629
+# ne2k: ioaddr=0x240, irq=9, mac=fe:fd:00:00:00:01, ethmod=tap, ethdev=tap0
630
+# ne2k: ioaddr=0x240, irq=9, mac=fe:fd:00:00:00:01, ethmod=tuntap, ethdev=/dev/net/tun0, script=./tunconfig
631
+# ne2k: ioaddr=0x240, irq=9, mac=b0:c4:20:00:00:01, ethmod=null, ethdev=eth0
632
+# ne2k: ioaddr=0x240, irq=9, mac=b0:c4:20:00:00:01, ethmod=vde, ethdev="/tmp/vde.ctl"
633
+# ne2k: ioaddr=0x240, irq=9, mac=b0:c4:20:00:00:01, ethmod=vnet, ethdev="c:/temp"
634
+pnic: mac=fe:fd:00:00:00:01, ethmod=tuntap, ethdev=/dev/net/tun:tap0
635
+#ne2k: ioaddr=0x240, irq=9, mac=fe:fd:00:00:00:01, ethmod=tuntap, ethdev=/dev/net/tun:tap0
636
+
637
+#=======================================================================
638
+# KEYBOARD_MAPPING:
639
+# This enables a remap of a physical localized keyboard to a
640
+# virtualized us keyboard, as the PC architecture expects.
641
+# If enabled, the keymap file must be specified.
642
+#
643
+# Examples:
644
+#   keyboard_mapping: enabled=1, map=gui/keymaps/x11-pc-de.map
645
+#=======================================================================
646
+keyboard_mapping: enabled=0, map=
647
+
648
+#=======================================================================
649
+# KEYBOARD_TYPE:
650
+# Type of keyboard return by a "identify keyboard" command to the
651
+# keyboard controler. It must be one of "xt", "at" or "mf".
652
+# Defaults to "mf". It should be ok for almost everybody. A known
653
+# exception is french macs, that do have a "at"-like keyboard.
654
+#
655
+# Examples:
656
+#   keyboard_type: mf
657
+#=======================================================================
658
+#keyboard_type: mf
659
+
660
+#=======================================================================
661
+# USER_SHORTCUT:
662
+# This defines the keyboard shortcut to be sent when you press the "user"
663
+# button in the headerbar. The shortcut string is a combination of maximum
664
+# 3 key names (listed below) separated with a '-' character. The old-style
665
+# syntax (without the '-') still works for the key combinations supported
666
+# in Bochs 2.2.1.
667
+# Valid key names:
668
+# "alt", "bksl", "bksp", "ctrl", "del", "down", "end", "enter", "esc",
669
+# "f1", ... "f12", "home", "ins", "left", "menu", "minus", "pgdwn", "pgup",
670
+# "plus", "right", "shift", "space", "tab", "up", and "win".
671
+#
672
+# Example:
673
+#   user_shortcut: keys=ctrl-alt-del
674
+#=======================================================================
675
+user_shortcut: keys=ctrl-alt-del
676
+
677
+#=======================================================================
678
+# I440FXSUPPORT:
679
+# This option controls the presence of the i440FX PCI chipset. You can
680
+# also specify the devices connected to PCI slots. Up to 5 slots are
681
+# available now. These devices are currently supported: ne2k, pcivga,
682
+# pcidev and pcipnic. If Bochs is compiled with Cirrus SVGA support
683
+# you'll have the additional choice 'cirrus'.
684
+#
685
+# Example:
686
+#   i440fxsupport: enabled=1, slot1=pcivga, slot2=ne2k
687
+#=======================================================================
688
+i440fxsupport: enabled=1, slot1=pcipnic
689
+#i440fxsupport: enabled=1, slot1=ne2k
690
+
691
+#=======================================================================
692
+# USB1:
693
+# This option controls the presence of the USB root hub which is a part
694
+# of the i440FX PCI chipset. With the portX option you can connect devices
695
+# to the hub (currently supported: 'mouse' and 'keypad'). If you connect
696
+# the mouse to one of the ports and use the mouse option 'type=usb' you'll
697
+# have a 3-button USB mouse.
698
+#
699
+# Example:
700
+#   usb1: enabled=1, port1=mouse, port2=keypad
701
+#=======================================================================
702
+#usb1: enabled=1
703
+
704
+#=======================================================================
705
+# CMOSIMAGE:
706
+# This defines image file that can be loaded into the CMOS RAM at startup.
707
+# The rtc_init parameter controls whether initialize the RTC with values stored
708
+# in the image. By default the time0 argument given to the clock option is used.
709
+# With 'rtc_init=image' the image is the source for the initial time.
710
+#
711
+# Example:
712
+#   cmosimage: file=cmos.img, rtc_init=image
713
+#=======================================================================
714
+#cmosimage: file=cmos.img, rtc_init=time0
715
+
716
+#=======================================================================
717
+# other stuff
718
+#=======================================================================
719
+magic_break: enabled=1
720
+#load32bitOSImage: os=nullkernel, path=../kernel.img, iolog=../vga_io.log
721
+#load32bitOSImage: os=linux, path=../linux.img, iolog=../vga_io.log, initrd=../initrd.img
722
+#text_snapshot_check: enable
723
+
724
+#-------------------------
725
+# PCI host device mapping
726
+#-------------------------
727
+#pcidev: vendor=0x1234, device=0x5678
728
+
729
+#=======================================================================
730
+# GDBSTUB:
731
+# Enable GDB stub. See user documentation for details.
732
+# Default value is enabled=0.
733
+#=======================================================================
734
+#gdbstub: enabled=0, port=1234, text_base=0, data_base=0, bss_base=0
735
+
736
+#=======================================================================
737
+# IPS:
738
+# The IPS directive is DEPRECATED. Use the parameter IPS of the CPU
739
+# directive instead.
740
+#=======================================================================
741
+#ips: 10000000
742
+
743
+#=======================================================================
744
+# for Macintosh, use the style of pathnames in the following
745
+# examples.
746
+#
747
+# vgaromimage: :bios:VGABIOS-elpin-2.40
748
+# romimage: file=:bios:BIOS-bochs-latest, address=0xf0000
749
+# floppya: 1_44=[fd:], status=inserted
750
+#=======================================================================

+ 278
- 0
contrib/vm/serial-console View File

@@ -0,0 +1,278 @@
1
+#!/usr/bin/perl -w
2
+
3
+=head1 NAME
4
+
5
+serial-console
6
+
7
+=head1 SYNOPSIS
8
+
9
+serial-console [options]
10
+
11
+Options:
12
+
13
+    -h,--help         Display brief help message
14
+    -v,--verbose      Increase verbosity
15
+    -q,--quiet        Decrease verbosity
16
+    -l,--log FILE     Log output to file
17
+    -r,--rcfile	FILE  Modify specified bochsrc file
18
+
19
+=head1 DESCRIPTION
20
+
21
+C<serial-console> provides a virtual serial console for use with
22
+Bochs.  Running C<serial-console> creates a pseudo-tty.  The master
23
+side of this pty is made available to the user for interaction; the
24
+slave device is written to the Bochs configuration file
25
+(C<bochsrc.txt>) for use by a subsequent Bochs session.
26
+
27
+=head1 EXAMPLES
28
+
29
+=over 4
30
+
31
+=item C<serial-console>
32
+
33
+Create a virtual serial console for Bochs, modify C<bochsrc.txt>
34
+appropriately.
35
+
36
+=item C<serial-console -r ../.bochsrc -l serial.log>
37
+
38
+Create a virtual serial console for Bochs, modify C<../.bochsrc>
39
+appropriately, log output to C<serial.log>.
40
+
41
+=back
42
+
43
+=head1 INVOCATION
44
+
45
+Before starting Bochs, run C<serial-console> in a different session
46
+(e.g. a different xterm window).  When you subsequently start Bochs,
47
+anything that the emulated machine writes to its serial port will
48
+appear in the window running C<serial-console>, and anything typed in
49
+the C<serial-console> window will arrive on the emulated machine's
50
+serial port.
51
+
52
+You do B<not> need to rerun C<serial-console> afresh for each Bochs
53
+session.
54
+
55
+=head1 OPTIONS
56
+
57
+=over 4
58
+
59
+=item B<-l,--log FILE>
60
+
61
+Log all output (i.e. everything that is printed in the
62
+C<serial-console> window) to the specified file.
63
+
64
+=item B<-r,--rcfile FILE>
65
+
66
+Modify the specified bochsrc file.  The file will be updated to
67
+contain the path to the slave side of the psuedo tty that we create.
68
+The original file will be restored when C<serial-console> exits.  The
69
+default is to modify the file C<bochsrc.txt> in the current directory.
70
+
71
+To avoid modifying any bochsrc file, use C<--norcfile>.
72
+
73
+=back
74
+
75
+=cut
76
+
77
+use IO::Pty;
78
+use IO::Select;
79
+use File::Spec::Functions qw ( :ALL );
80
+use Getopt::Long;
81
+use Pod::Usage;
82
+use POSIX qw ( :termios_h );
83
+use strict;
84
+use warnings;
85
+
86
+my $o;
87
+my $restore_file = {};
88
+my $restore_termios;
89
+use constant BLOCKSIZE => 8192;
90
+
91
+##############################################################################
92
+#
93
+# Parse command line options into options hash ($o)
94
+#
95
+# $o = parse_opts();
96
+
97
+sub parse_opts {
98
+  # $o is the hash that will hold the options
99
+  my $o = {
100
+    verbosity => 1,
101
+    rcfile => 'bochsrc.txt',
102
+  };
103
+  # Special handlers for some options
104
+  my $opt_handlers = {
105
+    verbose => sub { $o->{verbosity}++; },
106
+    quiet => sub { $o->{verbosity}--; },
107
+    help => sub { pod2usage(1); },
108
+    norcfile => sub { delete $o->{rcfile}; },
109
+  };
110
+  # Merge handlers into main options hash (so that Getopt::Long can find them)
111
+  $o->{$_} = $opt_handlers->{$_} foreach keys %$opt_handlers;
112
+  # Option specifiers for Getopt::Long
113
+  my @optspec = ( 'help|h|?',
114
+                  'quiet|q+',
115
+                  'verbose|v+',
116
+		  'log|l=s',
117
+		  'rcfile|r=s',
118
+		  'norcfile',
119
+                  );
120
+  # Do option parsing
121
+  Getopt::Long::Configure ( 'bundling' );
122
+  pod2usage("Error parsing command-line options") unless GetOptions (
123
+  $o, @optspec );
124
+  # Clean up $o by removing the handlers
125
+  delete $o->{$_} foreach keys %$opt_handlers;
126
+  return $o;
127
+}
128
+
129
+##############################################################################
130
+#
131
+# Modify bochsrc file
132
+
133
+sub patch_bochsrc {
134
+  my $active = shift;
135
+  my $pty = shift;
136
+
137
+  # Rename active file to backup file
138
+  ( my $vol, my $dir, my $file ) = splitpath ( $active );
139
+  $file = '.'.$file.".serial-console";
140
+  my $backup = catpath ( $vol, $dir, $file );
141
+  rename $active, $backup
142
+      or die "Could not back up $active to $backup: $!\n";
143
+
144
+  # Derive line to be inserted
145
+  my $patch = "com1: enabled=1, mode=term, dev=$pty\n";
146
+
147
+  # Modify file
148
+  open my $old, "<$backup" or die "Could not open $backup: $!\n";
149
+  open my $new, ">$active" or die "Could not open $active: $!\n";
150
+  print $new <<"EOF";
151
+##################################################
152
+#
153
+# This file has been modified by serial-console.
154
+#
155
+# Do not modify this file; it will be erased when
156
+# serial-console (pid $$) exits and will be
157
+# replaced with the backup copy held in
158
+# $backup.
159
+#
160
+##################################################
161
+
162
+
163
+EOF
164
+  my $patched;
165
+  while ( my $line = <$old> ) {
166
+    if ( $line =~ /^\s*\#?\s*com1:\s*\S/ ) {
167
+      if ( ! $patched ) {
168
+	$line = $patch;
169
+	$patched = 1;
170
+      } else {
171
+	$line = '# '.$line unless $line =~ /^\s*\#/;
172
+      }
173
+    }
174
+    print $new $line;
175
+  }
176
+  print $new $patch unless $patched;
177
+  close $old;
178
+  close $new;
179
+
180
+  return $backup;
181
+}
182
+
183
+##############################################################################
184
+#
185
+# Attach/detach message printing and terminal settings
186
+
187
+sub bochs_attached {
188
+  print STDERR "Bochs attached.\n\n\n"
189
+      if $o->{verbosity} >= 1;
190
+}
191
+
192
+sub bochs_detached {
193
+  print STDERR "\n\nWaiting for bochs to attach...\n"
194
+      if $o->{verbosity} >= 1;
195
+}
196
+
197
+##############################################################################
198
+#
199
+# Main program
200
+
201
+$o = parse_opts();
202
+pod2usage(1) if @ARGV;
203
+
204
+# Catch signals
205
+my $sigdie = sub { die "Exiting via signal\n"; };
206
+$SIG{INT} = $sigdie;
207
+
208
+# Create Pty, close slave side
209
+my $pty = IO::Pty->new();
210
+$pty->close_slave();
211
+$pty->set_raw();
212
+print STDERR "Slave pty is ".$pty->ttyname."\n" if $o->{verbosity} >= 1;
213
+
214
+# Open logfile
215
+my $log;
216
+if ( $o->{log} ) {
217
+  open $log, ">$o->{log}" or die "Could not open $o->{log}: $!\n";
218
+}
219
+
220
+# Set up terminal
221
+my $termios;
222
+if ( -t STDIN ) {
223
+  $termios = POSIX::Termios->new;
224
+  $restore_termios = POSIX::Termios->new;
225
+  $termios->getattr ( fileno(STDIN) );
226
+  $restore_termios->getattr ( fileno(STDIN) );
227
+  $termios->setlflag ( $termios->getlflag & ~(ICANON) & ~(ECHO) );
228
+  $termios->setiflag ( $termios->getiflag & ~(ICRNL) );
229
+  $termios->setattr ( fileno(STDIN), TCSANOW );
230
+}
231
+
232
+# Modify bochsrc file
233
+$restore_file = { $o->{rcfile} =>
234
+		  patch_bochsrc ( $o->{rcfile}, $pty->ttyname ) }
235
+    if $o->{rcfile};
236
+
237
+# Start character shunt
238
+my $attached = 1;
239
+my $select = IO::Select->new ( \*STDIN, $pty );
240
+while ( 1 ) {
241
+  my %can_read = map { $_ => 1 }
242
+		     $select->can_read ( $attached ? undef : 1 );
243
+  if ( $can_read{\*STDIN} ) {
244
+    sysread ( STDIN, my $data, BLOCKSIZE )
245
+	or die "Cannot read from STDIN: $!\n";
246
+    $pty->syswrite ( $data );
247
+  }
248
+  if ( $can_read{$pty} ) {
249
+    if ( $pty->sysread ( my $data, BLOCKSIZE ) ) {
250
+      # Actual data available
251
+      bochs_attached() if $attached == 0;
252
+      $attached = 1;
253
+      syswrite ( STDOUT, $data );
254
+      $log->syswrite ( $data ) if $log;
255
+    } else {
256
+      # No data available but select() says we can read.  This almost
257
+      # certainly indicates that nothing is attached to the slave.
258
+      bochs_detached() if $attached == 1;
259
+      $attached = 0;
260
+      sleep ( 1 );
261
+    }
262
+  } else {
263
+    bochs_attached() if $attached == 0;
264
+    $attached = 1;
265
+  }
266
+}
267
+
268
+END {
269
+  # Restore bochsrc file if applicable
270
+  if ( ( my $orig_file, my $backup_file ) = %$restore_file ) {
271
+    unlink $orig_file;
272
+    rename $backup_file, $orig_file;
273
+  }
274
+  # Restore terminal settings if applicable
275
+  if ( $restore_termios ) {
276
+    $restore_termios->setattr ( fileno(STDIN), TCSANOW );
277
+  }
278
+}

+ 190
- 0
contrib/vm/serial-console.1 View File

@@ -0,0 +1,190 @@
1
+.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07)
2
+.\"
3
+.\" Standard preamble:
4
+.\" ========================================================================
5
+.de Sp \" Vertical space (when we can't use .PP)
6
+.if t .sp .5v
7
+.if n .sp
8
+..
9
+.de Vb \" Begin verbatim text
10
+.ft CW
11
+.nf
12
+.ne \\$1
13
+..
14
+.de Ve \" End verbatim text
15
+.ft R
16
+.fi
17
+..
18
+.\" Set up some character translations and predefined strings.  \*(-- will
19
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20
+.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
21
+.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
22
+.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
23
+.\" nothing in troff, for use with C<>.
24
+.tr \(*W-
25
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26
+.ie n \{\
27
+.    ds -- \(*W-
28
+.    ds PI pi
29
+.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30
+.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
31
+.    ds L" ""
32
+.    ds R" ""
33
+.    ds C` ""
34
+.    ds C' ""
35
+'br\}
36
+.el\{\
37
+.    ds -- \|\(em\|
38
+.    ds PI \(*p
39
+.    ds L" ``
40
+.    ds R" ''
41
+'br\}
42
+.\"
43
+.\" Escape single quotes in literal strings from groff's Unicode transform.
44
+.ie \n(.g .ds Aq \(aq
45
+.el       .ds Aq '
46
+.\"
47
+.\" If the F register is turned on, we'll generate index entries on stderr for
48
+.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
49
+.\" entries marked with X<> in POD.  Of course, you'll have to process the
50
+.\" output yourself in some meaningful fashion.
51
+.ie \nF \{\
52
+.    de IX
53
+.    tm Index:\\$1\t\\n%\t"\\$2"
54
+..
55
+.    nr % 0
56
+.    rr F
57
+.\}
58
+.el \{\
59
+.    de IX
60
+..
61
+.\}
62
+.\"
63
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
64
+.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
65
+.    \" fudge factors for nroff and troff
66
+.if n \{\
67
+.    ds #H 0
68
+.    ds #V .8m
69
+.    ds #F .3m
70
+.    ds #[ \f1
71
+.    ds #] \fP
72
+.\}
73
+.if t \{\
74
+.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
75
+.    ds #V .6m
76
+.    ds #F 0
77
+.    ds #[ \&
78
+.    ds #] \&
79
+.\}
80
+.    \" simple accents for nroff and troff
81
+.if n \{\
82
+.    ds ' \&
83
+.    ds ` \&
84
+.    ds ^ \&
85
+.    ds , \&
86
+.    ds ~ ~
87
+.    ds /
88
+.\}
89
+.if t \{\
90
+.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
91
+.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
92
+.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
93
+.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
94
+.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
95
+.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
96
+.\}
97
+.    \" troff and (daisy-wheel) nroff accents
98
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
99
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
100
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
101
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
102
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
103
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
104
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
105
+.ds ae a\h'-(\w'a'u*4/10)'e
106
+.ds Ae A\h'-(\w'A'u*4/10)'E
107
+.    \" corrections for vroff
108
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
109
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
110
+.    \" for low resolution devices (crt and lpr)
111
+.if \n(.H>23 .if \n(.V>19 \
112
+\{\
113
+.    ds : e
114
+.    ds 8 ss
115
+.    ds o a
116
+.    ds d- d\h'-1'\(ga
117
+.    ds D- D\h'-1'\(hy
118
+.    ds th \o'bp'
119
+.    ds Th \o'LP'
120
+.    ds ae ae
121
+.    ds Ae AE
122
+.\}
123
+.rm #[ #] #H #V #F C
124
+.\" ========================================================================
125
+.\"
126
+.IX Title "SERIAL-CONSOLE 1"
127
+.TH SERIAL-CONSOLE 1 "2010-09-22" "perl v5.10.1" "User Contributed Perl Documentation"
128
+.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
129
+.\" way too many mistakes in technical documents.
130
+.if n .ad l
131
+.nh
132
+.SH "NAME"
133
+serial\-console
134
+.SH "SYNOPSIS"
135
+.IX Header "SYNOPSIS"
136
+serial-console [options]
137
+.PP
138
+Options:
139
+.PP
140
+.Vb 5
141
+\&    \-h,\-\-help         Display brief help message
142
+\&    \-v,\-\-verbose      Increase verbosity
143
+\&    \-q,\-\-quiet        Decrease verbosity
144
+\&    \-l,\-\-log FILE     Log output to file
145
+\&    \-r,\-\-rcfile FILE  Modify specified bochsrc file
146
+.Ve
147
+.SH "DESCRIPTION"
148
+.IX Header "DESCRIPTION"
149
+\&\f(CW\*(C`serial\-console\*(C'\fR provides a virtual serial console for use with
150
+Bochs.  Running \f(CW\*(C`serial\-console\*(C'\fR creates a pseudo-tty.  The master
151
+side of this pty is made available to the user for interaction; the
152
+slave device is written to the Bochs configuration file
153
+(\f(CW\*(C`bochsrc.txt\*(C'\fR) for use by a subsequent Bochs session.
154
+.SH "EXAMPLES"
155
+.IX Header "EXAMPLES"
156
+.ie n .IP """serial\-console""" 4
157
+.el .IP "\f(CWserial\-console\fR" 4
158
+.IX Item "serial-console"
159
+Create a virtual serial console for Bochs, modify \f(CW\*(C`bochsrc.txt\*(C'\fR
160
+appropriately.
161
+.ie n .IP """serial\-console \-r ../.bochsrc \-l serial.log""" 4
162
+.el .IP "\f(CWserial\-console \-r ../.bochsrc \-l serial.log\fR" 4
163
+.IX Item "serial-console -r ../.bochsrc -l serial.log"
164
+Create a virtual serial console for Bochs, modify \f(CW\*(C`../.bochsrc\*(C'\fR
165
+appropriately, log output to \f(CW\*(C`serial.log\*(C'\fR.
166
+.SH "INVOCATION"
167
+.IX Header "INVOCATION"
168
+Before starting Bochs, run \f(CW\*(C`serial\-console\*(C'\fR in a different session
169
+(e.g. a different xterm window).  When you subsequently start Bochs,
170
+anything that the emulated machine writes to its serial port will
171
+appear in the window running \f(CW\*(C`serial\-console\*(C'\fR, and anything typed in
172
+the \f(CW\*(C`serial\-console\*(C'\fR window will arrive on the emulated machine's
173
+serial port.
174
+.PP
175
+You do \fBnot\fR need to rerun \f(CW\*(C`serial\-console\*(C'\fR afresh for each Bochs
176
+session.
177
+.SH "OPTIONS"
178
+.IX Header "OPTIONS"
179
+.IP "\fB\-l,\-\-log \s-1FILE\s0\fR" 4
180
+.IX Item "-l,--log FILE"
181
+Log all output (i.e. everything that is printed in the
182
+\&\f(CW\*(C`serial\-console\*(C'\fR window) to the specified file.
183
+.IP "\fB\-r,\-\-rcfile \s-1FILE\s0\fR" 4
184
+.IX Item "-r,--rcfile FILE"
185
+Modify the specified bochsrc file.  The file will be updated to
186
+contain the path to the slave side of the psuedo tty that we create.
187
+The original file will be restored when \f(CW\*(C`serial\-console\*(C'\fR exits.  The
188
+default is to modify the file \f(CW\*(C`bochsrc.txt\*(C'\fR in the current directory.
189
+.Sp
190
+To avoid modifying any bochsrc file, use \f(CW\*(C`\-\-norcfile\*(C'\fR.

Loading…
Cancel
Save