.TH MS-DOS "" "" "Technical Information"
.PC "That other operating system"
.PP
.II "MS-DOS^equivalent COHERENT commands"
.II "MS-DOS^differences from COHERENT"
.II "background^running programs in"
.II "multi-user, definition"
.II "multi-tasking, definition"
\*(MD is the native operating system of the IBM-AT and compatible computers.
As such, it needs no introduction to most users.
Many customers have asked, however, how \*(MD and \*(CO compare
in terms of their capabilities; and many have also asked for a chart
that maps familiar \*(MD commands to their \*(CO equivalents.
This article attempts to fulfill these requests.
.SH "MS-DOS vs. COHERENT"
\*(MD differs significantly from \*(CO in practically every aspect
of its design.
For example,
its file system is incompatible with \*(CO;
its shell \fBcommand.com\fR differs significantly from \*(CO's
suite of shells;
the manner in which it loads and executes a program differs completely
from \*(CO's.
.PP
The most noticeable difference in design, however, is that \*(MD
is a single-user, single-process operating system, whereas \*(CO
is a multi-user, multi-tasking operating system.
.PP
.I Single-user
means that only one user can use \*(MD at any given time:
whoever sits at the keyboard ``owns'' the machine and all its facilities.
.I Multi-user
means, of course, that more than one user can use \*(CO at any given
time, via terminals or modems plugged into the computer's serial ports.
The number of users who can use your \*(CO system at once is
limited only by your computer's speed, available memory,
and by the number of serial ports that can be plugged into your computer.
.PP
.I Single-tasking
means that \*(MD can do only one task at a time:
it loads a program into memory, runs it to completion, then
awaits your request to execute another program.
.I Multi-tasking
means that \*(CO can execute more than one program at a time.
.PP
To grasp how multi-tasking can simplify some work,
consider the task of formatting floppy disks.
Under \*(MD, you pop the floppy disk into the drive, invoke the \*(MD
program \fBformat\fR, answer its queries, then go get a cup of
coffee while the machine grinds away.
Formatting a box of high-density floppy disks ties up your machine for
the better part of an hour, which is largely wasted time for you.
Under \*(CO, however, you can format a floppy disk in the
\fIbackground\fR \(em that is, you can tell \*(CO to execute the
disk-format program unsupervised, and let you work with another program.
For example, if you wish to low-level format a 5.25-inch, high-density floppy
disk in drive 0 (that is, drive A), use the following command:
.DM
	/etc/fdformat -v /dev/fha0 &
.DE
.PP
Try it.
You'll notice that the \*(CO prompt returns immediately:
while \*(CO is formatting your disk
for you, you can edit a file, play a video game,
dial out to a remote system,
or even format a second disk in your machine's B drive (should you have one).
.PP
Multi-tasking also means that you can program \*(CO to execute programs
untended, even while you are away from your machine.
The \*(UU system is a good example of this feature.
\*(UU lets you exchange mail and files with remote systems via modem;
once the system is set up, it runs automatically, without requiring that
you sit at the keyboard to run it.
.PP
This discussion only gives you a taste of the advantages \*(CO
enjoys over an obsolete system like \*(MD.
The following documents contain information that \*(MD users will find helpful:
.IP \(bu 0.3i
The tutorial \fIUsing the COHERENT System\fR introduces \*(CO to new users.
If you are new to \*(CO and have not yet read this tutorial, you should
do so before you continue any farther.
.IP \(bu
The Lexicon articles
.B "floppy disks"
and
.B "hard disk"
discuss the in's and out's of using mass-storage device with \*(CO.
The article
.B "floppy disks"
in particular discusses in detail all the steps required to format and
manipulate \*(MD-style floppy disks under \*(CO.
.IP \(bu
The Lexicon articles
.BR modem ,
.BR printer ,
and
.B terminal
discussion how to connect these devices to \*(CO, and introduce
the set of commands with which you can manipulate them under \*(CO.
.IP \(bu
The Lexicon article
.B execution
describes in detail how \*(CO loads and executes a program.
This article is aimed at the technically knowledgeable, but neophytes
may find parts of it helpful.
.IP \(bu
The Lexicon article
.B commands
summarizes all commands available under the \*(CO system.
This article will help you grasp the scope of \*(CO's suite
of commands, and will help you explore them systematically.
.IP \(bu
The following Lexicon articles describe \*(CO commands for
manipulating \*(MD files and disks:
.RS
.IP \fBdoscp\fR 0.75i
Copy files to/from an \*(MD file system.
.IP \fBdoscat\fR
Concatenate a file on an \*(MD file system.
.IP \fBdoscp\fR
Copy a file to/from an \*(MD file system.
.IP \fBdoscpdir\fR
Copy directories to/from an \*(MD file system.
.IP \fBdosdel\fR
Delete files from an \*(MD file system.
.IP \fBdosdir\fR
Show the contents of an \*(MD directory.
.IP \fBdosformat\fR
Write an \*(MD file system onto a floppy disk.
.IP \fBdoslabel\fR
Label an \*(MD floppy disk.
The \*(MD file system can reside on a floppy disk or an \*(MD portion of a
hard disk.
.IP \fBdosls\fR
List contents of an \*(MD file system.
.IP \fBdosmkdir\fR
Create a directory on an \*(MD file system.
.IP \fBdosrm\fR
Remove a file on an \*(MD file system.
.IP \fBdosrmdir\fR
Remove a directory from an \*(MD file system.
.SH "COHERENT Equivalents to MS-DOS Commands"
The following table lists the most commonly used \*(MD commands,
and gives \*(CO equivalents.
.PP
Note that often there is no single \*(CO command that equates to
a given \*(MD command.
\*(CO often offers several alternatives, and you can select the one
that best suits your needs.
Every \*(CO command has its own article in the \*(CO Lexicon; look
there first for details on how to use the command.
.IP \fBBACKUP\fR
This command copies a directory's files to a formatted
floppy disk to back them up.
To do so under \*(CO, use the command:
.DM
	find . -print | cpio -ocm > /dev/rfha0
.DE
.sp \n(pDu
Note that
.B cpio
requires a formatted, defect free floppy disk, however
you do not need to create a filesystem on the floppy disk prior to using
.BR cpio .
.sp \n(pDu
Note that if you want \*(CO to prompt you before it backs up a file, use
the command:
.DM
	find . -print | cpio -ocmr > /dev/rfha0
.DE
.sp \n(pDu
See the article on the archiving command \fBcpio\fR for details on
this command \(em especially important if you expect to retrieve your
backed-up files.
.sp \n(pDu
Note, too, that the device \fB/dev/rfha0\fR corresponds to a 5.25-inch,
high-density floppy disk in drive 0 (drive A).
See the article \fBfloppy disks\fR for a list of the devices that correspond
to different sizes and configuration of floppy disks.
.IP \fBBREAK\fR
Abort a command.
Aborting a command under \*(CO varies, depending upon whether the
command is running in the foreground or the background.
The keystroke
.DM
	<ctrl-c>
.DE
.sp \n(pDu
aborts most commands that are running in the foreground.
To abort a command that is running in the background, you must use the
\fBkill\fR command.
See its Lexicon entry for details on how to use it.
.IP "\fBCHDIR\fR or \fBCD\fR"
Change to another directory.
To do so under \*(CO, use the command
.DM
	cd \fIdir\fR
.DE
.sp \n(pDu
where
.I dir
is the directory to which you wish to go.
The directories `.' and `..' are used by both \*(CO and \*(MD;
since \*(MD ``borrowed'' its directory structure from \*(UN (of which
\*(CO is an implementation), the similarity should not be surprising.
.sp \n(pDu
Note that \*(MD requires that before you can change to directory on
another physical device or partition, you must first switch to that
device by typing its name before you use the \fBchdir\fR command.
\*(CO has no such restriction.
.IP \fBCHKDSK\fR
Check the integrity of a file system.
Under \*(CO, use the command:
.DM
	/etc/fsck [\fIoption\fP] [\fIfilesystem\fP]
.DE
.sp \n(pDu
\fIRead
the Lexicon entry on \fBfsck\fI before you attempt to run it!\fR
.IP \fBCOMP\fR
Compare the contents of two files.
To do so under \*(CO, use the following command
to compare two binary files:
.DM
	cmp [\fIoption\fP] \fIfile1 file2\fP
.DE
.sp \n(pDu
.B cmp
displays the bytes which differ between the files.
.sp \n(pDu
To compare the contents of two text files, use the command:
.DM
	diff [\fIoption\fP] \fIfile1 file2\fP
.DE
.IP \fBCOPY\fR
Copy the contents of one file into another;
create the target file if it does not already exist.
Under \*(CO, say:
.DM
	cp \fIoldfilename newfilename\fR
.DE
.sp \n(pDu
To copy a set of files into a directory without changing their names,
use the following form of the command:
.DM
	cp \fIfile1 ... fileN\fP \fIdirectory\fR
.DE
.IP \fBDATE\fR
Reset the current date and time.
Under \*(CO, use the command:
.DM
	date \fIyymmddhhmm.ss\fP
.DE
.sp \n(pDu	
Only the superuser can reset the system's date and time.
When \fBdate\fR is used without an argument, it prints the date
and time on the standard output.
.IP \fBDIR\fR
Type the contents of a directory.
Under \*(CO, use the command:
.DM
	ls -l
.DE
.IP \fBDIR/W\fR
List a directory's contents in columnar form.
Under \*(CO, use either the command:
.DM
	lc
.DE
.sp \n(pDu
or the command:
.DM
	ls -C
.DE
.IP \fBDISKCOPY\fR
Copy one floppy disk track-by-track to another floppy disk.
\*(CO has no exact equivalent to this command; however, you
can copy the contents of one disk to another by using the following
set of commands.
.sp \n(pDu
First, place a write-protect tab on your source disk;
insert the disk into drive 0 (drive A), then type the
following command:
.DM
	dd if=/dev/fha0 of=/tmp/filename
.DE
.sp \n(pDu
This copies the contents of the 5.25-inch,
high-density floppy disk in drive 0 into file
.BR /tmp/filename .
For a table of devices that correspond to other sizes and configurations
of floppy disks, see the Lexicon article
.BR "floppy disks" .
.sp \n(pDu
Second, insert formatted destination diskette into drive 0, and then type
the command:
.DM
	dd if=/tmp/filename of=/dev/fha0
.DE
.sp \n(pDu
This command copies the files in directory
.B /tmp/filename
onto the target floppy disk.
Note that the target disk must be formatted before it can receive files;
see the Lexicon article \fBfloppy disks\fR for information on how to do
this.
.IP \fBEDLIN\fR
Perform simple-minded editing of text files.
Under \*(CO, the \fBed\fR editor performs line editing, but is much
more sophisticated than \fBedlin\fR.
\*(CO also includes the \fBvi\fR and \*(ME screen editors, which
are more useful still.
.IP "\fBERASE\fR or \fBDEL\fR"
Remove a file or a directory.
To erase a file, use the command:
.DM
	rm \fIfile1 \fP[... \fIfileN\fP ]\fR
.DE
.sp \n(pDu
To erase a directory, use the command:
.DM
	rmdir \fIdirectory\fR
.DE
.sp \n(pDu
To erase a directory and all files and directories below it, use the command:
.DM
	rm -r \fIdirectory\fR
.DE
.IP \fBFIND\fR
Find a pattern within a text file.
Under \*(CO, use the command:
.DM
	egrep [\fIoption\fP] \fIpattern\fP [\fIfile\fP ...]
.DE
.IP
.B egrep
is an extremely useful command; see its Lexicon entry for details on
how to use it.
.IP \fBFORMAT\fR
Format a floppy disk.
To format a floppy disk for \*(MD, use the command
.BR dosformat .
To format a floppy disk for \*(CO, use the command
.BR fdformat .
For details, see the respective Lexicon entries for these commands.
Under \*(CO, use the command
.IP \fBMEM\fR
Find how much space is left free on your hard disk.
Under \*(CO, say:
.DM
	df [\fIoptions\fP]
.DE
.sp \n(pDu
See the Lexicon entry on \fBdf\fR for details.
.IP \fBMKDIR\fR
Create a new directory.
Under \*(CO:
.DM
	mkdir \fIdirectory\fP ...
.DE
.IP \fBMODE\fR
Set parameters for terminals and ports.
Under \*(CO, use the command \fBstty\fR.
This command comes with many options; see its Lexicon entry for details.
The default speeds of all ports and terminals reside in file
.BR /etc/ttys .
The superuser can use a text editor to edit this file to change any or all
default settings.
.IP \fBMORE\fR
Display text a screenful at a time.
Under \*(CO, use the commands \fBmore\fR or \fBscat\fR.
.IP \fBPRINT\fR
Print files via a serial port.
To print a file on a dot-matrix printer, use the command:
.DM
	lpr \fIfile1 \fP[ ... \fIfileN\fP ]
.DE
.sp \n(pDu
To print a file on a Hewlett-Packard LaserJet printer, use the command
.DM
	hpr \fIfile1 \fP[ ... \fIfileN\fP ]
.DE
.sp \n(pDu
Note that before these commands can be used, the appropriate devices
must be linked to your system.
See the Lexicon article on \fBprinter\fR for details.
.sp \n(pDu
Note, too, that \*(CO uses a spooling system to manage the printing of
files; thus, attempting to print a non-existent file will not hang the system.
.IP \fBPROMPT\fR
Change the \fBcommand.com\fR prompt.
The \*(CO shells store the prompt format within the environmental
variable \fBPS1\fR.
This variable is usually defined in each user's \fB.profile\fR file; this
file holds commands that are executed whenever the user logs in.
To change the definition of your prompt, edit \fB.profile\fR to define
.B PS1
to suit your preference, then log in again.
.sp \n(pDu
Note that the information that can be embedded within the prompt varies
between the Bourne and Korn shells.
See the Lexicon articles
.B sh
and
.B ksh
for details on those shells and their prompts.
.IP \fBRENAME\fR
Rename a file.
Under \*(CO, use the command:
.DM
	mv \fIoldfile newfile\fP
.DE
.sp \n(pDu
.B mv
can also be used to move files from one directory or file system to another.
.IP \fBRESTORE\fR
Restore a file saved with the \fBBACKUP\fR command.
Under \*(CO, insert the floppy disk upon which the \fBcpio\fR utility
saved its backup archive; then type the command:
.DM
	cpio -icv < /dev/rfha0
.DE
.sp \n(pDu
Note that this command assumes you are using
.BR /dev/rfha0 ,
which describes a 5.25-inch, high-density floppy disk in drive 0 (drive A).
For a table of devices that correspond to other sizes and configurations
of floppy disks, see the Lexicon article
.BR "floppy disks" .
.IP \fBTREE\fR
List all directories on a file system.
Under \*(CO, use the command:
.DM
	find / -type d | more
.DE
.sp \n(pDu
To list all files and directories that are subordinate to the current
directory, use the command:
.DM
	find . | more
.DE
.sp \n(pDu
The \*(CO command \fBls -lR\fR also lists a directory tree, in a
somewhat different output format.
.SH "MS-DOS 6.0 and COHERENT"
.II "MS-DOS^version 6.0"
.II Stacker
Release 6.0 of \*(MD offers a feature of dynamic file compression that
creates some difficulties for machines that have both \*(CO and \*(MD on
their systems.
.PP
To begin, \*(MD 6.0 assumes that it is the only operating system on your
computer.
When you install \*(MD 6.0, by default it overwrites the \*(CO master boot
block.
If at all possible, you should install \*(MD 6.0 onto your system first,
then install \*(CO so that its Master Bootstrap is in control of your
machine.
.PP
Second, \*(MD 6.0 offers a compression utility called
.BR dblspace ,
which compresses \*(MD file systems on the fly.
.II dos
The \*(CO
.B dos
commands do not understand compressed \*(MD file systems created by the
\*(MD 6.0 utility
.B dblspace ,
or by such programs as
.BR Stacker .
If you are running \*(MD 6.0 with file compression,
you must copy files to an uncompressed file system
(for example, to an uncompressed floppy disk or to the uncompressed
host for a compressed file system) to make them accessible to the \*(CO
.B dos
commands.
.SH "See Also"
.Xr "COHERENT," coherent
.Xr "doscat," doscat
.Xr "doscp," doscp
.Xr "doscpdir," doscpdir
.Xr "dosdel," dosdel
.Xr "dosdir," dosdir
.Xr "dosformat," dosformat
.Xr "doslabel," doslabel
.Xr "dosls," dosls
.Xr "dosmkdir," dosmkdir
.Xr "dosrmdir," dosrmdir
.Xr "floppy disks," floppy_di
.Xr "hard disk," hard_disk
.Xr "modem," modem
.Xr "printer," printer
.Xr "terminal," terminal
.Xr "Using COHERENT" using_coh
