UNIX Overview
UNIX Primer
UNIX is the dominant operating system for industrial, commercial, scientific, medical
and government enterprise computing networks. Not even Windows NT can match the installed
base of UNIX systems. Contrary to popular belief, UNIX use has grown each year of its
existence. In the last several years, there has been dramatic growth in its development
and use. In fact, the Internet uses UNIX's native networking protocol.
The UNIX trademark is owned by The Open Group, a computing industry consortium which
oversees compliance to UNIX standards. This helps to maintain the integrity of various
commercial UNIX systems and applications.
UNIX was first created in 1969 in Bell Laboratories in Murray Hill,New Jersey, as a
replacement and simplification of an older system, MULTICS. (Note the pun:
"uni-icks" replaces "multi-icks.")
Before UNIX, most operating systems were written in hardware-dependent assembly
language. One of the goals of UNIX was that it be used on various systems, therefore it
was written in the C programming language, a language independent of any particular
hardware.
In general, operating systems can be bare-bones (DOS, for example) or big and complex
(Windows NT). While UNIX supplies more resources and provides more
services than early operating systems, it doesn't try to do everything. This makes UNIX
somewhat difficult for the inexperienced end-user, compared to systemslike
Windows NT
with (sic) intuitive user interface.
However, the underlying simplicity of UNIX gives it many advantages. It makes powerful
and versatile applications easier to develop. It gives enterprise systems outstanding
stability. With its open system architecture, UNIX allows the networking of multiple
systems from many different vendors.
Several unique concepts reached maturity first in the UNIX system. Specifically:
virtual devices, replaceable command shells, filters, processes cloning, pipes, signals
and i/o inheritance.
Virtual Devices:
In UNIX systems, disks, serial i/o, networks, displays, tape drives and most other devices
appear in the system as files. Most system calls that can be performed on a regular file
can service virtual device files. There are three types of virtual device files in wide
use: Character devices, which accept byte-at-at-time input and output commands; Block
devices (such as raw disks, tapes and networks), which accept multi-byte transfers; FIFOs,
which maintain the order of i/o in a complex multi-plexed architecture.
Replaceable Command Shells:
Unlike most other systems, which maintain a tight coupling between the user command line
and the operating system, UNIX takes a liberal approach to command shells. The user
command line interface in UNIX systems is just another application that uses standard UNIX
services to spawn applications and maintain I/O hierarchies. As a result, there has been
much experimentation with shells in the UNIX community. Today, there are four dominant
shells in use, with many variations and branches from which to choose:
Bourne Shell - the historic shell which shipped in 1979 with UNIX version 7.
This shell is the least common denominator of all modern shells. It is powerful, but lacks
advanced features such as data structures and job control.
Korn Shell - a superset of the Bourne Shell, with advanced editing, aliasing,
data structures and job control.
C Shell - the original Berkeley shell which uses a "C" programming
like syntax for shell commands.
BASH - the powerful GNU shell which has gained in popularity over the last
several years.
Filters:
In UNIX systems, the output of one command can be used as input to the next command. While
normally limited to ASCII or other Alpha/Numeric data, the filter concept is powerful and
extensible. A good shell programmer can accomplish as much with ten lines of UNIX filtered
commands as a 3-GL programmer might accomplish in ten thousand lines of traditional code.
In the filter model, discrete tools and utilities are used in daisy-chain fashion to parse
and manipulate data until a desired result is achieved.
Process Cloning:
In UNIX systems, processes are instantiated by a two-step method. First the parent
process clones itself with the fork() command. The two resulting processes are identical
in every way except for the return code from the fork() call itself. The child process
then identifies itself by its unique return code from fork() and overlays itself with a
new process using the exec() system call. This two-step method seems cumbersome until the
programmer learns to combine i/o inheritance with process initiation - at which time, it can
be seen that the UNIX process model is elegant and powerful.
Pipes:
Pipes are transient fifos that are typically used for inter-process communication
(IPC). UNIX pipes operate on the same principal as regular and special files, but do not
normally exist as discrete file system entries. Pipes are created with the pipe() system
call in UNIX.
Signals:
Signals are the mechanism by which a process suspends normal command flow and handle
an external event or "catch a signal." Signals can be sent by hardware devices,
other processes, command line users or the process' parent.
I/O Inheritance:
When a process is initiated with an exec() system call, it inherits all of the open
files, pipes, devices and i/o streams held open by the parent. By selective use of opening
and closing desired files just prior to the exec() call, the parent process can create an
elegant multi-process system which can share data and events.
Elegance:
Perhaps the most difficult aspect of the UNIX system for newcomers is that it is an
additive system. Each of the fundamental parts is simple - in combination, they create a
powerful, flexible system environment.
BIG PICTURE INTRO
UNIX OVERVIEW
NT OVERVIEW
MERGING UNIX, NT
INTERIX ARCHITECTURE
|