doscmd man page on BSDi

Man page or keyword search:  
man Server   6284 pages
apropos Keyword Search (all sections)
Output format
BSDi logo
[printable version]

DOSCMD(1)		     BSD Reference Manual		     DOSCMD(1)

NAME
     doscmd - run a subset of real-mode DOS programs

SYNOPSIS
     doscmd -23AbDEfHIMOPRrtVvxz -c file -d file -i port[:cnt] -o port[:cnt]
	    -S int -U int [cmd [args ...]]

DESCRIPTION
     Doscmd can either emulate a subset of DOS and run the single command cmd
     args, or it can be used to emulate a PC and boot DOS, which allows it to
     run a larger variety of DOS applications.	It should be noted that MS DOS
     6.2 and higher appear to cause difficulties for doscmd. To boot DOS, ei-
     ther provide the -b flag or omit the cmd argument.	 If -b is specified,
     cmd and args are ignored.

     Although doscmd only provides a subset of DOS, it is sufficient to run a
     variety of programs, including, but not limited to, compilers, assemblers
     and linker-loaders.

     The various flags available to doscmd are:

     -2	     Enable debugging traces of every trap to the doscmd emulator from
	     the DOS program.  Note that some traps are handled in the kernel
	     and hence will not be traced.

     -3	     Enable debugging of several lower level functions, such as chang-
	     ing of interrupt vectors and initializing paths to logical
	     drives.

     -A	     Enable tracing of all interrupts that pass into the emulator.
	     This is the same as using the -S option will all 256 possible in-
	     terrupt values.

     -b	     Attempt to boot DOS rather than emulate it.

     -c file
	     Capture all output directed at the screen into file. Note that
	     direct screen writes will not be captured.

     -D	     Enable debugging of the disk and file operations.

     -d file
	     Send the debug output to file instead of stderr.

     -E	     Enable debugging of the exec routines.

     -f	     Use fork(2) for spawned processes rather than running them in the
	     current memory space.

     -H	     Enable tracing of half implemented calls.

     -I	     Enable tracing of all interrupts.	Almost the same as -A except a
	     few less traces are turned on.

     -i port[:cnt]
	     Enable tracing of all inputs requested from the io port. If cnt
	     is present, trace from port to port+cnt-1.

     -M	     Enable debugging of the memory operations.

     -O	     Direct the debugging output to stdout rather than stderr.

     -o port[:cnt]
	     Enable tracing of all outputs requested from the io port. If cnt
	     is present, trace from port to port+cnt-1.

     -P	     Enable tracing of io port calls (such as inb, outb, etc).

     -R	     Enable debugging of the file redirect code.

     -r	     Use the raw keyboard and display.	Pressing <CTRL-ALT-DEL> will
	     cause doscmd to exit.  This allows use of VGA graphics.

     -S int  Enable tracing of the interrupt int.

     -t	     Attempt to do instruction level tracing.  Some instructions con-
	     fuse the trace.  Pressing <CTRL-ALT-T> attempts to toggle the
	     trace mode on and off.

     -U int  Disable tracing of the interrupt int. Useful after -A or -I.

     -V	     Include register dumps when reporting unknown interrupts.

     -v	     Same as -AH

     -x	     Open an X11 window to display output.  This enables a variety in-
	     terrupts not available otherwise.	This can be used with or with-
	     out -b.

     -z	     Cause doscmd to pause just prior to jumping to the DOS program.
	     Very little use except for developing doscmd.

     When starting up, doscmd attempts to read a configuration file.  First
     the file .doscmdrc in the current directory.  If not found there, the
     $HOME directory is searched.  If still not found, the file /etc/doscmdrc
     is used.

     In the configuration file, a comment is started with the # character.
     Blank lines are ignored.  Non empty lines either are environment vari-
     ables or commands which configure devices.	 Any line which has an = be-
     fore any white space is considered to be an environment variable assign-
     ment and is added to the DOS environment.	The rest of the lines are one
     the of the following

     boot [A: | C:]
	    Set the device to boot from.  By default A: is first tried, it if
	    is defined, and if that fails, C: is tried.

     assign [A-Z]: [-ro] path
	    Assigns the BSD/OS directory path to be assigned as the specified
	    drive.  If the -ro flag is specified, it is a read only file sys-
	    tem.  These assignments will not take place when booting DOS until
	    the /usr/dos/instbsdi.exe binary is run.

     assign lpt[0-4]: [direct] path [timeout]
	    Attempt to assign the specified printer to path. If timeout is
	    specified then use it as the length of time for no activity (in
	    seconds) to indicate that the printer should be flushed.  The de-
	    fault is 30 seconds.  The direct option should be set when path
	    refers to a real printer.

     assign [A: | B:] [-ro] path density

     assign flop[01] [-ro] path density
	    Assign the file path to be used as either the next available flop-
	    py or to the specified floppy.  If -ro is specified the floppy
	    will be read only.	The density may be one of:

	    180	   9 head 40 track single sided floppy
	    360	   9 head 40 track double sided floppy
	    720	   9 head 80 track double sided floppy
	    1200   15 head 80 track double sided floppy
	    1440   18 head 80 track double sided floppy
	    2880   36 head 80 track double sided floppy

     assign [C-Z]: [-ro] path [type | cyl head sec] [fdisk_tab]

     assign hard[01] [-ro] path [type | cyl head sec] [fdisk_tab]
	    Assign the file path to be used as either the next available hard
	    disk or to the specified hard disk.	 A disk's geometry can either
	    be directly specified with cyl being the number of cylinders, head
	    the number of heads and sec the number of sectors per track, or it
	    can be one of the standard types specified by type (see below).
	    The option fdisk_tab argument specifies file to use as the first
	    sector of this disk.  This can be useful for inserting a false
	    fdisk table when path only refers to part of a disk.

     assign com[1-4]: path port irq
	    Assign the tty or pty specified by path to be used as the speci-
	    fied com port.  It's base address will emulated at port at inter-
	    rupt specified by irq. This code is lightly tested and may not
	    suit all needs.

     setver command version
	    Cause doscmd, when emulating DOS, to report version as the version
	    number of DOS when called from the program named command. The for-
	    mat of version is the same as of the MS_VERSION variable described
	    below.

     If not already assigned, C: will be assigned to the root directory (/)
     and the current directory for C: will be set the the actual current di-
     rectory.  Note that this means that invocations such as:

	  doscmd ../foo

     will not work as the C: directory will start with the current path.  Al-
     so, the following environment variables will be defined if not already
     defined:

     COMSPEC=C:\COMMAND.COM
     PATH=C:\
     PROMPT=DOS>

     The PATH variable is also used to find cmd. Like DOS, first cmd.com will
     be looked for and then cmd.exe.

CONFIGURATION VARIABLES
     There are several variables in the .doscmdrc file which are internal to
     doscmd and do not actually get inserted into the DOS environment.	These
     are:

     MS_VERSION	 The value of this variable is used to determine the version
		 of DOS that should be reported by doscmd. Note that doscmd
		 will not change the way it works, just the way it reports.
		 By default this value is 410, which corresponds to MS DOS
		 version 4.1. To change it to version 3.2 (the default in pre-
		 vious versions of doscmd) use the value of 320.

FILE TRANSLATION
     Doscmd translates BSD/OS file names into DOS file names by converting to
     all upper case and eliminating any invalid character.  It does not make
     any attempt to convert ASCII files into the <CR><LF> format favored in
     the DOS world.  Use the program bsd2dos(1) to convert ASCII files.

DISK TYPES
     +-----------+-----------------+-------------+---------------+------------+
     |	Type	 |   Cylinders	   |   Heads	 |   Sectors	 |     Size   |
     +-----------+-----------------+-------------+---------------+------------+
     |	  01	 |	   306	   |	   4	 |	  17	 |     10MB   |
     |	  02	 |	   615	   |	   4	 |	  17	 |     20MB   |
     |	  03	 |	   615	   |	   6	 |	  17	 |     30MB   |
     |	  04	 |	   940	   |	   8	 |	  17	 |     62MB   |
     |	  05	 |	   940	   |	   6	 |	  17	 |     46MB   |
     +-----------+-----------------+-------------+---------------+------------+
     |	  06	 |	   615	   |	   4	 |	  17	 |     20MB   |
     |	  07	 |	   462	   |	   8	 |	  17	 |     30MB   |
     |	  08	 |	   733	   |	   5	 |	  17	 |     30MB   |
     |	  09	 |	   900	   |	  15	 |	  17	 |    112MB   |
     |	  10	 |	   820	   |	   3	 |	  17	 |     20MB   |
     +-----------+-----------------+-------------+---------------+------------+
     |	  11	 |	   855	   |	   5	 |	  17	 |     35MB   |
     |	  12	 |	   855	   |	   7	 |	  17	 |     49MB   |
     |	  13	 |	   306	   |	   8	 |	  17	 |     20MB   |
     |	  14	 |	   733	   |	   7	 |	  17	 |     42MB   |
     |	  15	 |	   976	   |	  15	 |	  17	 |    121MB   |
     +-----------+-----------------+-------------+---------------+------------+
     |	  16	 |	   612	   |	   4	 |	  17	 |     20MB   |
     |	  17	 |	   977	   |	   5	 |	  17	 |     40MB   |
     |	  18	 |	   977	   |	   7	 |	  17	 |     56MB   |
     |	  19	 |	  1024	   |	   7	 |	  17	 |     59MB   |
     |	  20	 |	   733	   |	   5	 |	  17	 |     30MB   |
     +-----------+-----------------+-------------+---------------+------------+
     |	  21	 |	   733	   |	   7	 |	  17	 |     42MB   |
     |	  22	 |	   733	   |	   5	 |	  17	 |     30MB   |
     |	  23	 |	   306	   |	   4	 |	  17	 |     10MB   |
     |	  24	 |	   925	   |	   7	 |	  17	 |     53MB   |
     |	  25	 |	   925	   |	   9	 |	  17	 |     69MB   |
     +-----------+-----------------+-------------+---------------+------------+
     |	  26	 |	   754	   |	   7	 |	  17	 |     43MB   |
     |	  27	 |	   754	   |	  11	 |	  17	 |     68MB   |
     |	  28	 |	   699	   |	   7	 |	  17	 |     40MB   |
     |	  29	 |	   823	   |	  10	 |	  17	 |     68MB   |
     |	  30	 |	   918	   |	   7	 |	  17	 |     53MB   |
     +-----------+-----------------+-------------+---------------+------------+
     |	  31	 |	  1024	   |	  11	 |	  17	 |     93MB   |
     |	  32	 |	  1024	   |	  15	 |	  17	 |    127MB   |
     |	  33	 |	  1024	   |	   5	 |	  17	 |     42MB   |
     |	  34	 |	   612	   |	   2	 |	  17	 |     10MB   |
     |	  35	 |	  1024	   |	   9	 |	  17	 |     76MB   |
     +-----------+-----------------+-------------+---------------+------------+
     |	  36	 |	  1024	   |	   8	 |	  17	 |     68MB   |
     |	  37	 |	   615	   |	   8	 |	  17	 |     40MB   |
     |	  38	 |	   987	   |	   3	 |	  17	 |     24MB   |
     |	  39	 |	   987	   |	   7	 |	  17	 |     57MB   |
     |	  40	 |	   820	   |	   6	 |	  17	 |     40MB   |
     +-----------+-----------------+-------------+---------------+------------+
     |	  41	 |	   977	   |	   5	 |	  17	 |     40MB   |
     |	  42	 |	   981	   |	   5	 |	  17	 |     40MB   |
     |	  43	 |	   830	   |	   7	 |	  17	 |     48MB   |
     |	  44	 |	   830	   |	  10	 |	  17	 |     68MB   |
     |	  45	 |	   917	   |	  15	 |	  17	 |    114MB   |
     +-----------+-----------------+-------------+---------------+------------+
     |	  46	 |	  1224	   |	  15	 |	  17	 |    152MB   |
     +-----------+-----------------+-------------+---------------+------------+

INSTALLING DOS ON A PSEUDO DISK
     To install DOS on a pseudo hard disk under doscmd, do the following:

     1	   Create a .doscmdrc with at least the following:

		 assign A: /dev/rfd0_1440_3.5 1440
		 assign A: /dev/rfd0_720_3.5 720
		 assign hard boot_drive 80 2 2

	   You may need to adjust the raw files for the A: drive to match your
	   system.  This example will cause the HD drive to be tried first and
	   the DD drive second.

	   Note that you should only use raw devices or files at this point,
	   do not use a cooked device!	(Well, it would probably be okay for a
	   hard disk, but certainly not the floppy)

	   boot_drive should be the file name of where you want your bootable
	   image to be.	 The three numbers which follow 80 2 2 say that the
	   drive will have 80 cylinders, 2 heads and 2 sectors per track.
	   This is the smallest drive possible which still can have MS DOS 5.0
	   installed on it along with a config.sys and autoexec.bat file.

	   You might want to create a larger boot drive.

	   The file boot_drive must exist, so use the command touch to create
	   it.

     2	   Insert a floppy disk into the A: drive which is bootable to MS-DOS
	   and has the commands fdisk, format and sys on it.  You should also
	   copy the file instbsdi.exe onto the floppy by either mounting it
	   with the msdos file system type or by using mtools (e.g., mwrite
	   instbsdi.exe a: ).

     3	   run doscmd.

     4	   At the > prompt type fdisk.

     5	   Select Create DOS partition or Logical Drive.

     6	   Select Create Primary DOS Partition.

     7	   Tell it how big to make it (Typically the whole drive.  It is pret-
	   ty tiny after all.)

     8	   Get out of FDISK by hitting <ESC> a few times.

     9	   doscmd may abort, if it does, start up doscmd again.

     10	   At the > prompt, type format c: and follow the instructions.

     11	   At the > prompt type sys c:.

     12	   Get out of doscmd.

     13	   Either remove the floppy from the drive or add the line

		 boot C:
	   to your .doscmdrc.

     14	   You should now be running DOS off of your new disk.	You will prob-
	   ably want both config.sys and an autoexec.bat file.	To start with,
	   you can say:

		 > copy con: config.sys
		 LASTDRIVE=Z
		 ^Z
		 > copy con: autoexec.bat
		 @echo off
		 instbsdi.exe
		 ^Z

     15	   Quit doscmd.

     16	   You know have a bootable pseudo disk which will automatically call
	   the magic instbsdi program, which installs BSD/OS disks.  To use
	   them add lines to your .doscmdrc such as:

		 assign D: /usr/dos
		 assign P: -ro /usr/prb
	   Not that you will not always be able to access every file due to
	   naming problems.

DIAGNOSTICS
     If doscmd encounters an interrupt which is unimplemented, it will print a
     message such as:

	  Unknown interrupt 21 function 99

     and exit.

AUTHOR
     Pace Willisson
     Paul Borman

HISTORY
     The doscmd program first appeared in BSD/OS.

BSDI BSD/OS		       January 30, 1995				     6
[top]

List of man pages available for BSDi

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net