Anda di halaman 1dari 20

MSP133: Advanced

Operating System
V Balaji
balajiv211@yahoo.com

Advan

Course Overview
Prerequisites
Syllabus
Reference Materials
Assessments
Additional Work Papers & Publications
Class Policies

Advan

Introduction
Components of a Computer System
What is an Operating System ?
End
User
Programmer

Application
Programs
Utilities

OperatingSystem
Designer

Operating-System
Computer Hardware

Why Do I Need to Know This?


Ubiquitous: Most big computers and much of the

Internet infrastructure runs on some variant of Unix


(SUN, SGI, HP, etc.).
Linux is the fastest growing operating system in the

market.
Source code availability provides the ability to get

under the hood of operating system design and


function (and TCP/IP).
By understanding the Unix/Linux community and its

culture, you will be able to collect critical information.


Advan

One of Bell Laboratories people involved in

the project was Ken Thompson.


He liked the potential MULTICS had, but felt it

was too complex and that the same thing could


be done in simpler way.
IN 1969 he wrote first version of UNIX called as UNIC.

UNICS stood for UNI-PLEXED operating system and


eventually shortened to UNIX

Development of Unix
Inception in 1969 used in Universities
January 1983 System V
Variants : System V, BSD, etc.
Commercial Versions : Solaris, HP Unix, SCO

unix,
Open Source Edition : Linux with GUI

Advan

Unix is popular because,


Written in a high level language
Simpler User Interface
Provides primitives to build complex programs from simple

programs
Uses hierarchical file system easy to maintain and

efficient to implement
Uses a consistent format for files a Byte stream
Simple and Consistent interface to peripherals
Multi-user, Multi-processing, Multi-threading system
Hides machine architecture from the user
Advan

Features of Unix
1. Multi-user system : Multi-user capability of UNIX

allows several users to use the same computer to


perform their tasks
2. Multi-tasking : Multitasking is the capability of the

operating system to perform various task


simultaneously, i.e. a user can run multiple tasks
concurrently
3. Programming Facility : UNIX is highly

programmable, the UNIX shell has all the necessary


ingredients like conditional and control structures, etc.
Advan

Features of Unix
4. Security : UNIX allows sharing of data;

every user must have a single login name


and password. So, accessing another users
data is impossible without his permission
5. Portability : UNIX is portable because it is

written in a high level language. So, UNIX


can be run on different computers.

Advan

System Structure
System

Calls
Command

s
64 system

calls in
System V

Advan

10
1

Structure of a regular file inode way


Use of direct blocks
Levels of Indirect blocks
Byte capacity of a file (block size is 1K)

Advan

11
1
1

Block layout of a sample file


1. Calculate the

block number
to access
byte offset
9000
2. Calculate the

block number
to access
byte offset
350,000
Advan

.bmap

12
1
2

Directories
A file whose data is a sequence of entries

containing
Inode number
Name of the file
Unix System V restricts file name to 14

characters why?

Advan

13
1
3

Directories
Access permission on directories
r process can read the directory
w process can create files and sub

directories and delete the existing ones


x process can search for a file name

Advan

14
1
4

Conversion of a path name to an inode


iget :
Allocation of
incore inode

Advan

15
1
5

Super Block
Consists of

Size of the file system

Number of free blocks

A list of free blocks available on the file system

Index of the next free block

Size of the inode list

Number of free inodes

A list of free inodes

The index of the next free inode in the free inode list

Lock fields for the free block and free inode lists

A flag indicating that the super block is modified


Advan

16
1
6

When a new file is created


1. New block(s) to be allotted (disk)
2. New inode to be assigned (disk) in

consultation with the Super Block


3. Super block to be updated
.Cases:
1. Super block has free inodes
2. Super block does not have a free inode
3. Race conditions
17
1
7

Algorithm for
assigning a
new inode

1
8

Super Block updates


This is the structure of a Super Block (free

inode list)

1
9

Algorithm for
allocating a
disk block

2
0

Anda mungkin juga menyukai