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 $
38 .Nd run a subset of real-mode DOS programs
41 .Fl 23AbDEfGHIMOPRrtVvXxYz
52 .Op Ar cmd Op Ar args ...
56 utility can either emulate a subset of DOS and run the
60 or it can be used to emulate a PC and boot DOS,
61 which allows it to run a larger variety of DOS applications.
62 It should be noted that MS-DOS 6.2 and higher appear
63 to cause difficulties for
65 To boot DOS, either provide the
80 only provides a subset of DOS, it is sufficient to run a variety of
81 programs, including, but not limited to, compilers, assemblers and
84 The various flags available to
87 .Bl -tag -width indent
89 Enable debugging traces of every trap to the
91 emulator from the DOS program.
92 Note that some traps are handled in the kernel and hence will not
95 Enable debugging of several lower level functions, such
96 as changing of interrupt vectors and initializing paths to logical drives.
101 Enable tracing of all interrupts that pass into the emulator.
102 This is the same as using the
104 option with all 256 possible interrupt values.
109 Attempt to boot DOS rather than emulate it.
114 Capture all output directed at the screen into
116 Note that direct screen writes will not be captured.
121 List MS-DOS calls emulated and their return values.
126 Enable debugging of the disk and file operations.
131 Send the debug output to
138 Enable debugging of the exec routines.
143 Enable debugging of the video (graphics) routines.
148 Enable tracing of half implemented calls.
153 Enable tracing of all interrupts. Almost the same as
155 except a few less traces are turned on.
159 .It Fl i Ar port Ns Xo
162 Enable tracing of all inputs requested from the io
166 is present, trace from
169 .Ar port+cnt Ns No -1 .
174 Enable debugging of the memory operations.
179 Direct the debugging output to stdout rather than stderr.
183 .It Fl o Ar port Ns Xo
186 Enable tracing of all outputs requested from the io
190 is present, trace from
193 .Ar port+cnt Ns No -1 .
197 .It Fl p Ar port Ns Xo
202 (with optional range up to to
203 .Ar port+cnt Ns No -1 )
204 to the real hardware I/O port(s).
205 This will likely require root privs to access them.
210 Enable tracing of io port calls (such as
218 Enable debugging of the file redirect code.
223 Use the raw keyboard and display. Pressing <CTRL-ALT-DEL> will
224 cause doscmd to exit. This allows use of VGA graphics.
229 Enable tracing of the interrupt
235 Attempt to do instruction level tracing.
236 Some instructions confuse the trace.
239 attempts to toggle the trace mode on and off.
244 Disable tracing of the interrupt
254 Include register dumps when reporting unknown interrupts.
265 Enable debugging of the XMS operations.
270 Open an X11 window to display output. This enables a
271 variety interrupts not available otherwise. This
272 can be used with or without
278 Enable debugging of the EMS operations.
285 to pause just prior to jumping to the DOS program.
286 Very little use except for developing
292 attempts to read a configuration file. First the file
294 in the current directory. If not found there, the
296 directory is searched. If still not found, the file
300 In the configuration file, a comment is started with the \fB#\fP character.
301 Blank lines are ignored.
302 Non empty lines either are environment variables
303 or commands which configure devices.
304 Any line which has an \fB=\fP before any white space is considered to be
305 an environment variable assignment and is added to the DOS environment.
306 The rest of the lines are one of the following
307 .Bl -tag -width XXXXX
311 .It Cm boot Op Cm A: | C:
312 Set the device to boot from.
315 is first tried, if it is defined, and if that fails,
330 to be assigned as the specified drive. If the
332 flag is specified, it is a read only file system.
333 These assignments will not take place when booting DOS until the
334 .Pa /usr/libdata/doscmd/redir.com
340 .Cm lpt Ns Op Cm 0-4 :
345 Attempt to assign the specified printer to
349 is specified then use it as the length of time for no
350 activity (in seconds) to indicate that the printer
351 should be flushed. The default is 30 seconds.
354 option should be set when
356 refers to a real printer.
374 to be used as either the next available floppy or
375 to the specified floppy.
378 is specified the floppy will be read only.
383 .Bl -tag -compact -width 1440x
385 9 head 40 track single sided floppy
387 9 head 40 track double sided floppy
389 9 head 80 track double sided floppy
391 15 head 80 track double sided floppy
393 18 head 80 track double sided floppy
395 36 head 80 track double sided floppy
404 .Op Ar type | cyl head sec
411 .Op Ar type | cyl head sec
416 to be used as either the next available hard disk or
417 to the specified hard disk.
418 A disk's geometry can either be directly specified with
420 being the number of cylinders,
422 the number of heads and
424 the number of sectors per track,
425 or it can be one of the standard types specified by
430 argument specifies file to use as the first sector
431 of this disk. This can be useful for inserting a
432 false fdisk table when
434 only refers to part of a disk.
439 .Cm com Ns Op Cm 1-4 :
444 Assign the tty or pty specified by
446 to be used as the specified com port.
447 Its base address will be emulated at
449 at interrupt specified by
451 This code is lightly tested and may not suit all needs.
461 (with optional range up to to
462 .Ar port+count Ns No -1 )
463 to the real hardware I/O port(s).
464 This will likely require root privs to access them.
468 .It Cm "setver command version"
469 Cause doscmd, when emulating DOS, to report
471 as the version number of DOS when called from the program named
475 is the same as of the
477 variable described below.
480 If not already assigned,
482 will be assigned to the root directory (/) and the current directory
485 will be set to the actual current directory.
486 Note that this means that invocations such as:
492 directory will start with the current path.
493 Also, the following environment variables will be defined if not
496 .Cm "COMSPEC=C:\eCOMMAND.COM"
503 variable is also used to find
507 will be looked for and then
509 .Sh "CONFIGURATION VARIABLES"
510 There are several variables in the
512 file which are internal to doscmd and do not actually get inserted into
513 the DOS environment. These are:
514 .Bl -tag -width MS_VERSION
516 The value of this variable is used to determine the version of DOS that
517 should be reported by
521 will not change the way
522 it works, just the way it reports. By default this value is
527 To change it to version 3.2 (the default in previous versions of
532 The value of this variable determines the font used in an X window.
535 which is installed in
536 .Pa /usr/libdata/doscmd/fonts .
538 .Ql xset fp+ /usr/libdata/doscmd/fonts
540 .Pa ${HOME}/.xsession
543 to let the X server find it.
552 file names by converting to all upper case and eliminating any invalid
553 character. It does not make any attempt to convert ASCII files into
556 format favored in the DOS world. Use
560 collection) or similar tools to convert ASCII files.
566 Type Cylinders Heads Sectors Size
625 .Sh INSTALLING DOS ON A PSEUDO DISK
626 To install DOS on a pseudo hard disk under doscmd, do the following:
631 with at least the following:
632 .Bd -literal -offset indent
633 assign A: /dev/fd0.1440 1440
634 assign A: /dev/fd0.720 720
635 assign hard boot_drive 80 2 2
638 You may need to adjust the raw files for the A: drive to match
639 your system. This example will cause the HD drive to be tried
640 first and the DD drive second.
642 Note that you should only use raw devices or files at this point,
643 do not use a cooked device! (Well, it would probably be okay
644 for a hard disk, but certainly not the floppy)
647 should be the file name of where you want your bootable
648 image to be. The three numbers which follow
650 say that the drive will have 80 cylinders, 2 heads and 2 sectors per track.
651 This is the smallest drive possible which still can have MS-DOS
652 5.0 installed on it along with a
658 You might want to create a larger boot drive.
662 must exist, so use the command touch to create it.
664 Insert a floppy disk into the A: drive which is bootable to MS-DOS
665 and has the commands fdisk, format and sys on it. You should also
666 copy the file redir.com onto the floppy by either mounting it
667 with the msdos file system type or by using mtools
669 .Dq Li mwrite redir.com a: ) .
677 .Li Create DOS partition or Logical Drive .
680 .Li Create Primary DOS Partition .
682 Tell it how big to make it
683 (Typically the whole drive. It is pretty tiny after all.)
685 Get out of FDISK by hitting
689 doscmd may abort, if it does, start up doscmd again.
691 At the > prompt, type
693 and follow the instructions.
700 Either remove the floppy from the drive or add the line
701 .Bd -literal -offset indent
707 You should now be running DOS off of your new disk. You will
708 probably want both config.sys and an autoexec.bat file. To
709 start with, you can say:
710 .Bd -literal -offset indent
711 > copy con: config.sys
714 > copy con: autoexec.bat
722 You know have a bootable pseudo disk which will automatically call
725 program, which installs
728 them add lines to your .doscmdrc such as:
729 .Bd -literal -offset indent
731 assign P: -ro /usr/prb
733 Note that you will not always be able to access every file due to
739 encounters an interrupt which is unimplemented, it will print a message
742 .Dl Unknown interrupt 21 function 99
749 .Ic X11 support not compiled in
752 switch, this support can be added by defining an environment variable
754 which points to the installed X Window System (normally
758 in the source directory (normally
759 .Pa /usr/src/usr.bin/doscmd ) .
760 For this to work, the X programmer's kit must have been installed.
764 program first appeared in