Sie sind auf Seite 1von 39

Unit I Fundamentals of OS and System Software

Click to edit Master subtitle style

Mr. Sangram Patil

Sangram Patil

5/22/12

Overview

An operating system (OS) is a set of programs that manage computer hardware resources and provide common services for application software. OS is a program that acts as an intermediary between a user of a computer and the computer hardware. Operating system goals
user programs and make solving user 5/22/12 22

Execute Sangram Patil

Different Types of Operating System

Sangram Patil

5/22/12

33

Four Components of a Computer System

Sangram Patil

5/22/12

44

Detail Layered View of Computer

Sangram Patil

5/22/12

55

A View of Operating System Services

Sangram Patil

5/22/12

66

Types of Operating System

Real-time

aims at executing real-time applications; often use specialized scheduling algorithms Usable by a single user at a time allows multiple users to access a computer system concurrently
5/22/12 77

Single-user

Multi-user

Sangram Patil

Types of Operating System

Single-tasking

Only a single program is allowed to run at a time Allows the execution of multiple tasks at one time

Multi-tasking

Distributed

manages a group of independent computers and makes them appear to be a single Sangram Patil computer 5/22/12 88

Types of Operating System


1.

Batch processing Jobs, together with input data, are fed into the system in a batch. The jobs are then run one after another. No job can be started until previous job is completed

Sangram Patil

5/22/12

99

Types of Operating System


2.

Real time processing


Immediate response is needed. For example


anti-missile defense system airplane landing control system interrupt error in computer system

Sangram Patil

5/22/12

1010

Types of Operating System


3.

Time sharing processing


Each user is given a time slice to interact with the CPU. The size of the time slice will depend on the system. Each user is served in sequence

Sangram Patil

5/22/12

1111

Time sharing processing

Sangram Patil

5/22/12

1212

Source Code or Machine Code

The actual program which runs in a CPU consists of instructions in machine code ; patterns of 0's and 1's stored in words of memory. At last the expectation is - the machine code has to be placed in the right addresses for the dispatch unit of the CPU to run the instructions
5/22/12 1313

Sangram Patil

Assembler

Human programmers find it difficult


to write programs in machine code to understand, to read, to remember

Instead, they may write in assembly language


1414

E.g. INC COUNTER is easier to understand and5/22/12 remember than Sangram Patil

Assembler

Sangram Patil

5/22/12

1515

Compiler

The process of compilation is very complex, but the basic operation resembles that of assembly, with one exception - each line of the program can produce one or more machine code instructions.

Sangram Patil

5/22/12

1616

Most programs are written in a "high level language" such as C, rather than assembler. Programs can be clearer, better structured. It is easy to use pre-written functions, which may be quite complicated. The C compiler, if written carefully, can
5/22/12 1717

Advantages of C

Sangram Patil

Libraries

Programmers choose to let others use the procedures, rather than to give the source code for their programs. These are libraries.

Sangram Patil

5/22/12

1818

Process for producing an executable file

Sangram Patil

5/22/12

1919

Linker

Tool that merges the object files produced by separate compilation or assembly and creates an executable file Three tasks

Searches the program to find library routines used by program, e.g. printf(), math routines,

Determines the memory locations that code from each module will occupy and relocates its instructions by adjusting absolute Sangram Patil 5/22/12 2020

Loader

Part of the OS that brings an executable file residing on disk into memory and starts it running Steps

Read executable files header to determine the size of text and data segments Create a new address space for the program Copies instructions and data into address space Copies arguments passed to the program on the stack
5/22/12 2121

Sangram Patil

Common System Components


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

Sangram Patil

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


5/22/12 of mechanisms for: 2323

Sangram Patil Provision

Main-Memory Management

Memory 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

Main memory is a volatile storage device. It loses its contents in the case of system failure

The operating system is responsible for the following activities in connections with memory management Sangram Patil 5/22/12 2424

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


5/22/12 2525 of primitives for manipulating files

Sangram Patil Support

I/O System Management

The I/O system consists of:


A buffer-caching system A general device-driver interface Drivers for specific hardware devices

Sangram Patil

5/22/12

2626

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 5/22/12 2727

Sangram Patil

Networking (Distributed Systems)

A distributed system is a collection of processors that do not share memory or a clock Each processor has its own local memory The processors in the system are connected through a communication network
2828

Communication takes place using a Sangram Patil 5/22/12 protocol

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
5/22/12 2929

Sangram Patil

Command-Interpreter System

Many commands are given to the operating system by control statements which deal with:

Process creation and management I/O handling Secondary-storage management Main-memory management File-system access Protection
5/22/12 3030

Sangram Patil

Command-Interpreter System

The program that reads and interprets control statements is called variously:

command-line interpreter shell (in UNIX)

Its function is to get and execute the next command statement

Sangram Patil

5/22/12

3131

Operating System Services

Program execution

system capability to load a program into memory and to run it since user programs cannot execute I/O operations directly, the operating system must provide some means to perform I/O

I/O operations

File-system manipulation

program capability to read, write, create, and delete files 5/22/12 Sangram Patil 3232

Operating System Services

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 ensure correct computing by detecting errors in the CPU and memory hardware, in
5/22/12 3333

Error detection

Sangram Patil

Special Features of OS

Multi-tasking Multi-programming Parallel processing Buffering Spooling

Sangram Patil

5/22/12

3434

Multi-tasking

To handle two or more programs at the same time from a single users perception

CPU can only perform one task at a time, however, it runs so fast that two or more jobs seem to execute at the same time

Sangram Patil

5/22/12

3535

Multi-programming

Two or more programs store in the main memory at the same time when one job needs to wait (e.g. I/O operation), CPU switch to another job to execute when the first job finishes waiting, CPU will get back the first job to execute

Sangram Patil

5/22/12

3636

Parallel Processing

use two or more CPUs to handle jobs computer networking

Sangram Patil

5/22/12

3737

Buffering

a temporary storage area (buffers) to read data from input device or send data to the output device keep CPU busy

because I/O operation is slow

Sangram Patil

5/22/12

3838

Spooling

a larger buffer from hard disk buffer store the data through I/O operation

because I/O operation is slow and CPU operation is fast

Sangram Patil

5/22/12

3939

Das könnte Ihnen auch gefallen