Os concepts an introduction
This presentation is the property of its rightful owner.
Sponsored Links
1 / 36

OS Concepts An Introduction PowerPoint PPT Presentation


  • 79 Views
  • Uploaded on
  • Presentation posted in: General

OS Concepts An Introduction. operating systems. At the end of this module, you should have a basic understanding of what an operating system is, what it does, and what the major components of an operating system are. What is an Operating System?.

Download Presentation

OS Concepts An Introduction

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Os concepts an introduction

OS ConceptsAn Introduction

operating

systems


Os concepts an introduction

At the end of this module, you should have a

basic understanding of what an operating system

is, what it does, and what the major components

of an operating system are.


What is an operating system

What is an Operating System?


Os concepts an introduction

EDSAC – the world’s first stored program computer,

built at Cambridge University. It ran its first program in 1949.


Os concepts an introduction

Early computers were fantastically expensive ($M) and

were expensive to run and maintain. They were single

user machines. Programmers dealt with the machine

at a very low level. There was limited input and output.

Input

Device

Output

Device

Computer


Os concepts an introduction

This is not so different from your laptop or home

computer. Your computer supports a single user at

a time. Input usually comes from the keyboard and

mouse, and output is usually the display.

Input

Device

Output

Device

Computer


Os concepts an introduction

IBM System Z Mainframe System

Thousands of users, multiple applications and I/O devices


Os concepts an introduction

User

User

User

Application Programs

Language Libraries and System Calls

API

Operating System Kernel

CPU


Os concepts an introduction

personal computer

mainframe system

smart phones

game controllers

tablets

imbedded systems


Os concepts an introduction

This program has no sense of

sharing the system’s resources

with other programs. It sees an

Abstract Machinethat provides

the resources that it needs.

Executing

Program

Application Programs

Language Libraries and System Calls

Operating System Kernel

CPU


The abstract machine

The Abstract Machine

Modern computing systems are multi-user, multi-program

systems. The fundamental task of an operating system

in this environment is to give each running program a

logical, abstract machine that contains all of the

resources that it needs to do its job.

Input/Output devices

Memory

CPU

General purpose registers

Status registers

Stack

Execution

Context


Computer system organization

Computer System Organization


Os concepts an introduction

cpu

memory

system bus

. . .

disk

controller

device

controller

device

controller

printer

keyboard


Os concepts an introduction

Key Concepts

multiple applications

share the cpu

cpu

memory

cpu and devices must be

able to work concurrently

system bus

. . .

disk

controller

device

controller

device

controller

app

app

app

printer

keyboard


Os concepts an introduction

cpu

memory

system bus

. . .

devices are managed

by device controllers

disk

controller

printer

controller

keyboard

controller

app

app

app

they may be anything from a

chip to a plug in board, to a

stand alone unit.

printer

keyboard


Os concepts an introduction

cpu

memory

system bus

disk

controller

each device controller

has a local buffer so it

can work independent

of the cpu

. . .

printer

controller

keyboard

controller

app

app

app

buffer

printer

keyboard


Os concepts an introduction

cpu

memory

system bus

device controllers send

interrupts to the cpu to

tell it that they have

finished an operation

that the cpu told

them to do

disk

controller

. . .

printer

controller

keyboard

controller

app

app

app

buffer

printer

keyboard


Os concepts an introduction

Interrupts

An interrupt causes control to branch to an interrupt

service routine through an interrupt vector.

The address of the interrupted instruction is saved.

Incoming interrupts are disabled while an interrupt

is being processed.

A trap is a software generated interrupt.

An operating system is interrupt driven.


Os concepts an introduction

I/O Processing

requesting process

Asynchronous I/O

…runs…

1. A process starts an I/O operation

2. An acknowledgement is returned

3. The process continues execution

4. The device interrupts the process

when the I/O is complete

device driver

interrupt handler

hardware

data


Os concepts an introduction

I/O Processing

requesting process

Synchronous I/O

waits

1. A process starts an I/O operation

2. The requesting process waits

until the I/O completes

device driver

interrupt handler

hardware

data


Os concepts an introduction

It would be really neat if we

could let another application

run while this one is waiting.

requesting process

Synchronous I/O

waits

1. A process starts an I/O operation

2. The requesting process waits

until the I/O completes

device driver

interrupt handler

hardware

data


Processes

Processes

A process is defined as a program in execution.

It includes

* The program itself (program segment)

* The program’s data (data segment, stack, heap)

* Any open files

* The execution context (registers, status …)


Os concepts an introduction

For efficiency, modern operating systems allow

many processes to be running concurrently.

When one process has to wait for something,

typically for an I/O operation to complete, the

operating systems schedules another process

to run.

Many programs can be in memory at the same

time. The operating system gives each process

a slice of time in which to run.


Threads

A thread, or thread of execution, is the set of instructions

being executed in a process.

In a single thread system each process has exactly

one execution engine (the abstract machine).

In a multi-thread environment, a process may have many

execution engines, one for each thread. Thus, each thread has it’s

own runtime stack, registers, and state information, but they all

share the same address space in memory (program and data),

and the same files.

In new multi-core machines, each logical engine may run on a

real engine.

Threads


Resources

All of the components required for a program to do it’s

job are called resources.

* memory

* cpu time

* devices

* files

* network connection

When a process needs to use a resource, it must ask

the operating system for the resource before using it.

Once a process asks for a resource, it suspends operation

and waits until the resource is available.

Resources


Responsibilities of the os

Responsibilities of the OS

  • Create an abstract machine environment for each

  • running process.

  • 2. Manage the use of the physical components in

  • the system, according to the policies of the system’s

  • administrator or the system designer.

  • * Devices

  • * Processes and threads

  • * Memory

  • * Files


Device management

Device Management

The OS manages the allocation, isolation, and sharing

of devices.

* Terminals

* Disk Drives

* Printers

* Networks

* Keyboard

* etc


Process resource management

Process & Resource Management

Schedules the processor so that each thread/process receives

an equitable fraction of the available time, and maintains

the execution context for each thread (stack, registers, etc)

Allocates resources to processes when they are requested

and keeps track of resources when a thread is finished with

them. Isolates access to resources or allows sharing of

resources as required.


Memory management

Memory Management

Maintains a unique address space in memory for each

process.

Works with the file and/or device managers to provide

virtual memory (address space is larger than physical

memory).


File management

File Management

Works with the device managers to give applications

A logical view of storage (byte stream, indexed data,

text files, etc), and manage the flow of information

between the actual storage device and the program.


Design issues

Performance: The OS must be as efficient as possible,

maximizing the use of machine resources by applications.

There is some overhead involved in providing OS services.

If the overhead gets too large, it negates the value of

the service.

Exclusive Use of Resources: Each process must have the

ability to have exclusive use of the system resources

that it uses. A process must not be able to use a resource

unless the OS has given it permission. Sharing of resources

should also be allowed.

* Protection Mechanisms

* Security Policies

Design Issues


Processor modes

  • Modern computing hardware provides multiple modes of

  • operation:

    • User Mode

    • - Cannot execute all machine instructions (e.g. I/O)

    • - Can only access memory allocated to the process

    • Privileged Mode

    • - Executes any instruction in the repertoire

    • - Can access protected memory

    • - Only executes trusted software (The OS kernel)

Processor Modes


Trap instructions

User Space

User

Process

Kernel(trusted code)

. . .

fork( );

. . .

Trap Instructions

trap table

Library

Code

SYS_FORK

fork( )

{

trap SYS_FORK( )

. . .

}

interrupt

sys_fork( )

{

/* system function */

. . .

return;

}

Going to the kernel is expensive!


Os organization

Monolithic Kernels

* All OS function resides in the kernel

* Fast

* difficult to maintain

MicroKernels

* The trusted OS software is as small as possible

- only the essential OS functions

* All other code is implemented in user space

* Performance the major issue – many kernel calls required

OS Organization


Os concepts an introduction

Monolithic or Microkernel

The first king is very reclusive and sits in a small castle with high

walls and a few top advisors. The king tells the advisors what to do

and they go outside of the small (but well defended) castle and issue

orders to the knights, merchants and common-folk. The king never

leaves his castle and since only his most trusted advisors are allowed

in the king is very safe from attack. However, because each advisor

has to pass through several guard points it can sometimes take a

little while before the king’s orders can go out or news can come in.

The second king is much different. He doesn’t really live in a castle so

much as it is a large mansion with beautiful grounds. Strongly defended

walls encompass the entire city instead of just the castle. This makes

the king and the populace very secure from outside attacks. And since

this king is very friendly he goes throughout his city meeting and talking

with all of his subjects. Any command he, or his many trusted aides,

give are instantly obeyed. This makes his city very efficient. However,

should any enemy agents manage to penetrate the outer walls, then

they can quite easily assassinate the beloved king. In which case

order breaks down and the entire city riots.


The unix kernel

Libraries

Utilities

Apps

Shell

The Unix Kernel

OS System Call Interface

Device Driver

Trap Table

Device Driver

  • Monolithic Kernel Module

  • Process Mgt

  • Memory Mgt

  • File Mgt

  • Device Mgt

Driver Interface


  • Login