Chapter 1: Introduction
Objectives
To describe an operating system.
To provide a grand tour of the major components of
operating systems.
To give an overview of the many types of computing
environments.
To describe the basic organization of computer systems.
1.2
What is an Operating System?
A program that acts as an intermediary between a user of a
computer and the computer hardware.
OS is a system software acting as an interface between
application program and hard wars.
a program for hard ware abstraction and resources
management.
Operating system goals:
Execute user programs and solving user problems easily.
Make the computer system convenient to use
Use the computer hardware in an efficient manner
(Efficiency of usage of CPU, memory, etc..)
Protect user from unauthorized release and modification
of information.
1.3
Operating Systems
• Operating systems allow the
separation of hardware
management from
applications/programs.
• This allows the applications to
work across different hardware
platforms, although the
applications are still specific to
the OS.
1.4
Android
Examples of Operating system
1.5
Computer System Structure
Computer system can be divided into four components:
Hardware – provides basic computing resources
CPU, memory, I/O devices, etc.
Operating system
Controls and coordinates the use of hardware among
various applications and users.
Application programs – define the ways in which the system
resources are used to solve the computing problems of the
users
Word processors, web browsers, database systems, video
games
Users
People, machines, other computers
1.6
Four Components of a Computer System
1.7
Operating System Definition
OS is a resource allocator
Manages all resources
Decides between conflicting requests for efficient and fair
resource use.
OS control program
Controls the execution of programs to prevent errors and
improper use of the computer.
“The program running at all times on the computer” is the
kernel.
Everything else is either
a system program (ships with the operating system) , or
an application program.
1.8
Components of operating system
Kernel
Shell
Other program
Or
Process management, memory management, file
management, storage management, security
management components, etc.
1.9
Kernel
Kernel is the heart of an operating system.
It allocates the system resources and coordinate all the details
of the computer's internals.
It interacts with the hardware and perform most of the tasks
like;
memory management,
task scheduling,
file management,
input and output requests handling
access CPU and peripheral device like hard disk, DVD,
RAM, Printers, etc.
1.10
Shell
Users communicate with the kernel through a program known as
the shell.
Shell is a utility that processes user requests.
Is used to start other programs.
When you type a command at your terminal, the shell interprets
the command and calls the program that you want and pass the
request to a kernel.
The shell is a program that reads user commands, executing
commands, and then prints the result.
A shell can be GUI or text based(command based) interface.
Examples: sh, csh, ksh, bash, etc.
1.11
IO Management
1.12
Functions of an OS
User Environment - OS layer transforms bare hardware machine into higher level
abstractions.
Execution environment –to run other programs.
process management, file manipulation, interrupt handling, I/O operations.
Error detection and handling- internal and external hardware errors and
various software errors.
Make the response that clears the error condition with least impact on the
user
Security- enforce security through abstraction.
Access Control: regulating user access to the total system, subsystem
and data. And process access to various resources and objects.
Information flow control: flow of data within the system.
Securing a system against internal and external attacks.
Communication : message sending and receiving.
Message passing
Shared memory
1.13
Functions of an OS
Resource Management
Time management
CPU and disk transfer scheduling
Space management
main and secondary storage allocation
Synchronization and deadlock handling
IR, PC, critical section
Accounting and status information
resource usage tracking
Collect usage statistics
Monitor performance
1.14
Computer Startup
bootstrap program is loaded at power-up or reboot
Typically stored in ROM or EPROM, generally known
as firmware
Initializes all aspects of system
Loads operating system’s kernel and starts execution
1.15
Computer-System Architecture
Most systems use a single general-purpose processor.
Most systems have special-purpose processors as well
Multiprocessors systems are growing in use and importance.
Also known as parallel systems, tightly-coupled systems
Advantages include:
1. Increased throughput: more work with less time
2. Economy of scale: save money than single-core type
because it used shared resources.
3. Increased reliability – graceful degradation or fault tolerance
Two types:
1. Asymmetric Multiprocessing – each processor is assigned a
specific task.
a master processor controls the system, scheme defines a
master-slave relationship
2. Symmetric Multiprocessing – each processor performs all tasks.
processor runs an identical copy of the operating system and
communicate with one another
1.16 as needed.
What Operating Systems Do
Users want convenience, ease of use and good
performance
Don’t care about resource utilization
But shared computer such as mainframe or minicomputer
must keep all users happy.
Users of dedicate systems such as workstations have
dedicated resources but frequently use shared resources
from servers
Handheld computers are resource poor, optimized for
usability and battery life.
Some computers have little or no user interface, such as
embedded computers in devices and automobiles.
1.17
Operating-System Operations
Interrupt driven (hardware and software)
Hardware interrupt by one of the devices
Software interrupt (exception or trap):
Software error (e.g., division by zero)
Request for operating system service
Other process problems include infinite
loop, processes modifying each other or
the operating system
1.18
Operating-System Operations
Timer to prevent infinite loop / process hogging resources
Timer is set to interrupt the computer after some time period
Keep a counter that is decremented by the physical clock.
Operating system set the counter (privileged instruction)
When counter zero generate an interrupt
Set up before scheduling process to regain control or terminate program
that exceeds allotted time
1.19
Operating-System Operations (cont.)
Dual-mode operation allows OS to protect itself and other system
components
User mode and kernel mode
Mode bit provided by hardware
Provides ability to distinguish when system is running user
code or kernel code
Some instructions designated as privileged, only
executable in kernel mode
System call changes mode to kernel, return from call resets
it to user
Example. Shell is user mode
Increasingly CPUs support multi-mode operations
i.e. virtual machine manager (VMM) mode for guest VMs
1.20
Transition from User to Kernel Mode
1.21
Types of Operating System
Based on number of user and tasks, operating system can
be categorized as:
single-user single-tasking
One user executes one task at a time.
E.g. DOS
single user multi-tasking
One user executes multiple tasks in parallel.
E.g. Window, Ubuntu, etc.
multiuser multi-tasking operating systems.
Supports multiple users and tasks
E.g. Server Operating System such as window server
2008/12,Linux,etc.
1.22
Types of OS
Serial processing OS
Batch OS
Multi-programmed OS
Multi-tasking /Time sharing OS
Multiprocessors OS
Real time OS
Network OS
Distributed OS
1.23
1.24
1.25
1.26
1.27
1.28
1.29
1.30
1.31
Cont…
Real-Time Systems : is used when rigid time
requirements have been placed on the operation of a
processor or the flow of data.
Sensors bring data to the computer
Computer must analyze the data and possibly adjust
controls
works in fixed time constraints
It is used in scientific experiments, medical imaging
systems, industrial control systems, weapon systems,
robots, air traffic control systems, etc.
1.32
1.33
Network Operating System
run on a server and provide the capability to manage data, users,
groups, security, applications, shared access to files and printers,
and other networking functions.
Advantages of Network Operating System
Highly stable centralized servers.
Security concerns are handled through servers.
Server access is possible remotely from different locations and
types of systems.
Disadvantages of Network Operating System
Servers are costly.
User has to depend on a central location for most operations.
Maintenance and updates are required regularly.
1.34
1.35
1.36
Characteristic of Modern OS
Micro Kernel architecture- assign only few functions
Address space, inter process communication, basic scheduling
Multi-Tasking
creating displaceable unit of work called for a particular process
Symmetric Multi-Processing
Performance, availability, incremental growth, scaling
Distributed OS
1.37