ch1

33

Upload: rupalidhir

Post on 12-Nov-2014

1.628 views

Category:

Documents


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Ch1
Page 2: Ch1

What Operating Systems Do Computer-System Organization Computer-System Architecture Operating-System Structure Operating-System Operations Process Management Memory Management Storage Management Protection and Security Distributed Systems Special-Purpose Systems Computing Environments

Page 3: Ch1

Make a computer system easier to use:◦ An operating system hides the details of hardware

resources from users and provides them with a convenient interface for using a computer system.

USERSSystem SW & Application SW

OS Hardware

Page 4: Ch1

A program that acts as an intermediary between a user of a computer and the computer hardware.

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.

Page 5: Ch1

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

Page 6: Ch1

OS is a resource allocator◦ Manages all resources◦ Decides between conflicting requests for efficient and

fair resource use OS is a control program

◦ Controls execution of programs to prevent errors and improper use of the computer

Page 7: Ch1

No universally accepted definition “Everything a vendor ships when you order an operating

system” is good approximation◦ But varies wildly

“The one 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

Page 8: Ch1
Page 9: Ch1

bootstrap program is loaded at power-up or reboot◦ Typically stored in ROM or EPROM, generally known as

firmware◦ Initializates all aspects of system◦ Loads operating system kernel and starts execution

Page 10: Ch1

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

Page 11: Ch1

Batch Processing Multitasking Online OS/ Real Time Multiprocessing

Page 12: Ch1

Also known as mainframes Jobs like data processing were carried out in a batch Data was punched in a punch card Job control cards that carried the instructions were also used Utilization of resources was very low

◦ Advantages: Much of the work of the operator is moved to the computer Performance increases since it is possible for job to start as soon as

the previous job finished.

◦ Disadvantages: Turn around time can be large user standpoint More difficult to debug the program A job could enter an infinite loop. Sometime CPU remain Idle

Page 13: Ch1

Operating System

User Process

Unused

User Area

OS Area

Page 14: Ch1

A programmer would first write the program on paper. The programmer or a data entry operator would then punch the program

and its data on cards or paper tape. The programmer would the submit the deck of cards or the paper tape

containing the program and data at the reception counter of computer system.

An Operator would then take the cards deck pr paper tape and load it manually into the system from card reader or paper tape reader. Before loading of the job, the operator had to use the front panel switches of the system to clear any previous data from memory.

The Operator would then set the appropriate switches in the front panel to run the job.

Finally the operator would print and submit the result of execution of the job at the reception counter for the programmer to collect it later.

Page 15: Ch1
Page 16: Ch1

It is interleaved execution of multiple jobs(often referred to as tasks of same user) in a single user system.

Progress of different tasks is viewed on different windows in a multitasking system

Card reader reads one job after another, and stored in the main memory.

The processed output of various jobs are stored in the memory and printed one by one, on the printer.

CPU switches from one task to another while reading or processing the task

Ultimately saves CPU idle Time as well as peripheral Devices Idle Time.

Each user has at least one program executing in memory process.◦ If processes don’t fit in memory, swapping moves them in and out to run◦ Virtual memory allows execution of processes not completely in memory

Page 17: Ch1

USER JOB

Operating System

CPU

Execution in progress

OS AREA

User program Area

•It is interleaved execution of two or more different and independent programs by a computer.

Multiprogramming needed for efficiency•Single user cannot keep CPU and I/O devices busy at all times•Multiprogramming organizes jobs (code and data) so CPU always has one to execute•A subset of total jobs in system is kept in memory•One job selected and run via job scheduling•When it has to wait (for I/O for example), OS switches to another job

Page 18: Ch1

Partition 1

Partition n

User Area Divided into nEqual Sized Partition

OS Area Operating System

Partition 2

Partition 3

Partition 4

.

.

Multiprogramming memory model with fixed number of memory partition

Page 19: Ch1

OS

Free

OS

Free

OS

Free

OS

Free

P1P2P1 P1

P2P3

OS

Free

Free 2

P1

P3

OS

Free

P4P1

P3

OS

Free

Free 3

P3

OS

Free 1

P5

P3

Free 2

P4Free

2Free

2

P4

P1 Enters P2 Enters P3 Enters

P4 Enters P1 Left P5 Enters

Page 20: Ch1

Thread is a lightweight process which helps to improve the application performance.

Each Thread of process has its own program counter, its own register states, and its own stack.

All the threads of a process share same address space, same set of operating system resources , such as files, Devices, and information.

Page 21: Ch1

A process consists of an address space and one or more threads of control.

Address Space Address Space

Thread

T1 T2 T3

Page 22: Ch1

All resources can be accessed 24*7 hours Computer starts process immediately, takes

one or all inputs, and delivers the output instantaneously.

User cannot update or modify the program of these OS.

The main object of real-time operating systems is their quick and predictable response to events.

Page 23: Ch1

Process Management File Management Memory Management IO Subsystem Protection and Security Command Interpretation

Page 24: Ch1

A process is a program in execution. It is a unit of work within the system. Program is a passive entity, process is an active entity.

Process needs resources to accomplish its task◦ CPU, memory, I/O, files◦ Initialization data

Process termination requires reclaim of any reusable resources Single-threaded process has one program counter specifying

location of next instruction to execute◦ Process executes instructions sequentially, one at a time, until

completion Multi-threaded process has one program counter per thread Typically system has many processes, some user, some operating

system running concurrently on one or more CPUs◦ Concurrency by multiplexing the CPUs among the processes /

threads

Page 25: Ch1

The operating system is responsible for the following activities in connection with process management:

Creating and deleting both user and system processes Suspending and resuming processes Providing mechanisms for process synchronization Providing mechanisms for process communication Providing mechanisms for deadlock handling

Page 26: Ch1

Ready

Blocked

Running

Job is allocated to CPU forExecution

Allotted time slice is over

Job must wait for IOCompletion

Job process Complete

New job

IO Completed

Page 27: Ch1

This Module take care of allocation and De-Allocation of memory space to programs in need of particular resource.

All data in memory before and after processing All instructions in memory in order to execute Memory management determines what is in memory when

◦ Optimizing CPU utilization and computer response to users Memory management activities

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

◦ Deciding which processes (or parts thereof) and data to move into and out of memory

◦ Allocating and de-allocating memory space as needed.◦ When the program to be executed is very large to be

accommodate in the memory, the problem of how to execute the program arises, as the program has to be in main memory to get executed. This problem is solved by the “SWAPPING”

Page 28: Ch1

One purpose of OS is to hide peculiarities of hardware devices from the user

I/O subsystem responsible for◦ Memory management of I/O including buffering (storing data

temporarily while it is being transferred), caching (storing parts of data in faster storage for performance), spooling (the overlapping of output of one job with input of other jobs)

◦ General device-driver interface◦ Drivers for specific hardware devices

Page 29: Ch1

Sequential Access File◦ Normally used with sequential access media such as

magnetic tape. Sequential is a process can read the bytes or records in the file in the order in which they are stored, starting at the beginning.

Random Access file◦ Normally used with direct access media such as magnetic

disk or optical disk.◦ Content of random access file can be accessed randomly,

irrespective of the order in which the bytes or records are stored.

Page 30: Ch1

Create Delete Open Close Save Read Write Seek: used with random access file to first position read/write

pointer to specific place in file so that data can be read from, or written to , that position.

Get Attributes Set Attributes Rename Copy

Page 31: Ch1

Security module protects the resources and information of computer system against destruction and unauthorized access.◦ Password◦ File Permissions◦ File Handing

Page 32: Ch1

Protection – any mechanism for controlling access of processes or users to resources defined by the OS

Security – defense of the system against internal and external attacks◦ Huge range, including denial-of-service, worms, viruses, identity

theft, theft of service Systems generally first distinguish among users, to determine who

can do what◦ User identities (user IDs, security IDs) include name and

associated number, one per user◦ User ID then associated with all files, processes of that user to

determine access control◦ Group identifier (group ID) allows set of users to be defined

and controls managed, then also associated with each process, file

◦ Privilege escalation allows user to change to effective ID with more rights

Page 33: Ch1

This module take care of interpreting user commands, and directing system resources to process the commands. With this mode of interaction with a system, users are not much concerned about hardware details of the system.