0% found this document useful (0 votes)
131 views34 pages

Introduction To Os

This document provides an overview of an operating systems course, including: 1) The instructor's name and contact information. 2) An outline of topics to be covered, including the definition and functions of operating systems, the history and evolution of operating systems from early batch systems to modern personal computers and distributed systems, and computer system organization. 3) Descriptions of the first through fourth generations of operating systems and their characteristics.

Uploaded by

Aman E.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
131 views34 pages

Introduction To Os

This document provides an overview of an operating systems course, including: 1) The instructor's name and contact information. 2) An outline of topics to be covered, including the definition and functions of operating systems, the history and evolution of operating systems from early batch systems to modern personal computers and distributed systems, and computer system organization. 3) Descriptions of the first through fourth generations of operating systems and their characteristics.

Uploaded by

Aman E.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 34

Operating system

Instructor profile
Name: wendimu baye
Office:block-20, room-152
Email:[email protected]
Department: computer science
09/26/2023 Bahir Dar University OS(CoSc2034) 1
Chapter one

Introduction

09/26/2023 Bahir Dar University OS(CoSc2034) 2


Contents
o What is operating system
o History of operating system
o Computer system organization
o Operating system operation
o Operating system services

09/26/2023 Bahir Dar University OS(CoSc2034) 3


What is operating system
o that acts as an intermediary between a user of a computer and the computer
hardware.
o 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.
o 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).
09/26/2023 Bahir Dar University OS(CoSc2034) 4
History of operating system

 Since operating systems have historically been closely tied to the


architecture of the computers on which they run, we will look at
successive generations of computers to see what their operating
systems were like.
 First generation(early system-bare system)
 Second generation(simple batch system)
 Third generation(multiprogramming and time sharing)
 Fourth generation(personal computer)

09/26/2023 Bahir Dar University OS(CoSc2034) 5


First generation(early system-bare machine)
o Structure
 Large machines run from console
 Single user system
 Programmer/User as operator
 Paper tape or punched cards
o Early Software
 Assemblers
 Loaders
 Linkers
 Libraries of common subroutines
 Compilers
 Device drivers 3
o Secure
o Inefficient use of expensive resources
 Low CPU utilization
 Significant amount of setup time
09/26/2023 Bahir Dar University OS(CoSc2034) 6
Second generation(simple batch system)
 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

09/26/2023 Bahir Dar University OS(CoSc2034) 7


Second generation(con’t…)
Problems:
1. How does the monitor know about the nature of the job (e.g.,
Fortran versus Assembly) or which program to execute?
2. 2. 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.

09/26/2023 Bahir Dar University OS(CoSc2034) 8


Second generation(con’t…)
o Parts of resident monitor
o Control card interpreter - responsible for reading and carrying
out instructions on the cards.
o Loader - loads systems programs and applications programs
into memory. –
o Device drivers - know special characteristics and properties
for each of the system's I/O devices.
o Problem: Slow Performance - since I/O and CPU could not overlap,
and card reader very slow.
o 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.

09/26/2023 Bahir Dar University OS(CoSc2034) 9


Second generation(con’t…)
o 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.
o No changes need to be made to the application programs to change from direct to
off-line I/O operation.
o 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.
o (Simultaneous Peripheral Operation On Line) Simple Multiprogramming
o While executing one job, the operating system:
o reads the next job from the card reader into a storage area on the
disk (job queue).
o outputs the printout of previous job from disk to the line printer.
o Job pool - data structure that allows the operating system to select which
job to run next, in order to increase CPU utilization
09/26/2023 Bahir Dar University OS(CoSc2034) 10
Third generation-Multiprogramming and Time Sharing

Multiprogramming
 Several jobs are kept in main memory at the same time, and the CPU is shared
between them. Each job is called a process.
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
 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 to/from a separate terminal for each
user.
 On-line file system must be available for users to access data and code.

09/26/2023 Bahir Dar University OS(CoSc2034) 11


Fourth-generation(personal computer)
o Personal computers - computer system dedicated to a single user.

o I/O devices - keyboards, mice, display screens, small printers.

o User convenience and responsiveness.

o 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.

09/26/2023 Bahir Dar University OS(CoSc2034) 12


Fourth-generation(con’t…)
Parallel Systems - multiprocessor systems with more than one CPU in close
communication.
 Tightly coupled system - processors share memory and a clock; 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 system.
09/26/2023 Bahir Dar University OS(CoSc2034) 13
Fourth-generation(con’t…)
Distributed Systems - distribute the computation among several physical
processors.
 Loosely coupled system - each processor has its own local memory; processors
communicate with one another through various communication lines, such as
high-speed networks.
 Advantages of distributed systems:
 Resource sharing
 Computation speed up - load sharing
 Reliability
 Communication
Real-Time Systems
 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.
09/26/2023 Bahir Dar University OS(CoSc2034) 14
Computer system organization
Computer system can be divided into four components
–Hardware – provides basic computing resources
•CPU, memory, I/O devices
–Operating system
•Controls and coordinates 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, compilers, web browsers, database systems, video games
–Users
•People, machines, other computers

09/26/2023 Bahir Dar University OS(CoSc2034) 15


Computer system operation
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

09/26/2023 Bahir Dar University OS(CoSc2034) 16


Computer system operation(con’t…)
o I/O devices and the CPU can execute concurrently.
oEach device controller is in charge of a particular device type.
oEach device controller has a local buffer.
oCPU moves data from/to main memory to/from local buffers
oI/O is from the device to local buffer of controller.
Device controller informs CPU that it has finished its operation by causing an
interrupt.
• 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.
• Incoming interrupts are disabled while another interrupt is being processed to
prevent a lost interrupt.
• A trap is a software-generated interrupt caused either by an error or a user
request.
09/26/2023• An operating system is interrupt driven.
Bahir Dar University OS(CoSc2034) 17
Storage structure
oMain memory – only large storage media that the CPU can access directly.
oSecondary storage – extension of main memory that provides large
nonvolatile storage capacity.
oMagnetic disks – rigid metal or glass platters covered with magnetic recording
material
Disk surface is logically divided into tracks, which are subdivided into
sectors.
The disk controller determines the logical interaction between the device
and the computer.
oCaching – copying information into faster storage system; main memory can
be viewed as a last cache for secondary storage.
oStorage systems organized in hierarchy.
Speed
Cost
Volatility
09/26/2023 Bahir Dar University OS(CoSc2034) 18
Storage-Device Hierarchy

Less
High Cost
Cost and slow
and fast

09/26/2023 Bahir Dar University OS(CoSc2034) 19


Migration of A From Disk to Register

oData transfer between cache to CPU is hardware function without OS


intervention.
oTransfer from disk to memory is usually controlled by OS.

09/26/2023 Bahir Dar University OS(CoSc2034) 20


I/O structure
• After I/O starts, control returns to user program only upon I/O
completion.
– Wait instruction idles the CPU until the next interrupt
– Wait loop (contention for memory access).
– At most one I/O request is outstanding at a time, no simultaneous
I/O processing.
• After I/O starts, control returns to user program without waiting for I/O
completion.
– System call – request to the operating system to allow user to wait
for I/O completion.
– Device-status table contains entry for each I/O device indicating its
type, address, and state.
– Operating system indexes into I/O device table to determine device
status and to modify table entry to include interrupt.

09/26/2023 Bahir Dar University OS(CoSc2034) 21


Direct Memory Access Structure
oUsed for high-speed I/O devices able to transmit information at close
to memory speeds.
oDevice controller transfers blocks of data from buffer storage directly
to main memory without CPU intervention.
oOnly one interrupt is generated per block, rather than the one
interrupt per byte.

09/26/2023 Bahir Dar University OS(CoSc2034) 22


Operating system operation
• Interrupt driven by hardware
• Software error or request creates exception or trap
– Division by zero, request for operating system service
• Other process problems include infinite loop, processes modifying each other or the
operating system
• Dual-mode operation allows OS to protect itself and other system components
– User mode: execution done on behalf of a user.
– Monitor mode (also kernel mode or system mode) : execution done on behalf
of operating system.
 Mode bit added to computer hardware to indicate the current mode: monitor (0)
or user (1).
• Some instructions designated as privileged, only executable in kernel mode
• System call changes mode to kernel, return from call resets it to user

09/26/2023 Bahir Dar University OS(CoSc2034) 23


Transition from User to Kernel Mode
Timer to prevent infinite loop / process hogging resources
Set interrupt after specific period
Operating system decrements counter
When counter zero generate an interrupt
Set up before scheduling process to regain control or terminate
program that exceeds allotted time

09/26/2023 Bahir Dar University OS(CoSc2034) 24


Operating system services
One set of operating system service provides functions that are helpful
to user.
• Program execution - ability to load a program into memory and to run
it.
• I/O operations - since user programs cannot execute I/O operations
directly, the operating system must provide some means to perform
I/O.
• File-system manipulation - capability to read, write, create, and
delete files.
• Communications - exchange of information between processes
executing either on the same computer or on different systems tied
together by a network. Implemented via shared memory or message
passing.
• Error detection - ensure correct computing by detecting errors in
the CPU and memory hardware, in I/O devices, or in user programs.
09/26/2023 Bahir Dar University OS(CoSc2034) 25
Operating system service(con’t…)
Additional operating-system functions exist not for helping the user,
but rather for ensuring efficient system operation.
Resource allocation - allocating resources to multiple users or multiple
processes running at the same time.

 Accounting - keep track of and record which users use how much and what
kinds of computer resources for account billing or for accumulating usage
statistics.

 Protection - ensuring that all access to system resources is controlled.

09/26/2023 Bahir Dar University OS(CoSc2034) 26


Operating system common component
oUser interface
oProcess Management
oMain Memory Management
oSecondary-Storage Management
oI/O System Management
oFile Management
oProtection System
Networking

09/26/2023 Bahir Dar University OS(CoSc2034) 27


Process Management

A process is a program in execution. A process needs certain resources,


including CPU time, memory, files, and I/O devices, to accomplish its
task.
• The operating system is responsible for the following activities in
connection with process management.
Process creation and deletion.
process suspension and resumption.
Provision of mechanisms for:
process synchronization
process communication

09/26/2023 Bahir Dar University OS(CoSc2034) 28


Main-Memory Management
oMemory is a large array of words or bytes, each with its own address.
It is a repository of quickly accessible data shared by the CPU and I/O
devices.
oThe operating system is responsible for the following activities in
connection with memory management:
 Keep track of which parts of memory are currently being used and by whom.
Decide which processes to load when memory space becomes available.
Allocate and deallocate memory space as needed. e.g. the C function 'malloc'
(or 'New' in Pascal) allocates a specified amount of memory; this happens via an
OS call. The functions 'free'(C) and 'Dispose'(Pascal) deallocate this memory.

09/26/2023 Bahir Dar University OS(CoSc2034) 29


Secondary-Storage Management
Since main memory (primary storage) is volatile and too small to
accommodate all data and programs permanently, the computer system
must provide secondary storage to back up main memory.
Most modern computer systems use disks as the principle on-line
storage medium, for both programs and data.
The operating system is responsible for the following activities in
connection with disk management:
Free space management
Storage allocation
Disk scheduling

09/26/2023 Bahir Dar University OS(CoSc2034) 30


I/O System Management
The I/O system consists of:
o A buffer-caching system
o A general device-driver interface
o Drivers for specific hardware devices

09/26/2023 Bahir Dar University OS(CoSc2034) 31


File Management
 A file is a collection of related information defined by its creator.
Commonly, files represent programs (both source and object forms) and
data.
 The operating system is responsible for the following activities in
connections with file management:
File creation and deletion.
Directory creation and deletion.
Support of primitives for manipulating files and directories.
Mapping files onto secondary storage.
File backup on stable (nonvolatile) storage media.

09/26/2023 Bahir Dar University OS(CoSc2034) 32


Protection System
Protection refers to a mechanism for controlling access by programs,
processes, or users to both system and user resources.
The protection mechanism must:
distinguish between authorized and unauthorized usage.
specify the controls to be imposed.
provide a means of enforcement.

09/26/2023 Bahir Dar University OS(CoSc2034) 33


Any Queries

09/26/2023 Bahir Dar University OS(CoSc2034) 34

You might also like