Professional Documents
Culture Documents
PART I
What is Operating System?
• It is a program that
controls the execution of application programs
acts as an interface between applications and computer hardware
manages the resources associated with a computer
Objectives of OS:
Convenience of use of the computer
Efficient use of the computing resources
Should be such that it can permit effective development, testing and introduction of new
system functions without affecting he service.
A program that acts as an intermediary between a user of a computer and the computer
hardware.
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.
OR >> An operating system, or OS, is a software program that enables the computer hardware
to communicate and operate with the computer software. Without a computer operating
system, a computer would be useless.
Bootstrapping (diagram 2)
Computer Startup Steps:
1. Empty Ram
2. BIOS Loading
3. Boot drive (Floppy Drive, Hard disk, CD ROM, USB)
4. Primary drive (Primary partition, Drive C :), portioning or Active drive.
5. Goes to MBR (Master Boot record)=== Boot.ini
6. Boot loader files (boot.ini)
Registers (Assignment)
What is Cache?
Important principle, performed at many levels in a computer (in hardware, operating system,
software)
Information in use copied from slower to faster storage (temporarily)
Faster storage (cache) checked first to determine if information is there
If it is, information used directly from the cache (fast)
If not, data copied to cache and used there
Cache smaller than storage being cached
Cache management important design problem
Cache size and replacement policy
Performance of Various Levels of Storage (diagram 4)
Movement between levels of storage hierarchy can be explicit or implicit
Level 1 2 3 4
Name Registers Cache Main memory Disk Storage
Typical Size < 1 KB > 16 MB > 16 GB > 100 GB
Implementation Custom memory ON-chip or CMOS DRAM Magnetic disk
technology with multiple OFF-chip
ports (CMOS) CMOS SRAM
Access Time (ns) 0.25 - 0.5 0.5 - 25 80 - 250 5000000
Bandwidth 20000 - 100000 5000 - 10000 1000 - 5000 20 - 150
(MB/Sec)
Managed By Compiler Hardware Operating Operating
system system
Backed By Cache Main memory disk CD or Tape
Multiprocessor environment must provide cache coherency in hardware such that all CPUs
have the most recent value in their cache
Distributed environment situation even more complex
Several copies of a datum can exist
• Serial Processing
From 1940s to mid-1950s
Programmer interacted with the hardware
Programs in machine code were loaded via the input device (card reader)
In case of any error, they were indicated with lights
Spooling (Assignment)
Spooling & Buffering
Spooling: - (Simultaneous Peripheral Operation On-Line)
Using a disk or similar device as a large buffer, for reading as far ahead as possible on input devices
or storing output files until the output device are ready for them.
Buffering overlaps the I/O of a job with its own computation.
Spooling overlaps the I/O of a job with the computation of all other jobs.
Spooling can be used to provide a job pool
Spooling is a term used in computers and it means place an operation that is being run by the
operating system in a temporary are until another action is taken. For example sending a print
job from your computer to the printer. The operating system places the sent job in a temporary
folder until action is taken by the printer
Buffering: - A method of overlapping the I/O of a job with its execution. After data has been read
and while the CPU starts execution, the input device is instructed to begin the next input immediately
so that it is in memory when it is requested.
Timesharing
Multiprogramming allowed several jobs to be active at one time
1. General Purpose
a. Single User
b. Multi User
2. Special Purpose
a. Serial purpose OS
b. Batch processing OS
c. Multiprogramming
d. Multitasking
e. Multiprocessing
Single User OS:
These systems usually design for microcomputers which provide the services to a single user.
These types of OS are very simple in structure and working. The single user OS controls very limited
devices and their functions are restricted to initializing the system when it is turn O, providing I/O
routines (procedures) to permit user to perform to transfer data between main memory and I/O
devices and provide file system to process the program. And once it is loaded in the main memory it
remains until its completion or abortion.
a. Multiprocessing
b. Time sharing
c. Multiprogramming
Multithreading - Operating systems that allow different parts of a software program to run
concurrently. Operating systems that would fall into this category are:
Linux Unix Windows 2000
Multiprocessing - An operating system capable of supporting and utilizing more than one
computer processor. Below are some examples of multiprocessing operating systems.
Linux Unix Windows 2000
Multiprogramming
More than one user and one CPU sytem.
Multitasking:
One user more than one tasks with one CPU.
Multiprocessing:
More than one CPU processes.
Multithreading:
More than one pieces of one task, multi parts of the same task.
Time sharing:
That time of CPU which give to a specific job is called time slice or quantum and this process
is called time sharing.
Multiprocessor system:
A computer system that consist of two or more processor for processing is called
multiprocessor system. They divided in to two categories:
1. Asymmetric multiprocessing
2. Symmetric multiprocessing
1. Asymmetric:
In asymmetric multiprocessing their exist master, slave relationship among the processor. The
master processor is assigning the task of the distributing works to other slave processors. The
master does nothing but the assignment of job only where the slave processor execute the jobs
assign by the master. This architecture has the disadvantage of the low device utilization as
master sets idle for the most of the time. It has the total advantage of normal load to all slaves
as the master is performs the distribution of work.
2. Symmetric:
In symmetric multiprocessing there is no master slave relationship. Rather all processors all
peer each processor is executing a copy of same OS and accept jobs from job pool. These
processors communicate through OS. It has the advantage of good device utilization as all the
processors are in work.
2. Reliability:
Multiprocessors more reliable than others because if one fails the remaining are in
working.
3. Better throughput:
The time that a program takes in it’s over all execution called throughput of that
program. So by increasing the number of processors we hope to get more work in less
time.
Architecture of OS
OS consist of two parts which are further divided into parts.
Control programs and service programs
1. Control Programs
It permits the user, computer communication and manages the overall computer operation
to ensure that they are running properly.
These programs are further divided into four sections.
a. Supervisor
This is the major part of OS that control the operation of the computer.
Typically the functions of the supervisor are:
i. Loading programs and data into main memory from backing storing.
ii. Scheduling the sequence of jobs to be run for maximum efficiency.
b. Command processor
It carries out user command. These commands constitute of small modules
or programs a specific tasks. E.g. Format Hd of copying files.
c. Interrupt handler
It keeps track all the processes and executions of commands and display
error messages where and when require.
E.g. in task in not in Drive A and the user wants to format the disk, then
interrupt handler will display the error message “Not reading Drive A”
2. Service programs
That programs which provide services.
a. Utility programs
These programs enable users to handle file managements. E.g. files can be
easily prepared, copies, deleted, merged, started etc
b. Library programs
These maintain a directly of frequently and software programs and their
locations.
-: Structure
1. User Mode (shell)
2. Kernel mode
Interrupts
• A mechanism by which other modules (I/O, memory) may interrupt the normal sequencing of
the processor
• Interrupts help to improve processor utilization.
• Classes of interrupts:
1. Program: generated by some condition that occurs as a result of an instruction
execution, such as arithmetic overflow, division by zero,attempt to execute an illegal
machine instruction, and reference outside user’s allowed memory space.
2. Timer: Generated by a timer within the processor. This allows the operating system to
perform certain functions regularly.
3. I/O: Generated by an I/O controller, to signal normal completion of an operation or to
signal a variety of error conditions.
4. H/W failure: Generated by a failure, such as power, etc.
Functions of Interrupts
Interrupt transfers control to the interrupt service routine generally, through the interrupt
vector, which contains the addresses of all the service routines.
Interrupt architecture must save the address of the interrupted instruction.
A trap is a software-generated interrupt caused either by an error or a user request.
An operating system is interrupt driven.
Midterm exam