Вы находитесь на странице: 1из 50

Operating System Structures

System Components

Operating System Services

System Calls

System Programs

System Structures

Virtual Machines

System Design and Implementation

System Generation

Sreedhar Potla 1
System Components

Process Management

Main–Memory Management

File Management

I/O System Management

Secondary Storage / Disk Management

Networking

Protection System

Command Interpreter System

Sreedhar Potla 2
System Components
Process
Program in execution.
Active entity.
Unit work in a system.
Ex: Time-shared user program
Word-processing program
System task
Sending output to printer.
Needs certain resources.
CPU time
Memory
Files
I/O devices
Types
System processes (execute system code).
User processes (execute user code).

Program Counter
Specifies the next instruction to execute.
Sreedhar Potla 3
System Components

Process Management

Activities
       Create and delete both user and system processes.

        Suspend and resume processes.

        Provide mechanisms for process synchronisation.

        Provide mechanisms for process communication.

        Provide mechanisms for deadlock handling.

Sreedhar Potla 4
System Components

Main–Memory Management

Activities
Keep track of which parts of memory are currently being used and
by whom.

Decide which processes are to be loaded into memory when memory


space becomes available.

        Allocate and deallocate memory space as needed.

Sreedhar Potla 5
System Components

File
Collection of related information.

Represents programs and data.

Consists of sequence of bits, bytes, lines or records.

Organised into directories to ease their use.

Types
Free-form (Text files)
Fixed-form

Data files
Numeric
Alphabetic
Alphanumeric
Sreedhar Potla 6
System Components
File Management
One of the most visible components of operating system.
 
Activities
        Create and delete files.

        Create and delete directories.

        Support primitives for manipulating files and directories.

        Map files onto secondary storage.

        Back up files on stable (nonvolatile) storage media.

Sreedhar Potla 7
System Components

I/O System Management


        Memory management components.
Buffering
Caching
spooling

        General device driver interface.

        Drivers for specific hardware devices.

Sreedhar Potla 8
System Components

Secondary Storage / Disk Management

Activities
        Free space management

        Storage allocation

        Disk scheduling

Sreedhar Potla 9
System Components

Networking

Distributed System

Collection of processors
do not share
Memory
Peripheral devices
Clock.

Collects physically separate heterogeneous systems into single


coherent system.

Provides the user with access to various resources system maintains.

Sreedhar Potla 10
System Components

Protection System
Mechanism for controlling access of programs, processes or users to
the resources.

Improve reliability.
 

Command Interpreter System


Interface between user and OS.

Sreedhar Potla 11
Operating System Services
OS provides no. of services.
Lowest level – System calls
Allow running program to make requests from the OS directly.
Higher level – Command interpreter or Shell
User issues request without writing program.
Categories
Program Control
Status requests
I/O requests
Program execution
I/O operations
File system manipulation
Communications
Error detection
Resource allocation
Accounting
Protection
Sreedhar Potla 12
Operating System Services

Program execution
System must be able to
load program into memory.
run that program.

Programs must be able to end its execution, either normally or


abnormally (indicating error).

Sreedhar Potla 13
Operating System Services

I/O operations
OS must provide means to do I/O.

Sreedhar Potla 14
Operating System Services

File system manipulation


Programs need to read and write files.

Programs also need to create and delete files by name.

Sreedhar Potla 15
Operating System Services

Communications
One process needs to exchange information with another process.

Implemented via shared memory or message passing technique.

Message passing
Packets of information moved between processes by OS.

Sreedhar Potla 16
Operating System Services

Error detection
 
Resource allocation
 
Accounting
Record keeping may be used.
 
Protection
Ensures that all access to system resources is controlled.

Sreedhar Potla 17
System Calls

Provide interface between process and OS.

Major categories
Process control
File management
Device management
Information maintenance
Communications

Sreedhar Potla 18
System Calls

Process control
        End, abort

        Load, execute

        Create process, terminate process

        Get process attributes, set process attributes

        Wait for time

        Wait event, signal event

        Allocate and free memory

Sreedhar Potla 19
System Calls

File management
        Create file, delete file

        Open, close

        Read, write, reposition

        Get file attributes, set file attributes

Sreedhar Potla 20
System Calls

Device management
        Request device, release device

        Read, write, reposition

        Get device attributes, set device attributes

        Logically attach or detach devices

Sreedhar Potla 21
System Calls

Information maintenance
        Get time or date, set time or date

        Get system data, set system data

        Get process, file, or device attributes

        Set process, file, or device attributes

Sreedhar Potla 22
System Calls

Communications
        Create, delete communication connection

        Send, receive messages

        Transfer status information

        Attach or detach remote devices

Sreedhar Potla 23
System Programs

Provide convenient environment for program development and execution.

Categories
File management
Status information
File modification
Programming language support
Program loading and execution
Communications

Sreedhar Potla 24
System Programs

File management
Create
Delete
Copy
Rename
Print
Dump
List
Manipulate files and directories.

Sreedhar Potla 25
System Programs

Status information
Date
Time
Amount of available memory / disk space
No. of users

Sreedhar Potla 26
System Programs

File modification

Text editors
To create and modify the content of files stored on disk or tape.

Sreedhar Potla 27
System Programs

Programming language support


Compilers

Assemblers

Interpreters

Sreedhar Potla 28
System Programs

Program loading and execution


Absolute loaders

Relocatable loaders

Linkage editors

Overlay loaders

Debugging systems

Sreedhar Potla 29
System Programs

Communications
Provide mechanism for creating virtual connections among
processes, users and different computer systems.

Allow users to
Send messages to one another’s screens.
Browse web pages.
Send electronic mail messages.
Log in remotely.
Transfer files from one machine to another.

Sreedhar Potla 30
System Structures

Partition the task into small components.

Types
Simple Structure
Layered Approach
Microkernels

Sreedhar Potla 31
System Structures
MS-DOS Layer Structure

Sreedhar Potla 32
System Structures
UNIX System Structure

Sreedhar Potla 33
System Structures

Layered Approach
Operating system broken up into no. of layers (levels).

Each built on lower layers.


Bottom layer (layer 0) Hardware
Highest layer (layer N) User interface

Main advantage
Modularity

Simplified design and implementation of the system.

Each layer is implemented only by the lower layer operations.

Sreedhar Potla 34
System Structures
Layered Approach

Operating System Layer


Sreedhar Potla 35
System Structures

Microkernel approach
Structures OS by removing all nonessential components from the
kernel.
Implements nonessential components as system-level and user-level
programs.
Typically provides minimal process and memory management.
Main function
Provides communication facility (message passing) between
the client program and the various services running in user
space.
Benefits
Ease of extending OS.
Provides more security and reliability.
Examples
Tru64 UNIX
QNX (RTOS)

Sreedhar Potla 36
Virtual Machines

Provides interface.

Each process is provided with (virtual) copy of the underlying computer.

Major difficulty
Cannot allocate disk drive to each virtual machine.

Provides virtual disks (minidisks).

Sreedhar Potla 37
Virtual Machines

Sreedhar Potla 38
Virtual Machines

Implementation
Difficult to implement.

Modes
Virtual user mode.
Virtual monitor mode.

Sreedhar Potla 39
Virtual Machines

Benefits
Provides robust level of security.

Allows system development.

Each virtual machine is completely isolated from all other virtual


machines.

Sreedhar Potla 40
Virtual Machines

Java
Very popular object oriented language.

Introduced by Sun Microsystems in late 1995.

Provides specification for Java Virtual Machine (JVM).

Sreedhar Potla 41
Virtual Machines
Java Virtual Machine (JVM)

Automatically manages memory by performing garbage collection.

Its design provides


Secure
Efficient
Object oriented
Portable
Architecture-neutral platform.

Sreedhar Potla 42
Virtual Machines
Java Virtual Machine (JVM)

Sreedhar Potla 43
Virtual Machines

Java Virtual Machine (JVM)


Consists of
Class loader
Class verifier
Java interpreter
 
Class loader
Loads .class files.
 
Class verifier
Checks
the class file is valid Java bytecode.
Does not overflow or underflow the stack.

Also ensures that the bytecode does not perform pointer arithmetic.

Sreedhar Potla 44
Virtual Machines

Java Virtual Machine (JVM)

Java interpreter
Interprets bytecodes one at a time.
Just-in-time (JIT) compiler.
 

Just-in-time (JIT) compiler


Turns the architecture neutral bytecodes into native machine
language for the host computer

Sreedhar Potla 45
System Design and Implementation

Design Goals

Mechanisms and Policies

Implementation

Sreedhar Potla 46
System Design and Implementation
Design Goals
Define the goals and specifications of the system.
User goals
System should be
convenient and easy to use
easy to learn
reliable
safe
fast.
System goals
OS should be
Easy to design
Implement
Maintain
Flexible
Reliable
Error free
Efficient.
Sreedhar Potla 47
System Design and Implementation

Mechanisms and Policies

Mechanisms
Determine how to do something.
Ex: Timer construct (Mechanism for ensuring CPU protection)

Policies
Determine what will be done.
Ex: How long the time is to be set for a particular user?

Sreedhar Potla 48
System Design and Implementation

Implementation
Master Control Program (MCP)
Burroughs Computers.
Written in variant of ALGOL.

MULTiplex Information and Computing Service (MULTICS)


Developed at MIT.
Written in PL/1.

Primos
Prime computers.
Written in dialect of FORTRAN.

UNIX, OS/2, Windows NT


Mainly written in C.

Sreedhar Potla 49
System Generation (SYSGEN)

obtains information concerning the specific configuration of the


hardware system.

Sreedhar Potla 50

Вам также может понравиться