Chapter 1
Chapter 1
Hawassa university
Bensa Daye Campus
Department of Computer science
1
Chapter One
___________________________
Introduction to Operating Systems
2
Outline
Introduction
Why Study Operating Systems
The history of Operating System
Types of operating systems
Function of Operating System
Role of operating systems
Operating Systems Structure
Computer System Organization
Interrupts in Operating System
Concurrency and its importance
The purpose and role of OS in computer engineering
3
Introduction
The Operating System is a program that acts as an intermediary
between a user of computer and the computer hardware.
A every modern computer consists of:
• One or more processors
• Main memory
• Disks
• Printers
• Various input/output devices
Managing all these components requires a layer of software called
operating system.
A software that abstracts the computer hardware
• Hides the messy (unnecessary) details of the underlying hardware.
• Presents users with a resource abstraction that is easy to use.
• Extends or virtualizes the underlying machine.
4
Cont...
Responsible for allocating resources for users and
processes.
• Should ensure that no starvation, allocation is based on desired
policy( like FCFS) and efficient system utilization.
Most computers have two modes of operation:
• Kernel mode and user mode
OS runs in kernel mode, which has complete access to
all hardware and can execute any instruction
Rest of software runs in user mode, which has limited
capability.
Shell or GUI is the lowest level of user mode software.
5
Cont..
OS manages concurrency.
• The ability to execute more than one program or task simultaneously
• Concurrency leads to interesting programming challenges.
OS manages hardware.
• Programming hardware is challenging: timing dependent behavior,
undocumented behavior, hardware bugs.
• Allows the computer hardware to be used in an efficient manner.
OS fails machine fails.
• OS must fail less than user programs.
OS provides services that enable application programs
• Make the computer more convenient to use.
OS basis of system security.
• Allow only authorised access to data, computation, services, etc.
OS providing an interface to the users.
9
History of Operating Systems
The first true digital computer was designed by Charles Babbage (1792-
1871). however, the analytical engine didn’t have an operating system.
Operating system have been evolving over the years.
Generations:
10
10
Cont…
I. First Generation(1945–55) Vacuum Tubes
When electronic computer were first introduced in 1940’s.
Mechanical components are replaced by electronic component
(Vacuum Tubes).
Computers with out operating system.
The actual operation were took place with out the benefit of OS.
During this generation computers were generally used to solve
simple mathematical calculations.
Programs were written in machine language.
The application program were run one at a time.
The system was inefficient and depends on programmer competency.
11
Cont..
II. 2nd Generation(1955–65) Transistors and Batch Systems
Transistor was introduced.
The vacuum tubes replaced by the transistors.
CPU continued to be under utilized as sequential processing
with one job at a time was being done.
When the computer finished whatever job it was currently
running, an operator would do many works in between to
start the next job.
Expensive time lags between CPU and I/O devices.
12
Cont..
III. 3rd Generation(1955–65) ICs and Multiprogramming
IC was introduced and OS allowed the machine to run many
different application.
The computer that used ICs was created that answered
price/performance problem over the second-generation.
IC integrated hundreds of transistors.
• Speedy and economical.
OS designers were able to develop the system of multi-
programing, in which computers able to perform multiple tasks at
the same time.
15
Cont…
3. Time-sharing operating systems
Time sharing is a technique which enables many people, located at
various terminals, to use a particular computer system at the same
time.
Time-sharing or multitasking is a logical extension of
multiprogramming.
Processor's time which is shared among multiple users
simultaneously is termed as time-sharing.
The processors communicate with one another through various
communication lines (such as high-speed buses or telephone lines).
These are referred as loosely coupled systems or distributed
systems.
4. Real-time operating systems- These systems are characterized by
having time as a key parameter.
• Fast and time limit sensitive
• Used in time-critical environments
• Example an operating system used in missile systems, space flights,
airport traffic control, industrial processes.
16
Cont…
5. Distributed operating system- manage a group of different computers
and make appear to be a single computer.
6. Mainframe operating systems-
Mainframe computers are used for high-end Web servers, servers for
large-scale electronic commerce sites, etc...
Hence, the operating systems for mainframes are heavily oriented
toward processing many jobs at once, most of which need
remarkable numbers of I/O.
Nassau, Astronomers
7. Server operating systems-
It is one level down the mainframes OS which is very large personal
computers, workstations, or even mainframes.
It serves multiple users at once over a network and allows the users
to share hardware and software resources.
17
Cont…
8. Personal computer operating systems- Their job is to provide a
good interface to a single user. like, Window xp
9. Embedded operating systems- An OS that run on the
computers to control devices that are not generally
thought/part of as computers, such as TV sets, microwave
ovens, and mobile telephones.
10. Smart card operating systems-
The smallest operating systems run on smart cards.
Some of them can handle only a single function, such as
electronic payments.
18
Function/roles of operating system
Memory Management
File Management
Input/output management
Networking management
Protection system
Command interpreter
19
Cont..
1. Process Management
Process refers to a program in execution.
In multiprogramming environment, OS decides which
process gets the processor when and how much time. This
function is called process scheduling.
• Operating System does the following activities for processor
management.
• Keeps tracks of process and status of process.
• Allocates the processor(CPU) to a process.
• De-allocates processor when process is no longer required.
20
Cont..
2. Memory Management
Memory management refers to management of Primary Memory
or Main Memory.
Main memory provides a fast storage that can be access directly by
the CPU. So for a program to be executed, it must in the main
memory.
Each process has some set of addresses space in the main
memory that it can use.
Operating System does the following activities for memory
management.
• Keeping tracks of the status of each location of main memory i.e. each
memory location is either free or allocated.
• Decide which process are loaded into memory when memory space
become available.
• Allocates the memory when the process requests it to do so.
• De-allocates the memory when the process no longer needs it or has been
terminated. 21
Cont…
3. File management
A file is a collection of related information.
A file system contain a report, an executable program or a set of
commands to the OS.
A file system is normally organized into directories for easy
navigation and usage. These directories may contain files and other
directions.
Operating System does the following activities for file management.
• Creating and deleting of files
• Creating and deleting of directories
• Mapping files into secondary storage
• Backing up files on stable storage media
• Transmission of files elements b/n main and secondary storage.
The operating system is also hide the details of the disks and other
I/O devices and present the programmer with a nice, clean abstract
model. 22
Cont..
4. I/O system Management
OS manages device communication via their respective drivers.
Operating System does the following activities for device
management.
• Keeps tracks of all devices.
o The Program that keeps the track responsible for this task is
known as the I/O controller.
• Decides which process gets the device when and for how much
time.
• Allocates the device in the efficient way.
• De-allocates devices.
23
Cont…
5. Network Management
Networking enables computer users to share resources and
speed up computations.
The processors communication with one another through
various communication line. (wired or wireless)
Convenient way for users to share resource
24
Cont..
6. Protection/security system
Protection mechanisms are implemented in operating system to
support various security polices.
By means of password and similar other techniques, preventing
unauthorized access to programs and data.
Operating System
• Layered
• Microkernel
• Module
• Hybrid
27
Cont..
1. Monolithic systems – basic structure:
• The entire kernel is run as a single privileged entity.
• Functionality can be broken up into modules but the modules’ code is
highly integrated.
• The operating system is formed from individual procedures,
and then binds them all together into a single object file using
the system linker.
• The organization suggests a basic structure for the operating system:
A main program that invokes the requested service procedure.
A set of service procedures that carry out the system calls.
A set of utility procedures that help the service procedures.
28
Cont…
29
Cont..
2. Layered Approach
• The operating system is divided into a number of layers
(levels), each built on top to lower layers.
• The bottom layer (layer 0), is the hardware; the highest (layer
N) is the user interface.
• Each layer provides a different type of functionality.
30
Cont..
3. Microkernel System Structure
31
Cont..
Application File Device user
Program System Driver mode
messages messages
microkernel
hardware
32
Cont.…
4. Modules
The operating systems implement loadable kernel
modules.
33
Cont..
5. Hybrid Systems
Most modern operating systems are actually not one pure model.
Hybrid combines multiple approaches to address performance,
security, and usability needs.
34
Computer System Organization
Computer-system operation
• One or more CPUs, device controllers connect through common
bus providing access to shared memory.
• Concurrent execution of CPUs and devices competing for memory
cycles.
• Basic computer components:-
35
Cont…
Basic Elements:
Processor- Performs computations
Main Memory
• Volatile
• Referred to as real memory or primary memory
I/O modules
• Secondary memory devices
• Communications equipment
• Terminals
System bus
• Communication among processors, memory, and I/O modules.
• Load the data from CPU to memory or vice versa via
system bus
36
Interrupt in operating system
An interrupt is a signal from a device attached to a computer or
from a program within the computer that requires the operating
system to stop and figure out what to do next.
Signals that cause an interruption/stop to the normal sequence
of execution.
After the interrupt signal is sensed, the computer either
resumes running the current program or begins running
another program.
Classes of Interrupts:
Program exceptions (also called synchronous interrupts)
– Arithmetic overflow
– Division by zero
– Executing an illegal/privileged instruction
– Reference outside user’s memory space.
37
Cont..
Asynchronous (external) events
– Timer
– I/O
– Hardware or power failure
38
Cont..
Interrupt Handler:
• A software routine that determines the nature of the interrupt
and performs whatever actions are needed.
• The handler is generally part of the operating system.
39
Concurrency and its importance
40
The purpose of OS in computer engineering
41
Cont…
Communications – Processes may exchange information, on the
same computer or between computers over a network
• Communications may be via shared memory or through message
passing (packets moved by the OS).
Error detection – OS needs to be constantly aware of possible errors
may occur in the CPU and memory hardware, in I/O devices, in
user program.
• For each type of error, OS should take the appropriate action to ensure
correct and consistent computing
Resource allocation - When multiple users or multiple jobs
running concurrently, resources must be allocated to each of them.
• Many types of resources - CPU, main memory, file storage, I/O
devices.
42
Cont…
Protection and security
• The Operating System is responsible for using all the
information and resources available on the machine in the most
protected way.
• Allow only authorised access to data, computation, services, etc.
• Involves ensuring that all access to system resources is
controlled.
Accounting: The Operating System tracks an account of all
the functionalities taking place in the computer system at a
time.
– All the details such as the types of errors occurred are recorded
by the Operating System.
43
Group Assignments
Some commonly used operating system:-
1. Window OS
2. Unix OS
3. Linux OS
Overview OS, introduction about the
4. Mac OS given OS, Basic features, Development
or type (Version), Architecture, cost
5. Android OS Application/ function, Pros and cons of
it( the given OS).
6. Solaris OS
7. iSo OS
8. Debian OS
44
1
-
4 45
5