w eek t hree o perating s ystem s tructure. t opics to be discussed system components operating...

29
WEEK THREE OPERATING SYSTEM STRUCTURE

Upload: whitney-jemima-price

Post on 25-Dec-2015

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

WEEK THREEOPERATING SYSTEM STRUCTURE

Page 2: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

TOPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System Calls Types of System Calls System Programs Operating System Design and Implementation Operating System Structure System Calls Virtual Machines Operating System Debugging Operating System Generation System Boot

Page 3: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

OBJECTIVES To understand different components of an

operating system To describe services an operating system

provides to users, processes and other systems To discuss various ways of structuring an

operating system To explain how operating systems are installed,

customized and how they boot

Page 4: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

DIFFERENT COMPONENTS OF AN OPERATING SYSTEM

Process Management Main-Memory Management File Management I/O System Management Secondary-Storage Management Networking Protection System Command-Interpreter System

Page 5: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

OPERATING SYSTEM COMPONENTS Processes Management

Process can be thought as program in execution A program by itself is not a process, it is a passive entry e.g.

contents of a file stored on a disk A process is an active entity, with a program counter that

specifies which instruction to execute next CPU executes one instruction at a given time, even two

processes may be associated with one program but at no time they should be considered as two separate executable sequences

Execution is a sequential A process requires certain resources such as CPU time,

memory, files, I/O Resources can be given at the time of creation or allocated

when it is running A process is a unit of work in a system. Thus a system is a

collection of processes, some of which are operating-system processes ( those which execute system code) and the rest are user processes (those that execute user code)

Page 6: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

PROCESS MANAGEMENT Operating system is responsible for the

following activities with respect to process management

Creating and deleting both user and system processes

Suspending and resuming processes Providing mechanisms for process

synchronizations Mechanisms for process communication Mechanisms for deadlock handling

Page 7: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

MAIN-MEMORY MANAGEMENT Main memory is a storage area of quickly accessible data by the CPU

and I/O devices The CPU reads instructions form main memory in instruction-fetch

style, and it both reads and writes data from main memory during the data-fetch style

For a program to execute, it must be mapped to absolute addresses and loaded into memory. As the program executes, it accesses program instructions and addresses from memory by these addresses. When a program terminates, its memory space is declared available and the next program can be loaded and executed.

In order to increase CPU utilization and better user response, , we must keep several programs in memory.

There are different techniques for better memory-management such as hardware design of the system

o The operating system is responsible for the following activities with regards to main-memory management

o Keeping track of which parts of memory are being used and by whom

o Deciding which processes are to be loaded into memory when it becomes available

o Allocating and deallocating memory space as needed

Page 8: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

FILE MANAGEMENT The most visible part of an operating system As we discussed, several types of media available

for storing files depending upon: access speed, data-transfer-rate, capacity, access methods (sequential or random)

Operating system creates an abstract logical view of the data stored on physical media

With regards to file management, the operating system is responsible for following activities:

Creating and deleting files Creating and deleting directories (folders) Provides support for manipulating files and

directories Mapping files onto to physical media Backing up files on stable (non volatile) media

Page 9: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

I/O SYSTEM MANAGEMENT One of the purpose of an operating system is

to hide the peculiarities of I/O from user The I/O subsystems help us to achieve that.

Common subsystems are A memory-management component that

includes buffering, caching and spooling A General device driver interface Drivers for specific hardware devices

Only the device driver knows all peculiarities about a particular hardware

Page 10: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

SECONDARY STORAGE MANAGEMENT Proper management of the disk storage is of

central important to working of a computer system.

Operating system is responsible for the following activities:

Free space management Storage allocation Disk scheduling

Disk storage must be handled efficiently

Page 11: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

NETWORKING A distributed system is a collection of processors

that don’t share memory, peripheral devices or clock.

Many processors are connected together with communication networks. The communication network design must consider: message routing, connection strategies and other problems relating to connectivity and security

Networks provide access to shared resources. Access to a shared resource allows computation speedup, increased functionality, increased data availability, enhanced reliability and low costs

Operating system usually generalize network access as a form of file access, with the details of networking being connected in the network interface’s device driver

Page 12: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

PROTECTION SYSTEM In an environment where multi-user and

concurrent execution of processes is permitted, it is quite obvious that various processes must be protected from one another’s activities

Mechanisms need to ensure that files, memory segments, CPU and other sources cane only be operated by only those processes which are authorized by an operating system

Protection is a mechanism to control that access of programs, processes or users to the resources by a defined computer system

An un-protected resource cannot defend against use or misuse by an unauthorized or incompetent user

Page 13: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

COMMAND-INTERPRETER SYSTEMS An interface between a user and the operating

system Many commands to the operating system are

given by control statements A program that reads and interprets these

commands is called command-line interpreter and is often known as shell

Page 14: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

USER INTERFACE Operating system provides as environment for execution of

programs and services to programs and users One set of operating-system provides functions which are

helpful to users: User Interface – Almost all operating systems have user

interface (UI) Varies between command line (CLI), Graphics User

Interface (GUI), Batch Program Execution – The system must be able to load

program into memory and to run that program, end execution i.e. either normally or abnormally (indicating error)

I/O Operations – A running program may require an I/O which may involve a file or I/O device

File –system Manipulation – The file system is of particular interest. Programs needs to read and write files and directories, create and delete them, search them, list file information, protect them

Page 15: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

USER OPERATING SYSTEM INTERFACE - GUI

User-friendly desktop metaphor interface Usually, mouse, keyboard and monitor Icons represents files, programs and actions Various mouse buttons over objects in the

interface cause different actions (provide information, options, executes function, open directory also known as folder)

Invented at Xerox PARC Many systems now both include CLI and GUI

Microsoft Windows is GUI with CLI “command” shell

Apple Mac OS X as “Aqua” GUI interface with Unix kernel underneath and shells available

Solaris is CLI with optional GUI (Java Desktop, KDE)

Page 16: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

USER OPERATING SYSTEM INTERFACE - CLI

Command Line Interface (CLI) of Command Interpreter allows direct command entry

Sometimes implemented in kernel, sometimes by system program

Sometimes multiple flavors implemented –shells

Primarily fetches a command from user and executes it

Sometimes commands built-in, sometimes just names of programs

If the later, adding new features does not require shell modification

Page 17: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

OPERATING SYSTEM

What is an operating system?And what are its

goals?

Page 18: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

OPERATING SYSTEM

Controller for the execution of programs with efficient utilization of resources for timely services to the users

A concept of kernel and application programs An intermediary program between a user of a

computer and the computer hardware Uses the computer hardware efficiently

Page 19: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

OPERATING SYSTEM GOALS

Execute user programs and solve user problems easily through proper coordination and synchronization

Make the computer system convenient to use Efficient operation of the computer system

components Optimal use of computer resources Ability to evolve through hardware upgrades,

new services and fixing of problems

Page 20: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

TWO VIEWS OF OPERATING SYSTEM

User View – Varies from system being used System View

Resource Allocator CPU Time Memory Space File storage space I/O Devices

Controls Programs Executes user programs Prevents errors and improper use Responsible for operations and control of

I/O devices

Page 21: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

THE EVOLUTION OF OPERATING SYSTEM

Serial Processing Simple batch systems Multi-programmed batch systems Time-sharing systems Personal computer systems Parallel systems Distributed systems Real-time systems

Page 22: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

COMPUTER-SYSTEM OPERATIONS A modern computer consists of a CPU, memory,

system bus and a number of device controllers I/O Devices and the system can execute

concurrently Each device controller is in charge of a particular

device type A device controller for each device which contains

local buffer storage and a special purpose registers A bootstrap program is required to initialize the

computer system CPU moves data from/to main memory to/from local

buffers I/O is from the device to local buffer of controller Device controller informs CPU that it has finished its

operation by causing an interrupt

Page 23: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

COMPUTER-SYSTEM ARCHITECTURE

Page 24: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

INTERRUPTS

What are interrupts?

Page 25: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

COMMON FUNCTIONS OF INTERRUPTS The occurrence of an event is usually signaled by an

interrupt either the hardware or software System call or monitor call is executed to trigger 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

An operating system is interrupt driven and priority interrupts have been introduced in modern systems

Page 26: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

INTERRUPT HANDLING When the CPU is interrupted, it stops what it is doing and

immediately transfers execution to a fix location to execute the interrupt the routine through a table of pointers which is stored in LMA (Low Memory Address)

On completion of execution of service routine, the CPU resumes the interrupted computation

LMA locations hold the addresses of the interrupt service routines (Interrupt Vector i.e. Memory Address of an Interrupt handler) for the various devices

Separate segments of code determine what action should be taken for each type of interrupt

The operating system preserves the state of the CPU by storing registers and the program counter

Determines which type of interrupt has occurred: Polling Vectored interrupt systems

Interrupts are important part of a modern computer system and should be handled immediately

System call is a method used by a process to request action by the operating system

Page 27: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

STORAGE STRUCTURE Registers Cache Main Memory Electronic Disk Magnetic Disk Optical Disk Hard Disk Magnetic Tape

Page 28: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

HARDWARE PROTECTION Dual-Mode Operation I/O Protection Memory Protection CPU Protection

Page 29: W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System

COMPUTER NETWORKS LAN WAN