CSC 325 Operating Systems with an Emphasis on UNIX
Chapter 1 Introduction
- What is an operating system?
- Early Systems
- Simple Batch Systems
- Multiprogramming Batched Systems
- Time-Sharing Systems
- Personal-Computer Systems
- Parallel Systems
- Distributed Systems
- Real-Time Systems
What is an Operating system?
- A program that acts as an intermediary between a user of a computer and the computer
hardware.
- Its the most fundamental system program - one which controls all the computer's resources and provides a base upon which application programs can be written.
- A program which provides an illusion of infinite resources (CPU, memory, I/O devices,
networks)
to an user (i.e. It provides a virtual machine).
- An operating system implements a virtual machine that is
hopefully easier to program than the raw hardware.
- It is essentially a software engineering problem - how do you convert what hardware provides into what an application programmer wants.
Functionality of an Operating System
- As Coordinator: It allows many users/applications to work together
in a fair and efficient ways (e.g. look at file system).
- Standard Services Provider: It provides standard facilities that everybody
needs (e.g. printing, standard libraries, windowing systems, etc.)
Operating system goals:
- Execute user programs and make solving user problems easier.
- Make the computer system convenient to use.
- Use the computer hardware in an efficient manner.
Computer System Components
- Hardware - provides basic computing resources (CPU, memory, I/O devices).
- Operating system - controls and coordinates the use of the hardware among the various
application programs for the various users.
- Applications programs - define the ways in which the system resources are used to solve
the computing problems of the users (compilers, database systems, video games, business
pro grams).
- Users (people, machines, other computers).
Operating System Functions
- Resource allocator - manages and allocates resources.
- Control program - controls the execution of user programs and operation of I/O
devices.
- Kernel - the one program running at all times (all else being application
programs).
Major Issues in OS:
- structure - how is OS organized
- sharing - how are resources shared
- naming - how are resources named (by users/programs)
- protection - how is one user/program protected from another.
- security - how to restrict the flow of information.
- performance
- reliability and fault tolerance
- extensibility
- communication
- concurrency
- scale and growth
- accounting
- ....
What is this course about?
Several aspects of OS which will be covered again and again in this course:
- OS as illusionist: Hardware is kept transparent.
- OS as government: protect users from each other as well allocate
resources fairly and efficiently.
- OS as a complex system: but made of simpler functional units.
- How OS design changes with technology!
- How the knowledge from other areas is integrated.
Early Systems (early 1950s) - First Generation.
- Structure
- Large machines run from console
- Single user system
- Programmer/User as operator
- Paper tape or punched cards
- Early Software
- Assemblers
- Loaders
- Linkers
- Libraries of common subroutines
- Compilers
- Device drivers
- Secure
- Inefficient use of expensive resources
- Low CPU utilization
- Significant amount of setup time
Simple Batch Systems - Second Generation.
In the second generations of computers, the operating system was simple. Its major task was to transfer the control automatically from one job to the
next. The operating system was always memory resident. To speed up processing, the operator grouped all the jobs with
similar needs called a batch together and run them together. The control card told what the job was supposed to do, e.g. a PASCAL
program or a Fortran program etc.
Main Disadvantages: There is no interaction with the user. Often CPU is idle.
Remember that at that time hardware was phenomenally expensive.
- Use an operator (somebody to work the machine)
- Add a card reader (a device to read programs written on punched cards)
- Reduce setup time by batching similar jobs
- Automatic job sequencing - automatically transfers control from one job to another.
First rudimentary operating system.
- Resident monitor
- initial control in monitor
- control transfers to job
- when job completes control transfers back to monitor
Problems:
- How does the monitor know about the nature of the job (e.g., Fortran versus Assembly) or
which program to execute?
- How does the monitor distinguish
a) job from job?
b) data from program?
Solution: introduce control cards
Control Cards
- Special cards that tell the resident monitor which programs to run.
- Parts of resident monitor
- Control card interpreter - responsible for reading and carrying out instructions on the
cards.
- Loader - loads systems programs and applications programs into memory. -
- Device drivers - know special characteristics and properties for each of the system's
I/O devices.
- Problem: Slow Performance - since I/O and CPU could not overlap, and card reader very
slow.
- Solution: Off-line operation - speed up computation by loading jobs into memory from
tapes and card reading and line printing done off-line using smaller machines.
- Advantage of off-line operation - main computer not constrained by the speed of the card
readers and line printers, but only by the speed of faster magnetic tape units.
- No changes need to be made to the application programs to change from direct to off-line
I/O operation.
- Real gain - possibility of using multiple reader to-tape and tape-to-printer systems for
one CPU.
|
Spooling - overlap the I/O of one job with the computation of another job.
Abstraction: Spooling overlaps I/O of one job with computation of another job, at the cost of some disk space and some tables that the operating system needs to manage.
Spooling and Buffering were a simple improvement: Read the cards before hand into a faster media such as disks/ or
tapes, which are faster than the cards, ahead of time. Of course the operating system needs to manage, where the card data should
go into the disks. The location of card images will be somehow maintained by the operating system. Instead of reading from the
card reader, now the job reads it from the disk. Similarly, if a data has to be sent to the printer, it sends to a buffer
onto the disk and from there it is printed. This is the notion of SPOOLING = Simultaneous Peripheral Operation Online.
Remember that at that time hardware was phenomenally expensive.
(Simultaneous Peripheral Operation On Line).
- While executing one job, the operating system:
- reads the next job from the card reader into a storage area on the disk called the job
queue.
- outputs the printout of previous job from disk to the line printer.
- The job pool is a data structure that allows the operating system to select which job to run
next in order to increase CPU utilization.
Multiprogramming and Time Sharing- Third Generation
Multiprogramming
Since several jobs are often available on disk, the operating system must select which job to run, which eventually leads to job scheduling. The idea of multiprogramming is that several jobs are kept in main memory at the same time, and the CPU is shared between them. Each job is called a process.
The main motivation for multiprogramming is to try to ensure that the CPU is always busy. A single job may not be able to be keep CPU busy due to slow I/O, so multiprogramming allows to keep the CPU more busy as follows:
There are several jobs in the job pool. Some are selected to be loaded in memory, since main memory
is often much smaller than the job pool. A job is picked from memory, then the CPU executes it until it finishes or requests I/O. Since the CPU has to wait for the slow I/O, it loads another job and executes it and so on. The task of the operating system is to manage these jobs neatly. There are several issues to grapple with:
- Which jobs should stay in memory?
- Which should the CPU run next?
- How does the operating system manage memory?
- What happens to the job which is suspended?
- What happens when one has to activate a supended job?
- Can multiple jobs running effect each other?


OS Features Needed for Multiprogramming
- I/O routine supplied by the system.
- Memory management - the system must allocate the memory to several jobs.
- CPU scheduling - the system must choose among several jobs ready to run.
- Allocation of devices.
Time-Sharing Systems- Interactive Computing
In the previous approaches, the user is inactive during the whole execution cycle. But the user wants to have some control to see the intermediate results of execution, etc. Also, in the previous approaches, the program had to be debugged statically!
In a time-sharing system or a multitasking system (TSS/MTS), Multiple jobs are executed by the CPU, but the switching is so frequent that the user may interact with the program while it is running (e.g. using the keyboard).
- Most efficient for many users to share a large computer.
- The CPU is shared between several processes.
- Each process belongs to a user and I/O is separate for each user.
- An on-line file system must be available for users to access data and code.
- In this case jobs may have to be swapped in and
out of the main memory - so the concept of virtual memory was developed.
Thus, the abstraction of the main memory became a single uniform almost infinite size memory. The programmer no longer has to
worry about main memory management and lets the operating system take care of it.
Personal-Computer Systems - Fourth Generation
A personal computer is a computer system designed to be used by a single user.
- User convenience and responsiveness.
- Can adopt technology developed for larger operating systems; often individuals have sole
use of computer and do not need advanced CPU utilization or protection features.
- I/O devices - keyboards, mice, display screens, small printers.
Parallel Systems - multiprocessor systems with more than one CPU in close
communication.
Parallel systems have more than one processors in very close communication, sharing the bus, clock, and sometimes
memory and peripheral devices. They are called tightly coupled.
- Communication usually
takes place through the shared memory.
- Advantages of parallel systems:
- Increased throughput
- Economical
- Increased reliability
- Symmetric multiprocessing
- Each processor runs an identical copy of the operating system.
- Many processes can run at once without performance deterioration.
- Asymmetric multiprocessing
- Each processor is assigned a specific task; master processor schedules and allocates
work to slave processors.
- More common in extremely large systems.
Distributed Systems - distribute the computation among several physical
processors.
A distributed system is a loosely coupled system in which each processor has its own local memory and do not share a clock.
- Processors communicate
with one another through various communication lines, such as telephone lines or high-speed networks.
- Processors may be different in size, functionality etc.
- Advantages of distributed systems:
- Resource sharing
- Computation speed up - load sharing
- Reliability
- Communication
Real-Time Systems
Real-Time operating systems are used where there are rigid time requirements, especially used in control devices.
- Often used as a control device in a dedicated application such as controlling scientific
experiments, medical imaging systems, industrial control systems, and some display
systems.
- Well-defined fixed-time constraints.
- OS must be able to respond very quickly.
History of UNIX Operation System:
- 1956~:AT & T Signs Consent Decree that as a result of anti-trust legislation. Prohibited from manufacturing equiptment not related to telephone and telegraph.
- 1965~: Multics Project by MIT, General Electric Co. and Bell Lab.: Multi-User, Multi-Tasking, and Interactive System.
- 1969~: Bell Lab.:
- Ken Thompson: DEC PDP-7 -> PDP-11/20: ASSEMBLY -> FORTRAN -> BCPL -> B.
- Dennis M. Ritchie: develop C: a middle-level language.
- Brian Kernighan: name UNIX.
- AT&T USG (UNIX Support Group) -> USDL (UNIX System Development Laboratory). AT&T System V (SysV or SV).
- 1974~: AT&T licenses the source codes to academic institutes for a small liscensing fee only.
- UC Berkeley: BSD (Berkeley Software Development).
- Carnegie Mellon Univ.: Mach.
- DARPA grant to incorporate TCP/IP networking protocal
- 1977~: AT&T licenses the source codes to other commercial companies.
- IBM Co.: AIX.
- SUN Microsystems Co.: SunOS, Solaris.
- DEC Co.: Ultrix.
- HP Co.: HP-UX.
- SGI: IRIX.
- Novell: UnixWare.
- Santa Cruz Operations and HP: developing 64-bit version of UNIX from 1996.
- PC: Linux, FreeBSD, IBM OS/2, Microsoft XENIX, ...