Unix Case Study
Unix Case Study
What is UNIX?
UNIX is an operating system which was first developed in the 1960s, and has been under constant
development ever since. . It is a stable, multi-user, multi-tasking system for servers, desktops and laptops.
UNIX is highly portable across hardware since it is written in C language.
UNIX allows only needed modules to be loaded in memory (modularity).It has an inverted tree like file
structure, with files and directories created within the file structure. Each file can be protected using read,
write and execute permissions for the user, group and others(security).. UNIX uses TCP/IP protocol.
CAD/CAM applications best perform in a UNIX system, with its varied support for graphic cards.
UNIX systems also have a graphical user interface (GUI) similar to Microsoft Windows which provides an
easy to use environment. However, knowledge of UNIX is required for operations which are not covered
by a graphical program, or when there is no windows interface available, for example, in a telnet session.
Types of UNIX
There are many different versions of UNIX, although they share common similarities. The most popular
varieties of UNIX are Sun Solaris, GNU/Linux, and MacOS X.Here in the School, we use Solaris on our
servers and workstations, and Fedora Core Linux on theservers and desktop PCs.
History of UNIX
1969: Ken Thompson, Dennis Ritchie started working on a multi-user OS on PDP-7,Bell Labs.
1970: OS named as UNIX
1973: OS rewritten in C
1975: First Version of Berkeley Software Distribution (BSD)
1982: AT&T announced UNIX System III, first public release.
1983: AT&T announced UNIX System V, the first supported release. Installed base45,000.
1984: Berkeley releases 4.2BSD, includes TCP/IP. X/Open formed
1984: System V Release 2 introduced. 1, 00,000 installations worldwide.
1986: 4.3BSD released, including internet name server. Installed base 2, 50,000.
1987: System V Release 3 introduced. Around 7, 50,000 installations.
1988: Open Software Foundation formed.
1989: System V Release 4 ships unifying System V, BSD . 1.2 million installations.
its varied support for graphic cards.
Layered Architecture
UNIX is a layered operating system. The innermost layer is the hardware that provides the services for the
OS. The operating system, referred to in UNIX as the kernel, interacts directly with the hardware and
provides the services to the user programs. Most well written user programs are independent of the
underlying hardware, making them readily portable to new systems.
Fig 1.1
Layered Architecture of the UNIX System You can have many users logged into a system simultaneously,
each running many programs. It's the kernel's job to keep each process and user separate and to regulate
access to system hardware, including CPU, memory, disk and other I/O devices.
The Shell
The shell is the interface between the command language user and the OS
The shell is a user interface and comes in many forms (Bourne Shell, sh; Berkeley C Shell, csh; Korn
Shell, ksh; Restricted Shell, rsh)
User allowed to enter input when prompted ($ or %)
System supports all shells running concurrently. Appropriate shell is loaded at login, but user can
usually (except in sh, rsh) dynamically change the shell
A UNIX command takes the form of
Because UNIX treats I/O devices as special types of files, STDIO can be easily redirected to other
devices and files
Central part of the OS which provides system services to application programs and the shell
The kernel manages processes, memory, I/O and the Timer - so this is not the same as the kernel that
we covered in Lecture 3!
UNIX supports multiprogramming
Processes have their own address space - for protection
Each process's process environment is composed of an unmodifiable re-entrant text (code) region, a
modifiable data region and a stack region.
The text region is shareable
Processes can modify their environment only through calls to the OS
The i-node
Contains
file size
accounting information
file type
Consists of 13 fields
First 10 fields points directly to first 10 file blocks
11th field is an indirect block address
12th field is a double-indirect block address
13th field is a triple-indirect block address
Permissions
Each UNIX file and directory has 3 sets of permission bits associated with it
These give permissions for owner, group and world
System files (inc. devices) are owned by root, wizard, or superuser (terminology!)
Root has unlimited access to the entire installation - whoever owns the files!
Setuid
When you need to change your password, you need to modify a file called /etc/passwd. But this file
is owned by root and nobody other than root has write permission!
The passwd command (to change passwords) is owned by root, with execute permission for world.
The setuid is a bit which when set on an executable file temporarily gives the user the same
privileges as the owner of the file
This is similar in concept to some OS commands executing in Supervisor mode to perform a service
for an otherwise unauthorised process
Process Management
Scheduling
Signals
Signals are software equivalents to hardware interrupts used to inform processes asynchronously of
the occurrence of an event
Interprocess Communication
The output from who is directed to a buffer. grep will take its input from this buffer. The output
from grep will be displayed on the terminal
Timers
Memory Management
Paging
I/O
Data
Devices
Summary
Explained how UNIX is constructed with reference to material we have covered in the course
The UNIX File System
Process Management in UNIX
UNIX Memory Management
UNIX I/O Device Independence
Command Interpretation Loop