You are on page 1of 90

Computer Hardware and System

Software Concepts
Course Objective

To introduce

– fundamentals of Computer Architecture

– concepts of System Software

– concepts of Operating Systems

– concepts of Computer Networks.

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
References

Andrew S. Tanenbaum: Structured Computer Organization , PHI, 3rd


edition, 1991.

Silberschatz and Galvin: Operating System Concepts , 4th edition,


Addison-Wesley Pub, 1995.

Andrew S. Tanenbaum: Computer Networks, PHI, 1991.

Alfred V.Aho, Ravi Sethi, Jeffrey D.Ullman: Compilers -Principles,


Techniques and Tools, Narosa Publishing House, 1986.

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Organization of a simple computer
Central Processing Unit
(CPU) Input/Output devices

Main Memory Hard Disk KeyBoard CD ROM Drive

KeyBoard

BUS (Communication channel)

•Central Processing Unit (CPU)


•Main Memory
•Input / Output devices
•Bus
ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
CPU (Processor)

Brain of the computer

Function

– Fetch instructions from memory

– Examine

– Execute

Consists of 3 functional units

– Control Unit (CU)

– ALU

– Registers

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
CPU – Functional Units
 Fetches Instructions from memory
CPU
 Interprets the instructions
Performs arithmetic operations
Control Unit
Performs Logical operations
Very high speed memory units in the CPU-
for storing very small amount of data.
ALU Examples
•Program Counter (PC)
•Instruction Register (IR)
•Memory Address Register (MAR)
Registers
•Memory Buffer Register (MBR)
•Accumulator (A)

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Memory
MEMORY

Internal Main Cache Secondary

Memory Memory Memory Memory

Internal External
RAM ROM
Cache Cache

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Bus

Parallel wires that carry several bits at a time

Carries instructions, data, addresses or commands

Unidirectional or bi-directional

Major Categories
– Data bus

– Address bus

– Control bus

Bus width and Bus speed are the two major components for performance
measure

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Registers, CPU and the memory
Main Memory

CPU
Special Purpose
Registers

Control Unit Program Counter

MAR

Arithmetic and logic


Unit

Instruction Register

General Purpose
MBR
registers

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Von Neumann architecture
Data & Program, both stored in the same place.
Central Processing
Program Unit (CPU)

Control Unit
Address Bus
d
an Arithmetic Logic
m
gr a ta y Unit (ALU)
o a r
Pr D mo
e Data/Program Bus
M
REGISTERS

Advantages
+it treats data and programs alike meaning the same mechanisms to
fetch data and the programs.
Disadvantage
− same bus used for both program as well the data leads to so
called Von Neumann bottleneck.

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Von Neumann architecture - characteristics

One processor
Use of stored programs
Sequential processing of instructions
Single Instruction, Single Data stream (SISD) mode

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Execution of the Instructions

The execution process of the instruction stored in the memory happens


in three phases.
– Fetch Phase: In this phase the instructions retrieved picked from the
memory.

– Decode Phase: Once the instructions are retrieved these are decoded by
the CU.

– Execute Phase: Once the instructions are decoded, they are executed by
the ALU (in case they are Arithmetic instructions).

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Summary

Basic Computer Architecture

Execution of Instructions

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Session Plan

Introduction to the Concepts of System Software

Introduction to Operating System


– Memory Management

– Process Management

– Information Management

– Device Management

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Software Classification

Software

Application Software System Software

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
System Software

System programs which provide a more convenient environment for program


development and execution

Example
– Compilers

– Assemblers

– Loaders

– Linkers

– Operating System

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Translators

A program which converts a user’s program written in some language to


another language.

The language in which the user’s program is written is called the source
language

The language to which the source language is converted is called the target
language

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Translator

Source Program (High level language) Source Program (Assembly language)

Compiler Assembler

Target Program (Object /Exe code ) Target Program (Machine language )

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Loaders

Are system programs


Loader loads the binary code in the memory ready for execution

Transfer the control to 1st instruction


Responsible for locating program in the main memory every time it is being
executed.

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Various Loading Schemes

Assemble and Go Loader

Absolute Loader

Relocatable Loaders

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Linkers

Large Program

main sort search count

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Linkers

Linking is the process of combining various pieces of code and data


together to form a single executable that can be loaded in memory.

Linking can be done at compile time, and also at run time


 Static Loading and Linking
 Dynamic Loading & Linking

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Compiler

Are system programs that translates an input program in a high level


language into its machine language equivalent

Checks for errors

Optimizes the code

Prepares the code for execution

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Phases in a compiler

Lexical analysis

Syntactic analysis

Semantic analysis

Intermediate code generation

Code optimization

Code generation

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Phases in a compiler

Lexical Analysis
(Scanner /
Tokenizer)

Front End
Syntax Analysis
(Parser)

Semantic
Analysis
Symbol
Error
Table
Intermediate Processing
Manager
Code
Generation

Code Optimization
Back End

Code generation

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Compilation for different machines

High Level
HLL1 HLL2 HLL3 Languages

Compilers

Resultant
1001010 1100111 1001010 1100111 1001010 1100111 Object Code for
111 0001 111 0001 111 0001 Machine M1
and M2
Object Object Object Object Object Object
Code for Code for Code for Code for Code for Code for
M1 M2 M1 M2 M1 M2

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Compiler (Front - End )

Largely dependent on the source language

Independent of the target machine

Comprises the first three phases viz.,


– Lexical Analysis

– Syntactic Analysis

– Semantic Analysis

Sometimes the intermediate code generation phase is also included

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Back-End

Dependent on the target machine

Independent of the source language

Includes the last two phases viz.,


– Code Optimization

– Code Generation

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Interpreter

Interpreter
User (line by line) Result
pgm

D
ata

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Interpreter

Is a systems program that looks at and executes programs on a line-by-line


basis rather than producing object code

Whenever the programs have to be executed repeatedly, the source code has
to be interpreted every time. In contrast the compiled programs create an
object code and this object code will be executed.

entire source code needs to be present in memory during execution as a result


of which the memory space required is more when compared to that of a
compiled code.

Used in test environments as overhead of compilation is not there

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
OPERATING SYSTEMS
Operating systems

A program which acts as an interface between the user and the computer and
provides an environment in which a user can execute programs

Viewed as a Resource Allocator or Resource Manager


– Memory

– Processors

– Information

– Peripherals

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Memory management

Plays an important role as utilization of memory is crucial to the performance of


the system
– Allow as many user jobs as possible to be active

– Respond to changes in memory demand by individual user jobs

– Prevent unauthorized changes to a user job’s memory region

– Implement allocation and addressing as efficiently as possible

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Memory management Schemes

Single Contiguous allocation

Partitioned allocation

Relocatable Partitioned allocation

Simple Paged allocation

Demand Paging

Segmentation

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Single Contiguous Allocation

Memory Memory

OS 20K OS 20K

I am waiting 
20K
User’s Job

User’s Job 50K

Unused 30K New Job Waiting


20K
for CPU time

Case:1 Case:2

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Partitioned Allocation

Fixed Partitioned allocation

Variable Partitioned allocation

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Fixed Partitioned Allocation
Memory Memory Memory

OS OS OS
20K 20K 20K
(20K) (20K) (20K)

Job 1 10K Free 10K Free 10K

Job 2 10K Job 2 10K Job 2 10K

Job 4
(Only 10K used)
Job 3 20K Free 20K 20K
Not Used

Free 10K Free 10K Free 10K

Case:1 Case:2 Case:3

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Variable Partitioned Allocation
Memory Memory

OS OS
(20K) (20K)
I am waiting for
Job 1 Free free memory 
(10K) (10K)
Job 2 Job 2
(10K) (10K)

Job 3 Free
(20K) (20K) New Job
(30K)
Free Job 4
(10K) (10K)

Case:1 Case:2

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
(A) Technologies Ltd (B)
Version No: 2.0
Variable Partitioned allocation

No predetermined partitioning of memory – allocates the exact amount of


memory space needed for each process as and when required

Processes are loaded into consecutive areas until the memory is filled or
remaining space is too small to accommodate a new process.

Disadvantage
– External Fragmentation

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Relocatable Partitioned Allocation

Space wasted due to fragmentation can be used by doing compaction –


running jobs are squeezed together by relocating them and clubbing the rest of
the free space into one large block.

Simple to implement

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Relocatable partitioned allocation
MEMORY MEMORY

OS OS
JOB 2 10 K
FREE 20 K

JOB 2 10 K 60 K
FREE
FREE 30 K

FREE 10 K

After Compaction
ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Simple paged allocation

Divides the jobs address space into pages of the same size(4K)

Divides the main memory address space into blocks/frames(4 K)

Pages are units of memory that are swapped in and out of primary memory

Pages are grouped together for a given user job and are placed in page tables

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Simple paged allocation
Frame 0

Frame 1
2
A-
Page 0
Page 1 Frame 2 B-0
A-
Page 2 1
Job A Page 0
Page 1
Frame 3
Job B

A-

1
B-
0 Free Frame Frame 4

Frame 5

Free Frame Frame 6

Frame 7

Free Frame Frame 8

Memory Space
ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Internal Fragmentation due to simple paging
allocation
Frame 0
-0
A

A-1 Frame 1
Page 0
Page 1 A-2
Job A 17K Page 2
Frame 2
Page 3
Page 4 A-3
Logical Address Pages of Job A
Frame 3
A-
Page size=4K 4
Only 1K used
3K of memory Frame 4
wasted

Memory
ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Demand paging

Illusion of infinite memory available to the user (Virtual Memory)

Job operating under demand paging

A page is brought to the main memory only when there is a demand

Frame 0

-2
A
Page 0
Page 1 0 Frame 1
B -
Page 2
Job A Page 0
Page 1
Frame 2
Job B B-1

Memory Space
ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Demand paging
Page Table
Page number Frame number Modify
Status

OS
JOB 1 1000
2000
2 3 1 0 3000
4000

7000

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Page replacement algorithms

Algorithms based on which the pages are selected for replacement

Examples
– First in First out (FIFO )

– Least Frequently Used (LFU)

– Least Recently Used ( LRU )

– Not Recently Used (NRU )

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Thrashing

Most of the time is being spent in either swapping in or swapping out of the
pages from main memory to secondary memory,instead of doing useful work

This high paging activity when happens frequently is called THRASHING

To overcome thrashing ,system schedules some pages to be removed from


memory in the background (Page Stealing) and continues till a certain level of
page frames are free

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Segmentation

Segment is a grouping of information that is treated as a logical entity

A process is divided into different segments each of its own length for example
one segment can correspond to a single subroutine, a group of closely related
subroutines etc.

Segmentation uses unequal chunks

Chunk size is determined by the programmer

Each individual segment can be protected

Requires two-level translation : Segment tables to page tables and then to


main memory

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Process Management

Functions:
– To keep track of the status of each process

– To suspend and choose some processes based on some criteria

– To coordinate inter process communication

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Some concepts

Processor
– Hardware component that is capable of executing instructions

Process
– An instance of a program in execution

– Is an active entity whereas a program is a passive entity

– Needs certain resources for execution in which a processor is one of them

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Structure of a process

Code Region : Contains the executable instructions of the process

Data Region : Holds the data areas used by the process

Stack Region : Holds the dynamic data such as local data in a


procedure,arguments to a procedure/function etc.

Program Counter (PC): The PC gives the address of the next instruction to be
executed by the process.

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
States of a process

New : Created

Ready : Assign a process to a processor

Run : Instruction execution

Blocked : For an event to occur (Ex: I/O)

Terminated : Finished execution

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Process State Diagram.

Admitted
New
Interrupt
Ready
I/O or Event
Completion Running Exit
IO or Event
Waiting wait(Blocked) Terminated

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Context switching

The task of switching the CPU to another process by saving the state of the old
process and loading the saved state of the new process is known as context
switching

Context switching
– Keeps the CPU busy all the time

– Occurs when any of the following situations is encountered


• An I/O operation is initiated

• An interrupt occurs

• An I/O is completed

• A process terminates

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Some concepts

Uniprogramming

Multiprogramming

Multiprocessing

Multitasking

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Scheduling

Policy to decide which ready process is to be picked up next.

Criteria which lets a particular policy to be chosen are the following:


– CPU Utilization

– Throughput

– Turnaround time

– Waiting time

– Response time

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Scheduling policy

Scheduling policies are of two categories


– Non-Preemptive scheduling

– Preemptive scheduling

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Non-preemptive scheduling

CPU is allocated to a process till the job is over or incurs an I/O wait

Example
– FCFS ( First Come First Serve )

Disadvantage

Monopoly of the process

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Preemptive scheduling

Fixed time slice is specified during which a process gets attention

If the process gets terminated before the time slice then CPU makes a context
switch

Example
– Round Robin

– Shortest Job First(SJF)

– Priority Scheduling

SJF and Priority Scheduling may be either preemptive or non-preemptive.

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Threads

Thread is light weight where as a process is heavy weight.

A thread is a part of the program. But a process is a program itself

In the case of multi threading two parts of the same program can execute
simultaneously

Threads shares the same address space, data section and resources

Different Stack (to hold local data) and PC.

Context switching is easy in the case of threads

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
File Management

Part of the Operating System that deals with effective information


management

Features:
– Minimal I/O operations on files

– Flexibility between logical and physical block size

– Automatic allocation of file space

– Flexible file naming facility such as links, aliases etc

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
File System.

File System is a method of storing and managing the files, which contain data.

This makes it easy to locate and access the data.

Different Operating Systems incorporate different File Systems.

Example.

– MSDOS - file system

– NTFS (New Technology File System)

– Unix File System

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Structure of a Hard disk

SECTOR
TRACK

CYLINDER

PLATTER

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
FAT.

File Allocation Table (FAT) is a file system that was developed for MS-DOS.

It is used in consumer versions of Microsoft Windows up to and including Windows Me.

The purpose of the “File Allocation Table” is to keep track of which areas of the disk are
available and which areas are in use.

FAT 12 was the first version in FAT.

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
How to access the contents of a file?
FAT
0 FFFD

1 FFFF

First Cluster of File A 2 0003

End of File B is cluster 6


3 0004

4 0007

First Cluster of File B 5 0006


End of File A is cluster 7
6 FFFF

7 FFFF
Cluster 8 is free
8 0000

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Volume structure in MS-DOS

Boot-sector : Contains a bootstrap loader and disk characteristics

FAT : Main file allocation table

Additional FAT : used for recovery during the failure of main FAT

Root directory : It is in a fixed position of fixed size

File space : Rest of disk space which is available for files and sub-directories.

Additional
Boot Sector FAT Root Directory File Space
FATs

Volume Structure of a Disk

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
UNIX File system

UNIX has multiple file systems

A file system

– is a formatted partition of the disk

– Is a group of files having relevant information

There is always one compulsory file system known as the root.

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Volume structure in UNIX

Boot block : occupies the beginning of the root file system

Super block : Has the state of the file-its size,where to find the free space on
the file system,how many files it can store etc.

Inode list : It follows the super block-Give the internal representation of the file

Data Block : Contains data.( Size of the blocks can vary from 512 bytes to 4K)

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Volume structure of UNIX

Boot Block Super Block Inode Block Data Block File System 1

Boot Block Super Block Inode Block Data Block File System 2

Boot Block Super Block Inode Block Data Block File System 3

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Inode pointer structure Data Block

Direct 0

Direct 1 Data Block

.
.
. Data Block

Direct 9

Data Block
Single Index Block
Indirect

Double
Indirect
Data Block
Triple Index Block Index Block
Indirect
Array of 13
pointers
Data Block

Index Block Index Block Index Block

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
NTFS.
NTFS stands for New Technology File System.

It was introduced with Windows NT

Can support up to 2 TB in size.

no limitation on file sizes.

Allows encryption of files, which FAT does not allow.

NTFS is more reliable.

Security and access control

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
NTFS

MFT USER FILE SPACE USER FILE SPACE

Copy of first 16
MFT records

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Device management

The part of the operating system that manages to allocate a device to a


requirement or a users job is a device manager.

Functions
– To provide the simplest interface possible to the rest of the system

– To optimize I/O for maximum concurrency

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Interrupt handling

Interrupt
– is a hardware facility that enables a device to notify the CPU.
– causes the CPU to suspend its work, saves the status and jumps to the interrupt
handler routine at a fixed address in memory.
– The interrupt handler routine determines the cause of the interrupt, does the
necessary processing and returns the CPU to the execution state prior to the
interrupt.

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Software Interrupts

Software interrupts are special instructions to implement system calls.

System call is a function that is called by an application to invoke the kernel


service.
– Checks the arguments given by the application

– Builds a data structure to convey the arguments to the kernel

– Executes a special instruction called software interrupt or trap

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Direct Memory Access (DMA)

Direct Memory Access (DMA) is a technique that is used to transfer data


between memory and I/O devices .
– data channels that allow direct transfer of information between devices and memory
without routing those transfers through the CPU are said to be performing DMA

DMA unit (called DMA controller which is like another processor) has access to
the data bus and can transfer the data in and out of the memory.

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Device management (Structure of an I/O System)

Application I/O control Device Device Hardware


Program system driver controller device

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Device management (Allocation Policy)

Allocation Policy is of two kinds


– Dedicated

– Shared

Dedicated – Certain devices can be used in a serial and one-at-a- time


manner. For e.g. printer, tapes etc.
– Disadvantage is that it leads to monopoly.

– Solution is SPOOLing (Simultaneous Peripheral Operations Online)

– Jobs intended to be printed are saved in the disk until the job is completed

– All the saved outputs will be eventually printed

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Device management (Allocation Policy)

Shared
Devices are used concurrently by more than one job

Example
– Disk

Issues
– Readers and writers problem

– Mutual exclusion

– Security rights

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Computer Network
Introduction to Computer Network
Connecting computers via a communication network

work station mini

microprocessor COMMUNICATION
NETWORK general
purpose

Specific
Expensive
purpose (DSP)
Printer

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Complete topology Star topology

SWITCHING
ELEMENT

Ring topology
Linear bus

N nodes

Link
Terminator
ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
OSI Layer model

Deals with the connection and communication among open systems

Has a layered approach which helps in


– Reducing the design complexity of each layer

– Helps in shielding the implementation details of the services offered by each layer

Each layer provides services to the layer above

Different protocols are followed between corresponding layers in Sender and


Receiver

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
OSI Layer model

Application
7 APPLICATION protocol APPLICATION
Presentation
6 PRESENTATION PRESENTATION
protocol
Session SESSION
5 SESSION protocol
Transport TRANSPORT
4 TRANSPORT
protocol
Network NETWORK packet
3 NETWORK
protocol
Datalink frame
2 DATALINK DATALINK
protocol
Physical
1 PHYSICAL PHYSICAL bit
protocol

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Routing devices

Repeaters

Bridges

Routers

Gateway

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Network types

Local Area Network (LAN)

Wide Area Network (WAN)

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Communication methods

Broadcast communication network

Point-to-point network

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Summary

Computer Architecture

System Software

Operating System
– Memory Management

– Process Management

– File Management

– Device Management

Computer Networks

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0
Thank You!

ER/CORP/CRS/OS09/003
Copyright © 2004, Infosys
Technologies Ltd Version No: 2.0

You might also like