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
31 .\" $FreeBSD: src/usr.bin/doscmd/doscmd.1,v 1.12.2.11 2002/06/20 23:45:41 charnier Exp $
32 .\" $DragonFly: src/usr.bin/doscmd/doscmd.1,v 1.7 2008/04/29 09:33:41 swildner Exp $
39 .Nd run a subset of real-mode DOS programs
42 .Fl 23AbDEfGHIMOPRrtVvXxYz
53 .Op Ar cmd Op Ar args ...
57 utility can either emulate a subset of DOS and run the
61 or it can be used to emulate a PC and boot DOS,
62 which allows it to run a larger variety of DOS applications.
63 It should be noted that MS-DOS 6.2 and higher appear
64 to cause difficulties for
66 To boot DOS, either provide the
81 only provides a subset of DOS, it is sufficient to run a variety of
82 programs, including, but not limited to, compilers, assemblers and
85 The various flags available to
88 .Bl -tag -width indent
90 Enable debugging traces of every trap to the
92 emulator from the DOS program.
93 Note that some traps are handled in the kernel and hence will not
96 Enable debugging of several lower level functions, such
97 as changing of interrupt vectors and initializing paths to logical drives.
102 Enable tracing of all interrupts that pass into the emulator.
103 This is the same as using the
105 option with all 256 possible interrupt values.
110 Attempt to boot DOS rather than emulate it.
115 Capture all output directed at the screen into
117 Note that direct screen writes will not be captured.
122 List MS-DOS calls emulated and their return values.
127 Enable debugging of the disk and file operations.
132 Send the debug output to
139 Enable debugging of the exec routines.
144 Enable debugging of the video (graphics) routines.
149 Enable tracing of half implemented calls.
154 Enable tracing of all interrupts. Almost the same as
156 except a few less traces are turned on.
160 .It Fl i Ar port Ns Xo
163 Enable tracing of all inputs requested from the io
167 is present, trace from
170 .Ar port+cnt Ns No -1 .
175 Enable debugging of the memory operations.
180 Direct the debugging output to stdout rather than stderr.
184 .It Fl o Ar port Ns Xo
187 Enable tracing of all outputs requested from the io
191 is present, trace from
194 .Ar port+cnt Ns No -1 .
198 .It Fl p Ar port Ns Xo
203 (with optional range up to to
204 .Ar port+cnt Ns No -1 )
205 to the real hardware I/O port(s).
206 This will likely require root privs to access them.
211 Enable tracing of io port calls (such as
219 Enable debugging of the file redirect code.
224 Use the raw keyboard and display. Pressing <CTRL-ALT-DEL> will
225 cause doscmd to exit. This allows use of VGA graphics.
230 Enable tracing of the interrupt
236 Attempt to do instruction level tracing.
237 Some instructions confuse the trace.
240 attempts to toggle the trace mode on and off.
245 Disable tracing of the interrupt
255 Include register dumps when reporting unknown interrupts.
266 Enable debugging of the XMS operations.
271 Open an X11 window to display output. This enables a
272 variety interrupts not available otherwise. This
273 can be used with or without
279 Enable debugging of the EMS operations.
286 to pause just prior to jumping to the DOS program.
287 Very little use except for developing
293 attempts to read a configuration file. First the file
295 in the current directory. If not found there, the
297 directory is searched. If still not found, the file
301 In the configuration file, a comment is started with the \fB#\fP character.
302 Blank lines are ignored.
303 Non empty lines either are environment variables
304 or commands which configure devices.
305 Any line which has an \fB=\fP before any white space is considered to be
306 an environment variable assignment and is added to the DOS environment.
307 The rest of the lines are one of the following
308 .Bl -tag -width XXXXX
312 .It Cm boot Op Cm A: | C:
313 Set the device to boot from.
316 is first tried, if it is defined, and if that fails,
331 to be assigned as the specified drive. If the
333 flag is specified, it is a read only file system.
334 These assignments will not take place when booting DOS until the
335 .Pa /usr/libdata/doscmd/redir.com
341 .Cm lpt Ns Op Cm 0-4 :
346 Attempt to assign the specified printer to
350 is specified then use it as the length of time for no
351 activity (in seconds) to indicate that the printer
352 should be flushed. The default is 30 seconds.
355 option should be set when
357 refers to a real printer.
375 to be used as either the next available floppy or
376 to the specified floppy.
379 is specified the floppy will be read only.
384 .Bl -tag -compact -width 1440x
386 9 head 40 track single sided floppy
388 9 head 40 track double sided floppy
390 9 head 80 track double sided floppy
392 15 head 80 track double sided floppy
394 18 head 80 track double sided floppy
396 36 head 80 track double sided floppy
405 .Op Ar type | cyl head sec
412 .Op Ar type | cyl head sec
417 to be used as either the next available hard disk or
418 to the specified hard disk.
419 A disk's geometry can either be directly specified with
421 being the number of cylinders,
423 the number of heads and
425 the number of sectors per track,
426 or it can be one of the standard types specified by
431 argument specifies file to use as the first sector
432 of this disk. This can be useful for inserting a
433 false fdisk table when
435 only refers to part of a disk.
440 .Cm com Ns Op Cm 1-4 :
445 Assign the tty or pty specified by
447 to be used as the specified com port.
448 Its base address will be emulated at
450 at interrupt specified by
452 This code is lightly tested and may not suit all needs.
462 (with optional range up to to
463 .Ar port+count Ns No -1 )
464 to the real hardware I/O port(s).
465 This will likely require root privs to access them.
469 .It Cm "setver command version"
470 Cause doscmd, when emulating DOS, to report
472 as the version number of DOS when called from the program named
476 is the same as of the
478 variable described below.
481 If not already assigned,
483 will be assigned to the root directory (/) and the current directory
486 will be set to the actual current directory.
487 Note that this means that invocations such as:
493 directory will start with the current path.
494 Also, the following environment variables will be defined if not
497 .Cm "COMSPEC=C:\eCOMMAND.COM
504 variable is also used to find
508 will be looked for and then
510 .Sh "CONFIGURATION VARIABLES"
511 There are several variables in the
513 file which are internal to doscmd and do not actually get inserted into
514 the DOS environment. These are:
515 .Bl -tag -width MS_VERSION
517 The value of this variable is used to determine the version of DOS that
518 should be reported by
522 will not change the way
523 it works, just the way it reports. By default this value is
528 To change it to version 3.2 (the default in previous versions of
533 The value of this variable determines the font used in an X window.
536 which is installed in
537 .Pa /usr/libdata/doscmd/fonts .
539 .Ql xset fp+ /usr/libdata/doscmd/fonts
541 .Pa ${HOME}/.xsession
544 to let the X server find it.
553 file names by converting to all upper case and eliminating any invalid
554 character. It does not make any attempt to convert ASCII files into
557 format favored in the DOS world. Use
561 collection) or similar tools to convert ASCII files.
567 Type Cylinders Heads Sectors Size
626 .Sh INSTALLING DOS ON A PSEUDO DISK
627 To install DOS on a pseudo hard disk under doscmd, do the following:
632 with at least the following:
633 .Bd -literal -offset indent
634 assign A: /dev/fd0.1440 1440
635 assign A: /dev/fd0.720 720
636 assign hard boot_drive 80 2 2
639 You may need to adjust the raw files for the A: drive to match
640 your system. This example will cause the HD drive to be tried
641 first and the DD drive second.
643 Note that you should only use raw devices or files at this point,
644 do not use a cooked device! (Well, it would probably be okay
645 for a hard disk, but certainly not the floppy)
648 should be the file name of where you want your bootable
649 image to be. The three numbers which follow
651 say that the drive will have 80 cylinders, 2 heads and 2 sectors per track.
652 This is the smallest drive possible which still can have MS-DOS
653 5.0 installed on it along with a
659 You might want to create a larger boot drive.
663 must exist, so use the command touch to create it.
665 Insert a floppy disk into the A: drive which is bootable to MS-DOS
666 and has the commands fdisk, format and sys on it. You should also
667 copy the file redir.com onto the floppy by either mounting it
668 with the msdos file system type or by using mtools
670 .Dq Li mwrite redir.com a: ) .
678 .Li Create DOS partition or Logical Drive .
681 .Li Create Primary DOS Partition .
683 Tell it how big to make it
684 (Typically the whole drive. It is pretty tiny after all.)
686 Get out of FDISK by hitting
690 doscmd may abort, if it does, start up doscmd again.
692 At the > prompt, type
694 and follow the instructions.
701 Either remove the floppy from the drive or add the line
702 .Bd -literal -offset indent
708 You should now be running DOS off of your new disk. You will
709 probably want both config.sys and an autoexec.bat file. To
710 start with, you can say:
711 .Bd -literal -offset indent
712 > copy con: config.sys
715 > copy con: autoexec.bat
723 You know have a bootable pseudo disk which will automatically call
726 program, which installs
729 them add lines to your .doscmdrc such as:
730 .Bd -literal -offset indent
732 assign P: -ro /usr/prb
734 Note that you will not always be able to access every file due to
740 encounters an interrupt which is unimplemented, it will print a message
743 .Dl Unknown interrupt 21 function 99
750 .Ic X11 support not compiled in
753 switch, this support can be added by defining an environment variable
755 which points to the installed X Window System (normally
759 in the source directory (normally
760 .Pa /usr/src/usr.bin/doscmd ) .
761 For this to work, the X programmer's kit must have been installed.
765 program first appeared in