0% found this document useful (0 votes)
8 views

Chapter 1 Introduction

os
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Chapter 1 Introduction

os
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

OPERATING

SYSTEMS
Chapter 1: Introduction
o What Operating Systems Do
o Computer- System Organization
o Computer - System Architecture
o Operating – System Structure
o Operating – System Operations
o Process Management
Chapter 1: Introduction
o Memory Management
o Storage Management
o Protection and Security
o Distributed Systems
o Special – Purpose Systems
o Computing Environments
Objectives:
1. To provide a grand tour of the major operating systems components.
2. To provide coverage of basic computer system organization.
What is an Operating System?
o A program that acts as an intermediary between 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.
o Use the computer hardware in an efficient manner.
Computer System Structure
Computer system can be divided into four components:
o Hardware
o Operating system
o Application programs
o Users
Four Components of a Computer System
Operating System Definition
o OS is a resource allocator
- Manages all resources
- Decides between conflicting requests for efficient and fair resource use
o OS is a control program
- Controls execution of programs to prevent errors and improper use of
the computer
Computer System Organization
Computer-System Operation
o I/O devices and the CPU can execute concurrently.
o Each device controller is in charge of a particular device type.
o Each device controller has a local buffer.
o CPU moves data from/to main memory to/from local buffers
o I/O is from the device to local buffer of controller
o Device controller informs CPU that it has finished its operation by causing
an interrupt.
Common Functions of Interrupts
o Interrupt transfers control to the interrupt service routine through the interrupt
vector, which contains the addresses of all the service routines.
o Interrupt architecture must save the address of the interrupted instruction.
o Incoming interrupts are disabled while another interrupt is being processed to
prevent a lost interrupt.
o A trap is a software-generated interrupt caused either by an error or a user request.
o An operating system is interrupt driven.
Interrupt Handling
o Operating system preserves the state of the CPU by storing registers and
the program counter.
o Determines which type of interrupt has occurred:
- polling
- vectored interrupt system
o Separate segments of code determine what action should be taken for each
type of interrupt.
I/O Structure
o 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
- At most one I/O request is outstanding at a time, no simultaneous
I/O processing.
I/O Structure
o After I/O starts, control returns to user program without waiting for I/O
completion.
- System call
- Device-status table
- Operating system indexes into I/O device table
I/O Methods
Device-Status Table
Direct Memory Access Structure
o Used for high-speed I/O devices able to transmit information at close to
memory speeds.
o Device controller transfers blocks of data from buffer storage directly to
main memory without CPU intervention.
o Only on interrupt is generated per block, rather than the one interrupt per
byte.
Storage Structure
o Main memory
o Secondary Storage
o Magnetic disks
- disk surface is divided into tracks, which are subdivided into sectors
- disk controller determines the logical interaction between the device
and the computer
Storage Hierarchy
o Storage systems organized in a hierarchy.
- Speed
- Cost
- Volatility
o Caching
Storage-Device Hierarchy
Caching
o Important principle, performed at many levels in a computer
o Information in use copied from slower to faster storage temporarily
o Faster storage (checked) first to determine if the information is there
o Cache smaller than storage being cached
Operating System
Structure
Multiprogramming
o Single user cannot keep CPU and I/O devices busy at all times.
o Multiprogramming organizes jobs
o A subset of total jobs in system is kept in memory
o One job is selected and run via job scheduling
o When it has to wait, OS switches to another job
Timesharing
o Response time should be <1 second.
o Each user has at least one program executing in memory process
o If several jobs ready to run at the same time CPU scheduling
o If processes don’t fit in memory, swapping moves them in and out to run
o Virtual memory allows execution of processes not completely in memory
Operating-System Operations
o Interrupt driven by hardware
o Software error to request creates exception or trap
o Dual-mode operation allows OS to protect itself and other system
components
- User mode and kernel mode
Process Management
o A process is a program. Program is a passive entity, process is an active
entity.
o Process needs resources to accomplish its task
o Process termination requires reclaim of any reusable resources
o Single-threaded process has one program counter location of next
instruction to execute
o Multi-threaded process has one program counter per thread
Process Management Activities
o Creating and deleting both user and system processes.
o Suspending and resuming processes.
o Providing mechanisms for process synchronization
o Providing mechanisms for process communication
o Providing mechanisms for deadlock handling
Memory Management
o All data in memory before and after processing
o All instructions in order to execute
o Memory management determines what is in memory when optimizing CPU
utilization and computer response to users.
Memory Management Activities
o Keeping track of which parts of memory are currently being used and by
whom
o Deciding which processes and data to move into and out of memory
o Allocating and deallocating memory space as needed
Storage Management
o OS provides uniform, logical view of information storage
o File-System management
- Files usually organized into directories
- Access control on most systems to determine who can access what
o OS activities include
- Creating and deleting files and directories
Storage Management
- Primitives to manipulate files and dirs.
- Mapping files onto secondary storage
- Backup files onto stable storage media
Mass-Storage Management
o Usually disks used to store data that does not fit in main memory or data
that must be kept for a “long” period of time.
o Proper management is of central importance.
o Entire speed of computer operation hinges on disk subsystem and its
algorithms
o OS activities
- Free-space management
Mass-Storage Management
- Storage allocation
- Disk scheduling
o Some storage need not to be fast
- Tertiary storage includes optical storage, magnetic tape
- Varies between WORM and RW
I/O Subsystem
o One purpose of OS is to hide peculiarities of hardware devices from the
user
o I/O subsystem responsible for
- Memory management of I/O buffering, caching, spooling
- General device-driver interface
- Drivers for specific hardware devices.
Protection and Security
o Protection – any mechanism for controlling access of processes or users to
resources defined by the OS
o Security – defense of the system against internal and external attacks
o System generally first distinguishes among users,
- User Identities
- User Identities with all files
- Group Identifier
- Privilege escalation
Computing Environments
o Traditional computer
- Blurring over time
- Office environment
- Home networks
o Client-Server Computing
- Dumb terminals supplanted by smart PCs
Computing Environments
- Many systems now servers, responding to requests generated by clients
* Compute-server provides an interface to client to request services
* File-server provides interface for clients to store and retrieve files
Computing Environments
o Peer-to-Peer Computing
- Another model of distributed system
- does not distinguish clients and servers
* all nodes are considered peers
* may each act as client, server or both
* node must join P2P network
Computing Environment
o Web-Based Computing
- Web has become ubiquitous
- PCs most prevalent devices
- More devices becoming networked to allow web access
- New category of devices to manage web traffic among several servers
- Use of operating systems
END OF CHAPTER I

You might also like