Professional Documents
Culture Documents
Chapter one
After going through this unit, you will be able to:
A program that acts as an intermediary between a user of a computer and the computer
hardware.
An operating system is a software that manages the computer hardware. The hardware must
provide appropriate mechanisms to ensure the correct operation of the computer system and to
prevent user programs from interfering with the proper operation of the system.
An Operating system is a program that controls the execution of application programs and acts
as an interface between the user of a computer and the computer hardware.
Modes of operations:
To avoid having applications that constantly crashed, newer OSs were designed with 2 different
operative modes:
User modes:
The executing code has no ability to directly access hardware or reference memory.
Code running in user mode must delegate to system APIs to access hardware or
memory.
Due to the protection afforded by this sort of isolation, crashes in user mode are
always recoverable.
Most of the code running on your computer will execute in user mode.
Application program
Kernel modes:
The executing code has complete and unrestricted access to the underlying
hardware.
It can execute any CPU instruction and reference any memory address.
Kernel mode is generally reserved for the lowest-level, most trusted functions of the
operating system.
Crashes in kernel mode are catastrophic; they will halt the entire PC.
It has access to every resource
Supervisor mode
Many drivers run in kernel mode
Driver Programs (Device Driver) small program that allows a specific input or
output device to communicate with the rest of the computer system
How the switch occurs
Mode bit added to computer hardware to indicate the current mode: monitor (0) or
user (1).
1. System call
Interface to the services made available by an operating system.
Tasks where hardware must be accessed directly
2. API[ application program interface]
designed program
Computer System Components
Every general purpose computer consists:
1. Hardware provides basic computing resources (CPU, memory, I/O devices).
2. Operating system controls and coordinates the use of the hardware among the various
application programs for the various users.
3. 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
programs).
The operating system must support the following tasks. The tasks are:
1. Provides the facilities to create, modification of program and data files using and editor.
2. Access to the compiler for translating the user program from high level language to machine
language.
3. Provide a loader program to move the compiled program code to the computers memory for
execution.
Spooling:
Polling:
Device sets a flag when it is busy.
Program tests the flag in a loop waiting for completion of I/O.
Multiprogramming system:
When two or more programs are in memory at the same time, sharing the processor is
referred to the multiprogramming operating system.
Multiprogramming assumes a single processor that is being shared.
It increases CPU utilization by organizing jobs so that the CPU always has one to execute
Jobs entering into the system are kept into the memory. Operating system
picks the job and begins to execute one of the job in the memory
Requires CPU scheduling to choose the next job to run
Figure 4 memory layout of multiprogramming
Advantages:
1. High CPU utilization.
2. It appears that many programs are allotted CPU almost simultaneously.
Disadvantages:
1. CPU scheduling is requires.
2. To accommodate many jobs in memory, memory management is required
Time Sharing Systems:
To provide interactive use of a computer system
Uses CPU scheduling and multiprogramming to provide each user with a small
portion of a time-shared computer
Allows the many users to share the computer simultaneously
Multi-tasking system
Like multiprogramming, but timer device
A timer interrupt is used to multiplex CPU among jobs
CPU switching
Personal computer system:
Single user
Utilization is no longer a concern
Emphasis is on user interface and API
Many services & features not present
Parallel system:
Distributed system:
The processors do not share memory or a clock. Instead, each processor has its own local
memory.
They communicate with each other through various communication lines.
A distributed system provides user access to various system resources.
Advantages:
resource sharing
computation speed-up
reliability
communication - e.g. email
Real time system:
Correctness of the system depends not only on the logical result of the computation but
also on the time at which the results are produced.
A hard real-time task is one that must meet its deadline
Failure to meet deadlines is fatal
[example : Flight Control System]
A soft real-time task has an associated deadline that is desirable but not mandatory;
Late completion of jobs is undesirable but not fatal
[Online Databases]
Are time bounded system