Académique Documents
Professionnel Documents
Culture Documents
Chapter 2
Operating System
Definition:
A program that controls the execution of application programs An interface between applications and hardware
2. Efficiency y
Allows computer system resources to be used in an efficient manner
3. Ability to evolve
Permit effective development, testing, and introduction f i t d ti of new system functions without t f ti ith t interfering with service
Program execution Access to I/O devices Controlled access to files System access y
Accounting
collect statistics monitor performance used to anticipate future enhancements p used for billing users
Serial Processing
No operating system User i t U interact di tl with computer h d t directly ith t hardware. Machines run from a console with display lights and toggle switches, input device, and printer This mode of operation could be termed serial processing because users have access to the computer in series.
Setup time
Many steps involve in running a single program/job If error occurred, user had to go back to the beginning setup step. Much of the time is spending on setting up program.
This will cause the CPU to fetch its next instruction from monitor.
Privileged instruction
Can be executed only by the monitor An interrupt occurs if a program tries these instructions. E.g. I/O instructions.
Interrupts
Provides flexibility for relinquishing control to and regaining control from user programs
Time Sharing
Desirable to provide a mode in which the user interacts directly with the computer, i.e. transaction processing Batch B t h multiprogramming d lti i does not support t t interactions with users so time sharing was developed developed. Time sharing extends multiprogramming to jobs. handle multiple interactive jobs
Major Achievements
OS is the most complex pieces of software ever developed. Five major theoretical advances in the development of OS: d l t f OS
Process M t Memory M Management Information protection and security Scheduling d S h d li and resource management t System structure
Major Achievements
Process
Introduced to obtain a systematic way of monitoring and controlling program execution. Definitions of process:
A program in execution An instance of a program running on a computer The entity that can be assigned to and executed on a processor A unit of activity characterized by a single sequential thread of execution, a current state, and an associated set of system resources
Major Achievements
Improper synchronization
Process Process..
Major Achievements
Deadlocks
Process Process..
Two or more programs wait endlessly after each other to perform an operation.
Major Achievements
Process.. Process
Major Achievements
M t Management
Memory
Major Achievements
Management Management.. Virtual memory:
Memory
It allows programs to address memory from a logical point of view without regard to the amount that is physically available While a program is running only a portion of the program and data is kept in (real) memory Other portions are kept in blocks on disk
the user has access to a memory space that is y p larger than real memory
Major Achievements
Management Management..
Memory
All memory references made by a program are to i t l be ith t virtual memory which can b either hi h
a linear address space a collection of segments (variable-length blocks) (variable length
The hardware (mapper) must map virtual memory address to real memory address If a reference is made to a virtual address not in memory, then
(1) a portion of the content of real memory is swapped out to disk (2) th d i d bl k of d t i swapped i the desired block f data is d in
Major Achievements
M Management.. t File System:
Memory
Implements long-term store (often on disk) Information stored in named objects called files fil
a convenient unit of access and protection for OS
Files (and portions) may be copied into virtual memory for manipulation by p g y p y programs
Major Achievements
Management Management.. Paging:
Memory
Allows process to be comprised of a number of fixed-size blocks, called pages Virtual dd Vi t l address i a page number and an is b d offset within the page Each page may be located any where in main memory Real address or physical address in main p y memory
Major Achievements
Management.. Management
Memory
Major Achievements
I f ti Protection d Security it Information P t ti and S Protection of information is needed since the growth i th use of ti th in the f time-sharing systems and h i t d computer network. Work i W k in security and protection as it relates t it d t ti l t to OS can be roughly grouped into four categories. categories
Availability
Protecting the system against interruption
Major Achievements
Confidentiality
Data Integrity
Protection of data from unauthorized modification
Authenticity
Proper verification of identity of users and the validity of messages or data
Major Achievements
S h d li and R t Scheduling d Resource M Management A key task of the OS is to manage the various resources available and to schedule their use by the various by active process. Resource allocation and scheduling policy must R ll ti d h d li li t consider three factors: Fairness
give equal and fair access to all processes
Differential responsiveness
discriminate between different classes of jobs
Major Achievements
Efficiency
Major Achievements
S t System St t Structure Because of its enormous complexity, the OS can be viewed as a series of levels Each level performs a related subset of functions f ti Each level relies on the next lower level to perform more primitive f f i iti functions ti Well defined interfaces: one level can be modified without affecting other levels This decomposes a problem into a number of more manageable sub problems
External devices, such Open close devices Open, close, as printer, displays read, write and keyboards Files Pipes Create, destroy open Create destroy, open, close read, write Create, destroy, open. close, read, read write
9 8
Blocks of data, device Read, write, allocate, free channels Suspend, resume, wait, signal
3 2
Evaluation stack, micro- Load, store, add, subtract program i t interpreter, t branch b h scalar and array data Registers, gates, buses, etc. t Clear, transfer, activate, complement l t
Electronic circuits
Characteristics of Modern OS
New design elements were introduced recently. In response to new hardware development
multiprocessor machines high-speed networks faster processors and larger memory
Characteristics of Modern OS
Changes not only in modification and enhancement to existing architectures but also in new ways of organizing the operating system system. Much of the works fits into:
1. 2. 3. 3 4. 5. 5
Microkernel architecture Multithreading Symmetric multiprocessing Distributed OS Object-oriented design Object oriented design.
Characteristics of Modern OS Mi k l Architecture Microkernel A hit t Only a few essential functions in the kernel
primitive memory management (address space) Interprocess communication (IPC) I t i ti basic scheduling
Other Oth OS services are provided by processes i id d b running in user mode (servers)
device drivers file system virtual memory drivers, system, memory
Characteristics of Modern OS M ltith di Multithreading A process is a collection of one or more threads that can run simultaneously Useful when the application consists of several tasks th t d t k that do not need to be serialized t dt b i li d Gives the programmer a greater control over the timing of application related events application-related All threads within the same process share the same data and resources and a part of the processs execution context
Characteristics of Modern OS M ltith di Multithreading.. It is easier to create or destroy a thread or switch among threads ( f the same process) (of ) than to do these with processes.
Characteristics of Modern OS S t i Multiprocessing i Symmetric M lti Refers to a computer hardware architecture and also to the operating system behavior that reflects that architecture. Standalone computer system with the St d l t t ith th following characteristics:
A computer with multiple processors These processors share the same main memory and I/O facilities, interconnected by a facilities communication bus or other internal connection scheme.
Characteristics of Modern OS Di t ib t d OS Distributed DOS is a collection of independent computers that appears to the users of the system as a single computer. Provides the illusion f P id th ill i of a single main memory i l i and single secondary memory space, i.e. appearing as a single system system. E.g.. Cluster computer.
Characteristics of Modern OS Obj t O i t d D i Object Oriented Design Used for adding modular extensions to a small kernel Enables programmers to customize an operating system without disrupting system ti t ith t di ti t integrity