Coherent 4.0 -- A Desktop UNIX Clone
David M. Knight
Coherent 4.0, the latest release of Mark Williams Company's
clone, is an unlimited-user, full 32-bit, "UNIX-compatible"
OS and C development system that can run on almost any
386 or 486
PC compatible with 15 megabytes of extra disk space
(10Mb for Coherent,
5Mb for your programs). Coherent can coexist with DOS,
or Xenix partitions on the same disk and the Coherent
Boot" program allows boot-time selection of the
Coherent 4.0 includes a comprehensive set of familiar
languages (awk, lex, m4, make, yacc,
sed, etc.) as well as nroff and troff with HPLaserjet/PCL
and Postscript printer support. Some of the commands
reflect a BSD
flavor -- script and ps, for example -- but most
follow System V conventions.
The C development environment includes a very fast K&R
C compiler with math, lex, yacc, curses,
term and termcap libraries. There is no C source-level
debugger, though the literature reports that one is
"in the works."
The "COHware" collection of software from
public domain and
other sources rounds out the package with such tools
cu -- UNIX communications utility
ckermit -- Columbia U.'s communications package
elm -- electronic mailer and utilities
forth -- development language
mc -- spreadsheet
rcs -- Walter Tichey's RCS Revision Control
System (Rev 4.6 in my copy)
zip/unzip -- compression utilities
and a plethora of games, news readers, communications
tools, and utilities. The Coherent brochure also states
that GNU C,
C++, gawk, bash, make, perl and other
tools from the Free Software Foundation will be available
Coherent 4.0 goes a long way toward resolving the most
of prior releases and introduces some major enhancements
32-bit "flat" memory model
UNIX System V source code compatibility
large filesystems on high performance SCSI disks
iBCS2 object compatibility
UNIX (COFF) binary compatibility
MS-DOS filesystem (up to DOS 3.x) access commands
termcap/terminfo support including tic,
captoinfo, and infocmp
COFF compatible C compiler, assembler, and linker
System V advisory file/record locking
full 386 Macro Assembler
a Korn Shell
iBCS2 Binary Compatibility
Coherent 4.0 iBCS2 binary compatibility makes it possible
to run many
"shrink wrapped" SCO or Interactive UNIX applications
out of the box. Classes of application binaries known
work include all binaries containing hardware floating-point
and SCO Xenix binaries.
When you are considering a PC UNIX application for possible
Coherent, you must:
Ensure that the executables are System V COFF binaries.
Xenix (Microsoft a.out) binaries and System V.4 ELF
Ensure that the binary executables do not use hardware
instructions. Generally speaking, word processors, text
utilities, and software development tools rarely use
instructions, while most engineering applications, graphics
and spreadsheets use them extensively. Databases and
may use hardware floating point for some datatypes and
math" for others, particularly "money"
The hardware floating-point restriction also means that
automatically "sense" whether a floating-point
is installed will probably fail.
Look for tar or cpio installation instructions.
Coherent does not provide an equivalent to the SCO custom
the System V installpkg installation scripts.
Anticipate modifying the installation procedure. For
if an install script uses shell functions, it will need
to be run
under Coherent's Korn Shell.
PC UNIX application binaries known to run include:
Gimpel Software's FlexeLint
Promula Fortran Compiler and Application Dev. System
Xtree for UNIX (installation script had to be run with
See the "Shortcomings" section below for more
on application selection and compatibility issues.
System V Source Compatibility
Coherent's System V source compatibility allows many
UNIX PC applications
to port with just a recompile. During the Beta test,
a public domain
version of ctar compiled without change, while the GNU
(Rev 5.5) utilities port required only minor changes
to the makefile
and adding a _doprnt() function to the rcslex.c utility.
Although Coherent does not currently support DOS-under-UNIX
mounting of MS-DOS filesystems, it does provide MS-DOS
(up to version 5.0) access commands similar to those
found in other
UNIX packages. The doscpdir command, which copies subdirectories
like the System V.4 dir_copy command, is unique to Coherent.
letter" assignments and other configuration settings
in the /etc/default/msdos file.
As delivered, Coherent supports four Virtual Console
sessions on a
color monitor and four sessions on a monochrome monitor.
Up to eight
sessions can be configured for a single monitor using
described in the "System Tuning" section.
Coherent 4.0 Performance
The Beta test release documents and the Coherent 4.0
several statements comparing Coherent's C compiler and
to that of SCO, Interactive, and ESIX development systems.
their runtime sort performance seemed extraordinary.
Test Programs and Procedures
To test the performance claims, I used two test programs
testqsort -- as published in a Coherent 4.0 document
prepared for Byte Magazine and distributed as part of
test package. The output of this program indicates its
Figure 1 shows the output from a test run on a 33 MHz
a Dhrystone benchmark program -- as published in
Byte Magazine (c. 1987). The quote from the source code
in Figure 2 explains the structure of the program.
and compiled them with various OS/compiler combinations
Coherent 4.0 / cc
Interactive Systems UNIX 2.2 / cc (AT&T)
Interactive Systems UNIX 2.2 / gcc (GNU cc)
SCO ODT 1.1.1 / cc (Microsoft C)
SCO ODT 1.1.1 / rcc (AT&T)
to produce COFF binaries which would each be run on
of the platforms:
386sx/16 4MB RAM - Coherent 4.0
386dx/33 12MB RAM - Interactive UNIX 2.2
386sx/25 8MB RAM - SCO ODT 1.1.1
386sx/25 8MB RAM - Consensys V4 (AT&T UNIX System
5. 486dx/33 16MB RAM - SCO ODT 1.1.1
For an additional comparison, I also compiled and ran
these benchmarks on UNIX System V.4 (Consensys V4).
V.4 ELF binaries will not run on the System V.3 systems,
binaries do run on System V.4 and thus allow comparison
4.0 with a state of the art UNIX System V/386.
Executable Size Comparison
The size comparison of the resulting executables (shown
in Figure 3)
supports statements made in the Coherent 4.0 literature.
Compilation time for the RCS utilities, adjusted for
ranks the compiler performance as follows:
||(386sx/16 time = 6:57)
||ISC UNIX 2.2/cc
||(386dx/33 time = 3:26)
||SCO ODT 1.1.1/cc
||(486dx/33 time = 1:34)
As a nonstandard (benchmark) but substantial compilation
results lend credibility to MWC's claim that the Coherent
4.0 C compiler
outperforms SCO's cc compiler 3 to 1.
When the qsort tests were finally complete (on a lowly
it took over four days!) it was clear that Coherent
4.0 fixes a "merge"
problem found in many UNIX System V.3 qsort library
Compare the output of the Coherent 4.0 executable (see
Figure 4) to
the output of the ISC cc executable run on the same
machine and operating
system (Figure 1).
The average testqsort execution time (shown as the ratio
for each binary) across all 386/486 platforms tested,
in order of
fastest to slowest is:
||Coherent 4.0/cc (386dx/33 runtime = 1.01 minutes)
||Consensys V4 (System V.4)/cc
||ISC UNIX 2.2/gcc (GNU)
||ISC UNIX 2.2/cc (AT&T)
||SCO ODT 1.1.1/cc (Microsoft C)
||SCO ODT 1.1.1/rcc (AT&T) (386dx/33 runtime = 6.15 hours)
AT&T UNIX System V.4 and BSD 4.x have also addressed
the qsort problem, though not as successfully as Coherent.
The dhrystone tests tell a different story and one that
more typical. The average relative speed (as the ratio
across the 386/486 platforms tested, in order of fastest
||ISC UNIX 2.2/gcc (GNU) (386dx/33 dhrystones/second = 12690)
||Consensys V4 (System V.4)/cc
||SCO ODT 1.1.1/rcc (AT&T)
||SCO ODT 1.1.1/cc (Microsoft C)
||ISC UNIX 2.2/cc (AT&T)
||Coherent 4.0/cc (386dx/33 dhrystones/second = 8849)
No floating-point tests were run because of Coherent's
lack of FP
During my testing, Coherent appeared to be robust enough
for a commercial
platform. Indeed, during two weeks of intensive testing,
porting, and general mucking around, the (Beta test!)
In one test, I intentionally trashed the root file system
my Emergency Boot disk and root filesystem restore procedure.
an automatic boot from the trashed hard-disk root partition
(the system seemed unable to reboot the modified root
a sync), Coherent's fsck utility totally repaired the
when run (from the Emergency Boot Floppy) on an unmounted
Coherent's documentation is concise, easy to read, and
organized. It differs from traditional UNIX documentation
it is a single, 1,200-page manual divided into a Tutorial
(378 pages) and an alphabetically organized "Lexicon"
commands, C Standard Library calls, built-in shell constructs,
variables, device driver details and glossary terms.
The Tutorial section gives those new to UNIX a general
to using Coherent as well as detailed information on
Administration. The comprehensive tutorials on the standard
like awk, lex, nroff/troff, sed, and yacc
are well written and interesting to read. The UUCP tutorial
tailored to Coherent's uuinstall command and includes
good configuration examples and details of modem setup.
Be sure to
read the section covering manual modification of UUCP
files, as they seem to be a curious mixture of HDB and
The Lexicon is a concise reference for all aspects of
system. Its commands, C library functions, terms, and
information are in alphabetical order. Lexicon entries
"manpages" in that they contain syntax, description,
See Also, Diagnostics, and Notes sections, as appropriate.
entry can be used in several ways -- read, for example
there are multiple entries: "read -- COHERENT System
Call (libc)" and "read -- Command".
The Coherent 4.0 distribution consists of five 3.5 diskettes
5.25 diskettes. The Installation Guide includes comprehensive
compatibility, "Before you Install," and "Troubleshooting"
sections as well as step-by-step instructions and helpful
my installation, the only information I had to provide
1. how many virtual consoles I wanted and the keyboard
2. timezone/daylight savings info
3. whether I wanted to use the Coherent Master Boot
4. the disk partitioning and where Coherent was to reside
5. UUCP site and domain name (uuinstall is provided
help configure the rest of uucp)
6. my choice of passwords for root, bin uucp, etc.
7. my choice of additional user logins, passwords, shells,
8. serial port terminal/modem configurations
9. printer port selection, e.g., which LPTx or serial
10. whether I wanted to install the online manual pages
The first installation, when I was taking all these
notes, took about
one hour and forty five minutes. A second installation,
done for speed,
took less than one hour.
Configuration questions are accompanied by a concise
the choices and their consequences.
After you have booted the first diskette and answered
questions, the hard disk is initialized, some files
are loaded, and
you are prompted to reboot from the hard drive. The
with prompts to feed in the rest of the floppy disks.
To update a previous installation of Coherent to Rel
4.0, you type
"update" at the initial (floppy disk) boot
prompt and the
rest is automatic. All files not part of the distribution
untouched and files like /.profile and user-configured
in /etc and /usr/lib/uucp are preserved.
The "Using Coherent" tutorial covers most
aspects of Coherent
System administration. Topics include adding users,
backup/restore, filesystem formatting, mount/umount,
device drivers, printer management, cron, ps/kill, system
accounting, and Coherent startup/shutdown.
Disaster Recovery Options
The Lexicon "booting" entry, which provides
details of the
boot process and precise "boot disk" preparation
was a pleasant surprise. This Lexicon entry, along with
cpio, tar, dump and restore, and the "Using
Coherent" tutorial, gives you all the information
you need to
prepare for and recover from a root filesystem disaster.
Listing 1 shows my shell script to automate (and document)
required to generate an "Emergency Boot Disk"
with some disaster
recovery tools. As is the case with other UNIX systems,
when you boot
from a floppy drive, it becomes the root device and
cannot be used
for input of the backup diskettes. This presents a real
because there is currently no tape support! Hence, the
The ramroot script creates, initializes, and switches
to a RAMdrive root filesystem so that the boot diskette
can be removed
and the (boot) floppy drive used for backup and/or restore
A boot floppy prepared in this fashion can be used to
restore a root
filesystem (called /dev/root) or any other Coherent
from the boot drive, a second floppy drive, or other
(soon to be supported)
Alternatively, the script in Listing 1 could modified
to set up a
small emergency boot partition on your hard disk by
and /dev/rat0x, where x is partition id (a, b, c or
d) to be initialized, for /dev/fd0 and /dev/rfd0.
Performance (kernel buffer cache) tuning is done automatically
boot-time. Other tuning and configuration parameters
are set by "patching"
During installation, configuration changes are made
directly to the
kernel using the Coherent patch command, which supports
patching of variables within executables. Kernel build
files in the
/conf and /conf/gen directories use this strategy.
The Lexicon's patch command entry
/conf/patch /coherent KBBOOT=0
serves as a patch to the /coherent kernel's nkb
device driver that disables the [Ctrl-Alt-Del] warm
boot key sequence.
While the "patching" approach may seem arcane,
it is not too
different from System V kernel configuration using the
and stune configuration files. Some complex drivers
by special programs. For example, to configure a multiport
board, you need to
edit the /etc/default/async file, by uncommenting
the lines which describe your board configuration. The
for the asy driver contains copious details about the
and editing of this file.
run the /conf/asypatch program to apply the patches
to the kernel
run the /conf/asymkdev program to make the appropriate
device names in /dev
reboot the new kernel
The Lexicon entries for individual device drivers describe
asy - async port driver -- Coherent provides special
to simplify configuration of async ports and the supported
serial cards. First the file /etc/default/async, which
copious documentation of its content, is edited to reflect
Run the programs /conf/asypatch and /conf/asymkdev to
complete the async configuration process.
aha154x -- Adaptec SCSI driver: configured by the /etc/mkdev
at -- hard-disk-driver kernel variables: atparm, ATSREG,
ATSECS. atparm is the at driver's hard-drive geometry
table. It is normally patched during Coherent installation
the target machine's disk configuration:
Drive 0: atparm+0 - cylinders (short)
atparm+2 - heads (short)
atparm+14 - sectors per track (char)
Drive 1: atparm+16 - cylinders (short)
atparm+18 - heads (short)
atparm+30 - sectors per track (char)
For example, to set the drive 1 geometry to 829 cylinders,
10 heads, and 26 sectors per track in the "tkernel"
use the command:
/conf/patch /tkernel atparm+16=829:s\
ATSREG controls alternate vs. normal polling of IDE
ATSECS controls I/O request timeout interval
lp -- line printer driver: LPWAIT (for ready), LPTIME
(printer sleep ticks), LPTEST (for printer online)
msg -- msg IPC driver: NMSQID (number of msg queues),
NMSG (number of messages)
nkb -- new keyboard driver: KBBOOT (controls warm
boot from keyboard)
sem -- semaphore IPC driver: NSEMID (number of semaphore
IDs), NSEM (number of semaphores per ID)
shm -- shared memory IPC driver: NSHMID (number of
Shared memory IDs)
ss -- Future Domain/Seagate SCSI driver: configured
/etc/mkdev scsi command
The console driver can be reconfigured to support up
to eight virtual
console sessions on the VGA or monochrome monitors by
VTVGA and/or VTMONO kernel variables. For example, the
/conf/patch /coherent VTMONO=8
would allow eight sessions on the monochrome monitor.
The /conf/kbd/us keyboard configuration table would
to be modified to declare the appropriate hot-keys for
virtual consoles and the corresponding /dev/monox special
would have to be made with the mknod command.
Coherent 4.0 is compatible with most 386 and 486 ISA
and EISA bus
PC clones. Supported adapter cards include most monochrome
video cards, IDE/MFM/RLL/ESDI disk controllers, and
a variety of multiport
serial cards, including several models from Boca Research,
Comtrol, Arnet, and Stargate. The list of specific clones
known to work is too long to include here.
The currently supported SCSI controllers are the Adaptec
and AHA1542B, Seagate ST01 and ST02, and Future Domain
Microchannel machines are not supported.
Coherent's approach to technical support is comprehensive:
free phone support, UUNET email (firstname.lastname@example.org or
USPS Mail, and various Bulletin Boards at Mark Williams,
BIX, and USENET (comp.os.coherent).
I was pleased to see that many of the problems I encountered
my participation in the Beta test of 4.0 actually had
been fixed in
the production release.
Shortcomings in the Current Release
This section details problems which I encountered during
test that had not yet been fixed in the production release.
not a comparison of Coherent with other PC UNIX implementations.
COFF Binary Compatibility
1. COFF binaries which contain floating point instructions
Coherent because the kernel does not currently support
point (i.e., 80x87) or emulation when FP instructions
(SIGFPE) in the absence of a coprocessor.
Although some Interactive UNIX binaries failed with
an Invalid System
Call (SIGSYS) trap, FP exceptions were the problems
most frequently among the shrink-wrapped UNIX applications
own SCO and Interactive compiled programs. Programs
problems ran correctly after recompilation with Coherent's
2. The Coherent 4.0 shared memory implementation is
not UNIX System
V compatible, although the related features, semaphores
passing, work as expected.
1. The Bourne Shell in the production release does not
functions, but a new version of the shell available
on the BBS does.
2. The Korn Shell does not support vi-style command
but does allow vi to be used for "fix-command"
with the fc command.
3. When a Korn shell script containing the expression
is invoked without arguments -- e.g., ksh foobar --
"$*" expands to the exported environment instead
4. The Korn Shell r command, to re-execute commands
command history, fails when invoked with a string but
when invoked with the history number of the desired
5. The r command also fails to operate as expected when
to append, as in the commands:
r 18 | more
r 16 file3
6. The next command entered after an r command also
of residual input from the r command.
While these shell problems are somewhat irritating,
they are hardly
terminal (pun intended).
C Development Tools
I encountered a few problems while porting my test sources:
1. The default executable filename is not a.out. Setting
CCHEAD global variable to contain "-o a.out"
circumvents this problem, but creates others in cases
mutually exclusive of object file or executable file
as "-S" are used.
2. make doesn't handle macro references of the form
or lines with leading blanks.
3. The /usr/include/vfork.h file is missing. I created
file /usr/include/vfork.h containing a single line:
#define vfork fork
which solved this specific problem.
A number of other problems reported during the Beta
test were fixed
for the production release.
The vf*printf() and _doprnt() functions are missing.
A version of vf*printf() is in process and will soon
on the BBS.
The db debugger is rather like the UNIX adb debugger
and there is no source level C debugger. For a software
this is a serious limitation, although the speed of
the C compiler
relieves some of the pain. To use db, you need to be
with Intel assembler.
The current release lacks support for cartridge tapes.
Two features listed for the "Coherent 4.x Series"
virtual memory and SCSI tape drive support -- are missing
release 4.0. I hope these will added shortly.
The Future Improvements list includes an ANSI C compiler,
a C source level debugger, shared libraries, Graphics
support, Novell Netware support, TCP/IP, streams, and
Coherent 4.0's performance and reliability, excellent
and free technical support, ability to run many PC UNIX
and $99 price tag make this one of the most exciting
UNIX clones I
I believe it to be the only independently developed
UNIX clone (short
of BSD) that has achieved the flexibility, quality,
necessary for consideration as a commercial application
Despite its current lack of XWindow and network support,
I can easily
imagine system integrators and application developers
as a low-priced platform for small (up to eight users)
running combinations of off-the-shelf Coherent, SCO,
and other PC UNIX applications.
About the Author
David Knight is the President of Applied Computer Sciences,
Inc., a Connecticut-based consulting firm specializing
development, UNIX networks, distributed processing,
connectivity and interoperability. David has been programming
the early sixties and has specialized in UNIX/C since
1982. He can
be reached at (203) 270-XINU (voice) or via EMail at