2 .\" Copyright (c) 1992, 1993, 1996
3 .\" Berkeley Software Design, Inc. All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
13 .\" 3. All advertising materials mentioning features or use of this software
14 .\" must display the following acknowledgement:
15 .\" This product includes software developed by Berkeley Software
18 .\" THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" BSDI doscmd.1,v 2.3 1996/04/08 19:32:29 bostic Exp
38 .Nd run a subset of real-mode DOS programs
41 .Fl 23AbDEfHIMOPRrtVvXxYz
52 .Op Ar cmd Op Ar args ...
55 can either emulate a subset of DOS and run the
59 or it can be used to emulate a PC and boot DOS,
60 which allows it to run a larger variety of DOS applications.
61 It should be noted that MS DOS 6.2 and higher appear
62 to cause difficulties for
64 To boot DOS, either provide the
79 only provides a subset of DOS, it is sufficient to run a variety of
80 programs, including, but not limited to, compilers, assemblers and
83 The various flags available to
86 .Bl -tag -width indent
88 Enable debugging traces of every trap to the
90 emulator from the DOS program.
91 Note that some traps are handled in the kernel and hence will not
94 Enable debugging of several lower level functions, such
95 as changing of interrupt vectors and initializing paths to logical drives.
100 Enable tracing of all interrupts that pass into the emulator.
101 This is the same as using the
103 option with all 256 possible interrupt values.
108 Attempt to boot DOS rather than emulate it.
113 Capture all output directed at the screen into
115 Note that direct screen writes will not be captured.
120 List MS-DOS calls emulated and their return values.
125 Enable debugging of the disk and file operations.
130 Send the debug output to
137 Enable debugging of the exec routines.
142 Enable tracing of half implemented calls.
147 Enable tracing of all interrupts. Almost the same as
149 except a few less traces are turned on.
153 .It Fl i Ar port Ns Xo
156 Enable tracing of all inputs requested from the io
160 is present, trace from
163 .Ar port+cnt Ns No -1 .
168 Enable debugging of the memory operations.
173 Direct the debugging output to stdout rather than stderr.
177 .It Fl o Ar port Ns Xo
180 Enable tracing of all outputs requested from the io
184 is present, trace from
187 .Ar port+cnt Ns No -1 .
191 .It Fl p Ar port Ns Xo
196 (with optional range up to to
197 .Ar port+cnt Ns No -1 )
198 to the real hardware I/O port(s).
199 This will likely require root privs to access them.
204 Enable tracing of io port calls (such as
212 Enable debugging of the file redirect code.
217 Use the raw keyboard and display. Pressing <CTRL-ALT-DEL> will
218 cause doscmd to exit. This allows use of VGA graphics.
223 Enable tracing of the interrupt
229 Attempt to do instruction level tracing.
230 Some instructions confuse the trace.
233 attempts to toggle the trace mode on and off.
238 Disable tracing of the interrupt
248 Include register dumps when reporting unknown interrupts.
259 Enable debugging of the XMS operations.
264 Open an X11 window to display output. This enables a
265 variety interrupts not available otherwise. This
266 can be used with or without
272 Enable debugging of the EMS operations.
279 to pause just prior to jumping to the DOS program.
280 Very little use except for developing
286 attempts to read a configuration file. First the file
288 in the current directory. If not found there, the
290 directory is searched. If still not found, the file
294 In the configuration file, a comment is started with the \fB#\fP character.
295 Blank lines are ignored.
296 Non empty lines either are environment variables
297 or commands which configure devices.
298 Any line which has an \fB=\fP before any white space is considered to be
299 an environment variable assignment and is added to the DOS environment.
300 The rest of the lines are one of the following
301 .Bl -tag -width XXXXX
305 .It Cm boot Op Cm A: | C:
306 Set the device to boot from.
309 is first tried, if it is defined, and if that fails,
324 to be assigned as the specified drive. If the
326 flag is specified, it is a read only file system.
327 These assignments will not take place when booting DOS until the
328 .Pa /usr/libdata/doscmd/redir.com
334 .Cm lpt Ns Op Cm 0-4 :
339 Attempt to assign the specified printer to
343 is specified then use it as the length of time for no
344 activity (in seconds) to indicate that the printer
345 should be flushed. The default is 30 seconds.
348 option should be set when
350 refers to a real printer.
368 to be used as either the next available floppy or
369 to the specified floppy.
372 is specified the floppy will be read only.
377 .Bl -tag -compact -width 1440x
379 9 head 40 track single sided floppy
381 9 head 40 track double sided floppy
383 9 head 80 track double sided floppy
385 15 head 80 track double sided floppy
387 18 head 80 track double sided floppy
389 36 head 80 track double sided floppy
398 .Op Ar type | cyl head sec
405 .Op Ar type | cyl head sec
410 to be used as either the next available hard disk or
411 to the specified hard disk.
412 A disk's geometry can either be directly specified with
414 being the number of cylinders,
416 the number of heads and
418 the number of sectors per track,
419 or it can be one of the standard types specified by
424 argument specifies file to use as the first sector
425 of this disk. This can be useful for inserting a
426 false fdisk table when
428 only refers to part of a disk.
433 .Cm com Ns Op Cm 1-4 :
438 Assign the tty or pty specified by
440 to be used as the specified com port.
441 It's base address will be emulated at
443 at interrupt specified by
445 This code is lightly tested and may not suit all needs.
455 (with optional range up to to
456 .Ar port+count Ns No -1 )
457 to the real hardware I/O port(s).
458 This will likely require root privs to access them.
462 .It Cm "setver command version"
463 Cause doscmd, when emulating DOS, to report
465 as the version number of DOS when called from the program named
469 is the same as of the
471 variable described below.
474 If not already assigned,
476 will be assigned to the root directory (/) and the current directory
479 will be set to the actual current directory.
480 Note that this means that invocations such as:
486 directory will start with the current path.
487 Also, the following environment variables will be defined if not
490 .Cm "COMSPEC=C:\eCOMMAND.COM
497 variable is also used to find
501 will be looked for and then
503 .Sh "CONFIGURATION VARIABLES"
505 There are several variables in the
507 file which are internal to doscmd and do not actually get inserted into
508 the DOS environment. These are:
509 .Bl -tag -width MS_VERSION
511 The value of this variable is used to determine the version of DOS that
512 should be reported by
516 will not change the way
517 it works, just the way it reports. By default this value is
522 To change it to version 3.2 (the default in previous versions of
527 The value of this variable determines the font used in an X window.
530 which is installed in
531 .Pa /usr/libdata/doscmd/fonts .
533 .Ql xset fp+ /usr/libdata/doscmd/fonts
535 .Pa ${HOME}/.xsession
538 to let the X server find it.
546 file names by converting to all upper case and eliminating any invalid
547 character. It does not make any attempt to convert ASCII files into
550 format favored in the DOS world. Use
552 (part of the ports collection) or similar tools to convert ASCII files.
558 Type Cylinders Heads Sectors Size
617 .Sh INSTALLING DOS ON A PSEUDO DISK
619 To install DOS on a pseudo hard disk under doscmd, do the following:
624 with at least the following:
625 .Bd -literal -offset indent
626 assign A: /dev/fd0.1440 1440
627 assign A: /dev/fd0.720 720
628 assign hard boot_drive 80 2 2
631 You may need to adjust the raw files for the A: drive to match
632 your system. This example will cause the HD drive to be tried
633 first and the DD drive second.
635 Note that you should only use raw devices or files at this point,
636 do not use a cooked device! (Well, it would probably be okay
637 for a hard disk, but certainly not the floppy)
640 should be the file name of where you want your bootable
641 image to be. The three numbers which follow
643 say that the drive will have 80 cylinders, 2 heads and 2 sectors per track.
644 This is the smallest drive possible which still can have MS DOS
645 5.0 installed on it along with a
651 You might want to create a larger boot drive.
655 must exist, so use the command touch to create it.
657 Insert a floppy disk into the A: drive which is bootable to MS-DOS
658 and has the commands fdisk, format and sys on it. You should also
659 copy the file redir.com onto the floppy by either mounting it
660 with the msdos file system type or by using mtools
662 .Dq Li mwrite redir.com a: ) .
670 .Li Create DOS partition or Logical Drive .
673 .Li Create Primary DOS Partition .
675 Tell it how big to make it
676 (Typically the whole drive. It is pretty tiny after all.)
678 Get out of FDISK by hitting
682 doscmd may abort, if it does, start up doscmd again.
684 At the > prompt, type
686 and follow the instructions.
693 Either remove the floppy from the drive or add the line
694 .Bd -literal -offset indent
700 You should now be running DOS off of your new disk. You will
701 probably want both config.sys and an autoexec.bat file. To
702 start with, you can say:
703 .Bd -literal -offset indent
704 > copy con: config.sys
707 > copy con: autoexec.bat
715 You know have a bootable pseudo disk which will automatically call
718 program, which installs
721 them add lines to your .doscmdrc such as:
722 .Bd -literal -offset indent
724 assign P: -ro /usr/prb
726 Note that you will not always be able to access every file due to
733 encounters an interrupt which is unimplemented, it will print a message
736 .Dl Unknown interrupt 21 function 99
743 .Ic X11 support not compiled in
746 switch, this support can be added by defining an environment variable
748 which points to the installed X Window System (normally
752 in the source directory (normally
753 .Pa /usr/src/usr.bin/doscmd
754 ). For this to work, the X programmer's kit must have been installed.
761 program first appeared in BSD/386.