Beruflich Dokumente
Kultur Dokumente
History
The history of Unix dates back to the mid-1960s when
the Massachusetts Institute of Technology, AT&T Bell Labs,
and General Electricwere developing an experimental time
sharing operating system called Multics for the GE645 mainframe. Multics introduced manyinnovations, but had many
problems. Frustrated by the size and complexity of Multics but not the
aims, Bell Labs slowly pulled out of the project. Their last researchers
to leave Multics, Ken Thompson, Dennis Ritchie, M. D. McIlroy, and J.
F. Ossanna, decided to redo the work on a much smaller scale.
In 1970, Peter Neumann coined the project name UNICS (UNiplexed
Information and Computing Service) as a pun on Multics(Multiplexed
Information and Computer Services): the new operating system was
an emasculated Multics.
In 1972, Unix was rewritten in the C programming language. The
migration from assembly to the higher-level language C, resulted in
much more portable software, requiring only a relatively small amount
of machine-dependent code to be replaced when porting Unix to
other computing platforms. Bell Labs produced several versions of Unix
that are collectively referred to as Research Unix. In 1975, the first
source license for UNIX was sold to faculty at the University of
Illinois Department of Computer Science. UIUC Graduate Student Greg
Chesson (who had worked on the UNIX kernel at Bell Labs) was
instrumental in negotiating the terms of this license.
During the late 1970s and early 1980s, the influence of Unix in
academic circles led to large-scale adoption of Unix (BSD and System
V) by commercial startups, some of the most notable of which
are Sequent, HP-UX, Solaris, AIX, and Xenix. In the late 1980s,
Benefits of Unix
It has consistent format for files. The files are stored as byte
streams which makes it easier for the programs to use files.
System Structure
The unix system can be viewed as the set of layers. The lowermost
layer is the hardware layer which is not the part of the unix operating
system. The operating system is called the system kernel or the
kernel.
Kernel is the layer where the actual operating system code and
functionality resides. It is in complete isolation from the user
programs. This makes it easier for the programs to be ported onto
other system provided the kernel are same.
If a user program want to perform any task it can do so by talking to
the kernel. The programs interact with the kernel by using the system
calls. The system calls instruct the kernel to do various operations.
Other user programs can be built on top of the lower level programs
using these lower level programs and system calls.
A hierarchal structure.
The file system is organized as a tree. The root node is called root
and is denoted by /. Every non leaf node in this structure is a
directory and every leaf node is a file/special device file.
The name of the file is given by the path name.
A full path name starts with the root directory i.e. a slash character
and specifies the file that can be found by travestying the tree. Some
examples of paths could be /etc/passwd, /bin/who and
/usr/src/programs/test.c.
The path that starts from the root directory is called the absolute path.
Alternatively we can give path of any file relative to any other
directory. This path will be called relative path.
The files are just stream of bytes it is up-to the program to interpret
these bytes. Directories are also files i.e. a stream of bytes but the
operating system program knows how to interpret them as directories.
Example program could be ls
Permission to any file is governed by the file access permissions.
Access permissions are set independently for read, write and execute.
These permissions are set independently for the file owner, file group
and everyone else. Access permission looks like
rwx-rwx-rwx (We will see more of this in later chapters)
Unix treats devices as if they are files. Every device is treated as
special files and occupy position in the file system. Programs can
access devices using the same syntax as if they were accessing files.
Syntax of reading and writing on devices is more or less same as
reading and writing regular files. Devices are protected in the same
way as files i.e. using access permissions.
User level
Kernel level
Processes in user mode can assess their own instructions but not the
kernel instructions or the instruction of other processes. On the other
hand processes in kernel mode can access kernel data and instructions
as well as user data and instructions.
The system calls can only be executed in the kernel mode. If a user
process running in user mode make a system calls the process shifts
from user mode to kernel mode and then the kernel services the
request and the system comes back to the user mode after the
request is serviced.
priority interrupt occurs the kernel will not stop what it was doing and
that interrupt will have to wait. In other words the lower priority
interrupt is blocked if kernel is servicing some high priority interrupt.
An exception occurs when a process does something unexpected.
Exceptions are different from interrupts they occur as events. If an
interrupt occurs in the middle of instruction, that instruction will be
restarted after handling the exception. If the exception is not caused
by the instruction but because of some other reasons and between two
instructions then the next instruction is processed after handling the
exception.
Memory management
The unix kernel is in main memory and the user programs are also in
main memory so The operating system resides in the lower memory.
User processes execute in the higher memory. There is always a
possibility that user processes may try to access the lower memory
either accidentally or intentionally thereby causing loss of operating
system code and data. To prevent the user programs to corrupt the
kernel memory the memory management is also done by the unix
kernel.