Operating System Structure - Advanced Operating System - Lecture Slides, Slides of Computer Science

These are the lecture Slides of Advanced Operating System which includes Virtual Memory Performance, Resident Set Management, Allocating Pages, Page Fault Frequency Algorithm, Working Set Strategy, Thrashing, Replacement Policy, Multiprogramming Level etc. Key important points are: Operating System Structure, System Implementation, System Design Goals, System Components, Microkernel System Structure, Unix System Structure, Shell Interface Program, Solaris Modular Approach

Typology: Slides

2012/2013

Uploaded on 03/20/2013

dharmaketu
dharmaketu 🇮🇳

4.6

(165)

99 documents

1 / 12

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
OS Structure
COMP755 1
OSOS
St tSt t
OS
OS
St
ruc
t
ure
St
ruc
t
ure
COMP755 Advanced OS
The OS is a BIG program
The operating system is a large program
df dl
compose
d
o
f
many mo
d
u
l
es.
Writing and updating an OS requires
careful software engineering techniques.
Errors in the OS can cause the whole
system to fail
system
to
fail
.
System Implementation
Once written in assembly language,
operating systems are now written in
higher
level languages
higher
-
level
languages
Code written in a high-level language:
Can be written faster
Is more compact.
Is easier to understand and debug
Is
easier
to
understand
and
debug
An operating system is far easier to port
(move to some other hardware) if it is
written in a high-level language
System Design Goals
User goals operating system should be
conven
en
o use, easy
o
earn, re
a
e,
safe, and fast
System goals operating system should
be easy to design, implement, and
maintain, as well as flexible, reliable, error
-
maintain,
as
well
as
flexible,
reliable,
error
free, and efficient
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Operating System Structure - Advanced Operating System - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

OSOS St

t

St

t

OSOS Structure

Structure

COMP755 Advanced OS

The OS is a BIG

program

  • The operating system is a large program

d

f^

d l

composed of many modules.

  • Writing and updating an OS requires

careful software engineering techniques.

  • Errors in the OS can cause the whole

system to failsystem to fail.

System Implementation

  • Once written in assembly language,

operating systems are now written inhigher level languageshigher-level languages

  • Code written in a high-level language:
    • Can be written faster– Is more compact.– Is easier to understand and debug

Is easier to understand and debug

  • An operating system is far easier to

port

(move to some other hardware) if it iswritten in a high-level language

System Design Goals

•^

User goals

  • operating system should be

i^

t t

t^

l^

li bl

convenient to use, easy to learn, reliable,safe, and fast

-^

System goals

  • operating system should

be easy to design, implement, andmaintain, as well as flexible, reliable, error-maintain, as well as flexible, reliable, errorfree, and efficient

Docsity.com

System Components

  • Process management• Memory management• File management• I/O management• Security manager• Shell

OS kernel

  • The kernel of the OS is that portion

idi

i il

d hi h

i^

it

f^

ti

providing privileged high priority functions.– Dispatcher– Interrupt handling– I/O control– Memory management

Memory management

  • Some parts of the operating system do not

reside in the kernel.

Traditional UNIX System Structure

Microkernel System Structure

  • Moves as much from the kernel into “

user

space

  • Communication takes place between user

modules using message passing

Docsity.com

Shell Features

  • Reads user input and executes programs.• Provides the prompt.• Implements redirection• Implements parallel execution with &• May implement simple commands• Shells may provide a graphical user

interface.

Human Interface

  • The shell is the part of the OS that is most

i^

t^

t t

t

important to most users.

  • Considerable effort has gone into trying to

make the interface intuitive and easy to use

Popular Shells

  • command.com in DOS• C shell in Unix• Korn shell in Unix• Borne shell in Unix• explorer.exe – Windows user interface• Cygwin – Unix shell for Windows

Shell Outline

do forever {

print prompt;read command;if (fork()==0) { // child process

use exec() to load program;

} wait for child process to terminate;

}

Docsity.com

execv

function

**int _execv( const char ***

cmdname

,

**const char ***

argv[ ]

);

g [ ]

where:•^

cmdname

is the name of the program file.

-^

argv

is an array of pointer to strings

containing the parameters. By conventionargv[0] = cmdname; The last argv entry mustbe NULL. The execv function causes the specified

program to overlay the calling program. Thisfunction does not return if successful.

Simple C Program

int main ( int argc,

char

*argv[]

)

{{

...return 5;

}^ The

argv

array passed to the main function when

you start a C programs is the

argv

array passed to

execv

by the shell.

Standard I/O Streams

When a program is started, it has three I/O

t streams open:0 stdin – Standard input, usually keyboard1 stdout – Standard output, usually screen2 stderr – Standard error, usually screen

Redirection

Standard I/O streams can be redirected from

th

d li

the command line

ls

myfile.txt

myprog

usualstuff.txt

cc

nogood.c

allmsg.txt

Docsity.com

Scripts

  • The shell can execute script files to

d

d

f^

th

h ll

produce commands for the shell.

  • Scripts are a program whose output is a

series of commands to the shell.

  • DOS batch files are a simple example of

scriptingscripting.

  • Unix scripts can be much more elaborate.

Utilities

  • An operating system is more than just the

k

l th

tiliti

kernel, there are many utilities.

  • The utilities are just user applications.• Different user interfaces require different

utilities

DOS Commands

attrib

find

set

cd or chdir

format

setver

chkdsk

help

share

cls

join

smartdrive

copy

label

sort

ctty

md or mkdir

sys

defrag

mem

time and date

del or erase

more

tree

del or erase

more

tree

deltree

move

type

dir

rd or rmdir

xcopy

echo

ren

fdisk

scandisk

Unix Commands

at

env

nice

cat

grep

ps

cd

head

rm

chmod

kill

rmdir

chown

lp

sort

cmp

make

tail

compres

man

touch

p

cp

mkdir

uncompress

date

more

who

du

mv

Docsity.com

Windows Utilities

In Windows the user interface is

called the Explorer. It runs in

25%

25%

25%

25%

K

l^

d

. Kernel mode 2. High priority OS3. Low priority OS4. User mode

Kernel

mode

High

priority

OS

Low

priority

OS

User

mode

Process Management

• A

process

is a program in execution

  • A process needs certain resources,

i^

l di

CPU i

fil

d I/O

including CPU time, memory, files, and I/Odevices, to accomplish its task

  • The operating system is responsible for

the following activities in connectionwith process management

p

g

  • creation,

deletion

  • suspension,

resumption

  • synchronization,

communication

Main-Memory Management

-^

Memory

is a large array of words or

bytes, each with its own address

  • RAM is a volatile storage device

It loses

RAM is a volatile storage device. It losesits contents without power.

  • The operating system is responsible for

the following activities in connection withmemory management

Keep track of which parts of memory are

  • Keep track of which parts of memory are

currently being used and by whom

  • Decide which processes to load when

memory space becomes available

  • Allocate and deallocate memory space as

needed

Docsity.com

Priorities

  • The many different parts of the OS may

t diff

t^

i^

iti

run at different priorities– Non-process– High priority– Lower priority– User level

User level

  • The Intel Pentium supports 4 levels of

privilege.

OS Services

  • Program Execution• I/O control• Communications• Error detection• Resource allocation• Protection

Supervisor Calls

  • Supervisor Calls (SVC) are a means of

ki

f^

ti

ll t

OS

i

making a function call to an OS service.

  • The normal function call mechanism will

not work since you have to change to theOS environment.

  • An SVC or INT call generates an interrupt• An SVC or INT call generates an interrupt.

The OS gets control and executes thedesired function.

Virtual Machines

• A

virtual machine

takes the layered

approach to its logical conclusion. It treatshardware and the operating system kernelas though they were all hardware

  • A virtual machine provides an interface

identical

to the underlying bare hardware

The operating s stem creates the ill sion of

  • The operating system creates the illusion of

multiple processes, each executing on itsown processor with its own (virtual)memory

Docsity.com

Virtual Machines (Cont.)

  • The resources of the physical computer

h

d t

t^

th

i t

l^

hi

are shared to create the virtual machines– CPU scheduling can create the appearance

that users have their own processor

  • Spooling and a file system can provide virtual

card readers and virtual line printers

  • A normal user time-sharing terminal serves as

the virtual machine operator’s console

Virtual Machines

Non-virtual Machine

Virtual Machine

Advantages/Disadvantages

of Virtual Machines

  • The virtual-machine concept provides

complete protection of system resourcessince each virtual machine is isolated fromall other virtual machines. This isolation,however, permits no direct sharing ofresources.

Pros / Cons of Virtual Machines

  • A virtual-machine system is a perfect

vehicle for operating-systems research and

p

g

y

development.

  • The virtual machine concept is difficult to

implement due to the effort required toprovide an

exact

duplicate to the underlying

machinemachine

  • The OS on a virtual machine cannot

change the real page tables. Paging issometimes handled completely by the hostOS.

Docsity.com