Main Features of UNIX
- multi-user
more than one user can use the machine at a time
supported via terminals (serial or network connection)
- multi-tasking
more than one program can be run at a time
- hierarchical directory structure
to support the organisation and maintenance of files
- portability
only the kernel ( <10%) written in assembler
tools for program development
a wide range of support tools (debuggers, compilers)
The UNIX Operating System Consists of
- kernel
schedules tasks
manages data/file access and storage
enforces security mechanisms
performs all hardware access
- shell
presents each user with a prompt
interprets commands types by a user
executes user commands
supports a custom environment for each user
- utilities
file management (rm, cat, ls, rmdir, mkdir)
user management (passwd, chmod, chgrp)
process management (kill, ps)
printing (lpr)
Multi-User Operating Systems
A multi-user operating system allows more than one user to share the same computer system at the same time. It does this by time-slicing the computer processor at regular intervals between the various users.
In the above example, there are five users which share the processor hardware and main memory on a time basis.
We start off by giving the first user (which we will call Sophia) the processor hardware, and run Sophia's program for 1/5th of a second. When the time is up, we intervene, save Sophia's program state (program code and data) and then start running the second users program (for 1/5th of a second).
This process continues till we eventually get back to user Sophia. To continue running Sophia's program, we restore the programs code and data and then run for 1/5th of a second.
This switching between user programs is done by part of the kernel. To switch from one program to another requires,
- a regular timed interrupt event (provided by a clock)
- saving the interrupted programs state and data
- restoring the next programs state and data
- running that program till the next timed interrupt occurs
Main system memory is divided into portions for the operating system and user programs.
As you can see in the above diagram, the kernel space is kept separate from user programs.
In UNIX systems, each user is presented with a shell. This is a program which displays the users prompt, handles user input and displays output on the terminal. The shell program provides a mechanism for customizing each user's setup requirements, and storing this information for re-use (in a file called .profile).
When the UNIX system starts up, it also starts a system process which monitors the state of each terminal input line. Whenever a user logs in and their password is validated the UNIX system associates the shell program with that terminal.
Multi-Tasking OperatingSystems
Multi-tasking operating systems permit the use of more than one program to run at once. It does this in the same way as a multi-user system, by rapidly switching the processor between the various programs.
OS/2 and Windows 95 are examples of multi-tasking single-user operating system. UNIX is an example of a multi-tasking multi-user operating system.
A multi-user system is also a multi-tasking system. This means that a user can run more than one program at once, using key selection to switch between them.
Multi-tasking systems support foreground and background tasks. A foreground task is one that the user interacts directly with using the keyboard and screen. A background task is one that runs in the background (it does not have access to the keyboard). Background tasks are usually used for printing or backups.
The role of the operating system is to keep track of all the programs, allocating resources like disks, memory and printer queues as required.
UNIX Shells
No comments:
Post a Comment