58
ITSE 1202 Introduction to Operating Systems IBRI COLLEGE OF TECHNOLOGY 1 Chapter - I Operating System Concepts 1.1 What is an Operating System? An operating system (OS) can be defined as a set of computer programs that acts as an intermediary between a user of a computer and the computer hardware. Operating system goals: Execute user programs and make solving user problems easier. Make the computer system convenient to use. Use the computer hardware in an efficient manner. Four Components of a Computer System Figure 1.1 Computer System Structure Computer system can be divided into four components o Hardware provides basic computing resources CPU, memory, I/O devices o Operating system Controls and coordinates use of hardware among various applications and users.

Operating System - Summer

Embed Size (px)

Citation preview

Page 1: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

1

Chapter - I

Operating System Concepts

11 What is an Operating System

An operating system (OS) can be defined as a set of computer programs that acts as an intermediary

between a user of a computer and the computer hardware

Operating system goals

Execute user programs and make solving user problems easier

Make the computer system convenient to use

Use the computer hardware in an efficient manner

Four Components of a Computer System

Figure 11

Computer System Structure

Computer system can be divided into four components

o Hardware ndash provides basic computing resources

CPU memory IO devices

o Operating system

Controls and coordinates use of hardware among various applications and users

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

2

o System amp application programs ndash define the ways in which the system resources are used to

solve the computing problems of the users

Word processors compilers web browsers database systems video games

o Users

People machines other computers

12 Views of OS OS can be viewed from the perspective of what they are These views are diverse depending on the

particular view point of a user But some of these views are discussed below

Operating system is an Inter-mediator between Hardware and Application programs users

An Operating System is a software program or set of programs that mediate access between physical

devices (such as a keyboard monitor disk drive etc) and application programs (such as a Word Web

browser)

Operating system is a Resource Manager

An operating system (OS) is the software that manages the sharing of the resources of a computer and

provides resources to users for access them The OS directs the processor in the use of the other system

resources and in the timing of its execution of other programs

Operating system is a Master control program

When the computer is turned on a small boot program loads the operating system Although

additional modules may be loaded as needed the main part known as the kernel resides in memory at

all times After this the OS will load other programs as needed

In general OS manages following resources

Process

Memory

Input Output

Secondary Storage

File

Network

The following is the list of different operating systems

UNIX Linux DOSWindows vista Windows XP Windows 2003 MacOS etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

3

Operating systems can have the following property

Multi-user Allows two or more users at the same time

Multiprocessing Supports running a program on more than one CPU

Multitasking Allows more than one program to run concurrently

Multithreading Allows different parts of a single program to run concurrently

Real time Responds to input instantly General-purpose operating systems such as

DOS and UNIX are not real-time

Operating systems provide a software platform (Environment) on top of which other programs called application

programs can run (such as Word Internet Explorer Games) The application programs must be written to run on

top of a particular operating system Our choice of operating system therefore determines to a great extent the

applications we can run For PCs the most popular operating systems are Windows Linux and MacOS

13 Computer System Organization

Computer-system operation

One or more CPUs device controllers connect through common bus providing access to shared

memory

Concurrent execution of CPUs and devices competing for memory cycles

Figure 12

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

4

Computer-System Operation

IO devices and the CPU can execute concurrently

Each device controller is in charge of a particular device type

Each device controller has a local buffer

CPU moves data fromto main memory tofrom local buffers

IO is from the device to local buffer of controller

Device controller informs CPU that it has finished its operation by causing an interrupt (via

system bus)

14 Storage Structure

Main memory ndash Only large storage media that the CPU can access directly

Secondary storage ndash Extension of main memory that provides large nonvolatile storage

capacity

Magnetic disks ndash Rigid metal or glass platters covered with magnetic recording material

Disk surface is logically divided into tracks which are subdivided into sectors

The disk controller determines the logical interaction between the device and the

computer

Storage Hierarchy

Figure 13

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

5

Storage systems organized in hierarchy based on the following parameters

Speed

Cost

Volatility

Caching ndash copying information into faster storage system main memory can be viewed as a last

cache for secondary storage

15 HISTORY (Evolution) OF OPERATING SYSTEMS

The present day operating systems have not been developed overnight Just like any other system

operating systems also have evolved over a period of time starting from the very primitive systems to

the present day complex and versatile ones

151 Simple Batch Systems

Computers in earlier days of their inception were very bulky large machines usually run from a console

IO devices consisted of card readers tape drives and line printers Direct user interaction with the

system did not exist Users made a job consisting of programs data and control information The job

was submitted to an operator who would execute the job on the computer system The output appeared

after minutes hours or sometimes days The user collected the output from the operator which also

included a memory dump The operating system was very simple and its major task was to transfer

control from one job to another

To speed up processing jobs with the same needs were batched together and executed as a group Thus

came into existence batch operating systems

152 Time-sharing System (Multitasking)

Another mode for delivering computing services is provided by time sharing operating systems In this

environment a computer provides computing services to several or many users concurrently on-line Here

the various users are sharing the central processor the memory and other resources of the computer system

in a manner facilitated controlled and monitored by the operating system

The user in this environment has nearly full interaction with the program during its execution and the

computers response time may be expected to be no more than a few second

It allows the user interaction with the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

6

IBM CMS

Figure 14 Block Diagram of a Time-sharing System (Multitasking)

153 Multiprogrammed System

Multiprogramming increase CPU utilization by organizing jobs so that the CPU always has one to execute

The operating system keeps several jobs in memory simultaneously Thus it is evident that a time-sharing

system is a multiprogramming system but note that a multiprogramming system is not necessarily a

time-sharing system

Multiprogramming is a technique to execute number of programs simultaneously by a single

processor

In Multiprogramming number of processes resides in main memory at a time

The OS picks and begins to execute one of the jobs in the main memory

If any IO wait happened in a process then CPU switches from that job to another job

Hence CPU in not idle at any time

Figure 15 depicts the layout of multiprogramming system

The main memory consists of 4 jobs at a time the CPU executes one by one

OS

JOB1

JOB2

JOB3

JOB4

System 1

CPU

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

7

Advantages

bull Efficient memory utilization

bull Throughput increases

bull CPU is never idle so performance increases

154 Multiprocessor System

o System which supports more than one processor

o Processor communicates with each other

o Processors Share the memory and other devices

Advantages

More work in Less Time (Increased Throughput)

Saves money by sharing Devices (Economy of Scale )

Reliability

Figure 16 Block Diagram of a Multiprocessor System

System

Mother Board

CPU 1 CPU2

RAM Share

Memor

y

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

8

155 Distributed System

It is a collection of processors that do not share memory devices and system clock A distributed computing

system consists of a number of computers that are connected and managed so that they automatically share

the job processing load among the constituent computers or separate the job load as appropriate particularly

configured processors

Such a system requires an operating system which in addition to the typical stand- alone functionality

provides coordination of the operations and information flow among the component computers

Example ATM

Figure 17 Block Diagram of a Distributed System

156 Client ndash Server System

It consists of Client system and a Server System The client which can be either another operating

system component or application program requests a service by sending a message to the server An OS

kernel (or microkernel) running in kernel mode delivers the message to the appropriate server the server

performs the operation and microkernel delivers the results to the client in another message

Client requests a service and Server Responds with a Service

Example Email

Figure 18 Block Diagram of a Client ndash Server System

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

9

16 Services of Operating System

Program Execution

The operating system loads the contents (or sections) of a file into memory and begin its execution

I0 Operations

Disks tapes serial lines and other devices must be communicated with at a very low level The user

need only specify the device and the operation to perform on it while the system converts that request

into device or controller specific commands

File-system management

There are many details in file creation deletion allocation and naming that users should not have to

perform Blocks of disk space are used by files and must be tracked Deleting a file requires removing

the name file information and freeing the allocated blocks

Communications

Message passing between systems requires messages be turned into packets of information sent to the

network controller transmitted across a communication medium and reassembled by the destination

system

Error detection

Error detection occurs at both the hardware and software levels At hardware level all data transfers

must be inspected to ensure that data have not been corrupted in transmission At the software level

media must be checked for data consistency for instance do the numbers of allocated and unallocated

blocks of storage match the total number on the device

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

10

17 Operating System terminologies

The Kernel

It is central to the operating system It is the part of the operating system that loads first and it remains

in main memory Because it stays in memory it is important for the kernel to be as small as possible It

provides all the essential services required by other parts of the operating system and applications

Typically the kernel is responsible for memory management process management and disk

management

User Interface

The user interacts with the OS through the user interface

The components of the user interface are

1 The command interpreter

2 The file system

3 On-line help and

4 Application integration

Command Interpreter Shell

Users normally interact with the operating system through a set of commands For example the DOS operating

system contains commands such as COPY and RENAME for copying files and changing the names of files

respectively The commands are accepted and executed by a part of the operating system called the command

processor or command line interpreter In some operating systems the command interpreter is called the

shell

In some Operating systems Graphical user interfaces (GUI) allow us to enter commands by pointing and clicking

at objects that appear on the screen OS like Windows XP MacOS are some example for GUI

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

11

Examples

Below is the list of some DOS operating system commands

1 DIR [note Directory means Folder in windows XP]

This command displays files and folders in the current directory or folder

Most of the DOS commands come with various options They are called switches in DOS

Example with switches DIR AD

Here the switch AD is used with DIR command to display all the sub folders in the current directory

2 CLS ndashThis command clears the screen

Special switch

To know syntax of a particular command with all options type Command name

Example To know about COPY command type

COPY

Commands of UNIX

cp

(Copy -- same as DOS copy)

rm

(Remove [or delete] a file -- same as DOS del)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

12

Chapter ndash II

PROCESS MANAGEMENT-I

21 PROCESS

A program in execution is called process A process is executed sequentially one instruction at a

time A program is a passive entity For example a file on the disk A process on the other hand is an

active entity In addition to program code it includes PCB

PROCESS STATE

As a Process executes it changes state The state of a process is defined in which part by the

current activity of that process

Each process may be in any one of the following states

New Process being created

Running Instructions being executed

Waiting Process waiting for an event to occur

Ready Process waiting for CPU

Terminated Process has finished execution

Process State Transition Diagram Figure 21

The above diagram explains how the process transit to various states in its lifecycle by some events

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

13

22 PROCESS CONTROL BLOCK

A Process Control Block (PCB) also called Task Control Block represents each process in the

operating system

Every process has a process control block (PCB) which represents a process in an operating

system The PCB contains information that makes the process an active entity Following is the list of

information a PCB of a process contains

Process numbers is used to uniquely identify a process

The process state gives the current state of the process It can be either new ready

running waiting or terminated

The program counter contains the address of the next instruction to be executed

The values in the CPU registers are required when the CPU switches from one process

to another for a successful continuation

Memory management information is dependent on the memory system used by the

operating This includes base registers limit registers page tables segment tables and

other related details

IO information gives details about the IO devices allotted to the process the number of

files that are open and in use by the process etc

23 Multi Programming and Process Scheduling

Multiprogramming is a technique used to utilize maximum CPU time by running multiple programs

simultaneously It is achieved by two ways

1 The execution begins with the first process and continues till an instruction waiting for a peripheral is

reached the context of this process is stored and the next process in ready queue (in memory) is given a

chance to execute This will be continued until two or more programs exist in ready queue

2 Process gives up the CPU on expiry of its time slice and rejoins the ready queue This will be

continued until two or more programs exist in ready queue (This is nothing but timesharing)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

14

1

2

Figure 22

Queuing diagram of process scheduling

Scheduler

Scheduler is a part of OS which selects processes from the ready queue for execution by the CPU

Different methods are applied for selecting processes from the ready queue These methods are called

Scheduling Algorithms

Note

Hence it is clear that CPU scheduling is the basis for Multiprogramming operating systems

24 Major Category of CPU Scheduling

Non-preemptive In this scheduling if a process once selected for execution CPU keeps executing

until it is released either by that process for IO or by termination

Preemptive In this scheduling process can be stopped executing and returned to the ready queue to

resume later

25 Scheduling Criteria

Many algorithms exist for CPU scheduling Various criteria have been suggested for comparing

these CPU scheduling algorithms

All the CPU scheduling algorithms include the following criteria

1 CPU utilization Measured in Percentage of time the CPU is busy

2 Throughput Number of processes completed per time unit is throughput

3 Turnaround time The interval of time between submission and completion of a process

is called turnaround time It includes execution time and waiting time

4 Waiting time Sum of all the times spent by a process at different instances waiting in the

ready queue is called waiting time

5 Response time Response time is the difference between time of submission and the time

the first response occurs

Time slice expired

IO request

Ready queue

IO queue

IO

CPU

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

15

Desirable features are having maximum CPU utilization throughput and minimum

turnaround time waiting time and response time

26 SCHEDULING ALGORITHMS

Scheduling algorithms differ in the manner in which the CPU selects a process in the ready

queue for execution

261 FIRST COME FIRST SERVE (FCFS) SCHEDULING ALGORITHM

A process that requests for the CPU first is allocated the CPU first Hence the name first come first serve

The implementation of the FCFS policy is easily managed with a FIFO queue When a process enters the

ready queue its PCB is linked onto the tail of the queue When the CPU is free it is allocated to the process

at the head of the queue The running process is the removed from the queue Even though the algorithm is

simple the average waiting is often quite long

Consider a set of three processes P1 P2 and P3 arriving at time instant 0 and having CPU burst times as

shown below

Process Burst time (msecs)

P1 24

P2 3

P3 3

The Gantt chart below shows the result

0 24 27 30

Figure 23 Gantt chart for above example

Average waiting time and average turnaround time are calculated as follows

The waiting time for process P1 = 0 msecs

P2 = 24 msecs

P3 = 27 msecs

Average waiting time = (0 + 24 + 27) 3 = 51 3 = 17 msecs

P1 completes at the end of 24 msecs P2 at the end of 27 msecs and P3 at the end of 30 msecs Average

turnaround time = (24 + 27 + 30) 3 = 81 3 = 27 msecs

Since the algorithm is nonpreemptive in nature it is not suited for time sharing systems

P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

16

262 SHORTEST JOB FIRST (SJF) SCHEDULING ALGORITHM

Another approach to CPU scheduling is the shortest job first algorithm In this algorithm the length of

the CPU burst is considered When the CPU is available it is assigned to the process that has the

smallest next CPU burst Hence the name shortest job first If the next CPU bursts of two processes are

the same FCFS scheduling is used to break the tie As an example consider the following set of

processes P1 P2 P3 P4 and their CPU burst times

Process Burst time (msecs)

P1 6

P2 8

P3 7

P4 3

Using SJF algorithm the processes would be scheduled as shown below

0 3 9 16 24

Figure 24 Gantt chart for above example

Average waiting time = (0 + 3 + 9 + 16) 4 = 28 4 = 7 msecs

Average turnaround time = (3 + 9 + 16 + 24) 4 = 52 4 = 13 msecs

If the above processes were scheduled using FCFS algorithm then

Average waiting time = (0 + 6 + 14 + 21) 4 = 41 4 = 1025 msecs

Average turnaround time = (6 + 14 + 21 + 24) 4 = 65 4 = 1625 msecs

It is clear that the SJF algorithm produces the most optimal scheduling scheme For a given set of

processes the algorithm gives the minimum average waiting and turnaround times This is because

shorter processes are scheduled earlier than longer ones and hence waiting time for shorter processes

decreases and it increases the waiting time of long processes SJF algorithm could be either preemptive

or nonpreemptive

The main disadvantage with the SJF algorithm lies in knowing the length of the next CPU burst SJF

algorithm is therefore not applicable in CPU scheduling

P4 P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

17

263 Priority Scheduling A priority is associated with each process and the CPU is allocated to the process with the highest

priority Equal-priority processes are scheduled in FCFS

An SJF algorithm is therefore simply a priority algorithm where the priority is the inverse of the

(predicted) next CPU burst The larger the CPU burst the lower the priority and vice versa

Priority is expressed in terms of fixed range number such as 0 to 10 Some systems use low numbers to

represent low priority while others use low numbers for high priority But in this course we will use low

numbers to represent high priority

Consider the following set of processes assumed to have arrived at time 0 in the order P1 P2 P5

with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 3

P2 1 1

P3 2 4

P4 1 5

P5 5 2

Using priority scheduling we would schedule these processes according to the Gantt chart below

0 1 6 16 18 19

Figure 25 Gantt chart for above example

Average waiting time = (0 + 1 + 6 + 16+18) 5 = 41 5 = 82 msecs

Average turnaround time = (1 +6 + 16 + 18+19) 5 = 60 5 = 12 msecs

Priorities can be defined either internally or externally Internally defined priorities use measurable

quantity such as time limits memory requirements etc to compute the priority of a process

External priorities are set by criteria that are external to the operating system such as importance of the

process amount being paid for use of the compute the owner of the process and other (political)

factors

Priority scheduling may be either preemptive or nonpreemptive When a process arrives at the ready

queue its priority is compared with that of the currently running process A preemptive priority-

scheduling algorithm will preempt the CPU if the priority of the newly arrived process is higher than

P2 P5 P1 P3 P4

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

18

that of the currently running process A nonpreemptive priority-scheduling algorithm will simply put the

new process at the head of the ready queue

The major disadvantage of priority-scheduling algorithms is indefinite blocking or starvation A

situation whereby low priority processes indefinitely wait for the CPU because of a steady stream of

higher- priority processes

A solution to indefinite blocking of low-priority processes is aging Aging is a technique of gradually

increasing the priority of processes that wait in the system for a long time

264 ROUND ROBIN (RR) SCHEDULING ALGORITHM

The round-robin CPU scheduling algorithm is basically a preemptive scheduling algorithm designed for

time-sharing systems One unit of time is called a time slice Duration of a time slice may range between

10 msecs and about 100 msecs The CPU scheduler allocates to each process in the ready queue one

time slice at a time in a round-robin fashion Hence the name round-robin

Consider the same example explained under FCFS algorithm

Process Burst time (msecs)

A 13

B 3

C 3

D 5

Let the duration of a time slice be 4 msecs which is to say CPU switches between processes every 4

msecs in a round-robin fashion The Gantt chart below shows the scheduling of processes

0 4 7 10 14 18 19 23 24

Figure 25 Gantt chart for above example

Average waiting time = [(19 ndash 8) + 4 + 7+ (18 - 4)] 3 = 36 4 = 9 msecs

The performance of the RR algorithm is very much dependent on the length of the time slice If the

duration of the time slice is indefinitely large then the RR algorithm is the same as FCFS algorithm If

the time slice is too small then the performance of the algorithm deteriorates because of the effect of

frequent context switching

A B C D A D A A

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

19

Exercise

Consider the following set of processes with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 2

P2 4 3

P3 2 1

P4 6 4 P5 5 5

The processes are assumed to have arrived in the order P1 P2 P3 P4 and P5 all at time 0

a Draw four Gantt charts illustrating the execution of these processes using FCFS SJF a

nonpreemptive priority (a smaller priority number implies a higher priority)and RR (Quantum = 1) scheduling

b What is the turnaround time of each process for each of the scheduling algorithms in (a) above

c What is the waiting time of each process for each of the scheduling algorithms in (a)

d Which of the schedules in (a) results in the minimal average waiting time (over all processes)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

20

Chapter ndash III

PROCESS MANAGEMENT-II

31 Deadlock

A process request resources and if the resources are not available at that time the process enters a waiting

state A waiting process is never again able to change state because other waiting processes hold the

resources This situation is called a deadlock

Example

ndash System has two tape drives R1 and R2 and two process P1 and P2

ndash P1 holds R1 but demand R2

ndash P2 holds R2 but demand R1

System Model

bull Resource types R1 R2 hellipRm (CPU cycles memory space IO devices)

bull Each resource type Ri has Wi instances(More than One Instances)

bull Each process utilizes a resource as follows

Request

Use

Release

32 Deadlock Characterization

Deadlock can arise if four conditions hold simultaneously

bull Mutual exclusion

At least one resource must be held in a non-sharable mode ie only one process at a time can use the

resource If another process requests that resource the requesting process must be delayed until the resource

has been released

bull Hold and wait a process holding at least one resource is waiting to acquire additional resources held

by other processes

bull No preemption a resource can be released only voluntarily by the process holding it after that

process has completed its task

bull Circular wait there exists a set P0 P1 hellip P0 of waiting processes such that P0 is waiting for a

resource that is held by P1 P1 is waiting for a resource that is held by P2 hellip Pnndash1 is waiting for a

resource that is held by Pn and P0 is waiting for a resource that is held by P0

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

21

33 Methods for Handling Deadlocks

bull Ensure that the system will never enter a deadlock state

bull Allow the system to enter a deadlock state and then recover

bull Ignore the problem and pretend that deadlocks never occur in the system used by most operating

systems including UNIX

331 Deadlock Prevention

As you have seen Deadlock Characterization for a deadlock to occur each of the four necessary

conditions must hold By ensuring that at least one of the four necessary conditions cannot hold you can

prevent the occurrence of a deadlock

Mutual Exclusion

The mutual exclusion condition must hold for non-sharable resources For instance a printer cannot be

simultaneously shared by several processes Sharable resources do not require mutually exclusive

access and thus cannot be involved in a deadlock

In general however we cannot prevent deadlocks by denying the mutual-exclusion condition Some

resources are intrinsically non-sharable

Hold and Wait

To ensure that the hold-and-wait condition never occurs in the system we must guarantee that whenever a

process requests a resource it does not hold any other resources We can implement this the following

protocol

One protocol that can be used requires each process to request and be allocated all resources before it begins

execution

An alternative protocol allows a process to request resources only when the process has none A process

may request some resources and use them Before it can request any additional resources however it must

release all the resources that it is currently allocated

No Preemption

ndash If a process that is holding some resources requests another resource that cannot be immediately

allocated to it then all resources currently being held are released

ndash Preempted resources are added to the list of resources for which the process is waiting

ndash Process will be restarted only when it can regain its old resources as well as the new ones that it

is requesting

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

22

Circular Wait

Impose a total ordering of all resource types and require that each process requests resources in an

increasing order of enumeration

332 Deadlock Avoidance

bull Simplest and most useful model requires that each process declare the maximum number of resources

of each type that it may need

bull The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that

there can never be a circular-wait condition

bull Resource-allocation state is defined by the number of available and allocated resources and the

maximum demands of the processes

Safe State

bull When a process requests an available resource system must decide if immediate allocation leaves the

system in a safe state

bull System is in safe state if there exists a safe sequence of all processes

bull Sequence ltP1 P2 hellip Pngt is safe if for each Pi the resources that Pi can still request can be satisfied

by currently available resources + resources held by all the Pj with jltI

If Pi resource needs are not immediately available then Pi can wait until all Pj have finished

When Pj is finished Pi can obtain needed resources execute return allocated resources and terminate

When Pi terminates Pi+1 can obtain its needed resources and so on

Basic Facts

bull If a system is in safe state no deadlocks

bull If a system is in unsafe state possibility of deadlock

bull Avoidance ensures that a system will never enter an unsafe state

Resource-Allocation Graph Algorithm (Single Instance of Each Resource Type)

Claim edge Pi rarr Rj indicated that process Pj may request resource Rj represented by a dashed

line

Claim edge converts to request edge when a process requests a resource

When a process releases a resource assignment edge reconverts to a claim edge

Resources must be claimed a priori in the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

23

Resource-Allocation Graph for Deadlock Avoidance Unsafe State in a Resource-Allocation Graph

Figure 31

Bankerrsquos Algorithm (Several Instance of Each Resource Type)

bull Multiple instances

bull Each process must a priori claim maximum use

bull When a process requests a resource it may have to wait

bull When a process gets all its resources it must return them in a finite amount of time

Data Structures for the Bankerrsquos Algorithm

bull Available Vector of length m If available [j] = k there are k instances of resource type Rj available

bull Max n x m matrix If Max [ij] = k then process Pi may request at most k instances of resource type Rj

bull Allocation n x m matrix If Allocation[ij] = k then Pi is currently allocated k instances of Rj

bull Need n x m matrix If Need[ij] = k then Pi may need k more instances of Rj to complete its task

Need [ij] = Max[ij] ndash Allocation [ij]

Let n = number of processes

333 Deadlock Detection

bull Allow system to enter deadlock state

bull Detection algorithm

bull Recovery scheme

Single Instance of Each Resource Type

bull Maintain wait-for graph

ndash Nodes are processes

ndash Pi rarr Pj if Pi is waiting for Pj

bull Periodically invoke an algorithm that searches for a cycle in the graph

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 2: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

2

o System amp application programs ndash define the ways in which the system resources are used to

solve the computing problems of the users

Word processors compilers web browsers database systems video games

o Users

People machines other computers

12 Views of OS OS can be viewed from the perspective of what they are These views are diverse depending on the

particular view point of a user But some of these views are discussed below

Operating system is an Inter-mediator between Hardware and Application programs users

An Operating System is a software program or set of programs that mediate access between physical

devices (such as a keyboard monitor disk drive etc) and application programs (such as a Word Web

browser)

Operating system is a Resource Manager

An operating system (OS) is the software that manages the sharing of the resources of a computer and

provides resources to users for access them The OS directs the processor in the use of the other system

resources and in the timing of its execution of other programs

Operating system is a Master control program

When the computer is turned on a small boot program loads the operating system Although

additional modules may be loaded as needed the main part known as the kernel resides in memory at

all times After this the OS will load other programs as needed

In general OS manages following resources

Process

Memory

Input Output

Secondary Storage

File

Network

The following is the list of different operating systems

UNIX Linux DOSWindows vista Windows XP Windows 2003 MacOS etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

3

Operating systems can have the following property

Multi-user Allows two or more users at the same time

Multiprocessing Supports running a program on more than one CPU

Multitasking Allows more than one program to run concurrently

Multithreading Allows different parts of a single program to run concurrently

Real time Responds to input instantly General-purpose operating systems such as

DOS and UNIX are not real-time

Operating systems provide a software platform (Environment) on top of which other programs called application

programs can run (such as Word Internet Explorer Games) The application programs must be written to run on

top of a particular operating system Our choice of operating system therefore determines to a great extent the

applications we can run For PCs the most popular operating systems are Windows Linux and MacOS

13 Computer System Organization

Computer-system operation

One or more CPUs device controllers connect through common bus providing access to shared

memory

Concurrent execution of CPUs and devices competing for memory cycles

Figure 12

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

4

Computer-System Operation

IO devices and the CPU can execute concurrently

Each device controller is in charge of a particular device type

Each device controller has a local buffer

CPU moves data fromto main memory tofrom local buffers

IO is from the device to local buffer of controller

Device controller informs CPU that it has finished its operation by causing an interrupt (via

system bus)

14 Storage Structure

Main memory ndash Only large storage media that the CPU can access directly

Secondary storage ndash Extension of main memory that provides large nonvolatile storage

capacity

Magnetic disks ndash Rigid metal or glass platters covered with magnetic recording material

Disk surface is logically divided into tracks which are subdivided into sectors

The disk controller determines the logical interaction between the device and the

computer

Storage Hierarchy

Figure 13

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

5

Storage systems organized in hierarchy based on the following parameters

Speed

Cost

Volatility

Caching ndash copying information into faster storage system main memory can be viewed as a last

cache for secondary storage

15 HISTORY (Evolution) OF OPERATING SYSTEMS

The present day operating systems have not been developed overnight Just like any other system

operating systems also have evolved over a period of time starting from the very primitive systems to

the present day complex and versatile ones

151 Simple Batch Systems

Computers in earlier days of their inception were very bulky large machines usually run from a console

IO devices consisted of card readers tape drives and line printers Direct user interaction with the

system did not exist Users made a job consisting of programs data and control information The job

was submitted to an operator who would execute the job on the computer system The output appeared

after minutes hours or sometimes days The user collected the output from the operator which also

included a memory dump The operating system was very simple and its major task was to transfer

control from one job to another

To speed up processing jobs with the same needs were batched together and executed as a group Thus

came into existence batch operating systems

152 Time-sharing System (Multitasking)

Another mode for delivering computing services is provided by time sharing operating systems In this

environment a computer provides computing services to several or many users concurrently on-line Here

the various users are sharing the central processor the memory and other resources of the computer system

in a manner facilitated controlled and monitored by the operating system

The user in this environment has nearly full interaction with the program during its execution and the

computers response time may be expected to be no more than a few second

It allows the user interaction with the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

6

IBM CMS

Figure 14 Block Diagram of a Time-sharing System (Multitasking)

153 Multiprogrammed System

Multiprogramming increase CPU utilization by organizing jobs so that the CPU always has one to execute

The operating system keeps several jobs in memory simultaneously Thus it is evident that a time-sharing

system is a multiprogramming system but note that a multiprogramming system is not necessarily a

time-sharing system

Multiprogramming is a technique to execute number of programs simultaneously by a single

processor

In Multiprogramming number of processes resides in main memory at a time

The OS picks and begins to execute one of the jobs in the main memory

If any IO wait happened in a process then CPU switches from that job to another job

Hence CPU in not idle at any time

Figure 15 depicts the layout of multiprogramming system

The main memory consists of 4 jobs at a time the CPU executes one by one

OS

JOB1

JOB2

JOB3

JOB4

System 1

CPU

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

7

Advantages

bull Efficient memory utilization

bull Throughput increases

bull CPU is never idle so performance increases

154 Multiprocessor System

o System which supports more than one processor

o Processor communicates with each other

o Processors Share the memory and other devices

Advantages

More work in Less Time (Increased Throughput)

Saves money by sharing Devices (Economy of Scale )

Reliability

Figure 16 Block Diagram of a Multiprocessor System

System

Mother Board

CPU 1 CPU2

RAM Share

Memor

y

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

8

155 Distributed System

It is a collection of processors that do not share memory devices and system clock A distributed computing

system consists of a number of computers that are connected and managed so that they automatically share

the job processing load among the constituent computers or separate the job load as appropriate particularly

configured processors

Such a system requires an operating system which in addition to the typical stand- alone functionality

provides coordination of the operations and information flow among the component computers

Example ATM

Figure 17 Block Diagram of a Distributed System

156 Client ndash Server System

It consists of Client system and a Server System The client which can be either another operating

system component or application program requests a service by sending a message to the server An OS

kernel (or microkernel) running in kernel mode delivers the message to the appropriate server the server

performs the operation and microkernel delivers the results to the client in another message

Client requests a service and Server Responds with a Service

Example Email

Figure 18 Block Diagram of a Client ndash Server System

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

9

16 Services of Operating System

Program Execution

The operating system loads the contents (or sections) of a file into memory and begin its execution

I0 Operations

Disks tapes serial lines and other devices must be communicated with at a very low level The user

need only specify the device and the operation to perform on it while the system converts that request

into device or controller specific commands

File-system management

There are many details in file creation deletion allocation and naming that users should not have to

perform Blocks of disk space are used by files and must be tracked Deleting a file requires removing

the name file information and freeing the allocated blocks

Communications

Message passing between systems requires messages be turned into packets of information sent to the

network controller transmitted across a communication medium and reassembled by the destination

system

Error detection

Error detection occurs at both the hardware and software levels At hardware level all data transfers

must be inspected to ensure that data have not been corrupted in transmission At the software level

media must be checked for data consistency for instance do the numbers of allocated and unallocated

blocks of storage match the total number on the device

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

10

17 Operating System terminologies

The Kernel

It is central to the operating system It is the part of the operating system that loads first and it remains

in main memory Because it stays in memory it is important for the kernel to be as small as possible It

provides all the essential services required by other parts of the operating system and applications

Typically the kernel is responsible for memory management process management and disk

management

User Interface

The user interacts with the OS through the user interface

The components of the user interface are

1 The command interpreter

2 The file system

3 On-line help and

4 Application integration

Command Interpreter Shell

Users normally interact with the operating system through a set of commands For example the DOS operating

system contains commands such as COPY and RENAME for copying files and changing the names of files

respectively The commands are accepted and executed by a part of the operating system called the command

processor or command line interpreter In some operating systems the command interpreter is called the

shell

In some Operating systems Graphical user interfaces (GUI) allow us to enter commands by pointing and clicking

at objects that appear on the screen OS like Windows XP MacOS are some example for GUI

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

11

Examples

Below is the list of some DOS operating system commands

1 DIR [note Directory means Folder in windows XP]

This command displays files and folders in the current directory or folder

Most of the DOS commands come with various options They are called switches in DOS

Example with switches DIR AD

Here the switch AD is used with DIR command to display all the sub folders in the current directory

2 CLS ndashThis command clears the screen

Special switch

To know syntax of a particular command with all options type Command name

Example To know about COPY command type

COPY

Commands of UNIX

cp

(Copy -- same as DOS copy)

rm

(Remove [or delete] a file -- same as DOS del)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

12

Chapter ndash II

PROCESS MANAGEMENT-I

21 PROCESS

A program in execution is called process A process is executed sequentially one instruction at a

time A program is a passive entity For example a file on the disk A process on the other hand is an

active entity In addition to program code it includes PCB

PROCESS STATE

As a Process executes it changes state The state of a process is defined in which part by the

current activity of that process

Each process may be in any one of the following states

New Process being created

Running Instructions being executed

Waiting Process waiting for an event to occur

Ready Process waiting for CPU

Terminated Process has finished execution

Process State Transition Diagram Figure 21

The above diagram explains how the process transit to various states in its lifecycle by some events

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

13

22 PROCESS CONTROL BLOCK

A Process Control Block (PCB) also called Task Control Block represents each process in the

operating system

Every process has a process control block (PCB) which represents a process in an operating

system The PCB contains information that makes the process an active entity Following is the list of

information a PCB of a process contains

Process numbers is used to uniquely identify a process

The process state gives the current state of the process It can be either new ready

running waiting or terminated

The program counter contains the address of the next instruction to be executed

The values in the CPU registers are required when the CPU switches from one process

to another for a successful continuation

Memory management information is dependent on the memory system used by the

operating This includes base registers limit registers page tables segment tables and

other related details

IO information gives details about the IO devices allotted to the process the number of

files that are open and in use by the process etc

23 Multi Programming and Process Scheduling

Multiprogramming is a technique used to utilize maximum CPU time by running multiple programs

simultaneously It is achieved by two ways

1 The execution begins with the first process and continues till an instruction waiting for a peripheral is

reached the context of this process is stored and the next process in ready queue (in memory) is given a

chance to execute This will be continued until two or more programs exist in ready queue

2 Process gives up the CPU on expiry of its time slice and rejoins the ready queue This will be

continued until two or more programs exist in ready queue (This is nothing but timesharing)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

14

1

2

Figure 22

Queuing diagram of process scheduling

Scheduler

Scheduler is a part of OS which selects processes from the ready queue for execution by the CPU

Different methods are applied for selecting processes from the ready queue These methods are called

Scheduling Algorithms

Note

Hence it is clear that CPU scheduling is the basis for Multiprogramming operating systems

24 Major Category of CPU Scheduling

Non-preemptive In this scheduling if a process once selected for execution CPU keeps executing

until it is released either by that process for IO or by termination

Preemptive In this scheduling process can be stopped executing and returned to the ready queue to

resume later

25 Scheduling Criteria

Many algorithms exist for CPU scheduling Various criteria have been suggested for comparing

these CPU scheduling algorithms

All the CPU scheduling algorithms include the following criteria

1 CPU utilization Measured in Percentage of time the CPU is busy

2 Throughput Number of processes completed per time unit is throughput

3 Turnaround time The interval of time between submission and completion of a process

is called turnaround time It includes execution time and waiting time

4 Waiting time Sum of all the times spent by a process at different instances waiting in the

ready queue is called waiting time

5 Response time Response time is the difference between time of submission and the time

the first response occurs

Time slice expired

IO request

Ready queue

IO queue

IO

CPU

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

15

Desirable features are having maximum CPU utilization throughput and minimum

turnaround time waiting time and response time

26 SCHEDULING ALGORITHMS

Scheduling algorithms differ in the manner in which the CPU selects a process in the ready

queue for execution

261 FIRST COME FIRST SERVE (FCFS) SCHEDULING ALGORITHM

A process that requests for the CPU first is allocated the CPU first Hence the name first come first serve

The implementation of the FCFS policy is easily managed with a FIFO queue When a process enters the

ready queue its PCB is linked onto the tail of the queue When the CPU is free it is allocated to the process

at the head of the queue The running process is the removed from the queue Even though the algorithm is

simple the average waiting is often quite long

Consider a set of three processes P1 P2 and P3 arriving at time instant 0 and having CPU burst times as

shown below

Process Burst time (msecs)

P1 24

P2 3

P3 3

The Gantt chart below shows the result

0 24 27 30

Figure 23 Gantt chart for above example

Average waiting time and average turnaround time are calculated as follows

The waiting time for process P1 = 0 msecs

P2 = 24 msecs

P3 = 27 msecs

Average waiting time = (0 + 24 + 27) 3 = 51 3 = 17 msecs

P1 completes at the end of 24 msecs P2 at the end of 27 msecs and P3 at the end of 30 msecs Average

turnaround time = (24 + 27 + 30) 3 = 81 3 = 27 msecs

Since the algorithm is nonpreemptive in nature it is not suited for time sharing systems

P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

16

262 SHORTEST JOB FIRST (SJF) SCHEDULING ALGORITHM

Another approach to CPU scheduling is the shortest job first algorithm In this algorithm the length of

the CPU burst is considered When the CPU is available it is assigned to the process that has the

smallest next CPU burst Hence the name shortest job first If the next CPU bursts of two processes are

the same FCFS scheduling is used to break the tie As an example consider the following set of

processes P1 P2 P3 P4 and their CPU burst times

Process Burst time (msecs)

P1 6

P2 8

P3 7

P4 3

Using SJF algorithm the processes would be scheduled as shown below

0 3 9 16 24

Figure 24 Gantt chart for above example

Average waiting time = (0 + 3 + 9 + 16) 4 = 28 4 = 7 msecs

Average turnaround time = (3 + 9 + 16 + 24) 4 = 52 4 = 13 msecs

If the above processes were scheduled using FCFS algorithm then

Average waiting time = (0 + 6 + 14 + 21) 4 = 41 4 = 1025 msecs

Average turnaround time = (6 + 14 + 21 + 24) 4 = 65 4 = 1625 msecs

It is clear that the SJF algorithm produces the most optimal scheduling scheme For a given set of

processes the algorithm gives the minimum average waiting and turnaround times This is because

shorter processes are scheduled earlier than longer ones and hence waiting time for shorter processes

decreases and it increases the waiting time of long processes SJF algorithm could be either preemptive

or nonpreemptive

The main disadvantage with the SJF algorithm lies in knowing the length of the next CPU burst SJF

algorithm is therefore not applicable in CPU scheduling

P4 P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

17

263 Priority Scheduling A priority is associated with each process and the CPU is allocated to the process with the highest

priority Equal-priority processes are scheduled in FCFS

An SJF algorithm is therefore simply a priority algorithm where the priority is the inverse of the

(predicted) next CPU burst The larger the CPU burst the lower the priority and vice versa

Priority is expressed in terms of fixed range number such as 0 to 10 Some systems use low numbers to

represent low priority while others use low numbers for high priority But in this course we will use low

numbers to represent high priority

Consider the following set of processes assumed to have arrived at time 0 in the order P1 P2 P5

with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 3

P2 1 1

P3 2 4

P4 1 5

P5 5 2

Using priority scheduling we would schedule these processes according to the Gantt chart below

0 1 6 16 18 19

Figure 25 Gantt chart for above example

Average waiting time = (0 + 1 + 6 + 16+18) 5 = 41 5 = 82 msecs

Average turnaround time = (1 +6 + 16 + 18+19) 5 = 60 5 = 12 msecs

Priorities can be defined either internally or externally Internally defined priorities use measurable

quantity such as time limits memory requirements etc to compute the priority of a process

External priorities are set by criteria that are external to the operating system such as importance of the

process amount being paid for use of the compute the owner of the process and other (political)

factors

Priority scheduling may be either preemptive or nonpreemptive When a process arrives at the ready

queue its priority is compared with that of the currently running process A preemptive priority-

scheduling algorithm will preempt the CPU if the priority of the newly arrived process is higher than

P2 P5 P1 P3 P4

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

18

that of the currently running process A nonpreemptive priority-scheduling algorithm will simply put the

new process at the head of the ready queue

The major disadvantage of priority-scheduling algorithms is indefinite blocking or starvation A

situation whereby low priority processes indefinitely wait for the CPU because of a steady stream of

higher- priority processes

A solution to indefinite blocking of low-priority processes is aging Aging is a technique of gradually

increasing the priority of processes that wait in the system for a long time

264 ROUND ROBIN (RR) SCHEDULING ALGORITHM

The round-robin CPU scheduling algorithm is basically a preemptive scheduling algorithm designed for

time-sharing systems One unit of time is called a time slice Duration of a time slice may range between

10 msecs and about 100 msecs The CPU scheduler allocates to each process in the ready queue one

time slice at a time in a round-robin fashion Hence the name round-robin

Consider the same example explained under FCFS algorithm

Process Burst time (msecs)

A 13

B 3

C 3

D 5

Let the duration of a time slice be 4 msecs which is to say CPU switches between processes every 4

msecs in a round-robin fashion The Gantt chart below shows the scheduling of processes

0 4 7 10 14 18 19 23 24

Figure 25 Gantt chart for above example

Average waiting time = [(19 ndash 8) + 4 + 7+ (18 - 4)] 3 = 36 4 = 9 msecs

The performance of the RR algorithm is very much dependent on the length of the time slice If the

duration of the time slice is indefinitely large then the RR algorithm is the same as FCFS algorithm If

the time slice is too small then the performance of the algorithm deteriorates because of the effect of

frequent context switching

A B C D A D A A

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

19

Exercise

Consider the following set of processes with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 2

P2 4 3

P3 2 1

P4 6 4 P5 5 5

The processes are assumed to have arrived in the order P1 P2 P3 P4 and P5 all at time 0

a Draw four Gantt charts illustrating the execution of these processes using FCFS SJF a

nonpreemptive priority (a smaller priority number implies a higher priority)and RR (Quantum = 1) scheduling

b What is the turnaround time of each process for each of the scheduling algorithms in (a) above

c What is the waiting time of each process for each of the scheduling algorithms in (a)

d Which of the schedules in (a) results in the minimal average waiting time (over all processes)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

20

Chapter ndash III

PROCESS MANAGEMENT-II

31 Deadlock

A process request resources and if the resources are not available at that time the process enters a waiting

state A waiting process is never again able to change state because other waiting processes hold the

resources This situation is called a deadlock

Example

ndash System has two tape drives R1 and R2 and two process P1 and P2

ndash P1 holds R1 but demand R2

ndash P2 holds R2 but demand R1

System Model

bull Resource types R1 R2 hellipRm (CPU cycles memory space IO devices)

bull Each resource type Ri has Wi instances(More than One Instances)

bull Each process utilizes a resource as follows

Request

Use

Release

32 Deadlock Characterization

Deadlock can arise if four conditions hold simultaneously

bull Mutual exclusion

At least one resource must be held in a non-sharable mode ie only one process at a time can use the

resource If another process requests that resource the requesting process must be delayed until the resource

has been released

bull Hold and wait a process holding at least one resource is waiting to acquire additional resources held

by other processes

bull No preemption a resource can be released only voluntarily by the process holding it after that

process has completed its task

bull Circular wait there exists a set P0 P1 hellip P0 of waiting processes such that P0 is waiting for a

resource that is held by P1 P1 is waiting for a resource that is held by P2 hellip Pnndash1 is waiting for a

resource that is held by Pn and P0 is waiting for a resource that is held by P0

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

21

33 Methods for Handling Deadlocks

bull Ensure that the system will never enter a deadlock state

bull Allow the system to enter a deadlock state and then recover

bull Ignore the problem and pretend that deadlocks never occur in the system used by most operating

systems including UNIX

331 Deadlock Prevention

As you have seen Deadlock Characterization for a deadlock to occur each of the four necessary

conditions must hold By ensuring that at least one of the four necessary conditions cannot hold you can

prevent the occurrence of a deadlock

Mutual Exclusion

The mutual exclusion condition must hold for non-sharable resources For instance a printer cannot be

simultaneously shared by several processes Sharable resources do not require mutually exclusive

access and thus cannot be involved in a deadlock

In general however we cannot prevent deadlocks by denying the mutual-exclusion condition Some

resources are intrinsically non-sharable

Hold and Wait

To ensure that the hold-and-wait condition never occurs in the system we must guarantee that whenever a

process requests a resource it does not hold any other resources We can implement this the following

protocol

One protocol that can be used requires each process to request and be allocated all resources before it begins

execution

An alternative protocol allows a process to request resources only when the process has none A process

may request some resources and use them Before it can request any additional resources however it must

release all the resources that it is currently allocated

No Preemption

ndash If a process that is holding some resources requests another resource that cannot be immediately

allocated to it then all resources currently being held are released

ndash Preempted resources are added to the list of resources for which the process is waiting

ndash Process will be restarted only when it can regain its old resources as well as the new ones that it

is requesting

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

22

Circular Wait

Impose a total ordering of all resource types and require that each process requests resources in an

increasing order of enumeration

332 Deadlock Avoidance

bull Simplest and most useful model requires that each process declare the maximum number of resources

of each type that it may need

bull The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that

there can never be a circular-wait condition

bull Resource-allocation state is defined by the number of available and allocated resources and the

maximum demands of the processes

Safe State

bull When a process requests an available resource system must decide if immediate allocation leaves the

system in a safe state

bull System is in safe state if there exists a safe sequence of all processes

bull Sequence ltP1 P2 hellip Pngt is safe if for each Pi the resources that Pi can still request can be satisfied

by currently available resources + resources held by all the Pj with jltI

If Pi resource needs are not immediately available then Pi can wait until all Pj have finished

When Pj is finished Pi can obtain needed resources execute return allocated resources and terminate

When Pi terminates Pi+1 can obtain its needed resources and so on

Basic Facts

bull If a system is in safe state no deadlocks

bull If a system is in unsafe state possibility of deadlock

bull Avoidance ensures that a system will never enter an unsafe state

Resource-Allocation Graph Algorithm (Single Instance of Each Resource Type)

Claim edge Pi rarr Rj indicated that process Pj may request resource Rj represented by a dashed

line

Claim edge converts to request edge when a process requests a resource

When a process releases a resource assignment edge reconverts to a claim edge

Resources must be claimed a priori in the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

23

Resource-Allocation Graph for Deadlock Avoidance Unsafe State in a Resource-Allocation Graph

Figure 31

Bankerrsquos Algorithm (Several Instance of Each Resource Type)

bull Multiple instances

bull Each process must a priori claim maximum use

bull When a process requests a resource it may have to wait

bull When a process gets all its resources it must return them in a finite amount of time

Data Structures for the Bankerrsquos Algorithm

bull Available Vector of length m If available [j] = k there are k instances of resource type Rj available

bull Max n x m matrix If Max [ij] = k then process Pi may request at most k instances of resource type Rj

bull Allocation n x m matrix If Allocation[ij] = k then Pi is currently allocated k instances of Rj

bull Need n x m matrix If Need[ij] = k then Pi may need k more instances of Rj to complete its task

Need [ij] = Max[ij] ndash Allocation [ij]

Let n = number of processes

333 Deadlock Detection

bull Allow system to enter deadlock state

bull Detection algorithm

bull Recovery scheme

Single Instance of Each Resource Type

bull Maintain wait-for graph

ndash Nodes are processes

ndash Pi rarr Pj if Pi is waiting for Pj

bull Periodically invoke an algorithm that searches for a cycle in the graph

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 3: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

3

Operating systems can have the following property

Multi-user Allows two or more users at the same time

Multiprocessing Supports running a program on more than one CPU

Multitasking Allows more than one program to run concurrently

Multithreading Allows different parts of a single program to run concurrently

Real time Responds to input instantly General-purpose operating systems such as

DOS and UNIX are not real-time

Operating systems provide a software platform (Environment) on top of which other programs called application

programs can run (such as Word Internet Explorer Games) The application programs must be written to run on

top of a particular operating system Our choice of operating system therefore determines to a great extent the

applications we can run For PCs the most popular operating systems are Windows Linux and MacOS

13 Computer System Organization

Computer-system operation

One or more CPUs device controllers connect through common bus providing access to shared

memory

Concurrent execution of CPUs and devices competing for memory cycles

Figure 12

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

4

Computer-System Operation

IO devices and the CPU can execute concurrently

Each device controller is in charge of a particular device type

Each device controller has a local buffer

CPU moves data fromto main memory tofrom local buffers

IO is from the device to local buffer of controller

Device controller informs CPU that it has finished its operation by causing an interrupt (via

system bus)

14 Storage Structure

Main memory ndash Only large storage media that the CPU can access directly

Secondary storage ndash Extension of main memory that provides large nonvolatile storage

capacity

Magnetic disks ndash Rigid metal or glass platters covered with magnetic recording material

Disk surface is logically divided into tracks which are subdivided into sectors

The disk controller determines the logical interaction between the device and the

computer

Storage Hierarchy

Figure 13

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

5

Storage systems organized in hierarchy based on the following parameters

Speed

Cost

Volatility

Caching ndash copying information into faster storage system main memory can be viewed as a last

cache for secondary storage

15 HISTORY (Evolution) OF OPERATING SYSTEMS

The present day operating systems have not been developed overnight Just like any other system

operating systems also have evolved over a period of time starting from the very primitive systems to

the present day complex and versatile ones

151 Simple Batch Systems

Computers in earlier days of their inception were very bulky large machines usually run from a console

IO devices consisted of card readers tape drives and line printers Direct user interaction with the

system did not exist Users made a job consisting of programs data and control information The job

was submitted to an operator who would execute the job on the computer system The output appeared

after minutes hours or sometimes days The user collected the output from the operator which also

included a memory dump The operating system was very simple and its major task was to transfer

control from one job to another

To speed up processing jobs with the same needs were batched together and executed as a group Thus

came into existence batch operating systems

152 Time-sharing System (Multitasking)

Another mode for delivering computing services is provided by time sharing operating systems In this

environment a computer provides computing services to several or many users concurrently on-line Here

the various users are sharing the central processor the memory and other resources of the computer system

in a manner facilitated controlled and monitored by the operating system

The user in this environment has nearly full interaction with the program during its execution and the

computers response time may be expected to be no more than a few second

It allows the user interaction with the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

6

IBM CMS

Figure 14 Block Diagram of a Time-sharing System (Multitasking)

153 Multiprogrammed System

Multiprogramming increase CPU utilization by organizing jobs so that the CPU always has one to execute

The operating system keeps several jobs in memory simultaneously Thus it is evident that a time-sharing

system is a multiprogramming system but note that a multiprogramming system is not necessarily a

time-sharing system

Multiprogramming is a technique to execute number of programs simultaneously by a single

processor

In Multiprogramming number of processes resides in main memory at a time

The OS picks and begins to execute one of the jobs in the main memory

If any IO wait happened in a process then CPU switches from that job to another job

Hence CPU in not idle at any time

Figure 15 depicts the layout of multiprogramming system

The main memory consists of 4 jobs at a time the CPU executes one by one

OS

JOB1

JOB2

JOB3

JOB4

System 1

CPU

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

7

Advantages

bull Efficient memory utilization

bull Throughput increases

bull CPU is never idle so performance increases

154 Multiprocessor System

o System which supports more than one processor

o Processor communicates with each other

o Processors Share the memory and other devices

Advantages

More work in Less Time (Increased Throughput)

Saves money by sharing Devices (Economy of Scale )

Reliability

Figure 16 Block Diagram of a Multiprocessor System

System

Mother Board

CPU 1 CPU2

RAM Share

Memor

y

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

8

155 Distributed System

It is a collection of processors that do not share memory devices and system clock A distributed computing

system consists of a number of computers that are connected and managed so that they automatically share

the job processing load among the constituent computers or separate the job load as appropriate particularly

configured processors

Such a system requires an operating system which in addition to the typical stand- alone functionality

provides coordination of the operations and information flow among the component computers

Example ATM

Figure 17 Block Diagram of a Distributed System

156 Client ndash Server System

It consists of Client system and a Server System The client which can be either another operating

system component or application program requests a service by sending a message to the server An OS

kernel (or microkernel) running in kernel mode delivers the message to the appropriate server the server

performs the operation and microkernel delivers the results to the client in another message

Client requests a service and Server Responds with a Service

Example Email

Figure 18 Block Diagram of a Client ndash Server System

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

9

16 Services of Operating System

Program Execution

The operating system loads the contents (or sections) of a file into memory and begin its execution

I0 Operations

Disks tapes serial lines and other devices must be communicated with at a very low level The user

need only specify the device and the operation to perform on it while the system converts that request

into device or controller specific commands

File-system management

There are many details in file creation deletion allocation and naming that users should not have to

perform Blocks of disk space are used by files and must be tracked Deleting a file requires removing

the name file information and freeing the allocated blocks

Communications

Message passing between systems requires messages be turned into packets of information sent to the

network controller transmitted across a communication medium and reassembled by the destination

system

Error detection

Error detection occurs at both the hardware and software levels At hardware level all data transfers

must be inspected to ensure that data have not been corrupted in transmission At the software level

media must be checked for data consistency for instance do the numbers of allocated and unallocated

blocks of storage match the total number on the device

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

10

17 Operating System terminologies

The Kernel

It is central to the operating system It is the part of the operating system that loads first and it remains

in main memory Because it stays in memory it is important for the kernel to be as small as possible It

provides all the essential services required by other parts of the operating system and applications

Typically the kernel is responsible for memory management process management and disk

management

User Interface

The user interacts with the OS through the user interface

The components of the user interface are

1 The command interpreter

2 The file system

3 On-line help and

4 Application integration

Command Interpreter Shell

Users normally interact with the operating system through a set of commands For example the DOS operating

system contains commands such as COPY and RENAME for copying files and changing the names of files

respectively The commands are accepted and executed by a part of the operating system called the command

processor or command line interpreter In some operating systems the command interpreter is called the

shell

In some Operating systems Graphical user interfaces (GUI) allow us to enter commands by pointing and clicking

at objects that appear on the screen OS like Windows XP MacOS are some example for GUI

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

11

Examples

Below is the list of some DOS operating system commands

1 DIR [note Directory means Folder in windows XP]

This command displays files and folders in the current directory or folder

Most of the DOS commands come with various options They are called switches in DOS

Example with switches DIR AD

Here the switch AD is used with DIR command to display all the sub folders in the current directory

2 CLS ndashThis command clears the screen

Special switch

To know syntax of a particular command with all options type Command name

Example To know about COPY command type

COPY

Commands of UNIX

cp

(Copy -- same as DOS copy)

rm

(Remove [or delete] a file -- same as DOS del)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

12

Chapter ndash II

PROCESS MANAGEMENT-I

21 PROCESS

A program in execution is called process A process is executed sequentially one instruction at a

time A program is a passive entity For example a file on the disk A process on the other hand is an

active entity In addition to program code it includes PCB

PROCESS STATE

As a Process executes it changes state The state of a process is defined in which part by the

current activity of that process

Each process may be in any one of the following states

New Process being created

Running Instructions being executed

Waiting Process waiting for an event to occur

Ready Process waiting for CPU

Terminated Process has finished execution

Process State Transition Diagram Figure 21

The above diagram explains how the process transit to various states in its lifecycle by some events

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

13

22 PROCESS CONTROL BLOCK

A Process Control Block (PCB) also called Task Control Block represents each process in the

operating system

Every process has a process control block (PCB) which represents a process in an operating

system The PCB contains information that makes the process an active entity Following is the list of

information a PCB of a process contains

Process numbers is used to uniquely identify a process

The process state gives the current state of the process It can be either new ready

running waiting or terminated

The program counter contains the address of the next instruction to be executed

The values in the CPU registers are required when the CPU switches from one process

to another for a successful continuation

Memory management information is dependent on the memory system used by the

operating This includes base registers limit registers page tables segment tables and

other related details

IO information gives details about the IO devices allotted to the process the number of

files that are open and in use by the process etc

23 Multi Programming and Process Scheduling

Multiprogramming is a technique used to utilize maximum CPU time by running multiple programs

simultaneously It is achieved by two ways

1 The execution begins with the first process and continues till an instruction waiting for a peripheral is

reached the context of this process is stored and the next process in ready queue (in memory) is given a

chance to execute This will be continued until two or more programs exist in ready queue

2 Process gives up the CPU on expiry of its time slice and rejoins the ready queue This will be

continued until two or more programs exist in ready queue (This is nothing but timesharing)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

14

1

2

Figure 22

Queuing diagram of process scheduling

Scheduler

Scheduler is a part of OS which selects processes from the ready queue for execution by the CPU

Different methods are applied for selecting processes from the ready queue These methods are called

Scheduling Algorithms

Note

Hence it is clear that CPU scheduling is the basis for Multiprogramming operating systems

24 Major Category of CPU Scheduling

Non-preemptive In this scheduling if a process once selected for execution CPU keeps executing

until it is released either by that process for IO or by termination

Preemptive In this scheduling process can be stopped executing and returned to the ready queue to

resume later

25 Scheduling Criteria

Many algorithms exist for CPU scheduling Various criteria have been suggested for comparing

these CPU scheduling algorithms

All the CPU scheduling algorithms include the following criteria

1 CPU utilization Measured in Percentage of time the CPU is busy

2 Throughput Number of processes completed per time unit is throughput

3 Turnaround time The interval of time between submission and completion of a process

is called turnaround time It includes execution time and waiting time

4 Waiting time Sum of all the times spent by a process at different instances waiting in the

ready queue is called waiting time

5 Response time Response time is the difference between time of submission and the time

the first response occurs

Time slice expired

IO request

Ready queue

IO queue

IO

CPU

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

15

Desirable features are having maximum CPU utilization throughput and minimum

turnaround time waiting time and response time

26 SCHEDULING ALGORITHMS

Scheduling algorithms differ in the manner in which the CPU selects a process in the ready

queue for execution

261 FIRST COME FIRST SERVE (FCFS) SCHEDULING ALGORITHM

A process that requests for the CPU first is allocated the CPU first Hence the name first come first serve

The implementation of the FCFS policy is easily managed with a FIFO queue When a process enters the

ready queue its PCB is linked onto the tail of the queue When the CPU is free it is allocated to the process

at the head of the queue The running process is the removed from the queue Even though the algorithm is

simple the average waiting is often quite long

Consider a set of three processes P1 P2 and P3 arriving at time instant 0 and having CPU burst times as

shown below

Process Burst time (msecs)

P1 24

P2 3

P3 3

The Gantt chart below shows the result

0 24 27 30

Figure 23 Gantt chart for above example

Average waiting time and average turnaround time are calculated as follows

The waiting time for process P1 = 0 msecs

P2 = 24 msecs

P3 = 27 msecs

Average waiting time = (0 + 24 + 27) 3 = 51 3 = 17 msecs

P1 completes at the end of 24 msecs P2 at the end of 27 msecs and P3 at the end of 30 msecs Average

turnaround time = (24 + 27 + 30) 3 = 81 3 = 27 msecs

Since the algorithm is nonpreemptive in nature it is not suited for time sharing systems

P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

16

262 SHORTEST JOB FIRST (SJF) SCHEDULING ALGORITHM

Another approach to CPU scheduling is the shortest job first algorithm In this algorithm the length of

the CPU burst is considered When the CPU is available it is assigned to the process that has the

smallest next CPU burst Hence the name shortest job first If the next CPU bursts of two processes are

the same FCFS scheduling is used to break the tie As an example consider the following set of

processes P1 P2 P3 P4 and their CPU burst times

Process Burst time (msecs)

P1 6

P2 8

P3 7

P4 3

Using SJF algorithm the processes would be scheduled as shown below

0 3 9 16 24

Figure 24 Gantt chart for above example

Average waiting time = (0 + 3 + 9 + 16) 4 = 28 4 = 7 msecs

Average turnaround time = (3 + 9 + 16 + 24) 4 = 52 4 = 13 msecs

If the above processes were scheduled using FCFS algorithm then

Average waiting time = (0 + 6 + 14 + 21) 4 = 41 4 = 1025 msecs

Average turnaround time = (6 + 14 + 21 + 24) 4 = 65 4 = 1625 msecs

It is clear that the SJF algorithm produces the most optimal scheduling scheme For a given set of

processes the algorithm gives the minimum average waiting and turnaround times This is because

shorter processes are scheduled earlier than longer ones and hence waiting time for shorter processes

decreases and it increases the waiting time of long processes SJF algorithm could be either preemptive

or nonpreemptive

The main disadvantage with the SJF algorithm lies in knowing the length of the next CPU burst SJF

algorithm is therefore not applicable in CPU scheduling

P4 P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

17

263 Priority Scheduling A priority is associated with each process and the CPU is allocated to the process with the highest

priority Equal-priority processes are scheduled in FCFS

An SJF algorithm is therefore simply a priority algorithm where the priority is the inverse of the

(predicted) next CPU burst The larger the CPU burst the lower the priority and vice versa

Priority is expressed in terms of fixed range number such as 0 to 10 Some systems use low numbers to

represent low priority while others use low numbers for high priority But in this course we will use low

numbers to represent high priority

Consider the following set of processes assumed to have arrived at time 0 in the order P1 P2 P5

with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 3

P2 1 1

P3 2 4

P4 1 5

P5 5 2

Using priority scheduling we would schedule these processes according to the Gantt chart below

0 1 6 16 18 19

Figure 25 Gantt chart for above example

Average waiting time = (0 + 1 + 6 + 16+18) 5 = 41 5 = 82 msecs

Average turnaround time = (1 +6 + 16 + 18+19) 5 = 60 5 = 12 msecs

Priorities can be defined either internally or externally Internally defined priorities use measurable

quantity such as time limits memory requirements etc to compute the priority of a process

External priorities are set by criteria that are external to the operating system such as importance of the

process amount being paid for use of the compute the owner of the process and other (political)

factors

Priority scheduling may be either preemptive or nonpreemptive When a process arrives at the ready

queue its priority is compared with that of the currently running process A preemptive priority-

scheduling algorithm will preempt the CPU if the priority of the newly arrived process is higher than

P2 P5 P1 P3 P4

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

18

that of the currently running process A nonpreemptive priority-scheduling algorithm will simply put the

new process at the head of the ready queue

The major disadvantage of priority-scheduling algorithms is indefinite blocking or starvation A

situation whereby low priority processes indefinitely wait for the CPU because of a steady stream of

higher- priority processes

A solution to indefinite blocking of low-priority processes is aging Aging is a technique of gradually

increasing the priority of processes that wait in the system for a long time

264 ROUND ROBIN (RR) SCHEDULING ALGORITHM

The round-robin CPU scheduling algorithm is basically a preemptive scheduling algorithm designed for

time-sharing systems One unit of time is called a time slice Duration of a time slice may range between

10 msecs and about 100 msecs The CPU scheduler allocates to each process in the ready queue one

time slice at a time in a round-robin fashion Hence the name round-robin

Consider the same example explained under FCFS algorithm

Process Burst time (msecs)

A 13

B 3

C 3

D 5

Let the duration of a time slice be 4 msecs which is to say CPU switches between processes every 4

msecs in a round-robin fashion The Gantt chart below shows the scheduling of processes

0 4 7 10 14 18 19 23 24

Figure 25 Gantt chart for above example

Average waiting time = [(19 ndash 8) + 4 + 7+ (18 - 4)] 3 = 36 4 = 9 msecs

The performance of the RR algorithm is very much dependent on the length of the time slice If the

duration of the time slice is indefinitely large then the RR algorithm is the same as FCFS algorithm If

the time slice is too small then the performance of the algorithm deteriorates because of the effect of

frequent context switching

A B C D A D A A

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

19

Exercise

Consider the following set of processes with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 2

P2 4 3

P3 2 1

P4 6 4 P5 5 5

The processes are assumed to have arrived in the order P1 P2 P3 P4 and P5 all at time 0

a Draw four Gantt charts illustrating the execution of these processes using FCFS SJF a

nonpreemptive priority (a smaller priority number implies a higher priority)and RR (Quantum = 1) scheduling

b What is the turnaround time of each process for each of the scheduling algorithms in (a) above

c What is the waiting time of each process for each of the scheduling algorithms in (a)

d Which of the schedules in (a) results in the minimal average waiting time (over all processes)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

20

Chapter ndash III

PROCESS MANAGEMENT-II

31 Deadlock

A process request resources and if the resources are not available at that time the process enters a waiting

state A waiting process is never again able to change state because other waiting processes hold the

resources This situation is called a deadlock

Example

ndash System has two tape drives R1 and R2 and two process P1 and P2

ndash P1 holds R1 but demand R2

ndash P2 holds R2 but demand R1

System Model

bull Resource types R1 R2 hellipRm (CPU cycles memory space IO devices)

bull Each resource type Ri has Wi instances(More than One Instances)

bull Each process utilizes a resource as follows

Request

Use

Release

32 Deadlock Characterization

Deadlock can arise if four conditions hold simultaneously

bull Mutual exclusion

At least one resource must be held in a non-sharable mode ie only one process at a time can use the

resource If another process requests that resource the requesting process must be delayed until the resource

has been released

bull Hold and wait a process holding at least one resource is waiting to acquire additional resources held

by other processes

bull No preemption a resource can be released only voluntarily by the process holding it after that

process has completed its task

bull Circular wait there exists a set P0 P1 hellip P0 of waiting processes such that P0 is waiting for a

resource that is held by P1 P1 is waiting for a resource that is held by P2 hellip Pnndash1 is waiting for a

resource that is held by Pn and P0 is waiting for a resource that is held by P0

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

21

33 Methods for Handling Deadlocks

bull Ensure that the system will never enter a deadlock state

bull Allow the system to enter a deadlock state and then recover

bull Ignore the problem and pretend that deadlocks never occur in the system used by most operating

systems including UNIX

331 Deadlock Prevention

As you have seen Deadlock Characterization for a deadlock to occur each of the four necessary

conditions must hold By ensuring that at least one of the four necessary conditions cannot hold you can

prevent the occurrence of a deadlock

Mutual Exclusion

The mutual exclusion condition must hold for non-sharable resources For instance a printer cannot be

simultaneously shared by several processes Sharable resources do not require mutually exclusive

access and thus cannot be involved in a deadlock

In general however we cannot prevent deadlocks by denying the mutual-exclusion condition Some

resources are intrinsically non-sharable

Hold and Wait

To ensure that the hold-and-wait condition never occurs in the system we must guarantee that whenever a

process requests a resource it does not hold any other resources We can implement this the following

protocol

One protocol that can be used requires each process to request and be allocated all resources before it begins

execution

An alternative protocol allows a process to request resources only when the process has none A process

may request some resources and use them Before it can request any additional resources however it must

release all the resources that it is currently allocated

No Preemption

ndash If a process that is holding some resources requests another resource that cannot be immediately

allocated to it then all resources currently being held are released

ndash Preempted resources are added to the list of resources for which the process is waiting

ndash Process will be restarted only when it can regain its old resources as well as the new ones that it

is requesting

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

22

Circular Wait

Impose a total ordering of all resource types and require that each process requests resources in an

increasing order of enumeration

332 Deadlock Avoidance

bull Simplest and most useful model requires that each process declare the maximum number of resources

of each type that it may need

bull The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that

there can never be a circular-wait condition

bull Resource-allocation state is defined by the number of available and allocated resources and the

maximum demands of the processes

Safe State

bull When a process requests an available resource system must decide if immediate allocation leaves the

system in a safe state

bull System is in safe state if there exists a safe sequence of all processes

bull Sequence ltP1 P2 hellip Pngt is safe if for each Pi the resources that Pi can still request can be satisfied

by currently available resources + resources held by all the Pj with jltI

If Pi resource needs are not immediately available then Pi can wait until all Pj have finished

When Pj is finished Pi can obtain needed resources execute return allocated resources and terminate

When Pi terminates Pi+1 can obtain its needed resources and so on

Basic Facts

bull If a system is in safe state no deadlocks

bull If a system is in unsafe state possibility of deadlock

bull Avoidance ensures that a system will never enter an unsafe state

Resource-Allocation Graph Algorithm (Single Instance of Each Resource Type)

Claim edge Pi rarr Rj indicated that process Pj may request resource Rj represented by a dashed

line

Claim edge converts to request edge when a process requests a resource

When a process releases a resource assignment edge reconverts to a claim edge

Resources must be claimed a priori in the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

23

Resource-Allocation Graph for Deadlock Avoidance Unsafe State in a Resource-Allocation Graph

Figure 31

Bankerrsquos Algorithm (Several Instance of Each Resource Type)

bull Multiple instances

bull Each process must a priori claim maximum use

bull When a process requests a resource it may have to wait

bull When a process gets all its resources it must return them in a finite amount of time

Data Structures for the Bankerrsquos Algorithm

bull Available Vector of length m If available [j] = k there are k instances of resource type Rj available

bull Max n x m matrix If Max [ij] = k then process Pi may request at most k instances of resource type Rj

bull Allocation n x m matrix If Allocation[ij] = k then Pi is currently allocated k instances of Rj

bull Need n x m matrix If Need[ij] = k then Pi may need k more instances of Rj to complete its task

Need [ij] = Max[ij] ndash Allocation [ij]

Let n = number of processes

333 Deadlock Detection

bull Allow system to enter deadlock state

bull Detection algorithm

bull Recovery scheme

Single Instance of Each Resource Type

bull Maintain wait-for graph

ndash Nodes are processes

ndash Pi rarr Pj if Pi is waiting for Pj

bull Periodically invoke an algorithm that searches for a cycle in the graph

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 4: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

4

Computer-System Operation

IO devices and the CPU can execute concurrently

Each device controller is in charge of a particular device type

Each device controller has a local buffer

CPU moves data fromto main memory tofrom local buffers

IO is from the device to local buffer of controller

Device controller informs CPU that it has finished its operation by causing an interrupt (via

system bus)

14 Storage Structure

Main memory ndash Only large storage media that the CPU can access directly

Secondary storage ndash Extension of main memory that provides large nonvolatile storage

capacity

Magnetic disks ndash Rigid metal or glass platters covered with magnetic recording material

Disk surface is logically divided into tracks which are subdivided into sectors

The disk controller determines the logical interaction between the device and the

computer

Storage Hierarchy

Figure 13

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

5

Storage systems organized in hierarchy based on the following parameters

Speed

Cost

Volatility

Caching ndash copying information into faster storage system main memory can be viewed as a last

cache for secondary storage

15 HISTORY (Evolution) OF OPERATING SYSTEMS

The present day operating systems have not been developed overnight Just like any other system

operating systems also have evolved over a period of time starting from the very primitive systems to

the present day complex and versatile ones

151 Simple Batch Systems

Computers in earlier days of their inception were very bulky large machines usually run from a console

IO devices consisted of card readers tape drives and line printers Direct user interaction with the

system did not exist Users made a job consisting of programs data and control information The job

was submitted to an operator who would execute the job on the computer system The output appeared

after minutes hours or sometimes days The user collected the output from the operator which also

included a memory dump The operating system was very simple and its major task was to transfer

control from one job to another

To speed up processing jobs with the same needs were batched together and executed as a group Thus

came into existence batch operating systems

152 Time-sharing System (Multitasking)

Another mode for delivering computing services is provided by time sharing operating systems In this

environment a computer provides computing services to several or many users concurrently on-line Here

the various users are sharing the central processor the memory and other resources of the computer system

in a manner facilitated controlled and monitored by the operating system

The user in this environment has nearly full interaction with the program during its execution and the

computers response time may be expected to be no more than a few second

It allows the user interaction with the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

6

IBM CMS

Figure 14 Block Diagram of a Time-sharing System (Multitasking)

153 Multiprogrammed System

Multiprogramming increase CPU utilization by organizing jobs so that the CPU always has one to execute

The operating system keeps several jobs in memory simultaneously Thus it is evident that a time-sharing

system is a multiprogramming system but note that a multiprogramming system is not necessarily a

time-sharing system

Multiprogramming is a technique to execute number of programs simultaneously by a single

processor

In Multiprogramming number of processes resides in main memory at a time

The OS picks and begins to execute one of the jobs in the main memory

If any IO wait happened in a process then CPU switches from that job to another job

Hence CPU in not idle at any time

Figure 15 depicts the layout of multiprogramming system

The main memory consists of 4 jobs at a time the CPU executes one by one

OS

JOB1

JOB2

JOB3

JOB4

System 1

CPU

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

7

Advantages

bull Efficient memory utilization

bull Throughput increases

bull CPU is never idle so performance increases

154 Multiprocessor System

o System which supports more than one processor

o Processor communicates with each other

o Processors Share the memory and other devices

Advantages

More work in Less Time (Increased Throughput)

Saves money by sharing Devices (Economy of Scale )

Reliability

Figure 16 Block Diagram of a Multiprocessor System

System

Mother Board

CPU 1 CPU2

RAM Share

Memor

y

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

8

155 Distributed System

It is a collection of processors that do not share memory devices and system clock A distributed computing

system consists of a number of computers that are connected and managed so that they automatically share

the job processing load among the constituent computers or separate the job load as appropriate particularly

configured processors

Such a system requires an operating system which in addition to the typical stand- alone functionality

provides coordination of the operations and information flow among the component computers

Example ATM

Figure 17 Block Diagram of a Distributed System

156 Client ndash Server System

It consists of Client system and a Server System The client which can be either another operating

system component or application program requests a service by sending a message to the server An OS

kernel (or microkernel) running in kernel mode delivers the message to the appropriate server the server

performs the operation and microkernel delivers the results to the client in another message

Client requests a service and Server Responds with a Service

Example Email

Figure 18 Block Diagram of a Client ndash Server System

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

9

16 Services of Operating System

Program Execution

The operating system loads the contents (or sections) of a file into memory and begin its execution

I0 Operations

Disks tapes serial lines and other devices must be communicated with at a very low level The user

need only specify the device and the operation to perform on it while the system converts that request

into device or controller specific commands

File-system management

There are many details in file creation deletion allocation and naming that users should not have to

perform Blocks of disk space are used by files and must be tracked Deleting a file requires removing

the name file information and freeing the allocated blocks

Communications

Message passing between systems requires messages be turned into packets of information sent to the

network controller transmitted across a communication medium and reassembled by the destination

system

Error detection

Error detection occurs at both the hardware and software levels At hardware level all data transfers

must be inspected to ensure that data have not been corrupted in transmission At the software level

media must be checked for data consistency for instance do the numbers of allocated and unallocated

blocks of storage match the total number on the device

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

10

17 Operating System terminologies

The Kernel

It is central to the operating system It is the part of the operating system that loads first and it remains

in main memory Because it stays in memory it is important for the kernel to be as small as possible It

provides all the essential services required by other parts of the operating system and applications

Typically the kernel is responsible for memory management process management and disk

management

User Interface

The user interacts with the OS through the user interface

The components of the user interface are

1 The command interpreter

2 The file system

3 On-line help and

4 Application integration

Command Interpreter Shell

Users normally interact with the operating system through a set of commands For example the DOS operating

system contains commands such as COPY and RENAME for copying files and changing the names of files

respectively The commands are accepted and executed by a part of the operating system called the command

processor or command line interpreter In some operating systems the command interpreter is called the

shell

In some Operating systems Graphical user interfaces (GUI) allow us to enter commands by pointing and clicking

at objects that appear on the screen OS like Windows XP MacOS are some example for GUI

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

11

Examples

Below is the list of some DOS operating system commands

1 DIR [note Directory means Folder in windows XP]

This command displays files and folders in the current directory or folder

Most of the DOS commands come with various options They are called switches in DOS

Example with switches DIR AD

Here the switch AD is used with DIR command to display all the sub folders in the current directory

2 CLS ndashThis command clears the screen

Special switch

To know syntax of a particular command with all options type Command name

Example To know about COPY command type

COPY

Commands of UNIX

cp

(Copy -- same as DOS copy)

rm

(Remove [or delete] a file -- same as DOS del)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

12

Chapter ndash II

PROCESS MANAGEMENT-I

21 PROCESS

A program in execution is called process A process is executed sequentially one instruction at a

time A program is a passive entity For example a file on the disk A process on the other hand is an

active entity In addition to program code it includes PCB

PROCESS STATE

As a Process executes it changes state The state of a process is defined in which part by the

current activity of that process

Each process may be in any one of the following states

New Process being created

Running Instructions being executed

Waiting Process waiting for an event to occur

Ready Process waiting for CPU

Terminated Process has finished execution

Process State Transition Diagram Figure 21

The above diagram explains how the process transit to various states in its lifecycle by some events

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

13

22 PROCESS CONTROL BLOCK

A Process Control Block (PCB) also called Task Control Block represents each process in the

operating system

Every process has a process control block (PCB) which represents a process in an operating

system The PCB contains information that makes the process an active entity Following is the list of

information a PCB of a process contains

Process numbers is used to uniquely identify a process

The process state gives the current state of the process It can be either new ready

running waiting or terminated

The program counter contains the address of the next instruction to be executed

The values in the CPU registers are required when the CPU switches from one process

to another for a successful continuation

Memory management information is dependent on the memory system used by the

operating This includes base registers limit registers page tables segment tables and

other related details

IO information gives details about the IO devices allotted to the process the number of

files that are open and in use by the process etc

23 Multi Programming and Process Scheduling

Multiprogramming is a technique used to utilize maximum CPU time by running multiple programs

simultaneously It is achieved by two ways

1 The execution begins with the first process and continues till an instruction waiting for a peripheral is

reached the context of this process is stored and the next process in ready queue (in memory) is given a

chance to execute This will be continued until two or more programs exist in ready queue

2 Process gives up the CPU on expiry of its time slice and rejoins the ready queue This will be

continued until two or more programs exist in ready queue (This is nothing but timesharing)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

14

1

2

Figure 22

Queuing diagram of process scheduling

Scheduler

Scheduler is a part of OS which selects processes from the ready queue for execution by the CPU

Different methods are applied for selecting processes from the ready queue These methods are called

Scheduling Algorithms

Note

Hence it is clear that CPU scheduling is the basis for Multiprogramming operating systems

24 Major Category of CPU Scheduling

Non-preemptive In this scheduling if a process once selected for execution CPU keeps executing

until it is released either by that process for IO or by termination

Preemptive In this scheduling process can be stopped executing and returned to the ready queue to

resume later

25 Scheduling Criteria

Many algorithms exist for CPU scheduling Various criteria have been suggested for comparing

these CPU scheduling algorithms

All the CPU scheduling algorithms include the following criteria

1 CPU utilization Measured in Percentage of time the CPU is busy

2 Throughput Number of processes completed per time unit is throughput

3 Turnaround time The interval of time between submission and completion of a process

is called turnaround time It includes execution time and waiting time

4 Waiting time Sum of all the times spent by a process at different instances waiting in the

ready queue is called waiting time

5 Response time Response time is the difference between time of submission and the time

the first response occurs

Time slice expired

IO request

Ready queue

IO queue

IO

CPU

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

15

Desirable features are having maximum CPU utilization throughput and minimum

turnaround time waiting time and response time

26 SCHEDULING ALGORITHMS

Scheduling algorithms differ in the manner in which the CPU selects a process in the ready

queue for execution

261 FIRST COME FIRST SERVE (FCFS) SCHEDULING ALGORITHM

A process that requests for the CPU first is allocated the CPU first Hence the name first come first serve

The implementation of the FCFS policy is easily managed with a FIFO queue When a process enters the

ready queue its PCB is linked onto the tail of the queue When the CPU is free it is allocated to the process

at the head of the queue The running process is the removed from the queue Even though the algorithm is

simple the average waiting is often quite long

Consider a set of three processes P1 P2 and P3 arriving at time instant 0 and having CPU burst times as

shown below

Process Burst time (msecs)

P1 24

P2 3

P3 3

The Gantt chart below shows the result

0 24 27 30

Figure 23 Gantt chart for above example

Average waiting time and average turnaround time are calculated as follows

The waiting time for process P1 = 0 msecs

P2 = 24 msecs

P3 = 27 msecs

Average waiting time = (0 + 24 + 27) 3 = 51 3 = 17 msecs

P1 completes at the end of 24 msecs P2 at the end of 27 msecs and P3 at the end of 30 msecs Average

turnaround time = (24 + 27 + 30) 3 = 81 3 = 27 msecs

Since the algorithm is nonpreemptive in nature it is not suited for time sharing systems

P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

16

262 SHORTEST JOB FIRST (SJF) SCHEDULING ALGORITHM

Another approach to CPU scheduling is the shortest job first algorithm In this algorithm the length of

the CPU burst is considered When the CPU is available it is assigned to the process that has the

smallest next CPU burst Hence the name shortest job first If the next CPU bursts of two processes are

the same FCFS scheduling is used to break the tie As an example consider the following set of

processes P1 P2 P3 P4 and their CPU burst times

Process Burst time (msecs)

P1 6

P2 8

P3 7

P4 3

Using SJF algorithm the processes would be scheduled as shown below

0 3 9 16 24

Figure 24 Gantt chart for above example

Average waiting time = (0 + 3 + 9 + 16) 4 = 28 4 = 7 msecs

Average turnaround time = (3 + 9 + 16 + 24) 4 = 52 4 = 13 msecs

If the above processes were scheduled using FCFS algorithm then

Average waiting time = (0 + 6 + 14 + 21) 4 = 41 4 = 1025 msecs

Average turnaround time = (6 + 14 + 21 + 24) 4 = 65 4 = 1625 msecs

It is clear that the SJF algorithm produces the most optimal scheduling scheme For a given set of

processes the algorithm gives the minimum average waiting and turnaround times This is because

shorter processes are scheduled earlier than longer ones and hence waiting time for shorter processes

decreases and it increases the waiting time of long processes SJF algorithm could be either preemptive

or nonpreemptive

The main disadvantage with the SJF algorithm lies in knowing the length of the next CPU burst SJF

algorithm is therefore not applicable in CPU scheduling

P4 P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

17

263 Priority Scheduling A priority is associated with each process and the CPU is allocated to the process with the highest

priority Equal-priority processes are scheduled in FCFS

An SJF algorithm is therefore simply a priority algorithm where the priority is the inverse of the

(predicted) next CPU burst The larger the CPU burst the lower the priority and vice versa

Priority is expressed in terms of fixed range number such as 0 to 10 Some systems use low numbers to

represent low priority while others use low numbers for high priority But in this course we will use low

numbers to represent high priority

Consider the following set of processes assumed to have arrived at time 0 in the order P1 P2 P5

with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 3

P2 1 1

P3 2 4

P4 1 5

P5 5 2

Using priority scheduling we would schedule these processes according to the Gantt chart below

0 1 6 16 18 19

Figure 25 Gantt chart for above example

Average waiting time = (0 + 1 + 6 + 16+18) 5 = 41 5 = 82 msecs

Average turnaround time = (1 +6 + 16 + 18+19) 5 = 60 5 = 12 msecs

Priorities can be defined either internally or externally Internally defined priorities use measurable

quantity such as time limits memory requirements etc to compute the priority of a process

External priorities are set by criteria that are external to the operating system such as importance of the

process amount being paid for use of the compute the owner of the process and other (political)

factors

Priority scheduling may be either preemptive or nonpreemptive When a process arrives at the ready

queue its priority is compared with that of the currently running process A preemptive priority-

scheduling algorithm will preempt the CPU if the priority of the newly arrived process is higher than

P2 P5 P1 P3 P4

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

18

that of the currently running process A nonpreemptive priority-scheduling algorithm will simply put the

new process at the head of the ready queue

The major disadvantage of priority-scheduling algorithms is indefinite blocking or starvation A

situation whereby low priority processes indefinitely wait for the CPU because of a steady stream of

higher- priority processes

A solution to indefinite blocking of low-priority processes is aging Aging is a technique of gradually

increasing the priority of processes that wait in the system for a long time

264 ROUND ROBIN (RR) SCHEDULING ALGORITHM

The round-robin CPU scheduling algorithm is basically a preemptive scheduling algorithm designed for

time-sharing systems One unit of time is called a time slice Duration of a time slice may range between

10 msecs and about 100 msecs The CPU scheduler allocates to each process in the ready queue one

time slice at a time in a round-robin fashion Hence the name round-robin

Consider the same example explained under FCFS algorithm

Process Burst time (msecs)

A 13

B 3

C 3

D 5

Let the duration of a time slice be 4 msecs which is to say CPU switches between processes every 4

msecs in a round-robin fashion The Gantt chart below shows the scheduling of processes

0 4 7 10 14 18 19 23 24

Figure 25 Gantt chart for above example

Average waiting time = [(19 ndash 8) + 4 + 7+ (18 - 4)] 3 = 36 4 = 9 msecs

The performance of the RR algorithm is very much dependent on the length of the time slice If the

duration of the time slice is indefinitely large then the RR algorithm is the same as FCFS algorithm If

the time slice is too small then the performance of the algorithm deteriorates because of the effect of

frequent context switching

A B C D A D A A

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

19

Exercise

Consider the following set of processes with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 2

P2 4 3

P3 2 1

P4 6 4 P5 5 5

The processes are assumed to have arrived in the order P1 P2 P3 P4 and P5 all at time 0

a Draw four Gantt charts illustrating the execution of these processes using FCFS SJF a

nonpreemptive priority (a smaller priority number implies a higher priority)and RR (Quantum = 1) scheduling

b What is the turnaround time of each process for each of the scheduling algorithms in (a) above

c What is the waiting time of each process for each of the scheduling algorithms in (a)

d Which of the schedules in (a) results in the minimal average waiting time (over all processes)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

20

Chapter ndash III

PROCESS MANAGEMENT-II

31 Deadlock

A process request resources and if the resources are not available at that time the process enters a waiting

state A waiting process is never again able to change state because other waiting processes hold the

resources This situation is called a deadlock

Example

ndash System has two tape drives R1 and R2 and two process P1 and P2

ndash P1 holds R1 but demand R2

ndash P2 holds R2 but demand R1

System Model

bull Resource types R1 R2 hellipRm (CPU cycles memory space IO devices)

bull Each resource type Ri has Wi instances(More than One Instances)

bull Each process utilizes a resource as follows

Request

Use

Release

32 Deadlock Characterization

Deadlock can arise if four conditions hold simultaneously

bull Mutual exclusion

At least one resource must be held in a non-sharable mode ie only one process at a time can use the

resource If another process requests that resource the requesting process must be delayed until the resource

has been released

bull Hold and wait a process holding at least one resource is waiting to acquire additional resources held

by other processes

bull No preemption a resource can be released only voluntarily by the process holding it after that

process has completed its task

bull Circular wait there exists a set P0 P1 hellip P0 of waiting processes such that P0 is waiting for a

resource that is held by P1 P1 is waiting for a resource that is held by P2 hellip Pnndash1 is waiting for a

resource that is held by Pn and P0 is waiting for a resource that is held by P0

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

21

33 Methods for Handling Deadlocks

bull Ensure that the system will never enter a deadlock state

bull Allow the system to enter a deadlock state and then recover

bull Ignore the problem and pretend that deadlocks never occur in the system used by most operating

systems including UNIX

331 Deadlock Prevention

As you have seen Deadlock Characterization for a deadlock to occur each of the four necessary

conditions must hold By ensuring that at least one of the four necessary conditions cannot hold you can

prevent the occurrence of a deadlock

Mutual Exclusion

The mutual exclusion condition must hold for non-sharable resources For instance a printer cannot be

simultaneously shared by several processes Sharable resources do not require mutually exclusive

access and thus cannot be involved in a deadlock

In general however we cannot prevent deadlocks by denying the mutual-exclusion condition Some

resources are intrinsically non-sharable

Hold and Wait

To ensure that the hold-and-wait condition never occurs in the system we must guarantee that whenever a

process requests a resource it does not hold any other resources We can implement this the following

protocol

One protocol that can be used requires each process to request and be allocated all resources before it begins

execution

An alternative protocol allows a process to request resources only when the process has none A process

may request some resources and use them Before it can request any additional resources however it must

release all the resources that it is currently allocated

No Preemption

ndash If a process that is holding some resources requests another resource that cannot be immediately

allocated to it then all resources currently being held are released

ndash Preempted resources are added to the list of resources for which the process is waiting

ndash Process will be restarted only when it can regain its old resources as well as the new ones that it

is requesting

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

22

Circular Wait

Impose a total ordering of all resource types and require that each process requests resources in an

increasing order of enumeration

332 Deadlock Avoidance

bull Simplest and most useful model requires that each process declare the maximum number of resources

of each type that it may need

bull The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that

there can never be a circular-wait condition

bull Resource-allocation state is defined by the number of available and allocated resources and the

maximum demands of the processes

Safe State

bull When a process requests an available resource system must decide if immediate allocation leaves the

system in a safe state

bull System is in safe state if there exists a safe sequence of all processes

bull Sequence ltP1 P2 hellip Pngt is safe if for each Pi the resources that Pi can still request can be satisfied

by currently available resources + resources held by all the Pj with jltI

If Pi resource needs are not immediately available then Pi can wait until all Pj have finished

When Pj is finished Pi can obtain needed resources execute return allocated resources and terminate

When Pi terminates Pi+1 can obtain its needed resources and so on

Basic Facts

bull If a system is in safe state no deadlocks

bull If a system is in unsafe state possibility of deadlock

bull Avoidance ensures that a system will never enter an unsafe state

Resource-Allocation Graph Algorithm (Single Instance of Each Resource Type)

Claim edge Pi rarr Rj indicated that process Pj may request resource Rj represented by a dashed

line

Claim edge converts to request edge when a process requests a resource

When a process releases a resource assignment edge reconverts to a claim edge

Resources must be claimed a priori in the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

23

Resource-Allocation Graph for Deadlock Avoidance Unsafe State in a Resource-Allocation Graph

Figure 31

Bankerrsquos Algorithm (Several Instance of Each Resource Type)

bull Multiple instances

bull Each process must a priori claim maximum use

bull When a process requests a resource it may have to wait

bull When a process gets all its resources it must return them in a finite amount of time

Data Structures for the Bankerrsquos Algorithm

bull Available Vector of length m If available [j] = k there are k instances of resource type Rj available

bull Max n x m matrix If Max [ij] = k then process Pi may request at most k instances of resource type Rj

bull Allocation n x m matrix If Allocation[ij] = k then Pi is currently allocated k instances of Rj

bull Need n x m matrix If Need[ij] = k then Pi may need k more instances of Rj to complete its task

Need [ij] = Max[ij] ndash Allocation [ij]

Let n = number of processes

333 Deadlock Detection

bull Allow system to enter deadlock state

bull Detection algorithm

bull Recovery scheme

Single Instance of Each Resource Type

bull Maintain wait-for graph

ndash Nodes are processes

ndash Pi rarr Pj if Pi is waiting for Pj

bull Periodically invoke an algorithm that searches for a cycle in the graph

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 5: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

5

Storage systems organized in hierarchy based on the following parameters

Speed

Cost

Volatility

Caching ndash copying information into faster storage system main memory can be viewed as a last

cache for secondary storage

15 HISTORY (Evolution) OF OPERATING SYSTEMS

The present day operating systems have not been developed overnight Just like any other system

operating systems also have evolved over a period of time starting from the very primitive systems to

the present day complex and versatile ones

151 Simple Batch Systems

Computers in earlier days of their inception were very bulky large machines usually run from a console

IO devices consisted of card readers tape drives and line printers Direct user interaction with the

system did not exist Users made a job consisting of programs data and control information The job

was submitted to an operator who would execute the job on the computer system The output appeared

after minutes hours or sometimes days The user collected the output from the operator which also

included a memory dump The operating system was very simple and its major task was to transfer

control from one job to another

To speed up processing jobs with the same needs were batched together and executed as a group Thus

came into existence batch operating systems

152 Time-sharing System (Multitasking)

Another mode for delivering computing services is provided by time sharing operating systems In this

environment a computer provides computing services to several or many users concurrently on-line Here

the various users are sharing the central processor the memory and other resources of the computer system

in a manner facilitated controlled and monitored by the operating system

The user in this environment has nearly full interaction with the program during its execution and the

computers response time may be expected to be no more than a few second

It allows the user interaction with the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

6

IBM CMS

Figure 14 Block Diagram of a Time-sharing System (Multitasking)

153 Multiprogrammed System

Multiprogramming increase CPU utilization by organizing jobs so that the CPU always has one to execute

The operating system keeps several jobs in memory simultaneously Thus it is evident that a time-sharing

system is a multiprogramming system but note that a multiprogramming system is not necessarily a

time-sharing system

Multiprogramming is a technique to execute number of programs simultaneously by a single

processor

In Multiprogramming number of processes resides in main memory at a time

The OS picks and begins to execute one of the jobs in the main memory

If any IO wait happened in a process then CPU switches from that job to another job

Hence CPU in not idle at any time

Figure 15 depicts the layout of multiprogramming system

The main memory consists of 4 jobs at a time the CPU executes one by one

OS

JOB1

JOB2

JOB3

JOB4

System 1

CPU

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

7

Advantages

bull Efficient memory utilization

bull Throughput increases

bull CPU is never idle so performance increases

154 Multiprocessor System

o System which supports more than one processor

o Processor communicates with each other

o Processors Share the memory and other devices

Advantages

More work in Less Time (Increased Throughput)

Saves money by sharing Devices (Economy of Scale )

Reliability

Figure 16 Block Diagram of a Multiprocessor System

System

Mother Board

CPU 1 CPU2

RAM Share

Memor

y

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

8

155 Distributed System

It is a collection of processors that do not share memory devices and system clock A distributed computing

system consists of a number of computers that are connected and managed so that they automatically share

the job processing load among the constituent computers or separate the job load as appropriate particularly

configured processors

Such a system requires an operating system which in addition to the typical stand- alone functionality

provides coordination of the operations and information flow among the component computers

Example ATM

Figure 17 Block Diagram of a Distributed System

156 Client ndash Server System

It consists of Client system and a Server System The client which can be either another operating

system component or application program requests a service by sending a message to the server An OS

kernel (or microkernel) running in kernel mode delivers the message to the appropriate server the server

performs the operation and microkernel delivers the results to the client in another message

Client requests a service and Server Responds with a Service

Example Email

Figure 18 Block Diagram of a Client ndash Server System

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

9

16 Services of Operating System

Program Execution

The operating system loads the contents (or sections) of a file into memory and begin its execution

I0 Operations

Disks tapes serial lines and other devices must be communicated with at a very low level The user

need only specify the device and the operation to perform on it while the system converts that request

into device or controller specific commands

File-system management

There are many details in file creation deletion allocation and naming that users should not have to

perform Blocks of disk space are used by files and must be tracked Deleting a file requires removing

the name file information and freeing the allocated blocks

Communications

Message passing between systems requires messages be turned into packets of information sent to the

network controller transmitted across a communication medium and reassembled by the destination

system

Error detection

Error detection occurs at both the hardware and software levels At hardware level all data transfers

must be inspected to ensure that data have not been corrupted in transmission At the software level

media must be checked for data consistency for instance do the numbers of allocated and unallocated

blocks of storage match the total number on the device

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

10

17 Operating System terminologies

The Kernel

It is central to the operating system It is the part of the operating system that loads first and it remains

in main memory Because it stays in memory it is important for the kernel to be as small as possible It

provides all the essential services required by other parts of the operating system and applications

Typically the kernel is responsible for memory management process management and disk

management

User Interface

The user interacts with the OS through the user interface

The components of the user interface are

1 The command interpreter

2 The file system

3 On-line help and

4 Application integration

Command Interpreter Shell

Users normally interact with the operating system through a set of commands For example the DOS operating

system contains commands such as COPY and RENAME for copying files and changing the names of files

respectively The commands are accepted and executed by a part of the operating system called the command

processor or command line interpreter In some operating systems the command interpreter is called the

shell

In some Operating systems Graphical user interfaces (GUI) allow us to enter commands by pointing and clicking

at objects that appear on the screen OS like Windows XP MacOS are some example for GUI

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

11

Examples

Below is the list of some DOS operating system commands

1 DIR [note Directory means Folder in windows XP]

This command displays files and folders in the current directory or folder

Most of the DOS commands come with various options They are called switches in DOS

Example with switches DIR AD

Here the switch AD is used with DIR command to display all the sub folders in the current directory

2 CLS ndashThis command clears the screen

Special switch

To know syntax of a particular command with all options type Command name

Example To know about COPY command type

COPY

Commands of UNIX

cp

(Copy -- same as DOS copy)

rm

(Remove [or delete] a file -- same as DOS del)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

12

Chapter ndash II

PROCESS MANAGEMENT-I

21 PROCESS

A program in execution is called process A process is executed sequentially one instruction at a

time A program is a passive entity For example a file on the disk A process on the other hand is an

active entity In addition to program code it includes PCB

PROCESS STATE

As a Process executes it changes state The state of a process is defined in which part by the

current activity of that process

Each process may be in any one of the following states

New Process being created

Running Instructions being executed

Waiting Process waiting for an event to occur

Ready Process waiting for CPU

Terminated Process has finished execution

Process State Transition Diagram Figure 21

The above diagram explains how the process transit to various states in its lifecycle by some events

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

13

22 PROCESS CONTROL BLOCK

A Process Control Block (PCB) also called Task Control Block represents each process in the

operating system

Every process has a process control block (PCB) which represents a process in an operating

system The PCB contains information that makes the process an active entity Following is the list of

information a PCB of a process contains

Process numbers is used to uniquely identify a process

The process state gives the current state of the process It can be either new ready

running waiting or terminated

The program counter contains the address of the next instruction to be executed

The values in the CPU registers are required when the CPU switches from one process

to another for a successful continuation

Memory management information is dependent on the memory system used by the

operating This includes base registers limit registers page tables segment tables and

other related details

IO information gives details about the IO devices allotted to the process the number of

files that are open and in use by the process etc

23 Multi Programming and Process Scheduling

Multiprogramming is a technique used to utilize maximum CPU time by running multiple programs

simultaneously It is achieved by two ways

1 The execution begins with the first process and continues till an instruction waiting for a peripheral is

reached the context of this process is stored and the next process in ready queue (in memory) is given a

chance to execute This will be continued until two or more programs exist in ready queue

2 Process gives up the CPU on expiry of its time slice and rejoins the ready queue This will be

continued until two or more programs exist in ready queue (This is nothing but timesharing)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

14

1

2

Figure 22

Queuing diagram of process scheduling

Scheduler

Scheduler is a part of OS which selects processes from the ready queue for execution by the CPU

Different methods are applied for selecting processes from the ready queue These methods are called

Scheduling Algorithms

Note

Hence it is clear that CPU scheduling is the basis for Multiprogramming operating systems

24 Major Category of CPU Scheduling

Non-preemptive In this scheduling if a process once selected for execution CPU keeps executing

until it is released either by that process for IO or by termination

Preemptive In this scheduling process can be stopped executing and returned to the ready queue to

resume later

25 Scheduling Criteria

Many algorithms exist for CPU scheduling Various criteria have been suggested for comparing

these CPU scheduling algorithms

All the CPU scheduling algorithms include the following criteria

1 CPU utilization Measured in Percentage of time the CPU is busy

2 Throughput Number of processes completed per time unit is throughput

3 Turnaround time The interval of time between submission and completion of a process

is called turnaround time It includes execution time and waiting time

4 Waiting time Sum of all the times spent by a process at different instances waiting in the

ready queue is called waiting time

5 Response time Response time is the difference between time of submission and the time

the first response occurs

Time slice expired

IO request

Ready queue

IO queue

IO

CPU

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

15

Desirable features are having maximum CPU utilization throughput and minimum

turnaround time waiting time and response time

26 SCHEDULING ALGORITHMS

Scheduling algorithms differ in the manner in which the CPU selects a process in the ready

queue for execution

261 FIRST COME FIRST SERVE (FCFS) SCHEDULING ALGORITHM

A process that requests for the CPU first is allocated the CPU first Hence the name first come first serve

The implementation of the FCFS policy is easily managed with a FIFO queue When a process enters the

ready queue its PCB is linked onto the tail of the queue When the CPU is free it is allocated to the process

at the head of the queue The running process is the removed from the queue Even though the algorithm is

simple the average waiting is often quite long

Consider a set of three processes P1 P2 and P3 arriving at time instant 0 and having CPU burst times as

shown below

Process Burst time (msecs)

P1 24

P2 3

P3 3

The Gantt chart below shows the result

0 24 27 30

Figure 23 Gantt chart for above example

Average waiting time and average turnaround time are calculated as follows

The waiting time for process P1 = 0 msecs

P2 = 24 msecs

P3 = 27 msecs

Average waiting time = (0 + 24 + 27) 3 = 51 3 = 17 msecs

P1 completes at the end of 24 msecs P2 at the end of 27 msecs and P3 at the end of 30 msecs Average

turnaround time = (24 + 27 + 30) 3 = 81 3 = 27 msecs

Since the algorithm is nonpreemptive in nature it is not suited for time sharing systems

P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

16

262 SHORTEST JOB FIRST (SJF) SCHEDULING ALGORITHM

Another approach to CPU scheduling is the shortest job first algorithm In this algorithm the length of

the CPU burst is considered When the CPU is available it is assigned to the process that has the

smallest next CPU burst Hence the name shortest job first If the next CPU bursts of two processes are

the same FCFS scheduling is used to break the tie As an example consider the following set of

processes P1 P2 P3 P4 and their CPU burst times

Process Burst time (msecs)

P1 6

P2 8

P3 7

P4 3

Using SJF algorithm the processes would be scheduled as shown below

0 3 9 16 24

Figure 24 Gantt chart for above example

Average waiting time = (0 + 3 + 9 + 16) 4 = 28 4 = 7 msecs

Average turnaround time = (3 + 9 + 16 + 24) 4 = 52 4 = 13 msecs

If the above processes were scheduled using FCFS algorithm then

Average waiting time = (0 + 6 + 14 + 21) 4 = 41 4 = 1025 msecs

Average turnaround time = (6 + 14 + 21 + 24) 4 = 65 4 = 1625 msecs

It is clear that the SJF algorithm produces the most optimal scheduling scheme For a given set of

processes the algorithm gives the minimum average waiting and turnaround times This is because

shorter processes are scheduled earlier than longer ones and hence waiting time for shorter processes

decreases and it increases the waiting time of long processes SJF algorithm could be either preemptive

or nonpreemptive

The main disadvantage with the SJF algorithm lies in knowing the length of the next CPU burst SJF

algorithm is therefore not applicable in CPU scheduling

P4 P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

17

263 Priority Scheduling A priority is associated with each process and the CPU is allocated to the process with the highest

priority Equal-priority processes are scheduled in FCFS

An SJF algorithm is therefore simply a priority algorithm where the priority is the inverse of the

(predicted) next CPU burst The larger the CPU burst the lower the priority and vice versa

Priority is expressed in terms of fixed range number such as 0 to 10 Some systems use low numbers to

represent low priority while others use low numbers for high priority But in this course we will use low

numbers to represent high priority

Consider the following set of processes assumed to have arrived at time 0 in the order P1 P2 P5

with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 3

P2 1 1

P3 2 4

P4 1 5

P5 5 2

Using priority scheduling we would schedule these processes according to the Gantt chart below

0 1 6 16 18 19

Figure 25 Gantt chart for above example

Average waiting time = (0 + 1 + 6 + 16+18) 5 = 41 5 = 82 msecs

Average turnaround time = (1 +6 + 16 + 18+19) 5 = 60 5 = 12 msecs

Priorities can be defined either internally or externally Internally defined priorities use measurable

quantity such as time limits memory requirements etc to compute the priority of a process

External priorities are set by criteria that are external to the operating system such as importance of the

process amount being paid for use of the compute the owner of the process and other (political)

factors

Priority scheduling may be either preemptive or nonpreemptive When a process arrives at the ready

queue its priority is compared with that of the currently running process A preemptive priority-

scheduling algorithm will preempt the CPU if the priority of the newly arrived process is higher than

P2 P5 P1 P3 P4

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

18

that of the currently running process A nonpreemptive priority-scheduling algorithm will simply put the

new process at the head of the ready queue

The major disadvantage of priority-scheduling algorithms is indefinite blocking or starvation A

situation whereby low priority processes indefinitely wait for the CPU because of a steady stream of

higher- priority processes

A solution to indefinite blocking of low-priority processes is aging Aging is a technique of gradually

increasing the priority of processes that wait in the system for a long time

264 ROUND ROBIN (RR) SCHEDULING ALGORITHM

The round-robin CPU scheduling algorithm is basically a preemptive scheduling algorithm designed for

time-sharing systems One unit of time is called a time slice Duration of a time slice may range between

10 msecs and about 100 msecs The CPU scheduler allocates to each process in the ready queue one

time slice at a time in a round-robin fashion Hence the name round-robin

Consider the same example explained under FCFS algorithm

Process Burst time (msecs)

A 13

B 3

C 3

D 5

Let the duration of a time slice be 4 msecs which is to say CPU switches between processes every 4

msecs in a round-robin fashion The Gantt chart below shows the scheduling of processes

0 4 7 10 14 18 19 23 24

Figure 25 Gantt chart for above example

Average waiting time = [(19 ndash 8) + 4 + 7+ (18 - 4)] 3 = 36 4 = 9 msecs

The performance of the RR algorithm is very much dependent on the length of the time slice If the

duration of the time slice is indefinitely large then the RR algorithm is the same as FCFS algorithm If

the time slice is too small then the performance of the algorithm deteriorates because of the effect of

frequent context switching

A B C D A D A A

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

19

Exercise

Consider the following set of processes with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 2

P2 4 3

P3 2 1

P4 6 4 P5 5 5

The processes are assumed to have arrived in the order P1 P2 P3 P4 and P5 all at time 0

a Draw four Gantt charts illustrating the execution of these processes using FCFS SJF a

nonpreemptive priority (a smaller priority number implies a higher priority)and RR (Quantum = 1) scheduling

b What is the turnaround time of each process for each of the scheduling algorithms in (a) above

c What is the waiting time of each process for each of the scheduling algorithms in (a)

d Which of the schedules in (a) results in the minimal average waiting time (over all processes)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

20

Chapter ndash III

PROCESS MANAGEMENT-II

31 Deadlock

A process request resources and if the resources are not available at that time the process enters a waiting

state A waiting process is never again able to change state because other waiting processes hold the

resources This situation is called a deadlock

Example

ndash System has two tape drives R1 and R2 and two process P1 and P2

ndash P1 holds R1 but demand R2

ndash P2 holds R2 but demand R1

System Model

bull Resource types R1 R2 hellipRm (CPU cycles memory space IO devices)

bull Each resource type Ri has Wi instances(More than One Instances)

bull Each process utilizes a resource as follows

Request

Use

Release

32 Deadlock Characterization

Deadlock can arise if four conditions hold simultaneously

bull Mutual exclusion

At least one resource must be held in a non-sharable mode ie only one process at a time can use the

resource If another process requests that resource the requesting process must be delayed until the resource

has been released

bull Hold and wait a process holding at least one resource is waiting to acquire additional resources held

by other processes

bull No preemption a resource can be released only voluntarily by the process holding it after that

process has completed its task

bull Circular wait there exists a set P0 P1 hellip P0 of waiting processes such that P0 is waiting for a

resource that is held by P1 P1 is waiting for a resource that is held by P2 hellip Pnndash1 is waiting for a

resource that is held by Pn and P0 is waiting for a resource that is held by P0

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

21

33 Methods for Handling Deadlocks

bull Ensure that the system will never enter a deadlock state

bull Allow the system to enter a deadlock state and then recover

bull Ignore the problem and pretend that deadlocks never occur in the system used by most operating

systems including UNIX

331 Deadlock Prevention

As you have seen Deadlock Characterization for a deadlock to occur each of the four necessary

conditions must hold By ensuring that at least one of the four necessary conditions cannot hold you can

prevent the occurrence of a deadlock

Mutual Exclusion

The mutual exclusion condition must hold for non-sharable resources For instance a printer cannot be

simultaneously shared by several processes Sharable resources do not require mutually exclusive

access and thus cannot be involved in a deadlock

In general however we cannot prevent deadlocks by denying the mutual-exclusion condition Some

resources are intrinsically non-sharable

Hold and Wait

To ensure that the hold-and-wait condition never occurs in the system we must guarantee that whenever a

process requests a resource it does not hold any other resources We can implement this the following

protocol

One protocol that can be used requires each process to request and be allocated all resources before it begins

execution

An alternative protocol allows a process to request resources only when the process has none A process

may request some resources and use them Before it can request any additional resources however it must

release all the resources that it is currently allocated

No Preemption

ndash If a process that is holding some resources requests another resource that cannot be immediately

allocated to it then all resources currently being held are released

ndash Preempted resources are added to the list of resources for which the process is waiting

ndash Process will be restarted only when it can regain its old resources as well as the new ones that it

is requesting

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

22

Circular Wait

Impose a total ordering of all resource types and require that each process requests resources in an

increasing order of enumeration

332 Deadlock Avoidance

bull Simplest and most useful model requires that each process declare the maximum number of resources

of each type that it may need

bull The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that

there can never be a circular-wait condition

bull Resource-allocation state is defined by the number of available and allocated resources and the

maximum demands of the processes

Safe State

bull When a process requests an available resource system must decide if immediate allocation leaves the

system in a safe state

bull System is in safe state if there exists a safe sequence of all processes

bull Sequence ltP1 P2 hellip Pngt is safe if for each Pi the resources that Pi can still request can be satisfied

by currently available resources + resources held by all the Pj with jltI

If Pi resource needs are not immediately available then Pi can wait until all Pj have finished

When Pj is finished Pi can obtain needed resources execute return allocated resources and terminate

When Pi terminates Pi+1 can obtain its needed resources and so on

Basic Facts

bull If a system is in safe state no deadlocks

bull If a system is in unsafe state possibility of deadlock

bull Avoidance ensures that a system will never enter an unsafe state

Resource-Allocation Graph Algorithm (Single Instance of Each Resource Type)

Claim edge Pi rarr Rj indicated that process Pj may request resource Rj represented by a dashed

line

Claim edge converts to request edge when a process requests a resource

When a process releases a resource assignment edge reconverts to a claim edge

Resources must be claimed a priori in the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

23

Resource-Allocation Graph for Deadlock Avoidance Unsafe State in a Resource-Allocation Graph

Figure 31

Bankerrsquos Algorithm (Several Instance of Each Resource Type)

bull Multiple instances

bull Each process must a priori claim maximum use

bull When a process requests a resource it may have to wait

bull When a process gets all its resources it must return them in a finite amount of time

Data Structures for the Bankerrsquos Algorithm

bull Available Vector of length m If available [j] = k there are k instances of resource type Rj available

bull Max n x m matrix If Max [ij] = k then process Pi may request at most k instances of resource type Rj

bull Allocation n x m matrix If Allocation[ij] = k then Pi is currently allocated k instances of Rj

bull Need n x m matrix If Need[ij] = k then Pi may need k more instances of Rj to complete its task

Need [ij] = Max[ij] ndash Allocation [ij]

Let n = number of processes

333 Deadlock Detection

bull Allow system to enter deadlock state

bull Detection algorithm

bull Recovery scheme

Single Instance of Each Resource Type

bull Maintain wait-for graph

ndash Nodes are processes

ndash Pi rarr Pj if Pi is waiting for Pj

bull Periodically invoke an algorithm that searches for a cycle in the graph

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 6: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

6

IBM CMS

Figure 14 Block Diagram of a Time-sharing System (Multitasking)

153 Multiprogrammed System

Multiprogramming increase CPU utilization by organizing jobs so that the CPU always has one to execute

The operating system keeps several jobs in memory simultaneously Thus it is evident that a time-sharing

system is a multiprogramming system but note that a multiprogramming system is not necessarily a

time-sharing system

Multiprogramming is a technique to execute number of programs simultaneously by a single

processor

In Multiprogramming number of processes resides in main memory at a time

The OS picks and begins to execute one of the jobs in the main memory

If any IO wait happened in a process then CPU switches from that job to another job

Hence CPU in not idle at any time

Figure 15 depicts the layout of multiprogramming system

The main memory consists of 4 jobs at a time the CPU executes one by one

OS

JOB1

JOB2

JOB3

JOB4

System 1

CPU

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

7

Advantages

bull Efficient memory utilization

bull Throughput increases

bull CPU is never idle so performance increases

154 Multiprocessor System

o System which supports more than one processor

o Processor communicates with each other

o Processors Share the memory and other devices

Advantages

More work in Less Time (Increased Throughput)

Saves money by sharing Devices (Economy of Scale )

Reliability

Figure 16 Block Diagram of a Multiprocessor System

System

Mother Board

CPU 1 CPU2

RAM Share

Memor

y

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

8

155 Distributed System

It is a collection of processors that do not share memory devices and system clock A distributed computing

system consists of a number of computers that are connected and managed so that they automatically share

the job processing load among the constituent computers or separate the job load as appropriate particularly

configured processors

Such a system requires an operating system which in addition to the typical stand- alone functionality

provides coordination of the operations and information flow among the component computers

Example ATM

Figure 17 Block Diagram of a Distributed System

156 Client ndash Server System

It consists of Client system and a Server System The client which can be either another operating

system component or application program requests a service by sending a message to the server An OS

kernel (or microkernel) running in kernel mode delivers the message to the appropriate server the server

performs the operation and microkernel delivers the results to the client in another message

Client requests a service and Server Responds with a Service

Example Email

Figure 18 Block Diagram of a Client ndash Server System

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

9

16 Services of Operating System

Program Execution

The operating system loads the contents (or sections) of a file into memory and begin its execution

I0 Operations

Disks tapes serial lines and other devices must be communicated with at a very low level The user

need only specify the device and the operation to perform on it while the system converts that request

into device or controller specific commands

File-system management

There are many details in file creation deletion allocation and naming that users should not have to

perform Blocks of disk space are used by files and must be tracked Deleting a file requires removing

the name file information and freeing the allocated blocks

Communications

Message passing between systems requires messages be turned into packets of information sent to the

network controller transmitted across a communication medium and reassembled by the destination

system

Error detection

Error detection occurs at both the hardware and software levels At hardware level all data transfers

must be inspected to ensure that data have not been corrupted in transmission At the software level

media must be checked for data consistency for instance do the numbers of allocated and unallocated

blocks of storage match the total number on the device

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

10

17 Operating System terminologies

The Kernel

It is central to the operating system It is the part of the operating system that loads first and it remains

in main memory Because it stays in memory it is important for the kernel to be as small as possible It

provides all the essential services required by other parts of the operating system and applications

Typically the kernel is responsible for memory management process management and disk

management

User Interface

The user interacts with the OS through the user interface

The components of the user interface are

1 The command interpreter

2 The file system

3 On-line help and

4 Application integration

Command Interpreter Shell

Users normally interact with the operating system through a set of commands For example the DOS operating

system contains commands such as COPY and RENAME for copying files and changing the names of files

respectively The commands are accepted and executed by a part of the operating system called the command

processor or command line interpreter In some operating systems the command interpreter is called the

shell

In some Operating systems Graphical user interfaces (GUI) allow us to enter commands by pointing and clicking

at objects that appear on the screen OS like Windows XP MacOS are some example for GUI

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

11

Examples

Below is the list of some DOS operating system commands

1 DIR [note Directory means Folder in windows XP]

This command displays files and folders in the current directory or folder

Most of the DOS commands come with various options They are called switches in DOS

Example with switches DIR AD

Here the switch AD is used with DIR command to display all the sub folders in the current directory

2 CLS ndashThis command clears the screen

Special switch

To know syntax of a particular command with all options type Command name

Example To know about COPY command type

COPY

Commands of UNIX

cp

(Copy -- same as DOS copy)

rm

(Remove [or delete] a file -- same as DOS del)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

12

Chapter ndash II

PROCESS MANAGEMENT-I

21 PROCESS

A program in execution is called process A process is executed sequentially one instruction at a

time A program is a passive entity For example a file on the disk A process on the other hand is an

active entity In addition to program code it includes PCB

PROCESS STATE

As a Process executes it changes state The state of a process is defined in which part by the

current activity of that process

Each process may be in any one of the following states

New Process being created

Running Instructions being executed

Waiting Process waiting for an event to occur

Ready Process waiting for CPU

Terminated Process has finished execution

Process State Transition Diagram Figure 21

The above diagram explains how the process transit to various states in its lifecycle by some events

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

13

22 PROCESS CONTROL BLOCK

A Process Control Block (PCB) also called Task Control Block represents each process in the

operating system

Every process has a process control block (PCB) which represents a process in an operating

system The PCB contains information that makes the process an active entity Following is the list of

information a PCB of a process contains

Process numbers is used to uniquely identify a process

The process state gives the current state of the process It can be either new ready

running waiting or terminated

The program counter contains the address of the next instruction to be executed

The values in the CPU registers are required when the CPU switches from one process

to another for a successful continuation

Memory management information is dependent on the memory system used by the

operating This includes base registers limit registers page tables segment tables and

other related details

IO information gives details about the IO devices allotted to the process the number of

files that are open and in use by the process etc

23 Multi Programming and Process Scheduling

Multiprogramming is a technique used to utilize maximum CPU time by running multiple programs

simultaneously It is achieved by two ways

1 The execution begins with the first process and continues till an instruction waiting for a peripheral is

reached the context of this process is stored and the next process in ready queue (in memory) is given a

chance to execute This will be continued until two or more programs exist in ready queue

2 Process gives up the CPU on expiry of its time slice and rejoins the ready queue This will be

continued until two or more programs exist in ready queue (This is nothing but timesharing)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

14

1

2

Figure 22

Queuing diagram of process scheduling

Scheduler

Scheduler is a part of OS which selects processes from the ready queue for execution by the CPU

Different methods are applied for selecting processes from the ready queue These methods are called

Scheduling Algorithms

Note

Hence it is clear that CPU scheduling is the basis for Multiprogramming operating systems

24 Major Category of CPU Scheduling

Non-preemptive In this scheduling if a process once selected for execution CPU keeps executing

until it is released either by that process for IO or by termination

Preemptive In this scheduling process can be stopped executing and returned to the ready queue to

resume later

25 Scheduling Criteria

Many algorithms exist for CPU scheduling Various criteria have been suggested for comparing

these CPU scheduling algorithms

All the CPU scheduling algorithms include the following criteria

1 CPU utilization Measured in Percentage of time the CPU is busy

2 Throughput Number of processes completed per time unit is throughput

3 Turnaround time The interval of time between submission and completion of a process

is called turnaround time It includes execution time and waiting time

4 Waiting time Sum of all the times spent by a process at different instances waiting in the

ready queue is called waiting time

5 Response time Response time is the difference between time of submission and the time

the first response occurs

Time slice expired

IO request

Ready queue

IO queue

IO

CPU

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

15

Desirable features are having maximum CPU utilization throughput and minimum

turnaround time waiting time and response time

26 SCHEDULING ALGORITHMS

Scheduling algorithms differ in the manner in which the CPU selects a process in the ready

queue for execution

261 FIRST COME FIRST SERVE (FCFS) SCHEDULING ALGORITHM

A process that requests for the CPU first is allocated the CPU first Hence the name first come first serve

The implementation of the FCFS policy is easily managed with a FIFO queue When a process enters the

ready queue its PCB is linked onto the tail of the queue When the CPU is free it is allocated to the process

at the head of the queue The running process is the removed from the queue Even though the algorithm is

simple the average waiting is often quite long

Consider a set of three processes P1 P2 and P3 arriving at time instant 0 and having CPU burst times as

shown below

Process Burst time (msecs)

P1 24

P2 3

P3 3

The Gantt chart below shows the result

0 24 27 30

Figure 23 Gantt chart for above example

Average waiting time and average turnaround time are calculated as follows

The waiting time for process P1 = 0 msecs

P2 = 24 msecs

P3 = 27 msecs

Average waiting time = (0 + 24 + 27) 3 = 51 3 = 17 msecs

P1 completes at the end of 24 msecs P2 at the end of 27 msecs and P3 at the end of 30 msecs Average

turnaround time = (24 + 27 + 30) 3 = 81 3 = 27 msecs

Since the algorithm is nonpreemptive in nature it is not suited for time sharing systems

P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

16

262 SHORTEST JOB FIRST (SJF) SCHEDULING ALGORITHM

Another approach to CPU scheduling is the shortest job first algorithm In this algorithm the length of

the CPU burst is considered When the CPU is available it is assigned to the process that has the

smallest next CPU burst Hence the name shortest job first If the next CPU bursts of two processes are

the same FCFS scheduling is used to break the tie As an example consider the following set of

processes P1 P2 P3 P4 and their CPU burst times

Process Burst time (msecs)

P1 6

P2 8

P3 7

P4 3

Using SJF algorithm the processes would be scheduled as shown below

0 3 9 16 24

Figure 24 Gantt chart for above example

Average waiting time = (0 + 3 + 9 + 16) 4 = 28 4 = 7 msecs

Average turnaround time = (3 + 9 + 16 + 24) 4 = 52 4 = 13 msecs

If the above processes were scheduled using FCFS algorithm then

Average waiting time = (0 + 6 + 14 + 21) 4 = 41 4 = 1025 msecs

Average turnaround time = (6 + 14 + 21 + 24) 4 = 65 4 = 1625 msecs

It is clear that the SJF algorithm produces the most optimal scheduling scheme For a given set of

processes the algorithm gives the minimum average waiting and turnaround times This is because

shorter processes are scheduled earlier than longer ones and hence waiting time for shorter processes

decreases and it increases the waiting time of long processes SJF algorithm could be either preemptive

or nonpreemptive

The main disadvantage with the SJF algorithm lies in knowing the length of the next CPU burst SJF

algorithm is therefore not applicable in CPU scheduling

P4 P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

17

263 Priority Scheduling A priority is associated with each process and the CPU is allocated to the process with the highest

priority Equal-priority processes are scheduled in FCFS

An SJF algorithm is therefore simply a priority algorithm where the priority is the inverse of the

(predicted) next CPU burst The larger the CPU burst the lower the priority and vice versa

Priority is expressed in terms of fixed range number such as 0 to 10 Some systems use low numbers to

represent low priority while others use low numbers for high priority But in this course we will use low

numbers to represent high priority

Consider the following set of processes assumed to have arrived at time 0 in the order P1 P2 P5

with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 3

P2 1 1

P3 2 4

P4 1 5

P5 5 2

Using priority scheduling we would schedule these processes according to the Gantt chart below

0 1 6 16 18 19

Figure 25 Gantt chart for above example

Average waiting time = (0 + 1 + 6 + 16+18) 5 = 41 5 = 82 msecs

Average turnaround time = (1 +6 + 16 + 18+19) 5 = 60 5 = 12 msecs

Priorities can be defined either internally or externally Internally defined priorities use measurable

quantity such as time limits memory requirements etc to compute the priority of a process

External priorities are set by criteria that are external to the operating system such as importance of the

process amount being paid for use of the compute the owner of the process and other (political)

factors

Priority scheduling may be either preemptive or nonpreemptive When a process arrives at the ready

queue its priority is compared with that of the currently running process A preemptive priority-

scheduling algorithm will preempt the CPU if the priority of the newly arrived process is higher than

P2 P5 P1 P3 P4

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

18

that of the currently running process A nonpreemptive priority-scheduling algorithm will simply put the

new process at the head of the ready queue

The major disadvantage of priority-scheduling algorithms is indefinite blocking or starvation A

situation whereby low priority processes indefinitely wait for the CPU because of a steady stream of

higher- priority processes

A solution to indefinite blocking of low-priority processes is aging Aging is a technique of gradually

increasing the priority of processes that wait in the system for a long time

264 ROUND ROBIN (RR) SCHEDULING ALGORITHM

The round-robin CPU scheduling algorithm is basically a preemptive scheduling algorithm designed for

time-sharing systems One unit of time is called a time slice Duration of a time slice may range between

10 msecs and about 100 msecs The CPU scheduler allocates to each process in the ready queue one

time slice at a time in a round-robin fashion Hence the name round-robin

Consider the same example explained under FCFS algorithm

Process Burst time (msecs)

A 13

B 3

C 3

D 5

Let the duration of a time slice be 4 msecs which is to say CPU switches between processes every 4

msecs in a round-robin fashion The Gantt chart below shows the scheduling of processes

0 4 7 10 14 18 19 23 24

Figure 25 Gantt chart for above example

Average waiting time = [(19 ndash 8) + 4 + 7+ (18 - 4)] 3 = 36 4 = 9 msecs

The performance of the RR algorithm is very much dependent on the length of the time slice If the

duration of the time slice is indefinitely large then the RR algorithm is the same as FCFS algorithm If

the time slice is too small then the performance of the algorithm deteriorates because of the effect of

frequent context switching

A B C D A D A A

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

19

Exercise

Consider the following set of processes with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 2

P2 4 3

P3 2 1

P4 6 4 P5 5 5

The processes are assumed to have arrived in the order P1 P2 P3 P4 and P5 all at time 0

a Draw four Gantt charts illustrating the execution of these processes using FCFS SJF a

nonpreemptive priority (a smaller priority number implies a higher priority)and RR (Quantum = 1) scheduling

b What is the turnaround time of each process for each of the scheduling algorithms in (a) above

c What is the waiting time of each process for each of the scheduling algorithms in (a)

d Which of the schedules in (a) results in the minimal average waiting time (over all processes)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

20

Chapter ndash III

PROCESS MANAGEMENT-II

31 Deadlock

A process request resources and if the resources are not available at that time the process enters a waiting

state A waiting process is never again able to change state because other waiting processes hold the

resources This situation is called a deadlock

Example

ndash System has two tape drives R1 and R2 and two process P1 and P2

ndash P1 holds R1 but demand R2

ndash P2 holds R2 but demand R1

System Model

bull Resource types R1 R2 hellipRm (CPU cycles memory space IO devices)

bull Each resource type Ri has Wi instances(More than One Instances)

bull Each process utilizes a resource as follows

Request

Use

Release

32 Deadlock Characterization

Deadlock can arise if four conditions hold simultaneously

bull Mutual exclusion

At least one resource must be held in a non-sharable mode ie only one process at a time can use the

resource If another process requests that resource the requesting process must be delayed until the resource

has been released

bull Hold and wait a process holding at least one resource is waiting to acquire additional resources held

by other processes

bull No preemption a resource can be released only voluntarily by the process holding it after that

process has completed its task

bull Circular wait there exists a set P0 P1 hellip P0 of waiting processes such that P0 is waiting for a

resource that is held by P1 P1 is waiting for a resource that is held by P2 hellip Pnndash1 is waiting for a

resource that is held by Pn and P0 is waiting for a resource that is held by P0

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

21

33 Methods for Handling Deadlocks

bull Ensure that the system will never enter a deadlock state

bull Allow the system to enter a deadlock state and then recover

bull Ignore the problem and pretend that deadlocks never occur in the system used by most operating

systems including UNIX

331 Deadlock Prevention

As you have seen Deadlock Characterization for a deadlock to occur each of the four necessary

conditions must hold By ensuring that at least one of the four necessary conditions cannot hold you can

prevent the occurrence of a deadlock

Mutual Exclusion

The mutual exclusion condition must hold for non-sharable resources For instance a printer cannot be

simultaneously shared by several processes Sharable resources do not require mutually exclusive

access and thus cannot be involved in a deadlock

In general however we cannot prevent deadlocks by denying the mutual-exclusion condition Some

resources are intrinsically non-sharable

Hold and Wait

To ensure that the hold-and-wait condition never occurs in the system we must guarantee that whenever a

process requests a resource it does not hold any other resources We can implement this the following

protocol

One protocol that can be used requires each process to request and be allocated all resources before it begins

execution

An alternative protocol allows a process to request resources only when the process has none A process

may request some resources and use them Before it can request any additional resources however it must

release all the resources that it is currently allocated

No Preemption

ndash If a process that is holding some resources requests another resource that cannot be immediately

allocated to it then all resources currently being held are released

ndash Preempted resources are added to the list of resources for which the process is waiting

ndash Process will be restarted only when it can regain its old resources as well as the new ones that it

is requesting

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

22

Circular Wait

Impose a total ordering of all resource types and require that each process requests resources in an

increasing order of enumeration

332 Deadlock Avoidance

bull Simplest and most useful model requires that each process declare the maximum number of resources

of each type that it may need

bull The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that

there can never be a circular-wait condition

bull Resource-allocation state is defined by the number of available and allocated resources and the

maximum demands of the processes

Safe State

bull When a process requests an available resource system must decide if immediate allocation leaves the

system in a safe state

bull System is in safe state if there exists a safe sequence of all processes

bull Sequence ltP1 P2 hellip Pngt is safe if for each Pi the resources that Pi can still request can be satisfied

by currently available resources + resources held by all the Pj with jltI

If Pi resource needs are not immediately available then Pi can wait until all Pj have finished

When Pj is finished Pi can obtain needed resources execute return allocated resources and terminate

When Pi terminates Pi+1 can obtain its needed resources and so on

Basic Facts

bull If a system is in safe state no deadlocks

bull If a system is in unsafe state possibility of deadlock

bull Avoidance ensures that a system will never enter an unsafe state

Resource-Allocation Graph Algorithm (Single Instance of Each Resource Type)

Claim edge Pi rarr Rj indicated that process Pj may request resource Rj represented by a dashed

line

Claim edge converts to request edge when a process requests a resource

When a process releases a resource assignment edge reconverts to a claim edge

Resources must be claimed a priori in the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

23

Resource-Allocation Graph for Deadlock Avoidance Unsafe State in a Resource-Allocation Graph

Figure 31

Bankerrsquos Algorithm (Several Instance of Each Resource Type)

bull Multiple instances

bull Each process must a priori claim maximum use

bull When a process requests a resource it may have to wait

bull When a process gets all its resources it must return them in a finite amount of time

Data Structures for the Bankerrsquos Algorithm

bull Available Vector of length m If available [j] = k there are k instances of resource type Rj available

bull Max n x m matrix If Max [ij] = k then process Pi may request at most k instances of resource type Rj

bull Allocation n x m matrix If Allocation[ij] = k then Pi is currently allocated k instances of Rj

bull Need n x m matrix If Need[ij] = k then Pi may need k more instances of Rj to complete its task

Need [ij] = Max[ij] ndash Allocation [ij]

Let n = number of processes

333 Deadlock Detection

bull Allow system to enter deadlock state

bull Detection algorithm

bull Recovery scheme

Single Instance of Each Resource Type

bull Maintain wait-for graph

ndash Nodes are processes

ndash Pi rarr Pj if Pi is waiting for Pj

bull Periodically invoke an algorithm that searches for a cycle in the graph

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 7: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

7

Advantages

bull Efficient memory utilization

bull Throughput increases

bull CPU is never idle so performance increases

154 Multiprocessor System

o System which supports more than one processor

o Processor communicates with each other

o Processors Share the memory and other devices

Advantages

More work in Less Time (Increased Throughput)

Saves money by sharing Devices (Economy of Scale )

Reliability

Figure 16 Block Diagram of a Multiprocessor System

System

Mother Board

CPU 1 CPU2

RAM Share

Memor

y

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

8

155 Distributed System

It is a collection of processors that do not share memory devices and system clock A distributed computing

system consists of a number of computers that are connected and managed so that they automatically share

the job processing load among the constituent computers or separate the job load as appropriate particularly

configured processors

Such a system requires an operating system which in addition to the typical stand- alone functionality

provides coordination of the operations and information flow among the component computers

Example ATM

Figure 17 Block Diagram of a Distributed System

156 Client ndash Server System

It consists of Client system and a Server System The client which can be either another operating

system component or application program requests a service by sending a message to the server An OS

kernel (or microkernel) running in kernel mode delivers the message to the appropriate server the server

performs the operation and microkernel delivers the results to the client in another message

Client requests a service and Server Responds with a Service

Example Email

Figure 18 Block Diagram of a Client ndash Server System

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

9

16 Services of Operating System

Program Execution

The operating system loads the contents (or sections) of a file into memory and begin its execution

I0 Operations

Disks tapes serial lines and other devices must be communicated with at a very low level The user

need only specify the device and the operation to perform on it while the system converts that request

into device or controller specific commands

File-system management

There are many details in file creation deletion allocation and naming that users should not have to

perform Blocks of disk space are used by files and must be tracked Deleting a file requires removing

the name file information and freeing the allocated blocks

Communications

Message passing between systems requires messages be turned into packets of information sent to the

network controller transmitted across a communication medium and reassembled by the destination

system

Error detection

Error detection occurs at both the hardware and software levels At hardware level all data transfers

must be inspected to ensure that data have not been corrupted in transmission At the software level

media must be checked for data consistency for instance do the numbers of allocated and unallocated

blocks of storage match the total number on the device

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

10

17 Operating System terminologies

The Kernel

It is central to the operating system It is the part of the operating system that loads first and it remains

in main memory Because it stays in memory it is important for the kernel to be as small as possible It

provides all the essential services required by other parts of the operating system and applications

Typically the kernel is responsible for memory management process management and disk

management

User Interface

The user interacts with the OS through the user interface

The components of the user interface are

1 The command interpreter

2 The file system

3 On-line help and

4 Application integration

Command Interpreter Shell

Users normally interact with the operating system through a set of commands For example the DOS operating

system contains commands such as COPY and RENAME for copying files and changing the names of files

respectively The commands are accepted and executed by a part of the operating system called the command

processor or command line interpreter In some operating systems the command interpreter is called the

shell

In some Operating systems Graphical user interfaces (GUI) allow us to enter commands by pointing and clicking

at objects that appear on the screen OS like Windows XP MacOS are some example for GUI

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

11

Examples

Below is the list of some DOS operating system commands

1 DIR [note Directory means Folder in windows XP]

This command displays files and folders in the current directory or folder

Most of the DOS commands come with various options They are called switches in DOS

Example with switches DIR AD

Here the switch AD is used with DIR command to display all the sub folders in the current directory

2 CLS ndashThis command clears the screen

Special switch

To know syntax of a particular command with all options type Command name

Example To know about COPY command type

COPY

Commands of UNIX

cp

(Copy -- same as DOS copy)

rm

(Remove [or delete] a file -- same as DOS del)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

12

Chapter ndash II

PROCESS MANAGEMENT-I

21 PROCESS

A program in execution is called process A process is executed sequentially one instruction at a

time A program is a passive entity For example a file on the disk A process on the other hand is an

active entity In addition to program code it includes PCB

PROCESS STATE

As a Process executes it changes state The state of a process is defined in which part by the

current activity of that process

Each process may be in any one of the following states

New Process being created

Running Instructions being executed

Waiting Process waiting for an event to occur

Ready Process waiting for CPU

Terminated Process has finished execution

Process State Transition Diagram Figure 21

The above diagram explains how the process transit to various states in its lifecycle by some events

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

13

22 PROCESS CONTROL BLOCK

A Process Control Block (PCB) also called Task Control Block represents each process in the

operating system

Every process has a process control block (PCB) which represents a process in an operating

system The PCB contains information that makes the process an active entity Following is the list of

information a PCB of a process contains

Process numbers is used to uniquely identify a process

The process state gives the current state of the process It can be either new ready

running waiting or terminated

The program counter contains the address of the next instruction to be executed

The values in the CPU registers are required when the CPU switches from one process

to another for a successful continuation

Memory management information is dependent on the memory system used by the

operating This includes base registers limit registers page tables segment tables and

other related details

IO information gives details about the IO devices allotted to the process the number of

files that are open and in use by the process etc

23 Multi Programming and Process Scheduling

Multiprogramming is a technique used to utilize maximum CPU time by running multiple programs

simultaneously It is achieved by two ways

1 The execution begins with the first process and continues till an instruction waiting for a peripheral is

reached the context of this process is stored and the next process in ready queue (in memory) is given a

chance to execute This will be continued until two or more programs exist in ready queue

2 Process gives up the CPU on expiry of its time slice and rejoins the ready queue This will be

continued until two or more programs exist in ready queue (This is nothing but timesharing)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

14

1

2

Figure 22

Queuing diagram of process scheduling

Scheduler

Scheduler is a part of OS which selects processes from the ready queue for execution by the CPU

Different methods are applied for selecting processes from the ready queue These methods are called

Scheduling Algorithms

Note

Hence it is clear that CPU scheduling is the basis for Multiprogramming operating systems

24 Major Category of CPU Scheduling

Non-preemptive In this scheduling if a process once selected for execution CPU keeps executing

until it is released either by that process for IO or by termination

Preemptive In this scheduling process can be stopped executing and returned to the ready queue to

resume later

25 Scheduling Criteria

Many algorithms exist for CPU scheduling Various criteria have been suggested for comparing

these CPU scheduling algorithms

All the CPU scheduling algorithms include the following criteria

1 CPU utilization Measured in Percentage of time the CPU is busy

2 Throughput Number of processes completed per time unit is throughput

3 Turnaround time The interval of time between submission and completion of a process

is called turnaround time It includes execution time and waiting time

4 Waiting time Sum of all the times spent by a process at different instances waiting in the

ready queue is called waiting time

5 Response time Response time is the difference between time of submission and the time

the first response occurs

Time slice expired

IO request

Ready queue

IO queue

IO

CPU

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

15

Desirable features are having maximum CPU utilization throughput and minimum

turnaround time waiting time and response time

26 SCHEDULING ALGORITHMS

Scheduling algorithms differ in the manner in which the CPU selects a process in the ready

queue for execution

261 FIRST COME FIRST SERVE (FCFS) SCHEDULING ALGORITHM

A process that requests for the CPU first is allocated the CPU first Hence the name first come first serve

The implementation of the FCFS policy is easily managed with a FIFO queue When a process enters the

ready queue its PCB is linked onto the tail of the queue When the CPU is free it is allocated to the process

at the head of the queue The running process is the removed from the queue Even though the algorithm is

simple the average waiting is often quite long

Consider a set of three processes P1 P2 and P3 arriving at time instant 0 and having CPU burst times as

shown below

Process Burst time (msecs)

P1 24

P2 3

P3 3

The Gantt chart below shows the result

0 24 27 30

Figure 23 Gantt chart for above example

Average waiting time and average turnaround time are calculated as follows

The waiting time for process P1 = 0 msecs

P2 = 24 msecs

P3 = 27 msecs

Average waiting time = (0 + 24 + 27) 3 = 51 3 = 17 msecs

P1 completes at the end of 24 msecs P2 at the end of 27 msecs and P3 at the end of 30 msecs Average

turnaround time = (24 + 27 + 30) 3 = 81 3 = 27 msecs

Since the algorithm is nonpreemptive in nature it is not suited for time sharing systems

P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

16

262 SHORTEST JOB FIRST (SJF) SCHEDULING ALGORITHM

Another approach to CPU scheduling is the shortest job first algorithm In this algorithm the length of

the CPU burst is considered When the CPU is available it is assigned to the process that has the

smallest next CPU burst Hence the name shortest job first If the next CPU bursts of two processes are

the same FCFS scheduling is used to break the tie As an example consider the following set of

processes P1 P2 P3 P4 and their CPU burst times

Process Burst time (msecs)

P1 6

P2 8

P3 7

P4 3

Using SJF algorithm the processes would be scheduled as shown below

0 3 9 16 24

Figure 24 Gantt chart for above example

Average waiting time = (0 + 3 + 9 + 16) 4 = 28 4 = 7 msecs

Average turnaround time = (3 + 9 + 16 + 24) 4 = 52 4 = 13 msecs

If the above processes were scheduled using FCFS algorithm then

Average waiting time = (0 + 6 + 14 + 21) 4 = 41 4 = 1025 msecs

Average turnaround time = (6 + 14 + 21 + 24) 4 = 65 4 = 1625 msecs

It is clear that the SJF algorithm produces the most optimal scheduling scheme For a given set of

processes the algorithm gives the minimum average waiting and turnaround times This is because

shorter processes are scheduled earlier than longer ones and hence waiting time for shorter processes

decreases and it increases the waiting time of long processes SJF algorithm could be either preemptive

or nonpreemptive

The main disadvantage with the SJF algorithm lies in knowing the length of the next CPU burst SJF

algorithm is therefore not applicable in CPU scheduling

P4 P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

17

263 Priority Scheduling A priority is associated with each process and the CPU is allocated to the process with the highest

priority Equal-priority processes are scheduled in FCFS

An SJF algorithm is therefore simply a priority algorithm where the priority is the inverse of the

(predicted) next CPU burst The larger the CPU burst the lower the priority and vice versa

Priority is expressed in terms of fixed range number such as 0 to 10 Some systems use low numbers to

represent low priority while others use low numbers for high priority But in this course we will use low

numbers to represent high priority

Consider the following set of processes assumed to have arrived at time 0 in the order P1 P2 P5

with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 3

P2 1 1

P3 2 4

P4 1 5

P5 5 2

Using priority scheduling we would schedule these processes according to the Gantt chart below

0 1 6 16 18 19

Figure 25 Gantt chart for above example

Average waiting time = (0 + 1 + 6 + 16+18) 5 = 41 5 = 82 msecs

Average turnaround time = (1 +6 + 16 + 18+19) 5 = 60 5 = 12 msecs

Priorities can be defined either internally or externally Internally defined priorities use measurable

quantity such as time limits memory requirements etc to compute the priority of a process

External priorities are set by criteria that are external to the operating system such as importance of the

process amount being paid for use of the compute the owner of the process and other (political)

factors

Priority scheduling may be either preemptive or nonpreemptive When a process arrives at the ready

queue its priority is compared with that of the currently running process A preemptive priority-

scheduling algorithm will preempt the CPU if the priority of the newly arrived process is higher than

P2 P5 P1 P3 P4

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

18

that of the currently running process A nonpreemptive priority-scheduling algorithm will simply put the

new process at the head of the ready queue

The major disadvantage of priority-scheduling algorithms is indefinite blocking or starvation A

situation whereby low priority processes indefinitely wait for the CPU because of a steady stream of

higher- priority processes

A solution to indefinite blocking of low-priority processes is aging Aging is a technique of gradually

increasing the priority of processes that wait in the system for a long time

264 ROUND ROBIN (RR) SCHEDULING ALGORITHM

The round-robin CPU scheduling algorithm is basically a preemptive scheduling algorithm designed for

time-sharing systems One unit of time is called a time slice Duration of a time slice may range between

10 msecs and about 100 msecs The CPU scheduler allocates to each process in the ready queue one

time slice at a time in a round-robin fashion Hence the name round-robin

Consider the same example explained under FCFS algorithm

Process Burst time (msecs)

A 13

B 3

C 3

D 5

Let the duration of a time slice be 4 msecs which is to say CPU switches between processes every 4

msecs in a round-robin fashion The Gantt chart below shows the scheduling of processes

0 4 7 10 14 18 19 23 24

Figure 25 Gantt chart for above example

Average waiting time = [(19 ndash 8) + 4 + 7+ (18 - 4)] 3 = 36 4 = 9 msecs

The performance of the RR algorithm is very much dependent on the length of the time slice If the

duration of the time slice is indefinitely large then the RR algorithm is the same as FCFS algorithm If

the time slice is too small then the performance of the algorithm deteriorates because of the effect of

frequent context switching

A B C D A D A A

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

19

Exercise

Consider the following set of processes with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 2

P2 4 3

P3 2 1

P4 6 4 P5 5 5

The processes are assumed to have arrived in the order P1 P2 P3 P4 and P5 all at time 0

a Draw four Gantt charts illustrating the execution of these processes using FCFS SJF a

nonpreemptive priority (a smaller priority number implies a higher priority)and RR (Quantum = 1) scheduling

b What is the turnaround time of each process for each of the scheduling algorithms in (a) above

c What is the waiting time of each process for each of the scheduling algorithms in (a)

d Which of the schedules in (a) results in the minimal average waiting time (over all processes)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

20

Chapter ndash III

PROCESS MANAGEMENT-II

31 Deadlock

A process request resources and if the resources are not available at that time the process enters a waiting

state A waiting process is never again able to change state because other waiting processes hold the

resources This situation is called a deadlock

Example

ndash System has two tape drives R1 and R2 and two process P1 and P2

ndash P1 holds R1 but demand R2

ndash P2 holds R2 but demand R1

System Model

bull Resource types R1 R2 hellipRm (CPU cycles memory space IO devices)

bull Each resource type Ri has Wi instances(More than One Instances)

bull Each process utilizes a resource as follows

Request

Use

Release

32 Deadlock Characterization

Deadlock can arise if four conditions hold simultaneously

bull Mutual exclusion

At least one resource must be held in a non-sharable mode ie only one process at a time can use the

resource If another process requests that resource the requesting process must be delayed until the resource

has been released

bull Hold and wait a process holding at least one resource is waiting to acquire additional resources held

by other processes

bull No preemption a resource can be released only voluntarily by the process holding it after that

process has completed its task

bull Circular wait there exists a set P0 P1 hellip P0 of waiting processes such that P0 is waiting for a

resource that is held by P1 P1 is waiting for a resource that is held by P2 hellip Pnndash1 is waiting for a

resource that is held by Pn and P0 is waiting for a resource that is held by P0

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

21

33 Methods for Handling Deadlocks

bull Ensure that the system will never enter a deadlock state

bull Allow the system to enter a deadlock state and then recover

bull Ignore the problem and pretend that deadlocks never occur in the system used by most operating

systems including UNIX

331 Deadlock Prevention

As you have seen Deadlock Characterization for a deadlock to occur each of the four necessary

conditions must hold By ensuring that at least one of the four necessary conditions cannot hold you can

prevent the occurrence of a deadlock

Mutual Exclusion

The mutual exclusion condition must hold for non-sharable resources For instance a printer cannot be

simultaneously shared by several processes Sharable resources do not require mutually exclusive

access and thus cannot be involved in a deadlock

In general however we cannot prevent deadlocks by denying the mutual-exclusion condition Some

resources are intrinsically non-sharable

Hold and Wait

To ensure that the hold-and-wait condition never occurs in the system we must guarantee that whenever a

process requests a resource it does not hold any other resources We can implement this the following

protocol

One protocol that can be used requires each process to request and be allocated all resources before it begins

execution

An alternative protocol allows a process to request resources only when the process has none A process

may request some resources and use them Before it can request any additional resources however it must

release all the resources that it is currently allocated

No Preemption

ndash If a process that is holding some resources requests another resource that cannot be immediately

allocated to it then all resources currently being held are released

ndash Preempted resources are added to the list of resources for which the process is waiting

ndash Process will be restarted only when it can regain its old resources as well as the new ones that it

is requesting

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

22

Circular Wait

Impose a total ordering of all resource types and require that each process requests resources in an

increasing order of enumeration

332 Deadlock Avoidance

bull Simplest and most useful model requires that each process declare the maximum number of resources

of each type that it may need

bull The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that

there can never be a circular-wait condition

bull Resource-allocation state is defined by the number of available and allocated resources and the

maximum demands of the processes

Safe State

bull When a process requests an available resource system must decide if immediate allocation leaves the

system in a safe state

bull System is in safe state if there exists a safe sequence of all processes

bull Sequence ltP1 P2 hellip Pngt is safe if for each Pi the resources that Pi can still request can be satisfied

by currently available resources + resources held by all the Pj with jltI

If Pi resource needs are not immediately available then Pi can wait until all Pj have finished

When Pj is finished Pi can obtain needed resources execute return allocated resources and terminate

When Pi terminates Pi+1 can obtain its needed resources and so on

Basic Facts

bull If a system is in safe state no deadlocks

bull If a system is in unsafe state possibility of deadlock

bull Avoidance ensures that a system will never enter an unsafe state

Resource-Allocation Graph Algorithm (Single Instance of Each Resource Type)

Claim edge Pi rarr Rj indicated that process Pj may request resource Rj represented by a dashed

line

Claim edge converts to request edge when a process requests a resource

When a process releases a resource assignment edge reconverts to a claim edge

Resources must be claimed a priori in the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

23

Resource-Allocation Graph for Deadlock Avoidance Unsafe State in a Resource-Allocation Graph

Figure 31

Bankerrsquos Algorithm (Several Instance of Each Resource Type)

bull Multiple instances

bull Each process must a priori claim maximum use

bull When a process requests a resource it may have to wait

bull When a process gets all its resources it must return them in a finite amount of time

Data Structures for the Bankerrsquos Algorithm

bull Available Vector of length m If available [j] = k there are k instances of resource type Rj available

bull Max n x m matrix If Max [ij] = k then process Pi may request at most k instances of resource type Rj

bull Allocation n x m matrix If Allocation[ij] = k then Pi is currently allocated k instances of Rj

bull Need n x m matrix If Need[ij] = k then Pi may need k more instances of Rj to complete its task

Need [ij] = Max[ij] ndash Allocation [ij]

Let n = number of processes

333 Deadlock Detection

bull Allow system to enter deadlock state

bull Detection algorithm

bull Recovery scheme

Single Instance of Each Resource Type

bull Maintain wait-for graph

ndash Nodes are processes

ndash Pi rarr Pj if Pi is waiting for Pj

bull Periodically invoke an algorithm that searches for a cycle in the graph

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 8: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

8

155 Distributed System

It is a collection of processors that do not share memory devices and system clock A distributed computing

system consists of a number of computers that are connected and managed so that they automatically share

the job processing load among the constituent computers or separate the job load as appropriate particularly

configured processors

Such a system requires an operating system which in addition to the typical stand- alone functionality

provides coordination of the operations and information flow among the component computers

Example ATM

Figure 17 Block Diagram of a Distributed System

156 Client ndash Server System

It consists of Client system and a Server System The client which can be either another operating

system component or application program requests a service by sending a message to the server An OS

kernel (or microkernel) running in kernel mode delivers the message to the appropriate server the server

performs the operation and microkernel delivers the results to the client in another message

Client requests a service and Server Responds with a Service

Example Email

Figure 18 Block Diagram of a Client ndash Server System

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

9

16 Services of Operating System

Program Execution

The operating system loads the contents (or sections) of a file into memory and begin its execution

I0 Operations

Disks tapes serial lines and other devices must be communicated with at a very low level The user

need only specify the device and the operation to perform on it while the system converts that request

into device or controller specific commands

File-system management

There are many details in file creation deletion allocation and naming that users should not have to

perform Blocks of disk space are used by files and must be tracked Deleting a file requires removing

the name file information and freeing the allocated blocks

Communications

Message passing between systems requires messages be turned into packets of information sent to the

network controller transmitted across a communication medium and reassembled by the destination

system

Error detection

Error detection occurs at both the hardware and software levels At hardware level all data transfers

must be inspected to ensure that data have not been corrupted in transmission At the software level

media must be checked for data consistency for instance do the numbers of allocated and unallocated

blocks of storage match the total number on the device

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

10

17 Operating System terminologies

The Kernel

It is central to the operating system It is the part of the operating system that loads first and it remains

in main memory Because it stays in memory it is important for the kernel to be as small as possible It

provides all the essential services required by other parts of the operating system and applications

Typically the kernel is responsible for memory management process management and disk

management

User Interface

The user interacts with the OS through the user interface

The components of the user interface are

1 The command interpreter

2 The file system

3 On-line help and

4 Application integration

Command Interpreter Shell

Users normally interact with the operating system through a set of commands For example the DOS operating

system contains commands such as COPY and RENAME for copying files and changing the names of files

respectively The commands are accepted and executed by a part of the operating system called the command

processor or command line interpreter In some operating systems the command interpreter is called the

shell

In some Operating systems Graphical user interfaces (GUI) allow us to enter commands by pointing and clicking

at objects that appear on the screen OS like Windows XP MacOS are some example for GUI

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

11

Examples

Below is the list of some DOS operating system commands

1 DIR [note Directory means Folder in windows XP]

This command displays files and folders in the current directory or folder

Most of the DOS commands come with various options They are called switches in DOS

Example with switches DIR AD

Here the switch AD is used with DIR command to display all the sub folders in the current directory

2 CLS ndashThis command clears the screen

Special switch

To know syntax of a particular command with all options type Command name

Example To know about COPY command type

COPY

Commands of UNIX

cp

(Copy -- same as DOS copy)

rm

(Remove [or delete] a file -- same as DOS del)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

12

Chapter ndash II

PROCESS MANAGEMENT-I

21 PROCESS

A program in execution is called process A process is executed sequentially one instruction at a

time A program is a passive entity For example a file on the disk A process on the other hand is an

active entity In addition to program code it includes PCB

PROCESS STATE

As a Process executes it changes state The state of a process is defined in which part by the

current activity of that process

Each process may be in any one of the following states

New Process being created

Running Instructions being executed

Waiting Process waiting for an event to occur

Ready Process waiting for CPU

Terminated Process has finished execution

Process State Transition Diagram Figure 21

The above diagram explains how the process transit to various states in its lifecycle by some events

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

13

22 PROCESS CONTROL BLOCK

A Process Control Block (PCB) also called Task Control Block represents each process in the

operating system

Every process has a process control block (PCB) which represents a process in an operating

system The PCB contains information that makes the process an active entity Following is the list of

information a PCB of a process contains

Process numbers is used to uniquely identify a process

The process state gives the current state of the process It can be either new ready

running waiting or terminated

The program counter contains the address of the next instruction to be executed

The values in the CPU registers are required when the CPU switches from one process

to another for a successful continuation

Memory management information is dependent on the memory system used by the

operating This includes base registers limit registers page tables segment tables and

other related details

IO information gives details about the IO devices allotted to the process the number of

files that are open and in use by the process etc

23 Multi Programming and Process Scheduling

Multiprogramming is a technique used to utilize maximum CPU time by running multiple programs

simultaneously It is achieved by two ways

1 The execution begins with the first process and continues till an instruction waiting for a peripheral is

reached the context of this process is stored and the next process in ready queue (in memory) is given a

chance to execute This will be continued until two or more programs exist in ready queue

2 Process gives up the CPU on expiry of its time slice and rejoins the ready queue This will be

continued until two or more programs exist in ready queue (This is nothing but timesharing)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

14

1

2

Figure 22

Queuing diagram of process scheduling

Scheduler

Scheduler is a part of OS which selects processes from the ready queue for execution by the CPU

Different methods are applied for selecting processes from the ready queue These methods are called

Scheduling Algorithms

Note

Hence it is clear that CPU scheduling is the basis for Multiprogramming operating systems

24 Major Category of CPU Scheduling

Non-preemptive In this scheduling if a process once selected for execution CPU keeps executing

until it is released either by that process for IO or by termination

Preemptive In this scheduling process can be stopped executing and returned to the ready queue to

resume later

25 Scheduling Criteria

Many algorithms exist for CPU scheduling Various criteria have been suggested for comparing

these CPU scheduling algorithms

All the CPU scheduling algorithms include the following criteria

1 CPU utilization Measured in Percentage of time the CPU is busy

2 Throughput Number of processes completed per time unit is throughput

3 Turnaround time The interval of time between submission and completion of a process

is called turnaround time It includes execution time and waiting time

4 Waiting time Sum of all the times spent by a process at different instances waiting in the

ready queue is called waiting time

5 Response time Response time is the difference between time of submission and the time

the first response occurs

Time slice expired

IO request

Ready queue

IO queue

IO

CPU

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

15

Desirable features are having maximum CPU utilization throughput and minimum

turnaround time waiting time and response time

26 SCHEDULING ALGORITHMS

Scheduling algorithms differ in the manner in which the CPU selects a process in the ready

queue for execution

261 FIRST COME FIRST SERVE (FCFS) SCHEDULING ALGORITHM

A process that requests for the CPU first is allocated the CPU first Hence the name first come first serve

The implementation of the FCFS policy is easily managed with a FIFO queue When a process enters the

ready queue its PCB is linked onto the tail of the queue When the CPU is free it is allocated to the process

at the head of the queue The running process is the removed from the queue Even though the algorithm is

simple the average waiting is often quite long

Consider a set of three processes P1 P2 and P3 arriving at time instant 0 and having CPU burst times as

shown below

Process Burst time (msecs)

P1 24

P2 3

P3 3

The Gantt chart below shows the result

0 24 27 30

Figure 23 Gantt chart for above example

Average waiting time and average turnaround time are calculated as follows

The waiting time for process P1 = 0 msecs

P2 = 24 msecs

P3 = 27 msecs

Average waiting time = (0 + 24 + 27) 3 = 51 3 = 17 msecs

P1 completes at the end of 24 msecs P2 at the end of 27 msecs and P3 at the end of 30 msecs Average

turnaround time = (24 + 27 + 30) 3 = 81 3 = 27 msecs

Since the algorithm is nonpreemptive in nature it is not suited for time sharing systems

P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

16

262 SHORTEST JOB FIRST (SJF) SCHEDULING ALGORITHM

Another approach to CPU scheduling is the shortest job first algorithm In this algorithm the length of

the CPU burst is considered When the CPU is available it is assigned to the process that has the

smallest next CPU burst Hence the name shortest job first If the next CPU bursts of two processes are

the same FCFS scheduling is used to break the tie As an example consider the following set of

processes P1 P2 P3 P4 and their CPU burst times

Process Burst time (msecs)

P1 6

P2 8

P3 7

P4 3

Using SJF algorithm the processes would be scheduled as shown below

0 3 9 16 24

Figure 24 Gantt chart for above example

Average waiting time = (0 + 3 + 9 + 16) 4 = 28 4 = 7 msecs

Average turnaround time = (3 + 9 + 16 + 24) 4 = 52 4 = 13 msecs

If the above processes were scheduled using FCFS algorithm then

Average waiting time = (0 + 6 + 14 + 21) 4 = 41 4 = 1025 msecs

Average turnaround time = (6 + 14 + 21 + 24) 4 = 65 4 = 1625 msecs

It is clear that the SJF algorithm produces the most optimal scheduling scheme For a given set of

processes the algorithm gives the minimum average waiting and turnaround times This is because

shorter processes are scheduled earlier than longer ones and hence waiting time for shorter processes

decreases and it increases the waiting time of long processes SJF algorithm could be either preemptive

or nonpreemptive

The main disadvantage with the SJF algorithm lies in knowing the length of the next CPU burst SJF

algorithm is therefore not applicable in CPU scheduling

P4 P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

17

263 Priority Scheduling A priority is associated with each process and the CPU is allocated to the process with the highest

priority Equal-priority processes are scheduled in FCFS

An SJF algorithm is therefore simply a priority algorithm where the priority is the inverse of the

(predicted) next CPU burst The larger the CPU burst the lower the priority and vice versa

Priority is expressed in terms of fixed range number such as 0 to 10 Some systems use low numbers to

represent low priority while others use low numbers for high priority But in this course we will use low

numbers to represent high priority

Consider the following set of processes assumed to have arrived at time 0 in the order P1 P2 P5

with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 3

P2 1 1

P3 2 4

P4 1 5

P5 5 2

Using priority scheduling we would schedule these processes according to the Gantt chart below

0 1 6 16 18 19

Figure 25 Gantt chart for above example

Average waiting time = (0 + 1 + 6 + 16+18) 5 = 41 5 = 82 msecs

Average turnaround time = (1 +6 + 16 + 18+19) 5 = 60 5 = 12 msecs

Priorities can be defined either internally or externally Internally defined priorities use measurable

quantity such as time limits memory requirements etc to compute the priority of a process

External priorities are set by criteria that are external to the operating system such as importance of the

process amount being paid for use of the compute the owner of the process and other (political)

factors

Priority scheduling may be either preemptive or nonpreemptive When a process arrives at the ready

queue its priority is compared with that of the currently running process A preemptive priority-

scheduling algorithm will preempt the CPU if the priority of the newly arrived process is higher than

P2 P5 P1 P3 P4

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

18

that of the currently running process A nonpreemptive priority-scheduling algorithm will simply put the

new process at the head of the ready queue

The major disadvantage of priority-scheduling algorithms is indefinite blocking or starvation A

situation whereby low priority processes indefinitely wait for the CPU because of a steady stream of

higher- priority processes

A solution to indefinite blocking of low-priority processes is aging Aging is a technique of gradually

increasing the priority of processes that wait in the system for a long time

264 ROUND ROBIN (RR) SCHEDULING ALGORITHM

The round-robin CPU scheduling algorithm is basically a preemptive scheduling algorithm designed for

time-sharing systems One unit of time is called a time slice Duration of a time slice may range between

10 msecs and about 100 msecs The CPU scheduler allocates to each process in the ready queue one

time slice at a time in a round-robin fashion Hence the name round-robin

Consider the same example explained under FCFS algorithm

Process Burst time (msecs)

A 13

B 3

C 3

D 5

Let the duration of a time slice be 4 msecs which is to say CPU switches between processes every 4

msecs in a round-robin fashion The Gantt chart below shows the scheduling of processes

0 4 7 10 14 18 19 23 24

Figure 25 Gantt chart for above example

Average waiting time = [(19 ndash 8) + 4 + 7+ (18 - 4)] 3 = 36 4 = 9 msecs

The performance of the RR algorithm is very much dependent on the length of the time slice If the

duration of the time slice is indefinitely large then the RR algorithm is the same as FCFS algorithm If

the time slice is too small then the performance of the algorithm deteriorates because of the effect of

frequent context switching

A B C D A D A A

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

19

Exercise

Consider the following set of processes with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 2

P2 4 3

P3 2 1

P4 6 4 P5 5 5

The processes are assumed to have arrived in the order P1 P2 P3 P4 and P5 all at time 0

a Draw four Gantt charts illustrating the execution of these processes using FCFS SJF a

nonpreemptive priority (a smaller priority number implies a higher priority)and RR (Quantum = 1) scheduling

b What is the turnaround time of each process for each of the scheduling algorithms in (a) above

c What is the waiting time of each process for each of the scheduling algorithms in (a)

d Which of the schedules in (a) results in the minimal average waiting time (over all processes)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

20

Chapter ndash III

PROCESS MANAGEMENT-II

31 Deadlock

A process request resources and if the resources are not available at that time the process enters a waiting

state A waiting process is never again able to change state because other waiting processes hold the

resources This situation is called a deadlock

Example

ndash System has two tape drives R1 and R2 and two process P1 and P2

ndash P1 holds R1 but demand R2

ndash P2 holds R2 but demand R1

System Model

bull Resource types R1 R2 hellipRm (CPU cycles memory space IO devices)

bull Each resource type Ri has Wi instances(More than One Instances)

bull Each process utilizes a resource as follows

Request

Use

Release

32 Deadlock Characterization

Deadlock can arise if four conditions hold simultaneously

bull Mutual exclusion

At least one resource must be held in a non-sharable mode ie only one process at a time can use the

resource If another process requests that resource the requesting process must be delayed until the resource

has been released

bull Hold and wait a process holding at least one resource is waiting to acquire additional resources held

by other processes

bull No preemption a resource can be released only voluntarily by the process holding it after that

process has completed its task

bull Circular wait there exists a set P0 P1 hellip P0 of waiting processes such that P0 is waiting for a

resource that is held by P1 P1 is waiting for a resource that is held by P2 hellip Pnndash1 is waiting for a

resource that is held by Pn and P0 is waiting for a resource that is held by P0

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

21

33 Methods for Handling Deadlocks

bull Ensure that the system will never enter a deadlock state

bull Allow the system to enter a deadlock state and then recover

bull Ignore the problem and pretend that deadlocks never occur in the system used by most operating

systems including UNIX

331 Deadlock Prevention

As you have seen Deadlock Characterization for a deadlock to occur each of the four necessary

conditions must hold By ensuring that at least one of the four necessary conditions cannot hold you can

prevent the occurrence of a deadlock

Mutual Exclusion

The mutual exclusion condition must hold for non-sharable resources For instance a printer cannot be

simultaneously shared by several processes Sharable resources do not require mutually exclusive

access and thus cannot be involved in a deadlock

In general however we cannot prevent deadlocks by denying the mutual-exclusion condition Some

resources are intrinsically non-sharable

Hold and Wait

To ensure that the hold-and-wait condition never occurs in the system we must guarantee that whenever a

process requests a resource it does not hold any other resources We can implement this the following

protocol

One protocol that can be used requires each process to request and be allocated all resources before it begins

execution

An alternative protocol allows a process to request resources only when the process has none A process

may request some resources and use them Before it can request any additional resources however it must

release all the resources that it is currently allocated

No Preemption

ndash If a process that is holding some resources requests another resource that cannot be immediately

allocated to it then all resources currently being held are released

ndash Preempted resources are added to the list of resources for which the process is waiting

ndash Process will be restarted only when it can regain its old resources as well as the new ones that it

is requesting

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

22

Circular Wait

Impose a total ordering of all resource types and require that each process requests resources in an

increasing order of enumeration

332 Deadlock Avoidance

bull Simplest and most useful model requires that each process declare the maximum number of resources

of each type that it may need

bull The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that

there can never be a circular-wait condition

bull Resource-allocation state is defined by the number of available and allocated resources and the

maximum demands of the processes

Safe State

bull When a process requests an available resource system must decide if immediate allocation leaves the

system in a safe state

bull System is in safe state if there exists a safe sequence of all processes

bull Sequence ltP1 P2 hellip Pngt is safe if for each Pi the resources that Pi can still request can be satisfied

by currently available resources + resources held by all the Pj with jltI

If Pi resource needs are not immediately available then Pi can wait until all Pj have finished

When Pj is finished Pi can obtain needed resources execute return allocated resources and terminate

When Pi terminates Pi+1 can obtain its needed resources and so on

Basic Facts

bull If a system is in safe state no deadlocks

bull If a system is in unsafe state possibility of deadlock

bull Avoidance ensures that a system will never enter an unsafe state

Resource-Allocation Graph Algorithm (Single Instance of Each Resource Type)

Claim edge Pi rarr Rj indicated that process Pj may request resource Rj represented by a dashed

line

Claim edge converts to request edge when a process requests a resource

When a process releases a resource assignment edge reconverts to a claim edge

Resources must be claimed a priori in the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

23

Resource-Allocation Graph for Deadlock Avoidance Unsafe State in a Resource-Allocation Graph

Figure 31

Bankerrsquos Algorithm (Several Instance of Each Resource Type)

bull Multiple instances

bull Each process must a priori claim maximum use

bull When a process requests a resource it may have to wait

bull When a process gets all its resources it must return them in a finite amount of time

Data Structures for the Bankerrsquos Algorithm

bull Available Vector of length m If available [j] = k there are k instances of resource type Rj available

bull Max n x m matrix If Max [ij] = k then process Pi may request at most k instances of resource type Rj

bull Allocation n x m matrix If Allocation[ij] = k then Pi is currently allocated k instances of Rj

bull Need n x m matrix If Need[ij] = k then Pi may need k more instances of Rj to complete its task

Need [ij] = Max[ij] ndash Allocation [ij]

Let n = number of processes

333 Deadlock Detection

bull Allow system to enter deadlock state

bull Detection algorithm

bull Recovery scheme

Single Instance of Each Resource Type

bull Maintain wait-for graph

ndash Nodes are processes

ndash Pi rarr Pj if Pi is waiting for Pj

bull Periodically invoke an algorithm that searches for a cycle in the graph

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 9: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

9

16 Services of Operating System

Program Execution

The operating system loads the contents (or sections) of a file into memory and begin its execution

I0 Operations

Disks tapes serial lines and other devices must be communicated with at a very low level The user

need only specify the device and the operation to perform on it while the system converts that request

into device or controller specific commands

File-system management

There are many details in file creation deletion allocation and naming that users should not have to

perform Blocks of disk space are used by files and must be tracked Deleting a file requires removing

the name file information and freeing the allocated blocks

Communications

Message passing between systems requires messages be turned into packets of information sent to the

network controller transmitted across a communication medium and reassembled by the destination

system

Error detection

Error detection occurs at both the hardware and software levels At hardware level all data transfers

must be inspected to ensure that data have not been corrupted in transmission At the software level

media must be checked for data consistency for instance do the numbers of allocated and unallocated

blocks of storage match the total number on the device

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

10

17 Operating System terminologies

The Kernel

It is central to the operating system It is the part of the operating system that loads first and it remains

in main memory Because it stays in memory it is important for the kernel to be as small as possible It

provides all the essential services required by other parts of the operating system and applications

Typically the kernel is responsible for memory management process management and disk

management

User Interface

The user interacts with the OS through the user interface

The components of the user interface are

1 The command interpreter

2 The file system

3 On-line help and

4 Application integration

Command Interpreter Shell

Users normally interact with the operating system through a set of commands For example the DOS operating

system contains commands such as COPY and RENAME for copying files and changing the names of files

respectively The commands are accepted and executed by a part of the operating system called the command

processor or command line interpreter In some operating systems the command interpreter is called the

shell

In some Operating systems Graphical user interfaces (GUI) allow us to enter commands by pointing and clicking

at objects that appear on the screen OS like Windows XP MacOS are some example for GUI

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

11

Examples

Below is the list of some DOS operating system commands

1 DIR [note Directory means Folder in windows XP]

This command displays files and folders in the current directory or folder

Most of the DOS commands come with various options They are called switches in DOS

Example with switches DIR AD

Here the switch AD is used with DIR command to display all the sub folders in the current directory

2 CLS ndashThis command clears the screen

Special switch

To know syntax of a particular command with all options type Command name

Example To know about COPY command type

COPY

Commands of UNIX

cp

(Copy -- same as DOS copy)

rm

(Remove [or delete] a file -- same as DOS del)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

12

Chapter ndash II

PROCESS MANAGEMENT-I

21 PROCESS

A program in execution is called process A process is executed sequentially one instruction at a

time A program is a passive entity For example a file on the disk A process on the other hand is an

active entity In addition to program code it includes PCB

PROCESS STATE

As a Process executes it changes state The state of a process is defined in which part by the

current activity of that process

Each process may be in any one of the following states

New Process being created

Running Instructions being executed

Waiting Process waiting for an event to occur

Ready Process waiting for CPU

Terminated Process has finished execution

Process State Transition Diagram Figure 21

The above diagram explains how the process transit to various states in its lifecycle by some events

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

13

22 PROCESS CONTROL BLOCK

A Process Control Block (PCB) also called Task Control Block represents each process in the

operating system

Every process has a process control block (PCB) which represents a process in an operating

system The PCB contains information that makes the process an active entity Following is the list of

information a PCB of a process contains

Process numbers is used to uniquely identify a process

The process state gives the current state of the process It can be either new ready

running waiting or terminated

The program counter contains the address of the next instruction to be executed

The values in the CPU registers are required when the CPU switches from one process

to another for a successful continuation

Memory management information is dependent on the memory system used by the

operating This includes base registers limit registers page tables segment tables and

other related details

IO information gives details about the IO devices allotted to the process the number of

files that are open and in use by the process etc

23 Multi Programming and Process Scheduling

Multiprogramming is a technique used to utilize maximum CPU time by running multiple programs

simultaneously It is achieved by two ways

1 The execution begins with the first process and continues till an instruction waiting for a peripheral is

reached the context of this process is stored and the next process in ready queue (in memory) is given a

chance to execute This will be continued until two or more programs exist in ready queue

2 Process gives up the CPU on expiry of its time slice and rejoins the ready queue This will be

continued until two or more programs exist in ready queue (This is nothing but timesharing)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

14

1

2

Figure 22

Queuing diagram of process scheduling

Scheduler

Scheduler is a part of OS which selects processes from the ready queue for execution by the CPU

Different methods are applied for selecting processes from the ready queue These methods are called

Scheduling Algorithms

Note

Hence it is clear that CPU scheduling is the basis for Multiprogramming operating systems

24 Major Category of CPU Scheduling

Non-preemptive In this scheduling if a process once selected for execution CPU keeps executing

until it is released either by that process for IO or by termination

Preemptive In this scheduling process can be stopped executing and returned to the ready queue to

resume later

25 Scheduling Criteria

Many algorithms exist for CPU scheduling Various criteria have been suggested for comparing

these CPU scheduling algorithms

All the CPU scheduling algorithms include the following criteria

1 CPU utilization Measured in Percentage of time the CPU is busy

2 Throughput Number of processes completed per time unit is throughput

3 Turnaround time The interval of time between submission and completion of a process

is called turnaround time It includes execution time and waiting time

4 Waiting time Sum of all the times spent by a process at different instances waiting in the

ready queue is called waiting time

5 Response time Response time is the difference between time of submission and the time

the first response occurs

Time slice expired

IO request

Ready queue

IO queue

IO

CPU

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

15

Desirable features are having maximum CPU utilization throughput and minimum

turnaround time waiting time and response time

26 SCHEDULING ALGORITHMS

Scheduling algorithms differ in the manner in which the CPU selects a process in the ready

queue for execution

261 FIRST COME FIRST SERVE (FCFS) SCHEDULING ALGORITHM

A process that requests for the CPU first is allocated the CPU first Hence the name first come first serve

The implementation of the FCFS policy is easily managed with a FIFO queue When a process enters the

ready queue its PCB is linked onto the tail of the queue When the CPU is free it is allocated to the process

at the head of the queue The running process is the removed from the queue Even though the algorithm is

simple the average waiting is often quite long

Consider a set of three processes P1 P2 and P3 arriving at time instant 0 and having CPU burst times as

shown below

Process Burst time (msecs)

P1 24

P2 3

P3 3

The Gantt chart below shows the result

0 24 27 30

Figure 23 Gantt chart for above example

Average waiting time and average turnaround time are calculated as follows

The waiting time for process P1 = 0 msecs

P2 = 24 msecs

P3 = 27 msecs

Average waiting time = (0 + 24 + 27) 3 = 51 3 = 17 msecs

P1 completes at the end of 24 msecs P2 at the end of 27 msecs and P3 at the end of 30 msecs Average

turnaround time = (24 + 27 + 30) 3 = 81 3 = 27 msecs

Since the algorithm is nonpreemptive in nature it is not suited for time sharing systems

P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

16

262 SHORTEST JOB FIRST (SJF) SCHEDULING ALGORITHM

Another approach to CPU scheduling is the shortest job first algorithm In this algorithm the length of

the CPU burst is considered When the CPU is available it is assigned to the process that has the

smallest next CPU burst Hence the name shortest job first If the next CPU bursts of two processes are

the same FCFS scheduling is used to break the tie As an example consider the following set of

processes P1 P2 P3 P4 and their CPU burst times

Process Burst time (msecs)

P1 6

P2 8

P3 7

P4 3

Using SJF algorithm the processes would be scheduled as shown below

0 3 9 16 24

Figure 24 Gantt chart for above example

Average waiting time = (0 + 3 + 9 + 16) 4 = 28 4 = 7 msecs

Average turnaround time = (3 + 9 + 16 + 24) 4 = 52 4 = 13 msecs

If the above processes were scheduled using FCFS algorithm then

Average waiting time = (0 + 6 + 14 + 21) 4 = 41 4 = 1025 msecs

Average turnaround time = (6 + 14 + 21 + 24) 4 = 65 4 = 1625 msecs

It is clear that the SJF algorithm produces the most optimal scheduling scheme For a given set of

processes the algorithm gives the minimum average waiting and turnaround times This is because

shorter processes are scheduled earlier than longer ones and hence waiting time for shorter processes

decreases and it increases the waiting time of long processes SJF algorithm could be either preemptive

or nonpreemptive

The main disadvantage with the SJF algorithm lies in knowing the length of the next CPU burst SJF

algorithm is therefore not applicable in CPU scheduling

P4 P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

17

263 Priority Scheduling A priority is associated with each process and the CPU is allocated to the process with the highest

priority Equal-priority processes are scheduled in FCFS

An SJF algorithm is therefore simply a priority algorithm where the priority is the inverse of the

(predicted) next CPU burst The larger the CPU burst the lower the priority and vice versa

Priority is expressed in terms of fixed range number such as 0 to 10 Some systems use low numbers to

represent low priority while others use low numbers for high priority But in this course we will use low

numbers to represent high priority

Consider the following set of processes assumed to have arrived at time 0 in the order P1 P2 P5

with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 3

P2 1 1

P3 2 4

P4 1 5

P5 5 2

Using priority scheduling we would schedule these processes according to the Gantt chart below

0 1 6 16 18 19

Figure 25 Gantt chart for above example

Average waiting time = (0 + 1 + 6 + 16+18) 5 = 41 5 = 82 msecs

Average turnaround time = (1 +6 + 16 + 18+19) 5 = 60 5 = 12 msecs

Priorities can be defined either internally or externally Internally defined priorities use measurable

quantity such as time limits memory requirements etc to compute the priority of a process

External priorities are set by criteria that are external to the operating system such as importance of the

process amount being paid for use of the compute the owner of the process and other (political)

factors

Priority scheduling may be either preemptive or nonpreemptive When a process arrives at the ready

queue its priority is compared with that of the currently running process A preemptive priority-

scheduling algorithm will preempt the CPU if the priority of the newly arrived process is higher than

P2 P5 P1 P3 P4

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

18

that of the currently running process A nonpreemptive priority-scheduling algorithm will simply put the

new process at the head of the ready queue

The major disadvantage of priority-scheduling algorithms is indefinite blocking or starvation A

situation whereby low priority processes indefinitely wait for the CPU because of a steady stream of

higher- priority processes

A solution to indefinite blocking of low-priority processes is aging Aging is a technique of gradually

increasing the priority of processes that wait in the system for a long time

264 ROUND ROBIN (RR) SCHEDULING ALGORITHM

The round-robin CPU scheduling algorithm is basically a preemptive scheduling algorithm designed for

time-sharing systems One unit of time is called a time slice Duration of a time slice may range between

10 msecs and about 100 msecs The CPU scheduler allocates to each process in the ready queue one

time slice at a time in a round-robin fashion Hence the name round-robin

Consider the same example explained under FCFS algorithm

Process Burst time (msecs)

A 13

B 3

C 3

D 5

Let the duration of a time slice be 4 msecs which is to say CPU switches between processes every 4

msecs in a round-robin fashion The Gantt chart below shows the scheduling of processes

0 4 7 10 14 18 19 23 24

Figure 25 Gantt chart for above example

Average waiting time = [(19 ndash 8) + 4 + 7+ (18 - 4)] 3 = 36 4 = 9 msecs

The performance of the RR algorithm is very much dependent on the length of the time slice If the

duration of the time slice is indefinitely large then the RR algorithm is the same as FCFS algorithm If

the time slice is too small then the performance of the algorithm deteriorates because of the effect of

frequent context switching

A B C D A D A A

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

19

Exercise

Consider the following set of processes with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 2

P2 4 3

P3 2 1

P4 6 4 P5 5 5

The processes are assumed to have arrived in the order P1 P2 P3 P4 and P5 all at time 0

a Draw four Gantt charts illustrating the execution of these processes using FCFS SJF a

nonpreemptive priority (a smaller priority number implies a higher priority)and RR (Quantum = 1) scheduling

b What is the turnaround time of each process for each of the scheduling algorithms in (a) above

c What is the waiting time of each process for each of the scheduling algorithms in (a)

d Which of the schedules in (a) results in the minimal average waiting time (over all processes)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

20

Chapter ndash III

PROCESS MANAGEMENT-II

31 Deadlock

A process request resources and if the resources are not available at that time the process enters a waiting

state A waiting process is never again able to change state because other waiting processes hold the

resources This situation is called a deadlock

Example

ndash System has two tape drives R1 and R2 and two process P1 and P2

ndash P1 holds R1 but demand R2

ndash P2 holds R2 but demand R1

System Model

bull Resource types R1 R2 hellipRm (CPU cycles memory space IO devices)

bull Each resource type Ri has Wi instances(More than One Instances)

bull Each process utilizes a resource as follows

Request

Use

Release

32 Deadlock Characterization

Deadlock can arise if four conditions hold simultaneously

bull Mutual exclusion

At least one resource must be held in a non-sharable mode ie only one process at a time can use the

resource If another process requests that resource the requesting process must be delayed until the resource

has been released

bull Hold and wait a process holding at least one resource is waiting to acquire additional resources held

by other processes

bull No preemption a resource can be released only voluntarily by the process holding it after that

process has completed its task

bull Circular wait there exists a set P0 P1 hellip P0 of waiting processes such that P0 is waiting for a

resource that is held by P1 P1 is waiting for a resource that is held by P2 hellip Pnndash1 is waiting for a

resource that is held by Pn and P0 is waiting for a resource that is held by P0

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

21

33 Methods for Handling Deadlocks

bull Ensure that the system will never enter a deadlock state

bull Allow the system to enter a deadlock state and then recover

bull Ignore the problem and pretend that deadlocks never occur in the system used by most operating

systems including UNIX

331 Deadlock Prevention

As you have seen Deadlock Characterization for a deadlock to occur each of the four necessary

conditions must hold By ensuring that at least one of the four necessary conditions cannot hold you can

prevent the occurrence of a deadlock

Mutual Exclusion

The mutual exclusion condition must hold for non-sharable resources For instance a printer cannot be

simultaneously shared by several processes Sharable resources do not require mutually exclusive

access and thus cannot be involved in a deadlock

In general however we cannot prevent deadlocks by denying the mutual-exclusion condition Some

resources are intrinsically non-sharable

Hold and Wait

To ensure that the hold-and-wait condition never occurs in the system we must guarantee that whenever a

process requests a resource it does not hold any other resources We can implement this the following

protocol

One protocol that can be used requires each process to request and be allocated all resources before it begins

execution

An alternative protocol allows a process to request resources only when the process has none A process

may request some resources and use them Before it can request any additional resources however it must

release all the resources that it is currently allocated

No Preemption

ndash If a process that is holding some resources requests another resource that cannot be immediately

allocated to it then all resources currently being held are released

ndash Preempted resources are added to the list of resources for which the process is waiting

ndash Process will be restarted only when it can regain its old resources as well as the new ones that it

is requesting

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

22

Circular Wait

Impose a total ordering of all resource types and require that each process requests resources in an

increasing order of enumeration

332 Deadlock Avoidance

bull Simplest and most useful model requires that each process declare the maximum number of resources

of each type that it may need

bull The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that

there can never be a circular-wait condition

bull Resource-allocation state is defined by the number of available and allocated resources and the

maximum demands of the processes

Safe State

bull When a process requests an available resource system must decide if immediate allocation leaves the

system in a safe state

bull System is in safe state if there exists a safe sequence of all processes

bull Sequence ltP1 P2 hellip Pngt is safe if for each Pi the resources that Pi can still request can be satisfied

by currently available resources + resources held by all the Pj with jltI

If Pi resource needs are not immediately available then Pi can wait until all Pj have finished

When Pj is finished Pi can obtain needed resources execute return allocated resources and terminate

When Pi terminates Pi+1 can obtain its needed resources and so on

Basic Facts

bull If a system is in safe state no deadlocks

bull If a system is in unsafe state possibility of deadlock

bull Avoidance ensures that a system will never enter an unsafe state

Resource-Allocation Graph Algorithm (Single Instance of Each Resource Type)

Claim edge Pi rarr Rj indicated that process Pj may request resource Rj represented by a dashed

line

Claim edge converts to request edge when a process requests a resource

When a process releases a resource assignment edge reconverts to a claim edge

Resources must be claimed a priori in the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

23

Resource-Allocation Graph for Deadlock Avoidance Unsafe State in a Resource-Allocation Graph

Figure 31

Bankerrsquos Algorithm (Several Instance of Each Resource Type)

bull Multiple instances

bull Each process must a priori claim maximum use

bull When a process requests a resource it may have to wait

bull When a process gets all its resources it must return them in a finite amount of time

Data Structures for the Bankerrsquos Algorithm

bull Available Vector of length m If available [j] = k there are k instances of resource type Rj available

bull Max n x m matrix If Max [ij] = k then process Pi may request at most k instances of resource type Rj

bull Allocation n x m matrix If Allocation[ij] = k then Pi is currently allocated k instances of Rj

bull Need n x m matrix If Need[ij] = k then Pi may need k more instances of Rj to complete its task

Need [ij] = Max[ij] ndash Allocation [ij]

Let n = number of processes

333 Deadlock Detection

bull Allow system to enter deadlock state

bull Detection algorithm

bull Recovery scheme

Single Instance of Each Resource Type

bull Maintain wait-for graph

ndash Nodes are processes

ndash Pi rarr Pj if Pi is waiting for Pj

bull Periodically invoke an algorithm that searches for a cycle in the graph

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 10: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

10

17 Operating System terminologies

The Kernel

It is central to the operating system It is the part of the operating system that loads first and it remains

in main memory Because it stays in memory it is important for the kernel to be as small as possible It

provides all the essential services required by other parts of the operating system and applications

Typically the kernel is responsible for memory management process management and disk

management

User Interface

The user interacts with the OS through the user interface

The components of the user interface are

1 The command interpreter

2 The file system

3 On-line help and

4 Application integration

Command Interpreter Shell

Users normally interact with the operating system through a set of commands For example the DOS operating

system contains commands such as COPY and RENAME for copying files and changing the names of files

respectively The commands are accepted and executed by a part of the operating system called the command

processor or command line interpreter In some operating systems the command interpreter is called the

shell

In some Operating systems Graphical user interfaces (GUI) allow us to enter commands by pointing and clicking

at objects that appear on the screen OS like Windows XP MacOS are some example for GUI

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

11

Examples

Below is the list of some DOS operating system commands

1 DIR [note Directory means Folder in windows XP]

This command displays files and folders in the current directory or folder

Most of the DOS commands come with various options They are called switches in DOS

Example with switches DIR AD

Here the switch AD is used with DIR command to display all the sub folders in the current directory

2 CLS ndashThis command clears the screen

Special switch

To know syntax of a particular command with all options type Command name

Example To know about COPY command type

COPY

Commands of UNIX

cp

(Copy -- same as DOS copy)

rm

(Remove [or delete] a file -- same as DOS del)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

12

Chapter ndash II

PROCESS MANAGEMENT-I

21 PROCESS

A program in execution is called process A process is executed sequentially one instruction at a

time A program is a passive entity For example a file on the disk A process on the other hand is an

active entity In addition to program code it includes PCB

PROCESS STATE

As a Process executes it changes state The state of a process is defined in which part by the

current activity of that process

Each process may be in any one of the following states

New Process being created

Running Instructions being executed

Waiting Process waiting for an event to occur

Ready Process waiting for CPU

Terminated Process has finished execution

Process State Transition Diagram Figure 21

The above diagram explains how the process transit to various states in its lifecycle by some events

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

13

22 PROCESS CONTROL BLOCK

A Process Control Block (PCB) also called Task Control Block represents each process in the

operating system

Every process has a process control block (PCB) which represents a process in an operating

system The PCB contains information that makes the process an active entity Following is the list of

information a PCB of a process contains

Process numbers is used to uniquely identify a process

The process state gives the current state of the process It can be either new ready

running waiting or terminated

The program counter contains the address of the next instruction to be executed

The values in the CPU registers are required when the CPU switches from one process

to another for a successful continuation

Memory management information is dependent on the memory system used by the

operating This includes base registers limit registers page tables segment tables and

other related details

IO information gives details about the IO devices allotted to the process the number of

files that are open and in use by the process etc

23 Multi Programming and Process Scheduling

Multiprogramming is a technique used to utilize maximum CPU time by running multiple programs

simultaneously It is achieved by two ways

1 The execution begins with the first process and continues till an instruction waiting for a peripheral is

reached the context of this process is stored and the next process in ready queue (in memory) is given a

chance to execute This will be continued until two or more programs exist in ready queue

2 Process gives up the CPU on expiry of its time slice and rejoins the ready queue This will be

continued until two or more programs exist in ready queue (This is nothing but timesharing)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

14

1

2

Figure 22

Queuing diagram of process scheduling

Scheduler

Scheduler is a part of OS which selects processes from the ready queue for execution by the CPU

Different methods are applied for selecting processes from the ready queue These methods are called

Scheduling Algorithms

Note

Hence it is clear that CPU scheduling is the basis for Multiprogramming operating systems

24 Major Category of CPU Scheduling

Non-preemptive In this scheduling if a process once selected for execution CPU keeps executing

until it is released either by that process for IO or by termination

Preemptive In this scheduling process can be stopped executing and returned to the ready queue to

resume later

25 Scheduling Criteria

Many algorithms exist for CPU scheduling Various criteria have been suggested for comparing

these CPU scheduling algorithms

All the CPU scheduling algorithms include the following criteria

1 CPU utilization Measured in Percentage of time the CPU is busy

2 Throughput Number of processes completed per time unit is throughput

3 Turnaround time The interval of time between submission and completion of a process

is called turnaround time It includes execution time and waiting time

4 Waiting time Sum of all the times spent by a process at different instances waiting in the

ready queue is called waiting time

5 Response time Response time is the difference between time of submission and the time

the first response occurs

Time slice expired

IO request

Ready queue

IO queue

IO

CPU

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

15

Desirable features are having maximum CPU utilization throughput and minimum

turnaround time waiting time and response time

26 SCHEDULING ALGORITHMS

Scheduling algorithms differ in the manner in which the CPU selects a process in the ready

queue for execution

261 FIRST COME FIRST SERVE (FCFS) SCHEDULING ALGORITHM

A process that requests for the CPU first is allocated the CPU first Hence the name first come first serve

The implementation of the FCFS policy is easily managed with a FIFO queue When a process enters the

ready queue its PCB is linked onto the tail of the queue When the CPU is free it is allocated to the process

at the head of the queue The running process is the removed from the queue Even though the algorithm is

simple the average waiting is often quite long

Consider a set of three processes P1 P2 and P3 arriving at time instant 0 and having CPU burst times as

shown below

Process Burst time (msecs)

P1 24

P2 3

P3 3

The Gantt chart below shows the result

0 24 27 30

Figure 23 Gantt chart for above example

Average waiting time and average turnaround time are calculated as follows

The waiting time for process P1 = 0 msecs

P2 = 24 msecs

P3 = 27 msecs

Average waiting time = (0 + 24 + 27) 3 = 51 3 = 17 msecs

P1 completes at the end of 24 msecs P2 at the end of 27 msecs and P3 at the end of 30 msecs Average

turnaround time = (24 + 27 + 30) 3 = 81 3 = 27 msecs

Since the algorithm is nonpreemptive in nature it is not suited for time sharing systems

P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

16

262 SHORTEST JOB FIRST (SJF) SCHEDULING ALGORITHM

Another approach to CPU scheduling is the shortest job first algorithm In this algorithm the length of

the CPU burst is considered When the CPU is available it is assigned to the process that has the

smallest next CPU burst Hence the name shortest job first If the next CPU bursts of two processes are

the same FCFS scheduling is used to break the tie As an example consider the following set of

processes P1 P2 P3 P4 and their CPU burst times

Process Burst time (msecs)

P1 6

P2 8

P3 7

P4 3

Using SJF algorithm the processes would be scheduled as shown below

0 3 9 16 24

Figure 24 Gantt chart for above example

Average waiting time = (0 + 3 + 9 + 16) 4 = 28 4 = 7 msecs

Average turnaround time = (3 + 9 + 16 + 24) 4 = 52 4 = 13 msecs

If the above processes were scheduled using FCFS algorithm then

Average waiting time = (0 + 6 + 14 + 21) 4 = 41 4 = 1025 msecs

Average turnaround time = (6 + 14 + 21 + 24) 4 = 65 4 = 1625 msecs

It is clear that the SJF algorithm produces the most optimal scheduling scheme For a given set of

processes the algorithm gives the minimum average waiting and turnaround times This is because

shorter processes are scheduled earlier than longer ones and hence waiting time for shorter processes

decreases and it increases the waiting time of long processes SJF algorithm could be either preemptive

or nonpreemptive

The main disadvantage with the SJF algorithm lies in knowing the length of the next CPU burst SJF

algorithm is therefore not applicable in CPU scheduling

P4 P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

17

263 Priority Scheduling A priority is associated with each process and the CPU is allocated to the process with the highest

priority Equal-priority processes are scheduled in FCFS

An SJF algorithm is therefore simply a priority algorithm where the priority is the inverse of the

(predicted) next CPU burst The larger the CPU burst the lower the priority and vice versa

Priority is expressed in terms of fixed range number such as 0 to 10 Some systems use low numbers to

represent low priority while others use low numbers for high priority But in this course we will use low

numbers to represent high priority

Consider the following set of processes assumed to have arrived at time 0 in the order P1 P2 P5

with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 3

P2 1 1

P3 2 4

P4 1 5

P5 5 2

Using priority scheduling we would schedule these processes according to the Gantt chart below

0 1 6 16 18 19

Figure 25 Gantt chart for above example

Average waiting time = (0 + 1 + 6 + 16+18) 5 = 41 5 = 82 msecs

Average turnaround time = (1 +6 + 16 + 18+19) 5 = 60 5 = 12 msecs

Priorities can be defined either internally or externally Internally defined priorities use measurable

quantity such as time limits memory requirements etc to compute the priority of a process

External priorities are set by criteria that are external to the operating system such as importance of the

process amount being paid for use of the compute the owner of the process and other (political)

factors

Priority scheduling may be either preemptive or nonpreemptive When a process arrives at the ready

queue its priority is compared with that of the currently running process A preemptive priority-

scheduling algorithm will preempt the CPU if the priority of the newly arrived process is higher than

P2 P5 P1 P3 P4

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

18

that of the currently running process A nonpreemptive priority-scheduling algorithm will simply put the

new process at the head of the ready queue

The major disadvantage of priority-scheduling algorithms is indefinite blocking or starvation A

situation whereby low priority processes indefinitely wait for the CPU because of a steady stream of

higher- priority processes

A solution to indefinite blocking of low-priority processes is aging Aging is a technique of gradually

increasing the priority of processes that wait in the system for a long time

264 ROUND ROBIN (RR) SCHEDULING ALGORITHM

The round-robin CPU scheduling algorithm is basically a preemptive scheduling algorithm designed for

time-sharing systems One unit of time is called a time slice Duration of a time slice may range between

10 msecs and about 100 msecs The CPU scheduler allocates to each process in the ready queue one

time slice at a time in a round-robin fashion Hence the name round-robin

Consider the same example explained under FCFS algorithm

Process Burst time (msecs)

A 13

B 3

C 3

D 5

Let the duration of a time slice be 4 msecs which is to say CPU switches between processes every 4

msecs in a round-robin fashion The Gantt chart below shows the scheduling of processes

0 4 7 10 14 18 19 23 24

Figure 25 Gantt chart for above example

Average waiting time = [(19 ndash 8) + 4 + 7+ (18 - 4)] 3 = 36 4 = 9 msecs

The performance of the RR algorithm is very much dependent on the length of the time slice If the

duration of the time slice is indefinitely large then the RR algorithm is the same as FCFS algorithm If

the time slice is too small then the performance of the algorithm deteriorates because of the effect of

frequent context switching

A B C D A D A A

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

19

Exercise

Consider the following set of processes with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 2

P2 4 3

P3 2 1

P4 6 4 P5 5 5

The processes are assumed to have arrived in the order P1 P2 P3 P4 and P5 all at time 0

a Draw four Gantt charts illustrating the execution of these processes using FCFS SJF a

nonpreemptive priority (a smaller priority number implies a higher priority)and RR (Quantum = 1) scheduling

b What is the turnaround time of each process for each of the scheduling algorithms in (a) above

c What is the waiting time of each process for each of the scheduling algorithms in (a)

d Which of the schedules in (a) results in the minimal average waiting time (over all processes)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

20

Chapter ndash III

PROCESS MANAGEMENT-II

31 Deadlock

A process request resources and if the resources are not available at that time the process enters a waiting

state A waiting process is never again able to change state because other waiting processes hold the

resources This situation is called a deadlock

Example

ndash System has two tape drives R1 and R2 and two process P1 and P2

ndash P1 holds R1 but demand R2

ndash P2 holds R2 but demand R1

System Model

bull Resource types R1 R2 hellipRm (CPU cycles memory space IO devices)

bull Each resource type Ri has Wi instances(More than One Instances)

bull Each process utilizes a resource as follows

Request

Use

Release

32 Deadlock Characterization

Deadlock can arise if four conditions hold simultaneously

bull Mutual exclusion

At least one resource must be held in a non-sharable mode ie only one process at a time can use the

resource If another process requests that resource the requesting process must be delayed until the resource

has been released

bull Hold and wait a process holding at least one resource is waiting to acquire additional resources held

by other processes

bull No preemption a resource can be released only voluntarily by the process holding it after that

process has completed its task

bull Circular wait there exists a set P0 P1 hellip P0 of waiting processes such that P0 is waiting for a

resource that is held by P1 P1 is waiting for a resource that is held by P2 hellip Pnndash1 is waiting for a

resource that is held by Pn and P0 is waiting for a resource that is held by P0

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

21

33 Methods for Handling Deadlocks

bull Ensure that the system will never enter a deadlock state

bull Allow the system to enter a deadlock state and then recover

bull Ignore the problem and pretend that deadlocks never occur in the system used by most operating

systems including UNIX

331 Deadlock Prevention

As you have seen Deadlock Characterization for a deadlock to occur each of the four necessary

conditions must hold By ensuring that at least one of the four necessary conditions cannot hold you can

prevent the occurrence of a deadlock

Mutual Exclusion

The mutual exclusion condition must hold for non-sharable resources For instance a printer cannot be

simultaneously shared by several processes Sharable resources do not require mutually exclusive

access and thus cannot be involved in a deadlock

In general however we cannot prevent deadlocks by denying the mutual-exclusion condition Some

resources are intrinsically non-sharable

Hold and Wait

To ensure that the hold-and-wait condition never occurs in the system we must guarantee that whenever a

process requests a resource it does not hold any other resources We can implement this the following

protocol

One protocol that can be used requires each process to request and be allocated all resources before it begins

execution

An alternative protocol allows a process to request resources only when the process has none A process

may request some resources and use them Before it can request any additional resources however it must

release all the resources that it is currently allocated

No Preemption

ndash If a process that is holding some resources requests another resource that cannot be immediately

allocated to it then all resources currently being held are released

ndash Preempted resources are added to the list of resources for which the process is waiting

ndash Process will be restarted only when it can regain its old resources as well as the new ones that it

is requesting

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

22

Circular Wait

Impose a total ordering of all resource types and require that each process requests resources in an

increasing order of enumeration

332 Deadlock Avoidance

bull Simplest and most useful model requires that each process declare the maximum number of resources

of each type that it may need

bull The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that

there can never be a circular-wait condition

bull Resource-allocation state is defined by the number of available and allocated resources and the

maximum demands of the processes

Safe State

bull When a process requests an available resource system must decide if immediate allocation leaves the

system in a safe state

bull System is in safe state if there exists a safe sequence of all processes

bull Sequence ltP1 P2 hellip Pngt is safe if for each Pi the resources that Pi can still request can be satisfied

by currently available resources + resources held by all the Pj with jltI

If Pi resource needs are not immediately available then Pi can wait until all Pj have finished

When Pj is finished Pi can obtain needed resources execute return allocated resources and terminate

When Pi terminates Pi+1 can obtain its needed resources and so on

Basic Facts

bull If a system is in safe state no deadlocks

bull If a system is in unsafe state possibility of deadlock

bull Avoidance ensures that a system will never enter an unsafe state

Resource-Allocation Graph Algorithm (Single Instance of Each Resource Type)

Claim edge Pi rarr Rj indicated that process Pj may request resource Rj represented by a dashed

line

Claim edge converts to request edge when a process requests a resource

When a process releases a resource assignment edge reconverts to a claim edge

Resources must be claimed a priori in the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

23

Resource-Allocation Graph for Deadlock Avoidance Unsafe State in a Resource-Allocation Graph

Figure 31

Bankerrsquos Algorithm (Several Instance of Each Resource Type)

bull Multiple instances

bull Each process must a priori claim maximum use

bull When a process requests a resource it may have to wait

bull When a process gets all its resources it must return them in a finite amount of time

Data Structures for the Bankerrsquos Algorithm

bull Available Vector of length m If available [j] = k there are k instances of resource type Rj available

bull Max n x m matrix If Max [ij] = k then process Pi may request at most k instances of resource type Rj

bull Allocation n x m matrix If Allocation[ij] = k then Pi is currently allocated k instances of Rj

bull Need n x m matrix If Need[ij] = k then Pi may need k more instances of Rj to complete its task

Need [ij] = Max[ij] ndash Allocation [ij]

Let n = number of processes

333 Deadlock Detection

bull Allow system to enter deadlock state

bull Detection algorithm

bull Recovery scheme

Single Instance of Each Resource Type

bull Maintain wait-for graph

ndash Nodes are processes

ndash Pi rarr Pj if Pi is waiting for Pj

bull Periodically invoke an algorithm that searches for a cycle in the graph

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 11: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

11

Examples

Below is the list of some DOS operating system commands

1 DIR [note Directory means Folder in windows XP]

This command displays files and folders in the current directory or folder

Most of the DOS commands come with various options They are called switches in DOS

Example with switches DIR AD

Here the switch AD is used with DIR command to display all the sub folders in the current directory

2 CLS ndashThis command clears the screen

Special switch

To know syntax of a particular command with all options type Command name

Example To know about COPY command type

COPY

Commands of UNIX

cp

(Copy -- same as DOS copy)

rm

(Remove [or delete] a file -- same as DOS del)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

12

Chapter ndash II

PROCESS MANAGEMENT-I

21 PROCESS

A program in execution is called process A process is executed sequentially one instruction at a

time A program is a passive entity For example a file on the disk A process on the other hand is an

active entity In addition to program code it includes PCB

PROCESS STATE

As a Process executes it changes state The state of a process is defined in which part by the

current activity of that process

Each process may be in any one of the following states

New Process being created

Running Instructions being executed

Waiting Process waiting for an event to occur

Ready Process waiting for CPU

Terminated Process has finished execution

Process State Transition Diagram Figure 21

The above diagram explains how the process transit to various states in its lifecycle by some events

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

13

22 PROCESS CONTROL BLOCK

A Process Control Block (PCB) also called Task Control Block represents each process in the

operating system

Every process has a process control block (PCB) which represents a process in an operating

system The PCB contains information that makes the process an active entity Following is the list of

information a PCB of a process contains

Process numbers is used to uniquely identify a process

The process state gives the current state of the process It can be either new ready

running waiting or terminated

The program counter contains the address of the next instruction to be executed

The values in the CPU registers are required when the CPU switches from one process

to another for a successful continuation

Memory management information is dependent on the memory system used by the

operating This includes base registers limit registers page tables segment tables and

other related details

IO information gives details about the IO devices allotted to the process the number of

files that are open and in use by the process etc

23 Multi Programming and Process Scheduling

Multiprogramming is a technique used to utilize maximum CPU time by running multiple programs

simultaneously It is achieved by two ways

1 The execution begins with the first process and continues till an instruction waiting for a peripheral is

reached the context of this process is stored and the next process in ready queue (in memory) is given a

chance to execute This will be continued until two or more programs exist in ready queue

2 Process gives up the CPU on expiry of its time slice and rejoins the ready queue This will be

continued until two or more programs exist in ready queue (This is nothing but timesharing)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

14

1

2

Figure 22

Queuing diagram of process scheduling

Scheduler

Scheduler is a part of OS which selects processes from the ready queue for execution by the CPU

Different methods are applied for selecting processes from the ready queue These methods are called

Scheduling Algorithms

Note

Hence it is clear that CPU scheduling is the basis for Multiprogramming operating systems

24 Major Category of CPU Scheduling

Non-preemptive In this scheduling if a process once selected for execution CPU keeps executing

until it is released either by that process for IO or by termination

Preemptive In this scheduling process can be stopped executing and returned to the ready queue to

resume later

25 Scheduling Criteria

Many algorithms exist for CPU scheduling Various criteria have been suggested for comparing

these CPU scheduling algorithms

All the CPU scheduling algorithms include the following criteria

1 CPU utilization Measured in Percentage of time the CPU is busy

2 Throughput Number of processes completed per time unit is throughput

3 Turnaround time The interval of time between submission and completion of a process

is called turnaround time It includes execution time and waiting time

4 Waiting time Sum of all the times spent by a process at different instances waiting in the

ready queue is called waiting time

5 Response time Response time is the difference between time of submission and the time

the first response occurs

Time slice expired

IO request

Ready queue

IO queue

IO

CPU

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

15

Desirable features are having maximum CPU utilization throughput and minimum

turnaround time waiting time and response time

26 SCHEDULING ALGORITHMS

Scheduling algorithms differ in the manner in which the CPU selects a process in the ready

queue for execution

261 FIRST COME FIRST SERVE (FCFS) SCHEDULING ALGORITHM

A process that requests for the CPU first is allocated the CPU first Hence the name first come first serve

The implementation of the FCFS policy is easily managed with a FIFO queue When a process enters the

ready queue its PCB is linked onto the tail of the queue When the CPU is free it is allocated to the process

at the head of the queue The running process is the removed from the queue Even though the algorithm is

simple the average waiting is often quite long

Consider a set of three processes P1 P2 and P3 arriving at time instant 0 and having CPU burst times as

shown below

Process Burst time (msecs)

P1 24

P2 3

P3 3

The Gantt chart below shows the result

0 24 27 30

Figure 23 Gantt chart for above example

Average waiting time and average turnaround time are calculated as follows

The waiting time for process P1 = 0 msecs

P2 = 24 msecs

P3 = 27 msecs

Average waiting time = (0 + 24 + 27) 3 = 51 3 = 17 msecs

P1 completes at the end of 24 msecs P2 at the end of 27 msecs and P3 at the end of 30 msecs Average

turnaround time = (24 + 27 + 30) 3 = 81 3 = 27 msecs

Since the algorithm is nonpreemptive in nature it is not suited for time sharing systems

P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

16

262 SHORTEST JOB FIRST (SJF) SCHEDULING ALGORITHM

Another approach to CPU scheduling is the shortest job first algorithm In this algorithm the length of

the CPU burst is considered When the CPU is available it is assigned to the process that has the

smallest next CPU burst Hence the name shortest job first If the next CPU bursts of two processes are

the same FCFS scheduling is used to break the tie As an example consider the following set of

processes P1 P2 P3 P4 and their CPU burst times

Process Burst time (msecs)

P1 6

P2 8

P3 7

P4 3

Using SJF algorithm the processes would be scheduled as shown below

0 3 9 16 24

Figure 24 Gantt chart for above example

Average waiting time = (0 + 3 + 9 + 16) 4 = 28 4 = 7 msecs

Average turnaround time = (3 + 9 + 16 + 24) 4 = 52 4 = 13 msecs

If the above processes were scheduled using FCFS algorithm then

Average waiting time = (0 + 6 + 14 + 21) 4 = 41 4 = 1025 msecs

Average turnaround time = (6 + 14 + 21 + 24) 4 = 65 4 = 1625 msecs

It is clear that the SJF algorithm produces the most optimal scheduling scheme For a given set of

processes the algorithm gives the minimum average waiting and turnaround times This is because

shorter processes are scheduled earlier than longer ones and hence waiting time for shorter processes

decreases and it increases the waiting time of long processes SJF algorithm could be either preemptive

or nonpreemptive

The main disadvantage with the SJF algorithm lies in knowing the length of the next CPU burst SJF

algorithm is therefore not applicable in CPU scheduling

P4 P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

17

263 Priority Scheduling A priority is associated with each process and the CPU is allocated to the process with the highest

priority Equal-priority processes are scheduled in FCFS

An SJF algorithm is therefore simply a priority algorithm where the priority is the inverse of the

(predicted) next CPU burst The larger the CPU burst the lower the priority and vice versa

Priority is expressed in terms of fixed range number such as 0 to 10 Some systems use low numbers to

represent low priority while others use low numbers for high priority But in this course we will use low

numbers to represent high priority

Consider the following set of processes assumed to have arrived at time 0 in the order P1 P2 P5

with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 3

P2 1 1

P3 2 4

P4 1 5

P5 5 2

Using priority scheduling we would schedule these processes according to the Gantt chart below

0 1 6 16 18 19

Figure 25 Gantt chart for above example

Average waiting time = (0 + 1 + 6 + 16+18) 5 = 41 5 = 82 msecs

Average turnaround time = (1 +6 + 16 + 18+19) 5 = 60 5 = 12 msecs

Priorities can be defined either internally or externally Internally defined priorities use measurable

quantity such as time limits memory requirements etc to compute the priority of a process

External priorities are set by criteria that are external to the operating system such as importance of the

process amount being paid for use of the compute the owner of the process and other (political)

factors

Priority scheduling may be either preemptive or nonpreemptive When a process arrives at the ready

queue its priority is compared with that of the currently running process A preemptive priority-

scheduling algorithm will preempt the CPU if the priority of the newly arrived process is higher than

P2 P5 P1 P3 P4

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

18

that of the currently running process A nonpreemptive priority-scheduling algorithm will simply put the

new process at the head of the ready queue

The major disadvantage of priority-scheduling algorithms is indefinite blocking or starvation A

situation whereby low priority processes indefinitely wait for the CPU because of a steady stream of

higher- priority processes

A solution to indefinite blocking of low-priority processes is aging Aging is a technique of gradually

increasing the priority of processes that wait in the system for a long time

264 ROUND ROBIN (RR) SCHEDULING ALGORITHM

The round-robin CPU scheduling algorithm is basically a preemptive scheduling algorithm designed for

time-sharing systems One unit of time is called a time slice Duration of a time slice may range between

10 msecs and about 100 msecs The CPU scheduler allocates to each process in the ready queue one

time slice at a time in a round-robin fashion Hence the name round-robin

Consider the same example explained under FCFS algorithm

Process Burst time (msecs)

A 13

B 3

C 3

D 5

Let the duration of a time slice be 4 msecs which is to say CPU switches between processes every 4

msecs in a round-robin fashion The Gantt chart below shows the scheduling of processes

0 4 7 10 14 18 19 23 24

Figure 25 Gantt chart for above example

Average waiting time = [(19 ndash 8) + 4 + 7+ (18 - 4)] 3 = 36 4 = 9 msecs

The performance of the RR algorithm is very much dependent on the length of the time slice If the

duration of the time slice is indefinitely large then the RR algorithm is the same as FCFS algorithm If

the time slice is too small then the performance of the algorithm deteriorates because of the effect of

frequent context switching

A B C D A D A A

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

19

Exercise

Consider the following set of processes with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 2

P2 4 3

P3 2 1

P4 6 4 P5 5 5

The processes are assumed to have arrived in the order P1 P2 P3 P4 and P5 all at time 0

a Draw four Gantt charts illustrating the execution of these processes using FCFS SJF a

nonpreemptive priority (a smaller priority number implies a higher priority)and RR (Quantum = 1) scheduling

b What is the turnaround time of each process for each of the scheduling algorithms in (a) above

c What is the waiting time of each process for each of the scheduling algorithms in (a)

d Which of the schedules in (a) results in the minimal average waiting time (over all processes)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

20

Chapter ndash III

PROCESS MANAGEMENT-II

31 Deadlock

A process request resources and if the resources are not available at that time the process enters a waiting

state A waiting process is never again able to change state because other waiting processes hold the

resources This situation is called a deadlock

Example

ndash System has two tape drives R1 and R2 and two process P1 and P2

ndash P1 holds R1 but demand R2

ndash P2 holds R2 but demand R1

System Model

bull Resource types R1 R2 hellipRm (CPU cycles memory space IO devices)

bull Each resource type Ri has Wi instances(More than One Instances)

bull Each process utilizes a resource as follows

Request

Use

Release

32 Deadlock Characterization

Deadlock can arise if four conditions hold simultaneously

bull Mutual exclusion

At least one resource must be held in a non-sharable mode ie only one process at a time can use the

resource If another process requests that resource the requesting process must be delayed until the resource

has been released

bull Hold and wait a process holding at least one resource is waiting to acquire additional resources held

by other processes

bull No preemption a resource can be released only voluntarily by the process holding it after that

process has completed its task

bull Circular wait there exists a set P0 P1 hellip P0 of waiting processes such that P0 is waiting for a

resource that is held by P1 P1 is waiting for a resource that is held by P2 hellip Pnndash1 is waiting for a

resource that is held by Pn and P0 is waiting for a resource that is held by P0

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

21

33 Methods for Handling Deadlocks

bull Ensure that the system will never enter a deadlock state

bull Allow the system to enter a deadlock state and then recover

bull Ignore the problem and pretend that deadlocks never occur in the system used by most operating

systems including UNIX

331 Deadlock Prevention

As you have seen Deadlock Characterization for a deadlock to occur each of the four necessary

conditions must hold By ensuring that at least one of the four necessary conditions cannot hold you can

prevent the occurrence of a deadlock

Mutual Exclusion

The mutual exclusion condition must hold for non-sharable resources For instance a printer cannot be

simultaneously shared by several processes Sharable resources do not require mutually exclusive

access and thus cannot be involved in a deadlock

In general however we cannot prevent deadlocks by denying the mutual-exclusion condition Some

resources are intrinsically non-sharable

Hold and Wait

To ensure that the hold-and-wait condition never occurs in the system we must guarantee that whenever a

process requests a resource it does not hold any other resources We can implement this the following

protocol

One protocol that can be used requires each process to request and be allocated all resources before it begins

execution

An alternative protocol allows a process to request resources only when the process has none A process

may request some resources and use them Before it can request any additional resources however it must

release all the resources that it is currently allocated

No Preemption

ndash If a process that is holding some resources requests another resource that cannot be immediately

allocated to it then all resources currently being held are released

ndash Preempted resources are added to the list of resources for which the process is waiting

ndash Process will be restarted only when it can regain its old resources as well as the new ones that it

is requesting

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

22

Circular Wait

Impose a total ordering of all resource types and require that each process requests resources in an

increasing order of enumeration

332 Deadlock Avoidance

bull Simplest and most useful model requires that each process declare the maximum number of resources

of each type that it may need

bull The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that

there can never be a circular-wait condition

bull Resource-allocation state is defined by the number of available and allocated resources and the

maximum demands of the processes

Safe State

bull When a process requests an available resource system must decide if immediate allocation leaves the

system in a safe state

bull System is in safe state if there exists a safe sequence of all processes

bull Sequence ltP1 P2 hellip Pngt is safe if for each Pi the resources that Pi can still request can be satisfied

by currently available resources + resources held by all the Pj with jltI

If Pi resource needs are not immediately available then Pi can wait until all Pj have finished

When Pj is finished Pi can obtain needed resources execute return allocated resources and terminate

When Pi terminates Pi+1 can obtain its needed resources and so on

Basic Facts

bull If a system is in safe state no deadlocks

bull If a system is in unsafe state possibility of deadlock

bull Avoidance ensures that a system will never enter an unsafe state

Resource-Allocation Graph Algorithm (Single Instance of Each Resource Type)

Claim edge Pi rarr Rj indicated that process Pj may request resource Rj represented by a dashed

line

Claim edge converts to request edge when a process requests a resource

When a process releases a resource assignment edge reconverts to a claim edge

Resources must be claimed a priori in the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

23

Resource-Allocation Graph for Deadlock Avoidance Unsafe State in a Resource-Allocation Graph

Figure 31

Bankerrsquos Algorithm (Several Instance of Each Resource Type)

bull Multiple instances

bull Each process must a priori claim maximum use

bull When a process requests a resource it may have to wait

bull When a process gets all its resources it must return them in a finite amount of time

Data Structures for the Bankerrsquos Algorithm

bull Available Vector of length m If available [j] = k there are k instances of resource type Rj available

bull Max n x m matrix If Max [ij] = k then process Pi may request at most k instances of resource type Rj

bull Allocation n x m matrix If Allocation[ij] = k then Pi is currently allocated k instances of Rj

bull Need n x m matrix If Need[ij] = k then Pi may need k more instances of Rj to complete its task

Need [ij] = Max[ij] ndash Allocation [ij]

Let n = number of processes

333 Deadlock Detection

bull Allow system to enter deadlock state

bull Detection algorithm

bull Recovery scheme

Single Instance of Each Resource Type

bull Maintain wait-for graph

ndash Nodes are processes

ndash Pi rarr Pj if Pi is waiting for Pj

bull Periodically invoke an algorithm that searches for a cycle in the graph

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 12: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

12

Chapter ndash II

PROCESS MANAGEMENT-I

21 PROCESS

A program in execution is called process A process is executed sequentially one instruction at a

time A program is a passive entity For example a file on the disk A process on the other hand is an

active entity In addition to program code it includes PCB

PROCESS STATE

As a Process executes it changes state The state of a process is defined in which part by the

current activity of that process

Each process may be in any one of the following states

New Process being created

Running Instructions being executed

Waiting Process waiting for an event to occur

Ready Process waiting for CPU

Terminated Process has finished execution

Process State Transition Diagram Figure 21

The above diagram explains how the process transit to various states in its lifecycle by some events

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

13

22 PROCESS CONTROL BLOCK

A Process Control Block (PCB) also called Task Control Block represents each process in the

operating system

Every process has a process control block (PCB) which represents a process in an operating

system The PCB contains information that makes the process an active entity Following is the list of

information a PCB of a process contains

Process numbers is used to uniquely identify a process

The process state gives the current state of the process It can be either new ready

running waiting or terminated

The program counter contains the address of the next instruction to be executed

The values in the CPU registers are required when the CPU switches from one process

to another for a successful continuation

Memory management information is dependent on the memory system used by the

operating This includes base registers limit registers page tables segment tables and

other related details

IO information gives details about the IO devices allotted to the process the number of

files that are open and in use by the process etc

23 Multi Programming and Process Scheduling

Multiprogramming is a technique used to utilize maximum CPU time by running multiple programs

simultaneously It is achieved by two ways

1 The execution begins with the first process and continues till an instruction waiting for a peripheral is

reached the context of this process is stored and the next process in ready queue (in memory) is given a

chance to execute This will be continued until two or more programs exist in ready queue

2 Process gives up the CPU on expiry of its time slice and rejoins the ready queue This will be

continued until two or more programs exist in ready queue (This is nothing but timesharing)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

14

1

2

Figure 22

Queuing diagram of process scheduling

Scheduler

Scheduler is a part of OS which selects processes from the ready queue for execution by the CPU

Different methods are applied for selecting processes from the ready queue These methods are called

Scheduling Algorithms

Note

Hence it is clear that CPU scheduling is the basis for Multiprogramming operating systems

24 Major Category of CPU Scheduling

Non-preemptive In this scheduling if a process once selected for execution CPU keeps executing

until it is released either by that process for IO or by termination

Preemptive In this scheduling process can be stopped executing and returned to the ready queue to

resume later

25 Scheduling Criteria

Many algorithms exist for CPU scheduling Various criteria have been suggested for comparing

these CPU scheduling algorithms

All the CPU scheduling algorithms include the following criteria

1 CPU utilization Measured in Percentage of time the CPU is busy

2 Throughput Number of processes completed per time unit is throughput

3 Turnaround time The interval of time between submission and completion of a process

is called turnaround time It includes execution time and waiting time

4 Waiting time Sum of all the times spent by a process at different instances waiting in the

ready queue is called waiting time

5 Response time Response time is the difference between time of submission and the time

the first response occurs

Time slice expired

IO request

Ready queue

IO queue

IO

CPU

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

15

Desirable features are having maximum CPU utilization throughput and minimum

turnaround time waiting time and response time

26 SCHEDULING ALGORITHMS

Scheduling algorithms differ in the manner in which the CPU selects a process in the ready

queue for execution

261 FIRST COME FIRST SERVE (FCFS) SCHEDULING ALGORITHM

A process that requests for the CPU first is allocated the CPU first Hence the name first come first serve

The implementation of the FCFS policy is easily managed with a FIFO queue When a process enters the

ready queue its PCB is linked onto the tail of the queue When the CPU is free it is allocated to the process

at the head of the queue The running process is the removed from the queue Even though the algorithm is

simple the average waiting is often quite long

Consider a set of three processes P1 P2 and P3 arriving at time instant 0 and having CPU burst times as

shown below

Process Burst time (msecs)

P1 24

P2 3

P3 3

The Gantt chart below shows the result

0 24 27 30

Figure 23 Gantt chart for above example

Average waiting time and average turnaround time are calculated as follows

The waiting time for process P1 = 0 msecs

P2 = 24 msecs

P3 = 27 msecs

Average waiting time = (0 + 24 + 27) 3 = 51 3 = 17 msecs

P1 completes at the end of 24 msecs P2 at the end of 27 msecs and P3 at the end of 30 msecs Average

turnaround time = (24 + 27 + 30) 3 = 81 3 = 27 msecs

Since the algorithm is nonpreemptive in nature it is not suited for time sharing systems

P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

16

262 SHORTEST JOB FIRST (SJF) SCHEDULING ALGORITHM

Another approach to CPU scheduling is the shortest job first algorithm In this algorithm the length of

the CPU burst is considered When the CPU is available it is assigned to the process that has the

smallest next CPU burst Hence the name shortest job first If the next CPU bursts of two processes are

the same FCFS scheduling is used to break the tie As an example consider the following set of

processes P1 P2 P3 P4 and their CPU burst times

Process Burst time (msecs)

P1 6

P2 8

P3 7

P4 3

Using SJF algorithm the processes would be scheduled as shown below

0 3 9 16 24

Figure 24 Gantt chart for above example

Average waiting time = (0 + 3 + 9 + 16) 4 = 28 4 = 7 msecs

Average turnaround time = (3 + 9 + 16 + 24) 4 = 52 4 = 13 msecs

If the above processes were scheduled using FCFS algorithm then

Average waiting time = (0 + 6 + 14 + 21) 4 = 41 4 = 1025 msecs

Average turnaround time = (6 + 14 + 21 + 24) 4 = 65 4 = 1625 msecs

It is clear that the SJF algorithm produces the most optimal scheduling scheme For a given set of

processes the algorithm gives the minimum average waiting and turnaround times This is because

shorter processes are scheduled earlier than longer ones and hence waiting time for shorter processes

decreases and it increases the waiting time of long processes SJF algorithm could be either preemptive

or nonpreemptive

The main disadvantage with the SJF algorithm lies in knowing the length of the next CPU burst SJF

algorithm is therefore not applicable in CPU scheduling

P4 P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

17

263 Priority Scheduling A priority is associated with each process and the CPU is allocated to the process with the highest

priority Equal-priority processes are scheduled in FCFS

An SJF algorithm is therefore simply a priority algorithm where the priority is the inverse of the

(predicted) next CPU burst The larger the CPU burst the lower the priority and vice versa

Priority is expressed in terms of fixed range number such as 0 to 10 Some systems use low numbers to

represent low priority while others use low numbers for high priority But in this course we will use low

numbers to represent high priority

Consider the following set of processes assumed to have arrived at time 0 in the order P1 P2 P5

with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 3

P2 1 1

P3 2 4

P4 1 5

P5 5 2

Using priority scheduling we would schedule these processes according to the Gantt chart below

0 1 6 16 18 19

Figure 25 Gantt chart for above example

Average waiting time = (0 + 1 + 6 + 16+18) 5 = 41 5 = 82 msecs

Average turnaround time = (1 +6 + 16 + 18+19) 5 = 60 5 = 12 msecs

Priorities can be defined either internally or externally Internally defined priorities use measurable

quantity such as time limits memory requirements etc to compute the priority of a process

External priorities are set by criteria that are external to the operating system such as importance of the

process amount being paid for use of the compute the owner of the process and other (political)

factors

Priority scheduling may be either preemptive or nonpreemptive When a process arrives at the ready

queue its priority is compared with that of the currently running process A preemptive priority-

scheduling algorithm will preempt the CPU if the priority of the newly arrived process is higher than

P2 P5 P1 P3 P4

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

18

that of the currently running process A nonpreemptive priority-scheduling algorithm will simply put the

new process at the head of the ready queue

The major disadvantage of priority-scheduling algorithms is indefinite blocking or starvation A

situation whereby low priority processes indefinitely wait for the CPU because of a steady stream of

higher- priority processes

A solution to indefinite blocking of low-priority processes is aging Aging is a technique of gradually

increasing the priority of processes that wait in the system for a long time

264 ROUND ROBIN (RR) SCHEDULING ALGORITHM

The round-robin CPU scheduling algorithm is basically a preemptive scheduling algorithm designed for

time-sharing systems One unit of time is called a time slice Duration of a time slice may range between

10 msecs and about 100 msecs The CPU scheduler allocates to each process in the ready queue one

time slice at a time in a round-robin fashion Hence the name round-robin

Consider the same example explained under FCFS algorithm

Process Burst time (msecs)

A 13

B 3

C 3

D 5

Let the duration of a time slice be 4 msecs which is to say CPU switches between processes every 4

msecs in a round-robin fashion The Gantt chart below shows the scheduling of processes

0 4 7 10 14 18 19 23 24

Figure 25 Gantt chart for above example

Average waiting time = [(19 ndash 8) + 4 + 7+ (18 - 4)] 3 = 36 4 = 9 msecs

The performance of the RR algorithm is very much dependent on the length of the time slice If the

duration of the time slice is indefinitely large then the RR algorithm is the same as FCFS algorithm If

the time slice is too small then the performance of the algorithm deteriorates because of the effect of

frequent context switching

A B C D A D A A

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

19

Exercise

Consider the following set of processes with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 2

P2 4 3

P3 2 1

P4 6 4 P5 5 5

The processes are assumed to have arrived in the order P1 P2 P3 P4 and P5 all at time 0

a Draw four Gantt charts illustrating the execution of these processes using FCFS SJF a

nonpreemptive priority (a smaller priority number implies a higher priority)and RR (Quantum = 1) scheduling

b What is the turnaround time of each process for each of the scheduling algorithms in (a) above

c What is the waiting time of each process for each of the scheduling algorithms in (a)

d Which of the schedules in (a) results in the minimal average waiting time (over all processes)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

20

Chapter ndash III

PROCESS MANAGEMENT-II

31 Deadlock

A process request resources and if the resources are not available at that time the process enters a waiting

state A waiting process is never again able to change state because other waiting processes hold the

resources This situation is called a deadlock

Example

ndash System has two tape drives R1 and R2 and two process P1 and P2

ndash P1 holds R1 but demand R2

ndash P2 holds R2 but demand R1

System Model

bull Resource types R1 R2 hellipRm (CPU cycles memory space IO devices)

bull Each resource type Ri has Wi instances(More than One Instances)

bull Each process utilizes a resource as follows

Request

Use

Release

32 Deadlock Characterization

Deadlock can arise if four conditions hold simultaneously

bull Mutual exclusion

At least one resource must be held in a non-sharable mode ie only one process at a time can use the

resource If another process requests that resource the requesting process must be delayed until the resource

has been released

bull Hold and wait a process holding at least one resource is waiting to acquire additional resources held

by other processes

bull No preemption a resource can be released only voluntarily by the process holding it after that

process has completed its task

bull Circular wait there exists a set P0 P1 hellip P0 of waiting processes such that P0 is waiting for a

resource that is held by P1 P1 is waiting for a resource that is held by P2 hellip Pnndash1 is waiting for a

resource that is held by Pn and P0 is waiting for a resource that is held by P0

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

21

33 Methods for Handling Deadlocks

bull Ensure that the system will never enter a deadlock state

bull Allow the system to enter a deadlock state and then recover

bull Ignore the problem and pretend that deadlocks never occur in the system used by most operating

systems including UNIX

331 Deadlock Prevention

As you have seen Deadlock Characterization for a deadlock to occur each of the four necessary

conditions must hold By ensuring that at least one of the four necessary conditions cannot hold you can

prevent the occurrence of a deadlock

Mutual Exclusion

The mutual exclusion condition must hold for non-sharable resources For instance a printer cannot be

simultaneously shared by several processes Sharable resources do not require mutually exclusive

access and thus cannot be involved in a deadlock

In general however we cannot prevent deadlocks by denying the mutual-exclusion condition Some

resources are intrinsically non-sharable

Hold and Wait

To ensure that the hold-and-wait condition never occurs in the system we must guarantee that whenever a

process requests a resource it does not hold any other resources We can implement this the following

protocol

One protocol that can be used requires each process to request and be allocated all resources before it begins

execution

An alternative protocol allows a process to request resources only when the process has none A process

may request some resources and use them Before it can request any additional resources however it must

release all the resources that it is currently allocated

No Preemption

ndash If a process that is holding some resources requests another resource that cannot be immediately

allocated to it then all resources currently being held are released

ndash Preempted resources are added to the list of resources for which the process is waiting

ndash Process will be restarted only when it can regain its old resources as well as the new ones that it

is requesting

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

22

Circular Wait

Impose a total ordering of all resource types and require that each process requests resources in an

increasing order of enumeration

332 Deadlock Avoidance

bull Simplest and most useful model requires that each process declare the maximum number of resources

of each type that it may need

bull The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that

there can never be a circular-wait condition

bull Resource-allocation state is defined by the number of available and allocated resources and the

maximum demands of the processes

Safe State

bull When a process requests an available resource system must decide if immediate allocation leaves the

system in a safe state

bull System is in safe state if there exists a safe sequence of all processes

bull Sequence ltP1 P2 hellip Pngt is safe if for each Pi the resources that Pi can still request can be satisfied

by currently available resources + resources held by all the Pj with jltI

If Pi resource needs are not immediately available then Pi can wait until all Pj have finished

When Pj is finished Pi can obtain needed resources execute return allocated resources and terminate

When Pi terminates Pi+1 can obtain its needed resources and so on

Basic Facts

bull If a system is in safe state no deadlocks

bull If a system is in unsafe state possibility of deadlock

bull Avoidance ensures that a system will never enter an unsafe state

Resource-Allocation Graph Algorithm (Single Instance of Each Resource Type)

Claim edge Pi rarr Rj indicated that process Pj may request resource Rj represented by a dashed

line

Claim edge converts to request edge when a process requests a resource

When a process releases a resource assignment edge reconverts to a claim edge

Resources must be claimed a priori in the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

23

Resource-Allocation Graph for Deadlock Avoidance Unsafe State in a Resource-Allocation Graph

Figure 31

Bankerrsquos Algorithm (Several Instance of Each Resource Type)

bull Multiple instances

bull Each process must a priori claim maximum use

bull When a process requests a resource it may have to wait

bull When a process gets all its resources it must return them in a finite amount of time

Data Structures for the Bankerrsquos Algorithm

bull Available Vector of length m If available [j] = k there are k instances of resource type Rj available

bull Max n x m matrix If Max [ij] = k then process Pi may request at most k instances of resource type Rj

bull Allocation n x m matrix If Allocation[ij] = k then Pi is currently allocated k instances of Rj

bull Need n x m matrix If Need[ij] = k then Pi may need k more instances of Rj to complete its task

Need [ij] = Max[ij] ndash Allocation [ij]

Let n = number of processes

333 Deadlock Detection

bull Allow system to enter deadlock state

bull Detection algorithm

bull Recovery scheme

Single Instance of Each Resource Type

bull Maintain wait-for graph

ndash Nodes are processes

ndash Pi rarr Pj if Pi is waiting for Pj

bull Periodically invoke an algorithm that searches for a cycle in the graph

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 13: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

13

22 PROCESS CONTROL BLOCK

A Process Control Block (PCB) also called Task Control Block represents each process in the

operating system

Every process has a process control block (PCB) which represents a process in an operating

system The PCB contains information that makes the process an active entity Following is the list of

information a PCB of a process contains

Process numbers is used to uniquely identify a process

The process state gives the current state of the process It can be either new ready

running waiting or terminated

The program counter contains the address of the next instruction to be executed

The values in the CPU registers are required when the CPU switches from one process

to another for a successful continuation

Memory management information is dependent on the memory system used by the

operating This includes base registers limit registers page tables segment tables and

other related details

IO information gives details about the IO devices allotted to the process the number of

files that are open and in use by the process etc

23 Multi Programming and Process Scheduling

Multiprogramming is a technique used to utilize maximum CPU time by running multiple programs

simultaneously It is achieved by two ways

1 The execution begins with the first process and continues till an instruction waiting for a peripheral is

reached the context of this process is stored and the next process in ready queue (in memory) is given a

chance to execute This will be continued until two or more programs exist in ready queue

2 Process gives up the CPU on expiry of its time slice and rejoins the ready queue This will be

continued until two or more programs exist in ready queue (This is nothing but timesharing)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

14

1

2

Figure 22

Queuing diagram of process scheduling

Scheduler

Scheduler is a part of OS which selects processes from the ready queue for execution by the CPU

Different methods are applied for selecting processes from the ready queue These methods are called

Scheduling Algorithms

Note

Hence it is clear that CPU scheduling is the basis for Multiprogramming operating systems

24 Major Category of CPU Scheduling

Non-preemptive In this scheduling if a process once selected for execution CPU keeps executing

until it is released either by that process for IO or by termination

Preemptive In this scheduling process can be stopped executing and returned to the ready queue to

resume later

25 Scheduling Criteria

Many algorithms exist for CPU scheduling Various criteria have been suggested for comparing

these CPU scheduling algorithms

All the CPU scheduling algorithms include the following criteria

1 CPU utilization Measured in Percentage of time the CPU is busy

2 Throughput Number of processes completed per time unit is throughput

3 Turnaround time The interval of time between submission and completion of a process

is called turnaround time It includes execution time and waiting time

4 Waiting time Sum of all the times spent by a process at different instances waiting in the

ready queue is called waiting time

5 Response time Response time is the difference between time of submission and the time

the first response occurs

Time slice expired

IO request

Ready queue

IO queue

IO

CPU

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

15

Desirable features are having maximum CPU utilization throughput and minimum

turnaround time waiting time and response time

26 SCHEDULING ALGORITHMS

Scheduling algorithms differ in the manner in which the CPU selects a process in the ready

queue for execution

261 FIRST COME FIRST SERVE (FCFS) SCHEDULING ALGORITHM

A process that requests for the CPU first is allocated the CPU first Hence the name first come first serve

The implementation of the FCFS policy is easily managed with a FIFO queue When a process enters the

ready queue its PCB is linked onto the tail of the queue When the CPU is free it is allocated to the process

at the head of the queue The running process is the removed from the queue Even though the algorithm is

simple the average waiting is often quite long

Consider a set of three processes P1 P2 and P3 arriving at time instant 0 and having CPU burst times as

shown below

Process Burst time (msecs)

P1 24

P2 3

P3 3

The Gantt chart below shows the result

0 24 27 30

Figure 23 Gantt chart for above example

Average waiting time and average turnaround time are calculated as follows

The waiting time for process P1 = 0 msecs

P2 = 24 msecs

P3 = 27 msecs

Average waiting time = (0 + 24 + 27) 3 = 51 3 = 17 msecs

P1 completes at the end of 24 msecs P2 at the end of 27 msecs and P3 at the end of 30 msecs Average

turnaround time = (24 + 27 + 30) 3 = 81 3 = 27 msecs

Since the algorithm is nonpreemptive in nature it is not suited for time sharing systems

P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

16

262 SHORTEST JOB FIRST (SJF) SCHEDULING ALGORITHM

Another approach to CPU scheduling is the shortest job first algorithm In this algorithm the length of

the CPU burst is considered When the CPU is available it is assigned to the process that has the

smallest next CPU burst Hence the name shortest job first If the next CPU bursts of two processes are

the same FCFS scheduling is used to break the tie As an example consider the following set of

processes P1 P2 P3 P4 and their CPU burst times

Process Burst time (msecs)

P1 6

P2 8

P3 7

P4 3

Using SJF algorithm the processes would be scheduled as shown below

0 3 9 16 24

Figure 24 Gantt chart for above example

Average waiting time = (0 + 3 + 9 + 16) 4 = 28 4 = 7 msecs

Average turnaround time = (3 + 9 + 16 + 24) 4 = 52 4 = 13 msecs

If the above processes were scheduled using FCFS algorithm then

Average waiting time = (0 + 6 + 14 + 21) 4 = 41 4 = 1025 msecs

Average turnaround time = (6 + 14 + 21 + 24) 4 = 65 4 = 1625 msecs

It is clear that the SJF algorithm produces the most optimal scheduling scheme For a given set of

processes the algorithm gives the minimum average waiting and turnaround times This is because

shorter processes are scheduled earlier than longer ones and hence waiting time for shorter processes

decreases and it increases the waiting time of long processes SJF algorithm could be either preemptive

or nonpreemptive

The main disadvantage with the SJF algorithm lies in knowing the length of the next CPU burst SJF

algorithm is therefore not applicable in CPU scheduling

P4 P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

17

263 Priority Scheduling A priority is associated with each process and the CPU is allocated to the process with the highest

priority Equal-priority processes are scheduled in FCFS

An SJF algorithm is therefore simply a priority algorithm where the priority is the inverse of the

(predicted) next CPU burst The larger the CPU burst the lower the priority and vice versa

Priority is expressed in terms of fixed range number such as 0 to 10 Some systems use low numbers to

represent low priority while others use low numbers for high priority But in this course we will use low

numbers to represent high priority

Consider the following set of processes assumed to have arrived at time 0 in the order P1 P2 P5

with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 3

P2 1 1

P3 2 4

P4 1 5

P5 5 2

Using priority scheduling we would schedule these processes according to the Gantt chart below

0 1 6 16 18 19

Figure 25 Gantt chart for above example

Average waiting time = (0 + 1 + 6 + 16+18) 5 = 41 5 = 82 msecs

Average turnaround time = (1 +6 + 16 + 18+19) 5 = 60 5 = 12 msecs

Priorities can be defined either internally or externally Internally defined priorities use measurable

quantity such as time limits memory requirements etc to compute the priority of a process

External priorities are set by criteria that are external to the operating system such as importance of the

process amount being paid for use of the compute the owner of the process and other (political)

factors

Priority scheduling may be either preemptive or nonpreemptive When a process arrives at the ready

queue its priority is compared with that of the currently running process A preemptive priority-

scheduling algorithm will preempt the CPU if the priority of the newly arrived process is higher than

P2 P5 P1 P3 P4

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

18

that of the currently running process A nonpreemptive priority-scheduling algorithm will simply put the

new process at the head of the ready queue

The major disadvantage of priority-scheduling algorithms is indefinite blocking or starvation A

situation whereby low priority processes indefinitely wait for the CPU because of a steady stream of

higher- priority processes

A solution to indefinite blocking of low-priority processes is aging Aging is a technique of gradually

increasing the priority of processes that wait in the system for a long time

264 ROUND ROBIN (RR) SCHEDULING ALGORITHM

The round-robin CPU scheduling algorithm is basically a preemptive scheduling algorithm designed for

time-sharing systems One unit of time is called a time slice Duration of a time slice may range between

10 msecs and about 100 msecs The CPU scheduler allocates to each process in the ready queue one

time slice at a time in a round-robin fashion Hence the name round-robin

Consider the same example explained under FCFS algorithm

Process Burst time (msecs)

A 13

B 3

C 3

D 5

Let the duration of a time slice be 4 msecs which is to say CPU switches between processes every 4

msecs in a round-robin fashion The Gantt chart below shows the scheduling of processes

0 4 7 10 14 18 19 23 24

Figure 25 Gantt chart for above example

Average waiting time = [(19 ndash 8) + 4 + 7+ (18 - 4)] 3 = 36 4 = 9 msecs

The performance of the RR algorithm is very much dependent on the length of the time slice If the

duration of the time slice is indefinitely large then the RR algorithm is the same as FCFS algorithm If

the time slice is too small then the performance of the algorithm deteriorates because of the effect of

frequent context switching

A B C D A D A A

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

19

Exercise

Consider the following set of processes with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 2

P2 4 3

P3 2 1

P4 6 4 P5 5 5

The processes are assumed to have arrived in the order P1 P2 P3 P4 and P5 all at time 0

a Draw four Gantt charts illustrating the execution of these processes using FCFS SJF a

nonpreemptive priority (a smaller priority number implies a higher priority)and RR (Quantum = 1) scheduling

b What is the turnaround time of each process for each of the scheduling algorithms in (a) above

c What is the waiting time of each process for each of the scheduling algorithms in (a)

d Which of the schedules in (a) results in the minimal average waiting time (over all processes)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

20

Chapter ndash III

PROCESS MANAGEMENT-II

31 Deadlock

A process request resources and if the resources are not available at that time the process enters a waiting

state A waiting process is never again able to change state because other waiting processes hold the

resources This situation is called a deadlock

Example

ndash System has two tape drives R1 and R2 and two process P1 and P2

ndash P1 holds R1 but demand R2

ndash P2 holds R2 but demand R1

System Model

bull Resource types R1 R2 hellipRm (CPU cycles memory space IO devices)

bull Each resource type Ri has Wi instances(More than One Instances)

bull Each process utilizes a resource as follows

Request

Use

Release

32 Deadlock Characterization

Deadlock can arise if four conditions hold simultaneously

bull Mutual exclusion

At least one resource must be held in a non-sharable mode ie only one process at a time can use the

resource If another process requests that resource the requesting process must be delayed until the resource

has been released

bull Hold and wait a process holding at least one resource is waiting to acquire additional resources held

by other processes

bull No preemption a resource can be released only voluntarily by the process holding it after that

process has completed its task

bull Circular wait there exists a set P0 P1 hellip P0 of waiting processes such that P0 is waiting for a

resource that is held by P1 P1 is waiting for a resource that is held by P2 hellip Pnndash1 is waiting for a

resource that is held by Pn and P0 is waiting for a resource that is held by P0

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

21

33 Methods for Handling Deadlocks

bull Ensure that the system will never enter a deadlock state

bull Allow the system to enter a deadlock state and then recover

bull Ignore the problem and pretend that deadlocks never occur in the system used by most operating

systems including UNIX

331 Deadlock Prevention

As you have seen Deadlock Characterization for a deadlock to occur each of the four necessary

conditions must hold By ensuring that at least one of the four necessary conditions cannot hold you can

prevent the occurrence of a deadlock

Mutual Exclusion

The mutual exclusion condition must hold for non-sharable resources For instance a printer cannot be

simultaneously shared by several processes Sharable resources do not require mutually exclusive

access and thus cannot be involved in a deadlock

In general however we cannot prevent deadlocks by denying the mutual-exclusion condition Some

resources are intrinsically non-sharable

Hold and Wait

To ensure that the hold-and-wait condition never occurs in the system we must guarantee that whenever a

process requests a resource it does not hold any other resources We can implement this the following

protocol

One protocol that can be used requires each process to request and be allocated all resources before it begins

execution

An alternative protocol allows a process to request resources only when the process has none A process

may request some resources and use them Before it can request any additional resources however it must

release all the resources that it is currently allocated

No Preemption

ndash If a process that is holding some resources requests another resource that cannot be immediately

allocated to it then all resources currently being held are released

ndash Preempted resources are added to the list of resources for which the process is waiting

ndash Process will be restarted only when it can regain its old resources as well as the new ones that it

is requesting

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

22

Circular Wait

Impose a total ordering of all resource types and require that each process requests resources in an

increasing order of enumeration

332 Deadlock Avoidance

bull Simplest and most useful model requires that each process declare the maximum number of resources

of each type that it may need

bull The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that

there can never be a circular-wait condition

bull Resource-allocation state is defined by the number of available and allocated resources and the

maximum demands of the processes

Safe State

bull When a process requests an available resource system must decide if immediate allocation leaves the

system in a safe state

bull System is in safe state if there exists a safe sequence of all processes

bull Sequence ltP1 P2 hellip Pngt is safe if for each Pi the resources that Pi can still request can be satisfied

by currently available resources + resources held by all the Pj with jltI

If Pi resource needs are not immediately available then Pi can wait until all Pj have finished

When Pj is finished Pi can obtain needed resources execute return allocated resources and terminate

When Pi terminates Pi+1 can obtain its needed resources and so on

Basic Facts

bull If a system is in safe state no deadlocks

bull If a system is in unsafe state possibility of deadlock

bull Avoidance ensures that a system will never enter an unsafe state

Resource-Allocation Graph Algorithm (Single Instance of Each Resource Type)

Claim edge Pi rarr Rj indicated that process Pj may request resource Rj represented by a dashed

line

Claim edge converts to request edge when a process requests a resource

When a process releases a resource assignment edge reconverts to a claim edge

Resources must be claimed a priori in the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

23

Resource-Allocation Graph for Deadlock Avoidance Unsafe State in a Resource-Allocation Graph

Figure 31

Bankerrsquos Algorithm (Several Instance of Each Resource Type)

bull Multiple instances

bull Each process must a priori claim maximum use

bull When a process requests a resource it may have to wait

bull When a process gets all its resources it must return them in a finite amount of time

Data Structures for the Bankerrsquos Algorithm

bull Available Vector of length m If available [j] = k there are k instances of resource type Rj available

bull Max n x m matrix If Max [ij] = k then process Pi may request at most k instances of resource type Rj

bull Allocation n x m matrix If Allocation[ij] = k then Pi is currently allocated k instances of Rj

bull Need n x m matrix If Need[ij] = k then Pi may need k more instances of Rj to complete its task

Need [ij] = Max[ij] ndash Allocation [ij]

Let n = number of processes

333 Deadlock Detection

bull Allow system to enter deadlock state

bull Detection algorithm

bull Recovery scheme

Single Instance of Each Resource Type

bull Maintain wait-for graph

ndash Nodes are processes

ndash Pi rarr Pj if Pi is waiting for Pj

bull Periodically invoke an algorithm that searches for a cycle in the graph

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 14: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

14

1

2

Figure 22

Queuing diagram of process scheduling

Scheduler

Scheduler is a part of OS which selects processes from the ready queue for execution by the CPU

Different methods are applied for selecting processes from the ready queue These methods are called

Scheduling Algorithms

Note

Hence it is clear that CPU scheduling is the basis for Multiprogramming operating systems

24 Major Category of CPU Scheduling

Non-preemptive In this scheduling if a process once selected for execution CPU keeps executing

until it is released either by that process for IO or by termination

Preemptive In this scheduling process can be stopped executing and returned to the ready queue to

resume later

25 Scheduling Criteria

Many algorithms exist for CPU scheduling Various criteria have been suggested for comparing

these CPU scheduling algorithms

All the CPU scheduling algorithms include the following criteria

1 CPU utilization Measured in Percentage of time the CPU is busy

2 Throughput Number of processes completed per time unit is throughput

3 Turnaround time The interval of time between submission and completion of a process

is called turnaround time It includes execution time and waiting time

4 Waiting time Sum of all the times spent by a process at different instances waiting in the

ready queue is called waiting time

5 Response time Response time is the difference between time of submission and the time

the first response occurs

Time slice expired

IO request

Ready queue

IO queue

IO

CPU

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

15

Desirable features are having maximum CPU utilization throughput and minimum

turnaround time waiting time and response time

26 SCHEDULING ALGORITHMS

Scheduling algorithms differ in the manner in which the CPU selects a process in the ready

queue for execution

261 FIRST COME FIRST SERVE (FCFS) SCHEDULING ALGORITHM

A process that requests for the CPU first is allocated the CPU first Hence the name first come first serve

The implementation of the FCFS policy is easily managed with a FIFO queue When a process enters the

ready queue its PCB is linked onto the tail of the queue When the CPU is free it is allocated to the process

at the head of the queue The running process is the removed from the queue Even though the algorithm is

simple the average waiting is often quite long

Consider a set of three processes P1 P2 and P3 arriving at time instant 0 and having CPU burst times as

shown below

Process Burst time (msecs)

P1 24

P2 3

P3 3

The Gantt chart below shows the result

0 24 27 30

Figure 23 Gantt chart for above example

Average waiting time and average turnaround time are calculated as follows

The waiting time for process P1 = 0 msecs

P2 = 24 msecs

P3 = 27 msecs

Average waiting time = (0 + 24 + 27) 3 = 51 3 = 17 msecs

P1 completes at the end of 24 msecs P2 at the end of 27 msecs and P3 at the end of 30 msecs Average

turnaround time = (24 + 27 + 30) 3 = 81 3 = 27 msecs

Since the algorithm is nonpreemptive in nature it is not suited for time sharing systems

P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

16

262 SHORTEST JOB FIRST (SJF) SCHEDULING ALGORITHM

Another approach to CPU scheduling is the shortest job first algorithm In this algorithm the length of

the CPU burst is considered When the CPU is available it is assigned to the process that has the

smallest next CPU burst Hence the name shortest job first If the next CPU bursts of two processes are

the same FCFS scheduling is used to break the tie As an example consider the following set of

processes P1 P2 P3 P4 and their CPU burst times

Process Burst time (msecs)

P1 6

P2 8

P3 7

P4 3

Using SJF algorithm the processes would be scheduled as shown below

0 3 9 16 24

Figure 24 Gantt chart for above example

Average waiting time = (0 + 3 + 9 + 16) 4 = 28 4 = 7 msecs

Average turnaround time = (3 + 9 + 16 + 24) 4 = 52 4 = 13 msecs

If the above processes were scheduled using FCFS algorithm then

Average waiting time = (0 + 6 + 14 + 21) 4 = 41 4 = 1025 msecs

Average turnaround time = (6 + 14 + 21 + 24) 4 = 65 4 = 1625 msecs

It is clear that the SJF algorithm produces the most optimal scheduling scheme For a given set of

processes the algorithm gives the minimum average waiting and turnaround times This is because

shorter processes are scheduled earlier than longer ones and hence waiting time for shorter processes

decreases and it increases the waiting time of long processes SJF algorithm could be either preemptive

or nonpreemptive

The main disadvantage with the SJF algorithm lies in knowing the length of the next CPU burst SJF

algorithm is therefore not applicable in CPU scheduling

P4 P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

17

263 Priority Scheduling A priority is associated with each process and the CPU is allocated to the process with the highest

priority Equal-priority processes are scheduled in FCFS

An SJF algorithm is therefore simply a priority algorithm where the priority is the inverse of the

(predicted) next CPU burst The larger the CPU burst the lower the priority and vice versa

Priority is expressed in terms of fixed range number such as 0 to 10 Some systems use low numbers to

represent low priority while others use low numbers for high priority But in this course we will use low

numbers to represent high priority

Consider the following set of processes assumed to have arrived at time 0 in the order P1 P2 P5

with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 3

P2 1 1

P3 2 4

P4 1 5

P5 5 2

Using priority scheduling we would schedule these processes according to the Gantt chart below

0 1 6 16 18 19

Figure 25 Gantt chart for above example

Average waiting time = (0 + 1 + 6 + 16+18) 5 = 41 5 = 82 msecs

Average turnaround time = (1 +6 + 16 + 18+19) 5 = 60 5 = 12 msecs

Priorities can be defined either internally or externally Internally defined priorities use measurable

quantity such as time limits memory requirements etc to compute the priority of a process

External priorities are set by criteria that are external to the operating system such as importance of the

process amount being paid for use of the compute the owner of the process and other (political)

factors

Priority scheduling may be either preemptive or nonpreemptive When a process arrives at the ready

queue its priority is compared with that of the currently running process A preemptive priority-

scheduling algorithm will preempt the CPU if the priority of the newly arrived process is higher than

P2 P5 P1 P3 P4

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

18

that of the currently running process A nonpreemptive priority-scheduling algorithm will simply put the

new process at the head of the ready queue

The major disadvantage of priority-scheduling algorithms is indefinite blocking or starvation A

situation whereby low priority processes indefinitely wait for the CPU because of a steady stream of

higher- priority processes

A solution to indefinite blocking of low-priority processes is aging Aging is a technique of gradually

increasing the priority of processes that wait in the system for a long time

264 ROUND ROBIN (RR) SCHEDULING ALGORITHM

The round-robin CPU scheduling algorithm is basically a preemptive scheduling algorithm designed for

time-sharing systems One unit of time is called a time slice Duration of a time slice may range between

10 msecs and about 100 msecs The CPU scheduler allocates to each process in the ready queue one

time slice at a time in a round-robin fashion Hence the name round-robin

Consider the same example explained under FCFS algorithm

Process Burst time (msecs)

A 13

B 3

C 3

D 5

Let the duration of a time slice be 4 msecs which is to say CPU switches between processes every 4

msecs in a round-robin fashion The Gantt chart below shows the scheduling of processes

0 4 7 10 14 18 19 23 24

Figure 25 Gantt chart for above example

Average waiting time = [(19 ndash 8) + 4 + 7+ (18 - 4)] 3 = 36 4 = 9 msecs

The performance of the RR algorithm is very much dependent on the length of the time slice If the

duration of the time slice is indefinitely large then the RR algorithm is the same as FCFS algorithm If

the time slice is too small then the performance of the algorithm deteriorates because of the effect of

frequent context switching

A B C D A D A A

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

19

Exercise

Consider the following set of processes with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 2

P2 4 3

P3 2 1

P4 6 4 P5 5 5

The processes are assumed to have arrived in the order P1 P2 P3 P4 and P5 all at time 0

a Draw four Gantt charts illustrating the execution of these processes using FCFS SJF a

nonpreemptive priority (a smaller priority number implies a higher priority)and RR (Quantum = 1) scheduling

b What is the turnaround time of each process for each of the scheduling algorithms in (a) above

c What is the waiting time of each process for each of the scheduling algorithms in (a)

d Which of the schedules in (a) results in the minimal average waiting time (over all processes)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

20

Chapter ndash III

PROCESS MANAGEMENT-II

31 Deadlock

A process request resources and if the resources are not available at that time the process enters a waiting

state A waiting process is never again able to change state because other waiting processes hold the

resources This situation is called a deadlock

Example

ndash System has two tape drives R1 and R2 and two process P1 and P2

ndash P1 holds R1 but demand R2

ndash P2 holds R2 but demand R1

System Model

bull Resource types R1 R2 hellipRm (CPU cycles memory space IO devices)

bull Each resource type Ri has Wi instances(More than One Instances)

bull Each process utilizes a resource as follows

Request

Use

Release

32 Deadlock Characterization

Deadlock can arise if four conditions hold simultaneously

bull Mutual exclusion

At least one resource must be held in a non-sharable mode ie only one process at a time can use the

resource If another process requests that resource the requesting process must be delayed until the resource

has been released

bull Hold and wait a process holding at least one resource is waiting to acquire additional resources held

by other processes

bull No preemption a resource can be released only voluntarily by the process holding it after that

process has completed its task

bull Circular wait there exists a set P0 P1 hellip P0 of waiting processes such that P0 is waiting for a

resource that is held by P1 P1 is waiting for a resource that is held by P2 hellip Pnndash1 is waiting for a

resource that is held by Pn and P0 is waiting for a resource that is held by P0

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

21

33 Methods for Handling Deadlocks

bull Ensure that the system will never enter a deadlock state

bull Allow the system to enter a deadlock state and then recover

bull Ignore the problem and pretend that deadlocks never occur in the system used by most operating

systems including UNIX

331 Deadlock Prevention

As you have seen Deadlock Characterization for a deadlock to occur each of the four necessary

conditions must hold By ensuring that at least one of the four necessary conditions cannot hold you can

prevent the occurrence of a deadlock

Mutual Exclusion

The mutual exclusion condition must hold for non-sharable resources For instance a printer cannot be

simultaneously shared by several processes Sharable resources do not require mutually exclusive

access and thus cannot be involved in a deadlock

In general however we cannot prevent deadlocks by denying the mutual-exclusion condition Some

resources are intrinsically non-sharable

Hold and Wait

To ensure that the hold-and-wait condition never occurs in the system we must guarantee that whenever a

process requests a resource it does not hold any other resources We can implement this the following

protocol

One protocol that can be used requires each process to request and be allocated all resources before it begins

execution

An alternative protocol allows a process to request resources only when the process has none A process

may request some resources and use them Before it can request any additional resources however it must

release all the resources that it is currently allocated

No Preemption

ndash If a process that is holding some resources requests another resource that cannot be immediately

allocated to it then all resources currently being held are released

ndash Preempted resources are added to the list of resources for which the process is waiting

ndash Process will be restarted only when it can regain its old resources as well as the new ones that it

is requesting

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

22

Circular Wait

Impose a total ordering of all resource types and require that each process requests resources in an

increasing order of enumeration

332 Deadlock Avoidance

bull Simplest and most useful model requires that each process declare the maximum number of resources

of each type that it may need

bull The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that

there can never be a circular-wait condition

bull Resource-allocation state is defined by the number of available and allocated resources and the

maximum demands of the processes

Safe State

bull When a process requests an available resource system must decide if immediate allocation leaves the

system in a safe state

bull System is in safe state if there exists a safe sequence of all processes

bull Sequence ltP1 P2 hellip Pngt is safe if for each Pi the resources that Pi can still request can be satisfied

by currently available resources + resources held by all the Pj with jltI

If Pi resource needs are not immediately available then Pi can wait until all Pj have finished

When Pj is finished Pi can obtain needed resources execute return allocated resources and terminate

When Pi terminates Pi+1 can obtain its needed resources and so on

Basic Facts

bull If a system is in safe state no deadlocks

bull If a system is in unsafe state possibility of deadlock

bull Avoidance ensures that a system will never enter an unsafe state

Resource-Allocation Graph Algorithm (Single Instance of Each Resource Type)

Claim edge Pi rarr Rj indicated that process Pj may request resource Rj represented by a dashed

line

Claim edge converts to request edge when a process requests a resource

When a process releases a resource assignment edge reconverts to a claim edge

Resources must be claimed a priori in the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

23

Resource-Allocation Graph for Deadlock Avoidance Unsafe State in a Resource-Allocation Graph

Figure 31

Bankerrsquos Algorithm (Several Instance of Each Resource Type)

bull Multiple instances

bull Each process must a priori claim maximum use

bull When a process requests a resource it may have to wait

bull When a process gets all its resources it must return them in a finite amount of time

Data Structures for the Bankerrsquos Algorithm

bull Available Vector of length m If available [j] = k there are k instances of resource type Rj available

bull Max n x m matrix If Max [ij] = k then process Pi may request at most k instances of resource type Rj

bull Allocation n x m matrix If Allocation[ij] = k then Pi is currently allocated k instances of Rj

bull Need n x m matrix If Need[ij] = k then Pi may need k more instances of Rj to complete its task

Need [ij] = Max[ij] ndash Allocation [ij]

Let n = number of processes

333 Deadlock Detection

bull Allow system to enter deadlock state

bull Detection algorithm

bull Recovery scheme

Single Instance of Each Resource Type

bull Maintain wait-for graph

ndash Nodes are processes

ndash Pi rarr Pj if Pi is waiting for Pj

bull Periodically invoke an algorithm that searches for a cycle in the graph

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 15: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

15

Desirable features are having maximum CPU utilization throughput and minimum

turnaround time waiting time and response time

26 SCHEDULING ALGORITHMS

Scheduling algorithms differ in the manner in which the CPU selects a process in the ready

queue for execution

261 FIRST COME FIRST SERVE (FCFS) SCHEDULING ALGORITHM

A process that requests for the CPU first is allocated the CPU first Hence the name first come first serve

The implementation of the FCFS policy is easily managed with a FIFO queue When a process enters the

ready queue its PCB is linked onto the tail of the queue When the CPU is free it is allocated to the process

at the head of the queue The running process is the removed from the queue Even though the algorithm is

simple the average waiting is often quite long

Consider a set of three processes P1 P2 and P3 arriving at time instant 0 and having CPU burst times as

shown below

Process Burst time (msecs)

P1 24

P2 3

P3 3

The Gantt chart below shows the result

0 24 27 30

Figure 23 Gantt chart for above example

Average waiting time and average turnaround time are calculated as follows

The waiting time for process P1 = 0 msecs

P2 = 24 msecs

P3 = 27 msecs

Average waiting time = (0 + 24 + 27) 3 = 51 3 = 17 msecs

P1 completes at the end of 24 msecs P2 at the end of 27 msecs and P3 at the end of 30 msecs Average

turnaround time = (24 + 27 + 30) 3 = 81 3 = 27 msecs

Since the algorithm is nonpreemptive in nature it is not suited for time sharing systems

P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

16

262 SHORTEST JOB FIRST (SJF) SCHEDULING ALGORITHM

Another approach to CPU scheduling is the shortest job first algorithm In this algorithm the length of

the CPU burst is considered When the CPU is available it is assigned to the process that has the

smallest next CPU burst Hence the name shortest job first If the next CPU bursts of two processes are

the same FCFS scheduling is used to break the tie As an example consider the following set of

processes P1 P2 P3 P4 and their CPU burst times

Process Burst time (msecs)

P1 6

P2 8

P3 7

P4 3

Using SJF algorithm the processes would be scheduled as shown below

0 3 9 16 24

Figure 24 Gantt chart for above example

Average waiting time = (0 + 3 + 9 + 16) 4 = 28 4 = 7 msecs

Average turnaround time = (3 + 9 + 16 + 24) 4 = 52 4 = 13 msecs

If the above processes were scheduled using FCFS algorithm then

Average waiting time = (0 + 6 + 14 + 21) 4 = 41 4 = 1025 msecs

Average turnaround time = (6 + 14 + 21 + 24) 4 = 65 4 = 1625 msecs

It is clear that the SJF algorithm produces the most optimal scheduling scheme For a given set of

processes the algorithm gives the minimum average waiting and turnaround times This is because

shorter processes are scheduled earlier than longer ones and hence waiting time for shorter processes

decreases and it increases the waiting time of long processes SJF algorithm could be either preemptive

or nonpreemptive

The main disadvantage with the SJF algorithm lies in knowing the length of the next CPU burst SJF

algorithm is therefore not applicable in CPU scheduling

P4 P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

17

263 Priority Scheduling A priority is associated with each process and the CPU is allocated to the process with the highest

priority Equal-priority processes are scheduled in FCFS

An SJF algorithm is therefore simply a priority algorithm where the priority is the inverse of the

(predicted) next CPU burst The larger the CPU burst the lower the priority and vice versa

Priority is expressed in terms of fixed range number such as 0 to 10 Some systems use low numbers to

represent low priority while others use low numbers for high priority But in this course we will use low

numbers to represent high priority

Consider the following set of processes assumed to have arrived at time 0 in the order P1 P2 P5

with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 3

P2 1 1

P3 2 4

P4 1 5

P5 5 2

Using priority scheduling we would schedule these processes according to the Gantt chart below

0 1 6 16 18 19

Figure 25 Gantt chart for above example

Average waiting time = (0 + 1 + 6 + 16+18) 5 = 41 5 = 82 msecs

Average turnaround time = (1 +6 + 16 + 18+19) 5 = 60 5 = 12 msecs

Priorities can be defined either internally or externally Internally defined priorities use measurable

quantity such as time limits memory requirements etc to compute the priority of a process

External priorities are set by criteria that are external to the operating system such as importance of the

process amount being paid for use of the compute the owner of the process and other (political)

factors

Priority scheduling may be either preemptive or nonpreemptive When a process arrives at the ready

queue its priority is compared with that of the currently running process A preemptive priority-

scheduling algorithm will preempt the CPU if the priority of the newly arrived process is higher than

P2 P5 P1 P3 P4

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

18

that of the currently running process A nonpreemptive priority-scheduling algorithm will simply put the

new process at the head of the ready queue

The major disadvantage of priority-scheduling algorithms is indefinite blocking or starvation A

situation whereby low priority processes indefinitely wait for the CPU because of a steady stream of

higher- priority processes

A solution to indefinite blocking of low-priority processes is aging Aging is a technique of gradually

increasing the priority of processes that wait in the system for a long time

264 ROUND ROBIN (RR) SCHEDULING ALGORITHM

The round-robin CPU scheduling algorithm is basically a preemptive scheduling algorithm designed for

time-sharing systems One unit of time is called a time slice Duration of a time slice may range between

10 msecs and about 100 msecs The CPU scheduler allocates to each process in the ready queue one

time slice at a time in a round-robin fashion Hence the name round-robin

Consider the same example explained under FCFS algorithm

Process Burst time (msecs)

A 13

B 3

C 3

D 5

Let the duration of a time slice be 4 msecs which is to say CPU switches between processes every 4

msecs in a round-robin fashion The Gantt chart below shows the scheduling of processes

0 4 7 10 14 18 19 23 24

Figure 25 Gantt chart for above example

Average waiting time = [(19 ndash 8) + 4 + 7+ (18 - 4)] 3 = 36 4 = 9 msecs

The performance of the RR algorithm is very much dependent on the length of the time slice If the

duration of the time slice is indefinitely large then the RR algorithm is the same as FCFS algorithm If

the time slice is too small then the performance of the algorithm deteriorates because of the effect of

frequent context switching

A B C D A D A A

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

19

Exercise

Consider the following set of processes with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 2

P2 4 3

P3 2 1

P4 6 4 P5 5 5

The processes are assumed to have arrived in the order P1 P2 P3 P4 and P5 all at time 0

a Draw four Gantt charts illustrating the execution of these processes using FCFS SJF a

nonpreemptive priority (a smaller priority number implies a higher priority)and RR (Quantum = 1) scheduling

b What is the turnaround time of each process for each of the scheduling algorithms in (a) above

c What is the waiting time of each process for each of the scheduling algorithms in (a)

d Which of the schedules in (a) results in the minimal average waiting time (over all processes)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

20

Chapter ndash III

PROCESS MANAGEMENT-II

31 Deadlock

A process request resources and if the resources are not available at that time the process enters a waiting

state A waiting process is never again able to change state because other waiting processes hold the

resources This situation is called a deadlock

Example

ndash System has two tape drives R1 and R2 and two process P1 and P2

ndash P1 holds R1 but demand R2

ndash P2 holds R2 but demand R1

System Model

bull Resource types R1 R2 hellipRm (CPU cycles memory space IO devices)

bull Each resource type Ri has Wi instances(More than One Instances)

bull Each process utilizes a resource as follows

Request

Use

Release

32 Deadlock Characterization

Deadlock can arise if four conditions hold simultaneously

bull Mutual exclusion

At least one resource must be held in a non-sharable mode ie only one process at a time can use the

resource If another process requests that resource the requesting process must be delayed until the resource

has been released

bull Hold and wait a process holding at least one resource is waiting to acquire additional resources held

by other processes

bull No preemption a resource can be released only voluntarily by the process holding it after that

process has completed its task

bull Circular wait there exists a set P0 P1 hellip P0 of waiting processes such that P0 is waiting for a

resource that is held by P1 P1 is waiting for a resource that is held by P2 hellip Pnndash1 is waiting for a

resource that is held by Pn and P0 is waiting for a resource that is held by P0

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

21

33 Methods for Handling Deadlocks

bull Ensure that the system will never enter a deadlock state

bull Allow the system to enter a deadlock state and then recover

bull Ignore the problem and pretend that deadlocks never occur in the system used by most operating

systems including UNIX

331 Deadlock Prevention

As you have seen Deadlock Characterization for a deadlock to occur each of the four necessary

conditions must hold By ensuring that at least one of the four necessary conditions cannot hold you can

prevent the occurrence of a deadlock

Mutual Exclusion

The mutual exclusion condition must hold for non-sharable resources For instance a printer cannot be

simultaneously shared by several processes Sharable resources do not require mutually exclusive

access and thus cannot be involved in a deadlock

In general however we cannot prevent deadlocks by denying the mutual-exclusion condition Some

resources are intrinsically non-sharable

Hold and Wait

To ensure that the hold-and-wait condition never occurs in the system we must guarantee that whenever a

process requests a resource it does not hold any other resources We can implement this the following

protocol

One protocol that can be used requires each process to request and be allocated all resources before it begins

execution

An alternative protocol allows a process to request resources only when the process has none A process

may request some resources and use them Before it can request any additional resources however it must

release all the resources that it is currently allocated

No Preemption

ndash If a process that is holding some resources requests another resource that cannot be immediately

allocated to it then all resources currently being held are released

ndash Preempted resources are added to the list of resources for which the process is waiting

ndash Process will be restarted only when it can regain its old resources as well as the new ones that it

is requesting

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

22

Circular Wait

Impose a total ordering of all resource types and require that each process requests resources in an

increasing order of enumeration

332 Deadlock Avoidance

bull Simplest and most useful model requires that each process declare the maximum number of resources

of each type that it may need

bull The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that

there can never be a circular-wait condition

bull Resource-allocation state is defined by the number of available and allocated resources and the

maximum demands of the processes

Safe State

bull When a process requests an available resource system must decide if immediate allocation leaves the

system in a safe state

bull System is in safe state if there exists a safe sequence of all processes

bull Sequence ltP1 P2 hellip Pngt is safe if for each Pi the resources that Pi can still request can be satisfied

by currently available resources + resources held by all the Pj with jltI

If Pi resource needs are not immediately available then Pi can wait until all Pj have finished

When Pj is finished Pi can obtain needed resources execute return allocated resources and terminate

When Pi terminates Pi+1 can obtain its needed resources and so on

Basic Facts

bull If a system is in safe state no deadlocks

bull If a system is in unsafe state possibility of deadlock

bull Avoidance ensures that a system will never enter an unsafe state

Resource-Allocation Graph Algorithm (Single Instance of Each Resource Type)

Claim edge Pi rarr Rj indicated that process Pj may request resource Rj represented by a dashed

line

Claim edge converts to request edge when a process requests a resource

When a process releases a resource assignment edge reconverts to a claim edge

Resources must be claimed a priori in the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

23

Resource-Allocation Graph for Deadlock Avoidance Unsafe State in a Resource-Allocation Graph

Figure 31

Bankerrsquos Algorithm (Several Instance of Each Resource Type)

bull Multiple instances

bull Each process must a priori claim maximum use

bull When a process requests a resource it may have to wait

bull When a process gets all its resources it must return them in a finite amount of time

Data Structures for the Bankerrsquos Algorithm

bull Available Vector of length m If available [j] = k there are k instances of resource type Rj available

bull Max n x m matrix If Max [ij] = k then process Pi may request at most k instances of resource type Rj

bull Allocation n x m matrix If Allocation[ij] = k then Pi is currently allocated k instances of Rj

bull Need n x m matrix If Need[ij] = k then Pi may need k more instances of Rj to complete its task

Need [ij] = Max[ij] ndash Allocation [ij]

Let n = number of processes

333 Deadlock Detection

bull Allow system to enter deadlock state

bull Detection algorithm

bull Recovery scheme

Single Instance of Each Resource Type

bull Maintain wait-for graph

ndash Nodes are processes

ndash Pi rarr Pj if Pi is waiting for Pj

bull Periodically invoke an algorithm that searches for a cycle in the graph

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 16: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

16

262 SHORTEST JOB FIRST (SJF) SCHEDULING ALGORITHM

Another approach to CPU scheduling is the shortest job first algorithm In this algorithm the length of

the CPU burst is considered When the CPU is available it is assigned to the process that has the

smallest next CPU burst Hence the name shortest job first If the next CPU bursts of two processes are

the same FCFS scheduling is used to break the tie As an example consider the following set of

processes P1 P2 P3 P4 and their CPU burst times

Process Burst time (msecs)

P1 6

P2 8

P3 7

P4 3

Using SJF algorithm the processes would be scheduled as shown below

0 3 9 16 24

Figure 24 Gantt chart for above example

Average waiting time = (0 + 3 + 9 + 16) 4 = 28 4 = 7 msecs

Average turnaround time = (3 + 9 + 16 + 24) 4 = 52 4 = 13 msecs

If the above processes were scheduled using FCFS algorithm then

Average waiting time = (0 + 6 + 14 + 21) 4 = 41 4 = 1025 msecs

Average turnaround time = (6 + 14 + 21 + 24) 4 = 65 4 = 1625 msecs

It is clear that the SJF algorithm produces the most optimal scheduling scheme For a given set of

processes the algorithm gives the minimum average waiting and turnaround times This is because

shorter processes are scheduled earlier than longer ones and hence waiting time for shorter processes

decreases and it increases the waiting time of long processes SJF algorithm could be either preemptive

or nonpreemptive

The main disadvantage with the SJF algorithm lies in knowing the length of the next CPU burst SJF

algorithm is therefore not applicable in CPU scheduling

P4 P1 P2 P3

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

17

263 Priority Scheduling A priority is associated with each process and the CPU is allocated to the process with the highest

priority Equal-priority processes are scheduled in FCFS

An SJF algorithm is therefore simply a priority algorithm where the priority is the inverse of the

(predicted) next CPU burst The larger the CPU burst the lower the priority and vice versa

Priority is expressed in terms of fixed range number such as 0 to 10 Some systems use low numbers to

represent low priority while others use low numbers for high priority But in this course we will use low

numbers to represent high priority

Consider the following set of processes assumed to have arrived at time 0 in the order P1 P2 P5

with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 3

P2 1 1

P3 2 4

P4 1 5

P5 5 2

Using priority scheduling we would schedule these processes according to the Gantt chart below

0 1 6 16 18 19

Figure 25 Gantt chart for above example

Average waiting time = (0 + 1 + 6 + 16+18) 5 = 41 5 = 82 msecs

Average turnaround time = (1 +6 + 16 + 18+19) 5 = 60 5 = 12 msecs

Priorities can be defined either internally or externally Internally defined priorities use measurable

quantity such as time limits memory requirements etc to compute the priority of a process

External priorities are set by criteria that are external to the operating system such as importance of the

process amount being paid for use of the compute the owner of the process and other (political)

factors

Priority scheduling may be either preemptive or nonpreemptive When a process arrives at the ready

queue its priority is compared with that of the currently running process A preemptive priority-

scheduling algorithm will preempt the CPU if the priority of the newly arrived process is higher than

P2 P5 P1 P3 P4

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

18

that of the currently running process A nonpreemptive priority-scheduling algorithm will simply put the

new process at the head of the ready queue

The major disadvantage of priority-scheduling algorithms is indefinite blocking or starvation A

situation whereby low priority processes indefinitely wait for the CPU because of a steady stream of

higher- priority processes

A solution to indefinite blocking of low-priority processes is aging Aging is a technique of gradually

increasing the priority of processes that wait in the system for a long time

264 ROUND ROBIN (RR) SCHEDULING ALGORITHM

The round-robin CPU scheduling algorithm is basically a preemptive scheduling algorithm designed for

time-sharing systems One unit of time is called a time slice Duration of a time slice may range between

10 msecs and about 100 msecs The CPU scheduler allocates to each process in the ready queue one

time slice at a time in a round-robin fashion Hence the name round-robin

Consider the same example explained under FCFS algorithm

Process Burst time (msecs)

A 13

B 3

C 3

D 5

Let the duration of a time slice be 4 msecs which is to say CPU switches between processes every 4

msecs in a round-robin fashion The Gantt chart below shows the scheduling of processes

0 4 7 10 14 18 19 23 24

Figure 25 Gantt chart for above example

Average waiting time = [(19 ndash 8) + 4 + 7+ (18 - 4)] 3 = 36 4 = 9 msecs

The performance of the RR algorithm is very much dependent on the length of the time slice If the

duration of the time slice is indefinitely large then the RR algorithm is the same as FCFS algorithm If

the time slice is too small then the performance of the algorithm deteriorates because of the effect of

frequent context switching

A B C D A D A A

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

19

Exercise

Consider the following set of processes with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 2

P2 4 3

P3 2 1

P4 6 4 P5 5 5

The processes are assumed to have arrived in the order P1 P2 P3 P4 and P5 all at time 0

a Draw four Gantt charts illustrating the execution of these processes using FCFS SJF a

nonpreemptive priority (a smaller priority number implies a higher priority)and RR (Quantum = 1) scheduling

b What is the turnaround time of each process for each of the scheduling algorithms in (a) above

c What is the waiting time of each process for each of the scheduling algorithms in (a)

d Which of the schedules in (a) results in the minimal average waiting time (over all processes)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

20

Chapter ndash III

PROCESS MANAGEMENT-II

31 Deadlock

A process request resources and if the resources are not available at that time the process enters a waiting

state A waiting process is never again able to change state because other waiting processes hold the

resources This situation is called a deadlock

Example

ndash System has two tape drives R1 and R2 and two process P1 and P2

ndash P1 holds R1 but demand R2

ndash P2 holds R2 but demand R1

System Model

bull Resource types R1 R2 hellipRm (CPU cycles memory space IO devices)

bull Each resource type Ri has Wi instances(More than One Instances)

bull Each process utilizes a resource as follows

Request

Use

Release

32 Deadlock Characterization

Deadlock can arise if four conditions hold simultaneously

bull Mutual exclusion

At least one resource must be held in a non-sharable mode ie only one process at a time can use the

resource If another process requests that resource the requesting process must be delayed until the resource

has been released

bull Hold and wait a process holding at least one resource is waiting to acquire additional resources held

by other processes

bull No preemption a resource can be released only voluntarily by the process holding it after that

process has completed its task

bull Circular wait there exists a set P0 P1 hellip P0 of waiting processes such that P0 is waiting for a

resource that is held by P1 P1 is waiting for a resource that is held by P2 hellip Pnndash1 is waiting for a

resource that is held by Pn and P0 is waiting for a resource that is held by P0

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

21

33 Methods for Handling Deadlocks

bull Ensure that the system will never enter a deadlock state

bull Allow the system to enter a deadlock state and then recover

bull Ignore the problem and pretend that deadlocks never occur in the system used by most operating

systems including UNIX

331 Deadlock Prevention

As you have seen Deadlock Characterization for a deadlock to occur each of the four necessary

conditions must hold By ensuring that at least one of the four necessary conditions cannot hold you can

prevent the occurrence of a deadlock

Mutual Exclusion

The mutual exclusion condition must hold for non-sharable resources For instance a printer cannot be

simultaneously shared by several processes Sharable resources do not require mutually exclusive

access and thus cannot be involved in a deadlock

In general however we cannot prevent deadlocks by denying the mutual-exclusion condition Some

resources are intrinsically non-sharable

Hold and Wait

To ensure that the hold-and-wait condition never occurs in the system we must guarantee that whenever a

process requests a resource it does not hold any other resources We can implement this the following

protocol

One protocol that can be used requires each process to request and be allocated all resources before it begins

execution

An alternative protocol allows a process to request resources only when the process has none A process

may request some resources and use them Before it can request any additional resources however it must

release all the resources that it is currently allocated

No Preemption

ndash If a process that is holding some resources requests another resource that cannot be immediately

allocated to it then all resources currently being held are released

ndash Preempted resources are added to the list of resources for which the process is waiting

ndash Process will be restarted only when it can regain its old resources as well as the new ones that it

is requesting

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

22

Circular Wait

Impose a total ordering of all resource types and require that each process requests resources in an

increasing order of enumeration

332 Deadlock Avoidance

bull Simplest and most useful model requires that each process declare the maximum number of resources

of each type that it may need

bull The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that

there can never be a circular-wait condition

bull Resource-allocation state is defined by the number of available and allocated resources and the

maximum demands of the processes

Safe State

bull When a process requests an available resource system must decide if immediate allocation leaves the

system in a safe state

bull System is in safe state if there exists a safe sequence of all processes

bull Sequence ltP1 P2 hellip Pngt is safe if for each Pi the resources that Pi can still request can be satisfied

by currently available resources + resources held by all the Pj with jltI

If Pi resource needs are not immediately available then Pi can wait until all Pj have finished

When Pj is finished Pi can obtain needed resources execute return allocated resources and terminate

When Pi terminates Pi+1 can obtain its needed resources and so on

Basic Facts

bull If a system is in safe state no deadlocks

bull If a system is in unsafe state possibility of deadlock

bull Avoidance ensures that a system will never enter an unsafe state

Resource-Allocation Graph Algorithm (Single Instance of Each Resource Type)

Claim edge Pi rarr Rj indicated that process Pj may request resource Rj represented by a dashed

line

Claim edge converts to request edge when a process requests a resource

When a process releases a resource assignment edge reconverts to a claim edge

Resources must be claimed a priori in the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

23

Resource-Allocation Graph for Deadlock Avoidance Unsafe State in a Resource-Allocation Graph

Figure 31

Bankerrsquos Algorithm (Several Instance of Each Resource Type)

bull Multiple instances

bull Each process must a priori claim maximum use

bull When a process requests a resource it may have to wait

bull When a process gets all its resources it must return them in a finite amount of time

Data Structures for the Bankerrsquos Algorithm

bull Available Vector of length m If available [j] = k there are k instances of resource type Rj available

bull Max n x m matrix If Max [ij] = k then process Pi may request at most k instances of resource type Rj

bull Allocation n x m matrix If Allocation[ij] = k then Pi is currently allocated k instances of Rj

bull Need n x m matrix If Need[ij] = k then Pi may need k more instances of Rj to complete its task

Need [ij] = Max[ij] ndash Allocation [ij]

Let n = number of processes

333 Deadlock Detection

bull Allow system to enter deadlock state

bull Detection algorithm

bull Recovery scheme

Single Instance of Each Resource Type

bull Maintain wait-for graph

ndash Nodes are processes

ndash Pi rarr Pj if Pi is waiting for Pj

bull Periodically invoke an algorithm that searches for a cycle in the graph

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 17: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

17

263 Priority Scheduling A priority is associated with each process and the CPU is allocated to the process with the highest

priority Equal-priority processes are scheduled in FCFS

An SJF algorithm is therefore simply a priority algorithm where the priority is the inverse of the

(predicted) next CPU burst The larger the CPU burst the lower the priority and vice versa

Priority is expressed in terms of fixed range number such as 0 to 10 Some systems use low numbers to

represent low priority while others use low numbers for high priority But in this course we will use low

numbers to represent high priority

Consider the following set of processes assumed to have arrived at time 0 in the order P1 P2 P5

with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 3

P2 1 1

P3 2 4

P4 1 5

P5 5 2

Using priority scheduling we would schedule these processes according to the Gantt chart below

0 1 6 16 18 19

Figure 25 Gantt chart for above example

Average waiting time = (0 + 1 + 6 + 16+18) 5 = 41 5 = 82 msecs

Average turnaround time = (1 +6 + 16 + 18+19) 5 = 60 5 = 12 msecs

Priorities can be defined either internally or externally Internally defined priorities use measurable

quantity such as time limits memory requirements etc to compute the priority of a process

External priorities are set by criteria that are external to the operating system such as importance of the

process amount being paid for use of the compute the owner of the process and other (political)

factors

Priority scheduling may be either preemptive or nonpreemptive When a process arrives at the ready

queue its priority is compared with that of the currently running process A preemptive priority-

scheduling algorithm will preempt the CPU if the priority of the newly arrived process is higher than

P2 P5 P1 P3 P4

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

18

that of the currently running process A nonpreemptive priority-scheduling algorithm will simply put the

new process at the head of the ready queue

The major disadvantage of priority-scheduling algorithms is indefinite blocking or starvation A

situation whereby low priority processes indefinitely wait for the CPU because of a steady stream of

higher- priority processes

A solution to indefinite blocking of low-priority processes is aging Aging is a technique of gradually

increasing the priority of processes that wait in the system for a long time

264 ROUND ROBIN (RR) SCHEDULING ALGORITHM

The round-robin CPU scheduling algorithm is basically a preemptive scheduling algorithm designed for

time-sharing systems One unit of time is called a time slice Duration of a time slice may range between

10 msecs and about 100 msecs The CPU scheduler allocates to each process in the ready queue one

time slice at a time in a round-robin fashion Hence the name round-robin

Consider the same example explained under FCFS algorithm

Process Burst time (msecs)

A 13

B 3

C 3

D 5

Let the duration of a time slice be 4 msecs which is to say CPU switches between processes every 4

msecs in a round-robin fashion The Gantt chart below shows the scheduling of processes

0 4 7 10 14 18 19 23 24

Figure 25 Gantt chart for above example

Average waiting time = [(19 ndash 8) + 4 + 7+ (18 - 4)] 3 = 36 4 = 9 msecs

The performance of the RR algorithm is very much dependent on the length of the time slice If the

duration of the time slice is indefinitely large then the RR algorithm is the same as FCFS algorithm If

the time slice is too small then the performance of the algorithm deteriorates because of the effect of

frequent context switching

A B C D A D A A

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

19

Exercise

Consider the following set of processes with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 2

P2 4 3

P3 2 1

P4 6 4 P5 5 5

The processes are assumed to have arrived in the order P1 P2 P3 P4 and P5 all at time 0

a Draw four Gantt charts illustrating the execution of these processes using FCFS SJF a

nonpreemptive priority (a smaller priority number implies a higher priority)and RR (Quantum = 1) scheduling

b What is the turnaround time of each process for each of the scheduling algorithms in (a) above

c What is the waiting time of each process for each of the scheduling algorithms in (a)

d Which of the schedules in (a) results in the minimal average waiting time (over all processes)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

20

Chapter ndash III

PROCESS MANAGEMENT-II

31 Deadlock

A process request resources and if the resources are not available at that time the process enters a waiting

state A waiting process is never again able to change state because other waiting processes hold the

resources This situation is called a deadlock

Example

ndash System has two tape drives R1 and R2 and two process P1 and P2

ndash P1 holds R1 but demand R2

ndash P2 holds R2 but demand R1

System Model

bull Resource types R1 R2 hellipRm (CPU cycles memory space IO devices)

bull Each resource type Ri has Wi instances(More than One Instances)

bull Each process utilizes a resource as follows

Request

Use

Release

32 Deadlock Characterization

Deadlock can arise if four conditions hold simultaneously

bull Mutual exclusion

At least one resource must be held in a non-sharable mode ie only one process at a time can use the

resource If another process requests that resource the requesting process must be delayed until the resource

has been released

bull Hold and wait a process holding at least one resource is waiting to acquire additional resources held

by other processes

bull No preemption a resource can be released only voluntarily by the process holding it after that

process has completed its task

bull Circular wait there exists a set P0 P1 hellip P0 of waiting processes such that P0 is waiting for a

resource that is held by P1 P1 is waiting for a resource that is held by P2 hellip Pnndash1 is waiting for a

resource that is held by Pn and P0 is waiting for a resource that is held by P0

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

21

33 Methods for Handling Deadlocks

bull Ensure that the system will never enter a deadlock state

bull Allow the system to enter a deadlock state and then recover

bull Ignore the problem and pretend that deadlocks never occur in the system used by most operating

systems including UNIX

331 Deadlock Prevention

As you have seen Deadlock Characterization for a deadlock to occur each of the four necessary

conditions must hold By ensuring that at least one of the four necessary conditions cannot hold you can

prevent the occurrence of a deadlock

Mutual Exclusion

The mutual exclusion condition must hold for non-sharable resources For instance a printer cannot be

simultaneously shared by several processes Sharable resources do not require mutually exclusive

access and thus cannot be involved in a deadlock

In general however we cannot prevent deadlocks by denying the mutual-exclusion condition Some

resources are intrinsically non-sharable

Hold and Wait

To ensure that the hold-and-wait condition never occurs in the system we must guarantee that whenever a

process requests a resource it does not hold any other resources We can implement this the following

protocol

One protocol that can be used requires each process to request and be allocated all resources before it begins

execution

An alternative protocol allows a process to request resources only when the process has none A process

may request some resources and use them Before it can request any additional resources however it must

release all the resources that it is currently allocated

No Preemption

ndash If a process that is holding some resources requests another resource that cannot be immediately

allocated to it then all resources currently being held are released

ndash Preempted resources are added to the list of resources for which the process is waiting

ndash Process will be restarted only when it can regain its old resources as well as the new ones that it

is requesting

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

22

Circular Wait

Impose a total ordering of all resource types and require that each process requests resources in an

increasing order of enumeration

332 Deadlock Avoidance

bull Simplest and most useful model requires that each process declare the maximum number of resources

of each type that it may need

bull The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that

there can never be a circular-wait condition

bull Resource-allocation state is defined by the number of available and allocated resources and the

maximum demands of the processes

Safe State

bull When a process requests an available resource system must decide if immediate allocation leaves the

system in a safe state

bull System is in safe state if there exists a safe sequence of all processes

bull Sequence ltP1 P2 hellip Pngt is safe if for each Pi the resources that Pi can still request can be satisfied

by currently available resources + resources held by all the Pj with jltI

If Pi resource needs are not immediately available then Pi can wait until all Pj have finished

When Pj is finished Pi can obtain needed resources execute return allocated resources and terminate

When Pi terminates Pi+1 can obtain its needed resources and so on

Basic Facts

bull If a system is in safe state no deadlocks

bull If a system is in unsafe state possibility of deadlock

bull Avoidance ensures that a system will never enter an unsafe state

Resource-Allocation Graph Algorithm (Single Instance of Each Resource Type)

Claim edge Pi rarr Rj indicated that process Pj may request resource Rj represented by a dashed

line

Claim edge converts to request edge when a process requests a resource

When a process releases a resource assignment edge reconverts to a claim edge

Resources must be claimed a priori in the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

23

Resource-Allocation Graph for Deadlock Avoidance Unsafe State in a Resource-Allocation Graph

Figure 31

Bankerrsquos Algorithm (Several Instance of Each Resource Type)

bull Multiple instances

bull Each process must a priori claim maximum use

bull When a process requests a resource it may have to wait

bull When a process gets all its resources it must return them in a finite amount of time

Data Structures for the Bankerrsquos Algorithm

bull Available Vector of length m If available [j] = k there are k instances of resource type Rj available

bull Max n x m matrix If Max [ij] = k then process Pi may request at most k instances of resource type Rj

bull Allocation n x m matrix If Allocation[ij] = k then Pi is currently allocated k instances of Rj

bull Need n x m matrix If Need[ij] = k then Pi may need k more instances of Rj to complete its task

Need [ij] = Max[ij] ndash Allocation [ij]

Let n = number of processes

333 Deadlock Detection

bull Allow system to enter deadlock state

bull Detection algorithm

bull Recovery scheme

Single Instance of Each Resource Type

bull Maintain wait-for graph

ndash Nodes are processes

ndash Pi rarr Pj if Pi is waiting for Pj

bull Periodically invoke an algorithm that searches for a cycle in the graph

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 18: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

18

that of the currently running process A nonpreemptive priority-scheduling algorithm will simply put the

new process at the head of the ready queue

The major disadvantage of priority-scheduling algorithms is indefinite blocking or starvation A

situation whereby low priority processes indefinitely wait for the CPU because of a steady stream of

higher- priority processes

A solution to indefinite blocking of low-priority processes is aging Aging is a technique of gradually

increasing the priority of processes that wait in the system for a long time

264 ROUND ROBIN (RR) SCHEDULING ALGORITHM

The round-robin CPU scheduling algorithm is basically a preemptive scheduling algorithm designed for

time-sharing systems One unit of time is called a time slice Duration of a time slice may range between

10 msecs and about 100 msecs The CPU scheduler allocates to each process in the ready queue one

time slice at a time in a round-robin fashion Hence the name round-robin

Consider the same example explained under FCFS algorithm

Process Burst time (msecs)

A 13

B 3

C 3

D 5

Let the duration of a time slice be 4 msecs which is to say CPU switches between processes every 4

msecs in a round-robin fashion The Gantt chart below shows the scheduling of processes

0 4 7 10 14 18 19 23 24

Figure 25 Gantt chart for above example

Average waiting time = [(19 ndash 8) + 4 + 7+ (18 - 4)] 3 = 36 4 = 9 msecs

The performance of the RR algorithm is very much dependent on the length of the time slice If the

duration of the time slice is indefinitely large then the RR algorithm is the same as FCFS algorithm If

the time slice is too small then the performance of the algorithm deteriorates because of the effect of

frequent context switching

A B C D A D A A

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

19

Exercise

Consider the following set of processes with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 2

P2 4 3

P3 2 1

P4 6 4 P5 5 5

The processes are assumed to have arrived in the order P1 P2 P3 P4 and P5 all at time 0

a Draw four Gantt charts illustrating the execution of these processes using FCFS SJF a

nonpreemptive priority (a smaller priority number implies a higher priority)and RR (Quantum = 1) scheduling

b What is the turnaround time of each process for each of the scheduling algorithms in (a) above

c What is the waiting time of each process for each of the scheduling algorithms in (a)

d Which of the schedules in (a) results in the minimal average waiting time (over all processes)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

20

Chapter ndash III

PROCESS MANAGEMENT-II

31 Deadlock

A process request resources and if the resources are not available at that time the process enters a waiting

state A waiting process is never again able to change state because other waiting processes hold the

resources This situation is called a deadlock

Example

ndash System has two tape drives R1 and R2 and two process P1 and P2

ndash P1 holds R1 but demand R2

ndash P2 holds R2 but demand R1

System Model

bull Resource types R1 R2 hellipRm (CPU cycles memory space IO devices)

bull Each resource type Ri has Wi instances(More than One Instances)

bull Each process utilizes a resource as follows

Request

Use

Release

32 Deadlock Characterization

Deadlock can arise if four conditions hold simultaneously

bull Mutual exclusion

At least one resource must be held in a non-sharable mode ie only one process at a time can use the

resource If another process requests that resource the requesting process must be delayed until the resource

has been released

bull Hold and wait a process holding at least one resource is waiting to acquire additional resources held

by other processes

bull No preemption a resource can be released only voluntarily by the process holding it after that

process has completed its task

bull Circular wait there exists a set P0 P1 hellip P0 of waiting processes such that P0 is waiting for a

resource that is held by P1 P1 is waiting for a resource that is held by P2 hellip Pnndash1 is waiting for a

resource that is held by Pn and P0 is waiting for a resource that is held by P0

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

21

33 Methods for Handling Deadlocks

bull Ensure that the system will never enter a deadlock state

bull Allow the system to enter a deadlock state and then recover

bull Ignore the problem and pretend that deadlocks never occur in the system used by most operating

systems including UNIX

331 Deadlock Prevention

As you have seen Deadlock Characterization for a deadlock to occur each of the four necessary

conditions must hold By ensuring that at least one of the four necessary conditions cannot hold you can

prevent the occurrence of a deadlock

Mutual Exclusion

The mutual exclusion condition must hold for non-sharable resources For instance a printer cannot be

simultaneously shared by several processes Sharable resources do not require mutually exclusive

access and thus cannot be involved in a deadlock

In general however we cannot prevent deadlocks by denying the mutual-exclusion condition Some

resources are intrinsically non-sharable

Hold and Wait

To ensure that the hold-and-wait condition never occurs in the system we must guarantee that whenever a

process requests a resource it does not hold any other resources We can implement this the following

protocol

One protocol that can be used requires each process to request and be allocated all resources before it begins

execution

An alternative protocol allows a process to request resources only when the process has none A process

may request some resources and use them Before it can request any additional resources however it must

release all the resources that it is currently allocated

No Preemption

ndash If a process that is holding some resources requests another resource that cannot be immediately

allocated to it then all resources currently being held are released

ndash Preempted resources are added to the list of resources for which the process is waiting

ndash Process will be restarted only when it can regain its old resources as well as the new ones that it

is requesting

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

22

Circular Wait

Impose a total ordering of all resource types and require that each process requests resources in an

increasing order of enumeration

332 Deadlock Avoidance

bull Simplest and most useful model requires that each process declare the maximum number of resources

of each type that it may need

bull The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that

there can never be a circular-wait condition

bull Resource-allocation state is defined by the number of available and allocated resources and the

maximum demands of the processes

Safe State

bull When a process requests an available resource system must decide if immediate allocation leaves the

system in a safe state

bull System is in safe state if there exists a safe sequence of all processes

bull Sequence ltP1 P2 hellip Pngt is safe if for each Pi the resources that Pi can still request can be satisfied

by currently available resources + resources held by all the Pj with jltI

If Pi resource needs are not immediately available then Pi can wait until all Pj have finished

When Pj is finished Pi can obtain needed resources execute return allocated resources and terminate

When Pi terminates Pi+1 can obtain its needed resources and so on

Basic Facts

bull If a system is in safe state no deadlocks

bull If a system is in unsafe state possibility of deadlock

bull Avoidance ensures that a system will never enter an unsafe state

Resource-Allocation Graph Algorithm (Single Instance of Each Resource Type)

Claim edge Pi rarr Rj indicated that process Pj may request resource Rj represented by a dashed

line

Claim edge converts to request edge when a process requests a resource

When a process releases a resource assignment edge reconverts to a claim edge

Resources must be claimed a priori in the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

23

Resource-Allocation Graph for Deadlock Avoidance Unsafe State in a Resource-Allocation Graph

Figure 31

Bankerrsquos Algorithm (Several Instance of Each Resource Type)

bull Multiple instances

bull Each process must a priori claim maximum use

bull When a process requests a resource it may have to wait

bull When a process gets all its resources it must return them in a finite amount of time

Data Structures for the Bankerrsquos Algorithm

bull Available Vector of length m If available [j] = k there are k instances of resource type Rj available

bull Max n x m matrix If Max [ij] = k then process Pi may request at most k instances of resource type Rj

bull Allocation n x m matrix If Allocation[ij] = k then Pi is currently allocated k instances of Rj

bull Need n x m matrix If Need[ij] = k then Pi may need k more instances of Rj to complete its task

Need [ij] = Max[ij] ndash Allocation [ij]

Let n = number of processes

333 Deadlock Detection

bull Allow system to enter deadlock state

bull Detection algorithm

bull Recovery scheme

Single Instance of Each Resource Type

bull Maintain wait-for graph

ndash Nodes are processes

ndash Pi rarr Pj if Pi is waiting for Pj

bull Periodically invoke an algorithm that searches for a cycle in the graph

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 19: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

19

Exercise

Consider the following set of processes with the length of the CPU-burst time given in milliseconds

Process Burst time Priority

P1 10 2

P2 4 3

P3 2 1

P4 6 4 P5 5 5

The processes are assumed to have arrived in the order P1 P2 P3 P4 and P5 all at time 0

a Draw four Gantt charts illustrating the execution of these processes using FCFS SJF a

nonpreemptive priority (a smaller priority number implies a higher priority)and RR (Quantum = 1) scheduling

b What is the turnaround time of each process for each of the scheduling algorithms in (a) above

c What is the waiting time of each process for each of the scheduling algorithms in (a)

d Which of the schedules in (a) results in the minimal average waiting time (over all processes)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

20

Chapter ndash III

PROCESS MANAGEMENT-II

31 Deadlock

A process request resources and if the resources are not available at that time the process enters a waiting

state A waiting process is never again able to change state because other waiting processes hold the

resources This situation is called a deadlock

Example

ndash System has two tape drives R1 and R2 and two process P1 and P2

ndash P1 holds R1 but demand R2

ndash P2 holds R2 but demand R1

System Model

bull Resource types R1 R2 hellipRm (CPU cycles memory space IO devices)

bull Each resource type Ri has Wi instances(More than One Instances)

bull Each process utilizes a resource as follows

Request

Use

Release

32 Deadlock Characterization

Deadlock can arise if four conditions hold simultaneously

bull Mutual exclusion

At least one resource must be held in a non-sharable mode ie only one process at a time can use the

resource If another process requests that resource the requesting process must be delayed until the resource

has been released

bull Hold and wait a process holding at least one resource is waiting to acquire additional resources held

by other processes

bull No preemption a resource can be released only voluntarily by the process holding it after that

process has completed its task

bull Circular wait there exists a set P0 P1 hellip P0 of waiting processes such that P0 is waiting for a

resource that is held by P1 P1 is waiting for a resource that is held by P2 hellip Pnndash1 is waiting for a

resource that is held by Pn and P0 is waiting for a resource that is held by P0

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

21

33 Methods for Handling Deadlocks

bull Ensure that the system will never enter a deadlock state

bull Allow the system to enter a deadlock state and then recover

bull Ignore the problem and pretend that deadlocks never occur in the system used by most operating

systems including UNIX

331 Deadlock Prevention

As you have seen Deadlock Characterization for a deadlock to occur each of the four necessary

conditions must hold By ensuring that at least one of the four necessary conditions cannot hold you can

prevent the occurrence of a deadlock

Mutual Exclusion

The mutual exclusion condition must hold for non-sharable resources For instance a printer cannot be

simultaneously shared by several processes Sharable resources do not require mutually exclusive

access and thus cannot be involved in a deadlock

In general however we cannot prevent deadlocks by denying the mutual-exclusion condition Some

resources are intrinsically non-sharable

Hold and Wait

To ensure that the hold-and-wait condition never occurs in the system we must guarantee that whenever a

process requests a resource it does not hold any other resources We can implement this the following

protocol

One protocol that can be used requires each process to request and be allocated all resources before it begins

execution

An alternative protocol allows a process to request resources only when the process has none A process

may request some resources and use them Before it can request any additional resources however it must

release all the resources that it is currently allocated

No Preemption

ndash If a process that is holding some resources requests another resource that cannot be immediately

allocated to it then all resources currently being held are released

ndash Preempted resources are added to the list of resources for which the process is waiting

ndash Process will be restarted only when it can regain its old resources as well as the new ones that it

is requesting

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

22

Circular Wait

Impose a total ordering of all resource types and require that each process requests resources in an

increasing order of enumeration

332 Deadlock Avoidance

bull Simplest and most useful model requires that each process declare the maximum number of resources

of each type that it may need

bull The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that

there can never be a circular-wait condition

bull Resource-allocation state is defined by the number of available and allocated resources and the

maximum demands of the processes

Safe State

bull When a process requests an available resource system must decide if immediate allocation leaves the

system in a safe state

bull System is in safe state if there exists a safe sequence of all processes

bull Sequence ltP1 P2 hellip Pngt is safe if for each Pi the resources that Pi can still request can be satisfied

by currently available resources + resources held by all the Pj with jltI

If Pi resource needs are not immediately available then Pi can wait until all Pj have finished

When Pj is finished Pi can obtain needed resources execute return allocated resources and terminate

When Pi terminates Pi+1 can obtain its needed resources and so on

Basic Facts

bull If a system is in safe state no deadlocks

bull If a system is in unsafe state possibility of deadlock

bull Avoidance ensures that a system will never enter an unsafe state

Resource-Allocation Graph Algorithm (Single Instance of Each Resource Type)

Claim edge Pi rarr Rj indicated that process Pj may request resource Rj represented by a dashed

line

Claim edge converts to request edge when a process requests a resource

When a process releases a resource assignment edge reconverts to a claim edge

Resources must be claimed a priori in the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

23

Resource-Allocation Graph for Deadlock Avoidance Unsafe State in a Resource-Allocation Graph

Figure 31

Bankerrsquos Algorithm (Several Instance of Each Resource Type)

bull Multiple instances

bull Each process must a priori claim maximum use

bull When a process requests a resource it may have to wait

bull When a process gets all its resources it must return them in a finite amount of time

Data Structures for the Bankerrsquos Algorithm

bull Available Vector of length m If available [j] = k there are k instances of resource type Rj available

bull Max n x m matrix If Max [ij] = k then process Pi may request at most k instances of resource type Rj

bull Allocation n x m matrix If Allocation[ij] = k then Pi is currently allocated k instances of Rj

bull Need n x m matrix If Need[ij] = k then Pi may need k more instances of Rj to complete its task

Need [ij] = Max[ij] ndash Allocation [ij]

Let n = number of processes

333 Deadlock Detection

bull Allow system to enter deadlock state

bull Detection algorithm

bull Recovery scheme

Single Instance of Each Resource Type

bull Maintain wait-for graph

ndash Nodes are processes

ndash Pi rarr Pj if Pi is waiting for Pj

bull Periodically invoke an algorithm that searches for a cycle in the graph

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 20: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

20

Chapter ndash III

PROCESS MANAGEMENT-II

31 Deadlock

A process request resources and if the resources are not available at that time the process enters a waiting

state A waiting process is never again able to change state because other waiting processes hold the

resources This situation is called a deadlock

Example

ndash System has two tape drives R1 and R2 and two process P1 and P2

ndash P1 holds R1 but demand R2

ndash P2 holds R2 but demand R1

System Model

bull Resource types R1 R2 hellipRm (CPU cycles memory space IO devices)

bull Each resource type Ri has Wi instances(More than One Instances)

bull Each process utilizes a resource as follows

Request

Use

Release

32 Deadlock Characterization

Deadlock can arise if four conditions hold simultaneously

bull Mutual exclusion

At least one resource must be held in a non-sharable mode ie only one process at a time can use the

resource If another process requests that resource the requesting process must be delayed until the resource

has been released

bull Hold and wait a process holding at least one resource is waiting to acquire additional resources held

by other processes

bull No preemption a resource can be released only voluntarily by the process holding it after that

process has completed its task

bull Circular wait there exists a set P0 P1 hellip P0 of waiting processes such that P0 is waiting for a

resource that is held by P1 P1 is waiting for a resource that is held by P2 hellip Pnndash1 is waiting for a

resource that is held by Pn and P0 is waiting for a resource that is held by P0

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

21

33 Methods for Handling Deadlocks

bull Ensure that the system will never enter a deadlock state

bull Allow the system to enter a deadlock state and then recover

bull Ignore the problem and pretend that deadlocks never occur in the system used by most operating

systems including UNIX

331 Deadlock Prevention

As you have seen Deadlock Characterization for a deadlock to occur each of the four necessary

conditions must hold By ensuring that at least one of the four necessary conditions cannot hold you can

prevent the occurrence of a deadlock

Mutual Exclusion

The mutual exclusion condition must hold for non-sharable resources For instance a printer cannot be

simultaneously shared by several processes Sharable resources do not require mutually exclusive

access and thus cannot be involved in a deadlock

In general however we cannot prevent deadlocks by denying the mutual-exclusion condition Some

resources are intrinsically non-sharable

Hold and Wait

To ensure that the hold-and-wait condition never occurs in the system we must guarantee that whenever a

process requests a resource it does not hold any other resources We can implement this the following

protocol

One protocol that can be used requires each process to request and be allocated all resources before it begins

execution

An alternative protocol allows a process to request resources only when the process has none A process

may request some resources and use them Before it can request any additional resources however it must

release all the resources that it is currently allocated

No Preemption

ndash If a process that is holding some resources requests another resource that cannot be immediately

allocated to it then all resources currently being held are released

ndash Preempted resources are added to the list of resources for which the process is waiting

ndash Process will be restarted only when it can regain its old resources as well as the new ones that it

is requesting

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

22

Circular Wait

Impose a total ordering of all resource types and require that each process requests resources in an

increasing order of enumeration

332 Deadlock Avoidance

bull Simplest and most useful model requires that each process declare the maximum number of resources

of each type that it may need

bull The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that

there can never be a circular-wait condition

bull Resource-allocation state is defined by the number of available and allocated resources and the

maximum demands of the processes

Safe State

bull When a process requests an available resource system must decide if immediate allocation leaves the

system in a safe state

bull System is in safe state if there exists a safe sequence of all processes

bull Sequence ltP1 P2 hellip Pngt is safe if for each Pi the resources that Pi can still request can be satisfied

by currently available resources + resources held by all the Pj with jltI

If Pi resource needs are not immediately available then Pi can wait until all Pj have finished

When Pj is finished Pi can obtain needed resources execute return allocated resources and terminate

When Pi terminates Pi+1 can obtain its needed resources and so on

Basic Facts

bull If a system is in safe state no deadlocks

bull If a system is in unsafe state possibility of deadlock

bull Avoidance ensures that a system will never enter an unsafe state

Resource-Allocation Graph Algorithm (Single Instance of Each Resource Type)

Claim edge Pi rarr Rj indicated that process Pj may request resource Rj represented by a dashed

line

Claim edge converts to request edge when a process requests a resource

When a process releases a resource assignment edge reconverts to a claim edge

Resources must be claimed a priori in the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

23

Resource-Allocation Graph for Deadlock Avoidance Unsafe State in a Resource-Allocation Graph

Figure 31

Bankerrsquos Algorithm (Several Instance of Each Resource Type)

bull Multiple instances

bull Each process must a priori claim maximum use

bull When a process requests a resource it may have to wait

bull When a process gets all its resources it must return them in a finite amount of time

Data Structures for the Bankerrsquos Algorithm

bull Available Vector of length m If available [j] = k there are k instances of resource type Rj available

bull Max n x m matrix If Max [ij] = k then process Pi may request at most k instances of resource type Rj

bull Allocation n x m matrix If Allocation[ij] = k then Pi is currently allocated k instances of Rj

bull Need n x m matrix If Need[ij] = k then Pi may need k more instances of Rj to complete its task

Need [ij] = Max[ij] ndash Allocation [ij]

Let n = number of processes

333 Deadlock Detection

bull Allow system to enter deadlock state

bull Detection algorithm

bull Recovery scheme

Single Instance of Each Resource Type

bull Maintain wait-for graph

ndash Nodes are processes

ndash Pi rarr Pj if Pi is waiting for Pj

bull Periodically invoke an algorithm that searches for a cycle in the graph

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 21: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

21

33 Methods for Handling Deadlocks

bull Ensure that the system will never enter a deadlock state

bull Allow the system to enter a deadlock state and then recover

bull Ignore the problem and pretend that deadlocks never occur in the system used by most operating

systems including UNIX

331 Deadlock Prevention

As you have seen Deadlock Characterization for a deadlock to occur each of the four necessary

conditions must hold By ensuring that at least one of the four necessary conditions cannot hold you can

prevent the occurrence of a deadlock

Mutual Exclusion

The mutual exclusion condition must hold for non-sharable resources For instance a printer cannot be

simultaneously shared by several processes Sharable resources do not require mutually exclusive

access and thus cannot be involved in a deadlock

In general however we cannot prevent deadlocks by denying the mutual-exclusion condition Some

resources are intrinsically non-sharable

Hold and Wait

To ensure that the hold-and-wait condition never occurs in the system we must guarantee that whenever a

process requests a resource it does not hold any other resources We can implement this the following

protocol

One protocol that can be used requires each process to request and be allocated all resources before it begins

execution

An alternative protocol allows a process to request resources only when the process has none A process

may request some resources and use them Before it can request any additional resources however it must

release all the resources that it is currently allocated

No Preemption

ndash If a process that is holding some resources requests another resource that cannot be immediately

allocated to it then all resources currently being held are released

ndash Preempted resources are added to the list of resources for which the process is waiting

ndash Process will be restarted only when it can regain its old resources as well as the new ones that it

is requesting

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

22

Circular Wait

Impose a total ordering of all resource types and require that each process requests resources in an

increasing order of enumeration

332 Deadlock Avoidance

bull Simplest and most useful model requires that each process declare the maximum number of resources

of each type that it may need

bull The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that

there can never be a circular-wait condition

bull Resource-allocation state is defined by the number of available and allocated resources and the

maximum demands of the processes

Safe State

bull When a process requests an available resource system must decide if immediate allocation leaves the

system in a safe state

bull System is in safe state if there exists a safe sequence of all processes

bull Sequence ltP1 P2 hellip Pngt is safe if for each Pi the resources that Pi can still request can be satisfied

by currently available resources + resources held by all the Pj with jltI

If Pi resource needs are not immediately available then Pi can wait until all Pj have finished

When Pj is finished Pi can obtain needed resources execute return allocated resources and terminate

When Pi terminates Pi+1 can obtain its needed resources and so on

Basic Facts

bull If a system is in safe state no deadlocks

bull If a system is in unsafe state possibility of deadlock

bull Avoidance ensures that a system will never enter an unsafe state

Resource-Allocation Graph Algorithm (Single Instance of Each Resource Type)

Claim edge Pi rarr Rj indicated that process Pj may request resource Rj represented by a dashed

line

Claim edge converts to request edge when a process requests a resource

When a process releases a resource assignment edge reconverts to a claim edge

Resources must be claimed a priori in the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

23

Resource-Allocation Graph for Deadlock Avoidance Unsafe State in a Resource-Allocation Graph

Figure 31

Bankerrsquos Algorithm (Several Instance of Each Resource Type)

bull Multiple instances

bull Each process must a priori claim maximum use

bull When a process requests a resource it may have to wait

bull When a process gets all its resources it must return them in a finite amount of time

Data Structures for the Bankerrsquos Algorithm

bull Available Vector of length m If available [j] = k there are k instances of resource type Rj available

bull Max n x m matrix If Max [ij] = k then process Pi may request at most k instances of resource type Rj

bull Allocation n x m matrix If Allocation[ij] = k then Pi is currently allocated k instances of Rj

bull Need n x m matrix If Need[ij] = k then Pi may need k more instances of Rj to complete its task

Need [ij] = Max[ij] ndash Allocation [ij]

Let n = number of processes

333 Deadlock Detection

bull Allow system to enter deadlock state

bull Detection algorithm

bull Recovery scheme

Single Instance of Each Resource Type

bull Maintain wait-for graph

ndash Nodes are processes

ndash Pi rarr Pj if Pi is waiting for Pj

bull Periodically invoke an algorithm that searches for a cycle in the graph

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 22: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

22

Circular Wait

Impose a total ordering of all resource types and require that each process requests resources in an

increasing order of enumeration

332 Deadlock Avoidance

bull Simplest and most useful model requires that each process declare the maximum number of resources

of each type that it may need

bull The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that

there can never be a circular-wait condition

bull Resource-allocation state is defined by the number of available and allocated resources and the

maximum demands of the processes

Safe State

bull When a process requests an available resource system must decide if immediate allocation leaves the

system in a safe state

bull System is in safe state if there exists a safe sequence of all processes

bull Sequence ltP1 P2 hellip Pngt is safe if for each Pi the resources that Pi can still request can be satisfied

by currently available resources + resources held by all the Pj with jltI

If Pi resource needs are not immediately available then Pi can wait until all Pj have finished

When Pj is finished Pi can obtain needed resources execute return allocated resources and terminate

When Pi terminates Pi+1 can obtain its needed resources and so on

Basic Facts

bull If a system is in safe state no deadlocks

bull If a system is in unsafe state possibility of deadlock

bull Avoidance ensures that a system will never enter an unsafe state

Resource-Allocation Graph Algorithm (Single Instance of Each Resource Type)

Claim edge Pi rarr Rj indicated that process Pj may request resource Rj represented by a dashed

line

Claim edge converts to request edge when a process requests a resource

When a process releases a resource assignment edge reconverts to a claim edge

Resources must be claimed a priori in the system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

23

Resource-Allocation Graph for Deadlock Avoidance Unsafe State in a Resource-Allocation Graph

Figure 31

Bankerrsquos Algorithm (Several Instance of Each Resource Type)

bull Multiple instances

bull Each process must a priori claim maximum use

bull When a process requests a resource it may have to wait

bull When a process gets all its resources it must return them in a finite amount of time

Data Structures for the Bankerrsquos Algorithm

bull Available Vector of length m If available [j] = k there are k instances of resource type Rj available

bull Max n x m matrix If Max [ij] = k then process Pi may request at most k instances of resource type Rj

bull Allocation n x m matrix If Allocation[ij] = k then Pi is currently allocated k instances of Rj

bull Need n x m matrix If Need[ij] = k then Pi may need k more instances of Rj to complete its task

Need [ij] = Max[ij] ndash Allocation [ij]

Let n = number of processes

333 Deadlock Detection

bull Allow system to enter deadlock state

bull Detection algorithm

bull Recovery scheme

Single Instance of Each Resource Type

bull Maintain wait-for graph

ndash Nodes are processes

ndash Pi rarr Pj if Pi is waiting for Pj

bull Periodically invoke an algorithm that searches for a cycle in the graph

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 23: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

23

Resource-Allocation Graph for Deadlock Avoidance Unsafe State in a Resource-Allocation Graph

Figure 31

Bankerrsquos Algorithm (Several Instance of Each Resource Type)

bull Multiple instances

bull Each process must a priori claim maximum use

bull When a process requests a resource it may have to wait

bull When a process gets all its resources it must return them in a finite amount of time

Data Structures for the Bankerrsquos Algorithm

bull Available Vector of length m If available [j] = k there are k instances of resource type Rj available

bull Max n x m matrix If Max [ij] = k then process Pi may request at most k instances of resource type Rj

bull Allocation n x m matrix If Allocation[ij] = k then Pi is currently allocated k instances of Rj

bull Need n x m matrix If Need[ij] = k then Pi may need k more instances of Rj to complete its task

Need [ij] = Max[ij] ndash Allocation [ij]

Let n = number of processes

333 Deadlock Detection

bull Allow system to enter deadlock state

bull Detection algorithm

bull Recovery scheme

Single Instance of Each Resource Type

bull Maintain wait-for graph

ndash Nodes are processes

ndash Pi rarr Pj if Pi is waiting for Pj

bull Periodically invoke an algorithm that searches for a cycle in the graph

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 24: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

24

bull An algorithm to detect a cycle in a graph requires an order of n2 operations where n is the number of

vertices in the graph

Resource-Allocation Graph Corresponding wait-for graph Figure 32

Several Instances of a Resource Type

bull Available A vector of length m indicates the number of available resources of each type

bull Allocation An n x m matrix defines the number of resources of each type currently allocated to each

process

bull Request An n x m matrix indicates the current request of each process If Request [ij] = k then process

Pi is requesting k more instances of resource type Rj

334 Recovery from Deadlock

Process Termination

bull Abort all deadlocked processes

This method clearly will break the deadlock cycle but at a great expense these processes may have

computed for a long time and the results of these partial computations must be discarded and probably

recomputed later

bull Abort one process at a time until the deadlock cycle is eliminated

This method incurs considerable overhead since after each process is aborted a deadlock-detection

algorithm must be invoked to determine whether any processes are still deadlocked

bull In which order should we choose to abort

Priority of the process

How long process has computed and how much longer to completion

Resources the process has used

Resources process needs to complete

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 25: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

25

How many processes will need to be terminated

Is process interactive or batch

Resource Preemption

To elimination deadlocks using resource preemption we successfully preempt some resources from

processes and give these resources to other processes until the deadlock cycle is broken If preemption is

required to deal with deadlocks then three issues need to be addressed

bull Selecting a victim ndash minimize cost

bull Rollback ndash return to some safe state restart process from that state

bull Starvation ndash same process may always be picked as victim include number of rollback in cost factor

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 26: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

26

Chapter ndash IV

INTER-PROCESS COMMUNICATIONS

The operating system provides mechanisms for communications and data sharing between

applicationsprocess Collectively these mechanisms are called interprocess communications (IPC)

Some forms of IPC facilitate communication among several processes in same computer Other forms of

IPC facilitate communication among processes in different computers on a network

41 Commonly used methods to achieve IPC

Message Passing by system call

In this method one process communicate with other process through Kernel If process 1 need to pass a

message to process 2 it will make a request to kernel then kernel send the request to process 2 In other

words we say that Process 1 make system call to communicate with process 2 (since kernel is used)

request request

process 1 ----------------gt Kernel ---------------gt Process 2

System call

It is easy to implement this method but very expensive since kernel is involved

Shared memory

In this method two or more processes can use a common memory area to pass message among them It

is inexpensive compare to previous method but need protection mechanism for memory

RPC

In this method two processes in different computers in a network can pass message It provides

automatic data conversion and communications with other operating systems

42 The following IPC mechanisms are supported by Windows

( reference httpmsdnmicrosoftcomen-uslibrary )

Clipboard

COM

File Mapping

Using a Mailslot for IPC

Pipes

RPC

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 27: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

27

Using the Clipboard for IPC

The clipboard acts as a central store for data sharing among applications When a user performs a cut or

copy operation in an application the application puts the selected data on the clipboard in standard

format

Using COM for IPC

This enables an application to include embedded or linked data that when chosen automatically starts

another application for data editing

Using a File Mapping for IPC

File mapping enables a process to treat the contents of a file as if they were a block of memory in the

processs address space File mapping is an efficient way for two or more processes on the same

computer to share data but user must provide synchronization between the processes

Using a Mail slot for IPC

Mail slots offer an easy way for applications to send and receive short messages They also provide the

ability to broadcast messages across all computers in a network domain

Using Pipes for IPC

Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the

same computer Named pipes provide a simple programming interface for transferring data between two

processes whether they reside on the same computer or over a network (Shared memory)

Using RPC for IPC

RPC enables applications to call functions remotely Therefore RPC makes IPC as easy as calling a

function RPC operates between processes on a single computer or on different computers on a network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 28: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

28

Chapter - V

MEMORY MANAGEMENT

51 Need for Memory management

bull Subdividing memory to accommodate multiple processes

bull Memory needs to be allocated to ensure a reasonable supply of ready processes to consume

available processor time

The three major activities of an operating system in regard to memory management

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

OS manages memory in lot of ways Virtual memory is the best example to understand the memory

management in OS

52 Virtual Memory

It is a temporary storage used by a computer to run programs that need more memory than the computer

has

If computer lacks the RAM space needed to run a program or operation OS uses virtual memory to

compensate

Virtual memory combines computerrsquos RAM with temporary space on hard disk

When RAM runs low OS moves some data from RAM to a place in a disk called a paging file to create

free space in RAM

Role of OS

Selecting portion of RAM and moving data to and from the paging file is the service of OS

Different OS apply different method in selecting portion of RAM for swapping

Note

1 Moving data to and from the paging file which is in hard disk is called Swapping

2 Each processprogram is divided in to small fixed parts called Pages and loaded into memory (need

not be contiguous)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 29: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

29

Figure 51

53 Page replacement algorithms

These algorithms decide which memory page to swap out (write to disk) when a new page of memory

needs to be allocated provided there is no space in memory Here the goal is to minimize the number of

page faults

531 First-in first-out Algorithm

The simplest page-replacement algorithm is a FIFO algorithm The first-in first-out (FIFO) page

replacement algorithm is a low-overhead algorithm The idea is obvious from the name - the operating

system keeps track of all the pages in memory in a queue with the most recent arrival at the back and

the earliest arrival in front When a page needs to be replaced the page at the front of the queue (the

oldest page) is selected While FIFO is cheap and intuitive it performs poorly in practical application

Memory with 3 pages Figure 52

This algorithm yields 12 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 30: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

30

532 Optimal Algorithm

It replaces the page that will not be used for the longest period of time An optimal page replacement

algorithm has the lowest page-fault rate of all algorithms Use of these page replacement algorithm

guarantees the lowest possible page fault rate for fixed number of frames

Memory reference sequence

Memory with 3 pages Figure 53

This algorithm yields 6 page faults

This above picture explains the way how the Optimal Algorithm selects pages in memory to swap out

This algorithm is difficult to implement because it requires future knowledge

It is used mainly for comparison studies

533 LRU (Least recently used)

If we use the recent past as an approximation of the near future then we can replace the page that has not been

used for the longest period of timeLRU replacement associates with each page the time of that pagesrsquo last use

When a page must be replaced LRU chooses the page that has not been used for the longest period of time We

can think of this strategy as the optimal page replacement algorithm looking backward in time rather than

forward

Figure 54

This algorithm yields 9 page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 31: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

31

Page fault

A page fault occurs when a memory reference is made to a page that is not in memory If it occur then

swap in should be needed So more time wasted for IO operation with Disk devices

Best Algorithm

It is the one which gives less number of page faults

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 32: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

32

Chapter - VI

Operating Systems Design Principles

Security

Elegance

Resilience

Extensibility

Distribution

Reliability

Reversibility

Simplicity

61 Security

Security has two halves preventing users from accessing objects they have no right to access and

allowing users to access objects they have every right to access

Example 1 Windows Firewall

It is software that checks information coming from the Internet or a network and then either blocks it or

allows it to pass through to user computer depending on user firewall settings

A firewall can help prevent hackers or malicious software from gaining access to user computer through

a network or the Internet

The following illustration shows how a firewall works

Figure 61

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 33: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

33

Firewall settings

1 On (recommended)

This setting is selected by default When Windows Firewall is on most programs are blocked

from communicating through the firewall If user want to allow a program user can add it to the

Exceptions list (on the Exceptions tab) For example user might not be able to send photos in an

instant message until user add the instant messaging program to the Exceptions list

2 Block all incoming connections

This setting blocks all unsolicited attempts to connect to user computer Use this setting when

user need maximum protection for user computer such as when user connect to a public network

in a hotel or airport or when a computer worm is spreading over the Internet With this setting

user are not notified when Windows Firewall blocks programs and programs on the Exceptions

list are ignored

When user select Block all incoming connections user can still view most WebPages send and

receive e-mail

3 Notify me when Windows Firewall blocks a new program

If you select this check box Windows Firewall will inform you when it blocks a new program and

give you the option of unblocking that program

4 Off (not recommended)

Avoid using this setting unless users have another firewall running on user computer Turning

off Windows Firewall might make user computer more vulnerable to damage from hackers and

malicious software (such as worms)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 34: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

34

62 User Accounts amp Groups in Windows

Local and Domain User Accounts

Windows XP supports two kinds of users local users and domain users A computer that is running

Windows XP Professional has the ability to store its own user accounts database The users stored at the

local computer are known as local user accounts

Active Directory is a directory service that is available with the Windows Server 2003 and Windows

2000 Server It stores information in a central database that allows users to have a single user account

for the network The users stored in Active Directoryrsquos central database are called domain user accounts

Built-in Accounts

By default a computer that is installed with Windows XP Professional in a workgroup has five user

accounts

Administrator

The Administrator account is a special account that has full control over the computer User

provide a password for this account during XP installation The Administrator account can

perform all tasks such as creating users and groups managing the file system and setting up

printing

Guest

The Guest account allows users to access the computer even if they do not have a unique

username and password Because of the inherent security risks associated with this type of user

the Guest account is disabled by default When this account is enabled it is usually given very

limited privileges

Initial user

The initial user account uses the name of the registered user This account is created only if the

computer is installed as a member of a workgroup rather than as part of a domain By default

the initial user is a member of the Administrators group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 35: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

35

Help Assistant

The Help Assistant account is used in conjunction with the Remote Desktop Help Assistance

feature

Support_xxxxxxx Microsoft uses the Support_xxxxxxx account for

the Help and Support Service This account is disabled by default

Creating New Users

To create users on a Windows XP Professional computer user must be logged on as a user with

permissions to create a new user or user must be a member of the Administrators group or Power Users

group

Disabling User Accounts

When a user account is no longer needed the account should be disabled or deleted After userrsquove

disabled an account user can later enable it again to restore it with all of its associated user properties

An account that is deleted however can never be recovered

Example 1 User might disable an account because a user will not be using it for a period of time

perhaps because that employee is going on vacation or taking a leave of absence Another reason to

disable an account is that userrsquore planning to put another user in that same function For example

suppose that Rick the engineering manager quits If user disable his account when user company hires

a new engineering manager user can simply rename Rickrsquos user account (to the usernamefor the new

manager) and enable that account This ensures that the user who takes over Rickrsquos position will have all

the same user properties and own all the same resources

Example 2 Disabling accounts also provides a security mechanism for special situations For example

if user company were laying off a group of people a security measure would be to disable their accounts

at the same time the layoff notices were given out This prevents those users from inflicting any damage

to the companyrsquos files on their way out

Deleting User Accounts

User should delete a user account if user are sure that the account will never be needed again After

deleting account user will not be able to re-create or re-access the account

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 36: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

36

63 Properties of User Account

User profile

User profiles contain information about the Windows XP environment for a specific user For

example profile settings include the Desktop arrangement program groups and screen colors

that users see when they log on The first time users log on they receive a default user profile A folder

that matches the userrsquos logon name is created for the user in the Documents and Settings folder

Logon script

Logon scripts are files that run every time a user logs on to the network They are usually batch

files but they can be any type of executable file

User might use logon scripts to set up drive mappings or to run a specific executable file each

time a user logs on to the computer

Home folder

Users normally store their personal files and information in a private folder called a home folder In the

Profile tab of the user Properties dialog box user can specify the location of a home folder as a local

folder or a network folder

64 Creating and Managing Groups

A user group is a collection of user accounts that all have the same security rights

A user account can be a member of more than one group The two most common user groups are the

standard user group and the administrator group but there are others A user account is often referred to

by the user group its in

If user have an administrator account user can create custom user groups move accounts from one

group to another and add or remove accounts from different groups When user create a custom user

group user can choose which rights to assign

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 37: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

37

Default Local Groups

A local group is a group that is stored on the local computerrsquos accounts database These are the groups

user can add users to and can manage directly on a Windows XP Professional computer By default the

following local groups are created on Windows XP Professional computers

The Administrators Group

The Administrators group has full permissions and privileges Its members can grant themselves any

permission they do not have by default to manage all the objects on the computer (Objects include the

file system printers and account management) By default the Administrator and initial user account

are members of the Administrators local group

The Backup Operators Group

Members of the Backup Operators group have permissions to back up and restore the file system even if

the file system is NTFS and they have not been assigned permissions to access the file system However

the members of Backup Operators can access the file system only through the Backup utility To access

the file system directly Backup Operators must have explicit permissions assigned There are no default

members of the Backup Operators local group

The Guests Group

The Guests group has limited access to the computer This group is provided so that user can allow

people who are not regular users to access specific network resources As a general rule most

administrators do not allow Guest access because it poses a potential security risk By default the Guest

user account is a member of the Guests local group

The Network Configuration Operators Group

Members of the Network Configuration Operators group have some administrative rights to manage the

computerrsquos network configuration for example editing the computerrsquos TCPIP settings

The Power Users Group

The Power Users group has fewer rights than the Administrators group but more rights than the Users

group There are no default members of the Power Users local group

The Remote Desktop Users Group

The Remote Desktop Users group allows members of the group to log on remotely for the purpose of

using the Remote Desktop service

The Replicator Group

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 38: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

38

The Replicator group is intended to support directory replication which is a feature used by domain

servers Only domain users who will start the replication service should be assigned to this group The

Replicator local group has no default members

The Users Group

The Users group is intended for end users who should have very limited system access If user have

installed a fresh copy of Windows XP Professional the default settings for the Users group prohibit its

members from compromising the operating system or program files By default all users who have been

created on the computer except Guest are members of the Users local group

The Help Services Group

The HelpServicesGroup group has special permissions needed to support the computer through

Microsoft Help Services

65 File Folder Permission

Full Control

This permission allows the following rights

Traverse folders and execute files (programs) in the folders The ability to traverse folders allows user

to access files and folders in lower subdirectories even if user do not have permissions to access specific

portions of the directory path

List the contents of a folder and read the data in a folderrsquos files

See a folderrsquos or filersquos attributes

Change a folderrsquos or file is attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete subfolders and files

Delete files

Compress files

Change permissions for files and folders

Take ownership of files and folders

Modify

This permission allows the following rights

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 39: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

39

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Delete files

Read amp Execute

This permission allows the following rights

Traverse folders and execute files in the folders

List the contents of a folder and read the data in a folderrsquos files

See a file or folderrsquos attributes

List Folder Contents

This permission allows the following rights

Traverse folders

List the contents of a folder

See a file or folderrsquos attributes

Read

This permission allows the following rights

List the contents of a folder and read the data in a folderrsquos files

See a filersquos or folderrsquos attributes

View ownership

Write

This permission allows the following rights

Overwrite a file

View files ownership and permissions

Change a filersquos or folderrsquos attributes

Create new files and write data to the files

Create new folders and append data to the files

Simplicity

Simplicity doesnt mean that the OS is weak or that it provides few abstractions What it means is that

each abstraction is simple and components of the OS have simple sets of abstractions Using different

storage devices like hard drive flash drive CD drive etc is more or less same (Simple)

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 40: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

40

Resilience

A system (network or service for example) is called resilient if it can bounce back from partial or

complete failures attacks and sabotage It is closely associated with graceful degradation and a

necessary component of survivability though resilience doesnt imply continuous service through the

duration of the attack

Resilience of the Operating System would be its ability to restore service (or be restored to service)

if broken or attacked

Example Resiliency in Windows Installer

Robustness

Robustness of system means it is resistance to failure from outside stimuli In other words no amount of

user-generated or environmentally-generated input can cause the system to fail

Robust means its hard to break Resilient means that it bounces back quickly when it breaks (either it

self-repairs or is simply easy to fix)

Uniformity

Components should obey the same syntax have the same meta-interface

Distribution

Sharing of resources among users or processes

Example Folder sharing Printer sharing internet connection sharing etc

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 41: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

41

Chapter -VII

Input Output in Operating System

71 Input Output Management

Goal

Device independence

Programs can access any IO devices without specifying device in advance

Uniform naming

Name of a file or device should simply be a string or an integer

Error handling

Handle as close to the hardware as possible

Buffering

Data coming off the device cannot be stored in final destination directly Buffer is a temporary

area in a memory of computer or device

Shared and dedicated devices

Dedicated (UN sharable) devices create problems such as deadlocks

72 Device controller or IO module (who is performing IO)

IO module is a separate processor (called IO processor)

It has its own local memory

It is a computer in its own right

Different Types of IO (How IO performed)

Programmed IO

ndash Under direct control of CPU

ndash CPU issues a command on behalf of a process to an IO module

ndash CPU then waits for the operation to be completed before proceeding

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 42: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

42

Interrupt driven IO

ndash CPU issues a command on behalf of a process to an IO module

ndash If the IO instruction is nonblocking CPU continues to execute next instruction[s] from the same

process

ndash If the IO instruction is blocking OS takes over suspends the current process and assigns CPU

to another process

Direct memory access (DMA)

ndash DMA module controls exchange of data between memory and an IO module

ndash CPU sends a request to transfer a block of data to the DMA module and is interrupted only after

the entire block has been transferred

ndash DMA module takes over control of system bus to perform the transfer

ndash CPU initiates the IO by sending the following information to DMA module

IO scheduler

It is a part of OS -like CPU scheduler It schedules IO jobs in a computer system It decides the order of

IO jobs that will be submitted to the disk subsystem Best disk scheduler is the one which take less

average access time for set of IO jobs

Access time is calculated by

Access time = seek time + latency time

Seek time

Time needed to place the read write head from the current track to required track

Latency time

Time needed to place the read write head from the current sector to required sector

73 Managing hardware devices in OS

Most of the modern operating system provides tool to manage devices in computer This tool is called

device manager in windows operating system

The specific actions that can be taken through Device Manager include the following

Viewing a list of all hardware that is installed on user computer

Determining which device driver is installed for each device

Updating device drivers

Changing hardware settings

Disabling enabling and uninstalling devices

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 43: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

43

Using driver rollback to roll back to a previous version of a driver

Troubleshooting device problems

Printing a summary of all devices that are installed on user computer

74 Device Driver

A device driver is software that allows a specific device to communicate with the

Operating system A device driver essentially converts the more general inputoutput instructions of the

operating system to messages that the device type can understand

Without exact driver software the hardware user connectmdashfor example a video card or a printer will

not work properly or will not work at all

In most cases driver software for the devices on the OSrsquos Hardware Compatibility

List (HCL) are included in OS itself

Note

HCL is a list of devices compatible to an operating system This list varies from OS to OS

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 44: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

44

Figure 71 Logical positioning of device drivers

Managing device drivers

It involves

Updating them when necessary

Device manufacturers periodically update device drivers to add functionality or enhance driver

performance The updated drivers are typically posted on the manufacturerrsquos website

Deciding how to handle drivers that may not have been properly tested

In the past poorly written device drivers have caused problems in OS Now OS has mechanism

called driver signing as a way of ensuring that drivers are properly tested before they are released

to the public

Note

A signed driver is device driver software that includes a digital signature A digital signature is an

electronic security mark that can indicate the publisher of the software

75 Service

A system service is a program or process that performs a specific function within the operating system

In general a program or process that runs in the background and provides support to other programs are

called service

Examples for standard services in Windows

ServiceName Description

Automatic Updates Enable the download and installation of critical Windows updates

Background

Intelligent Transfer

Service

Transfer files using idle network bandwidth maintain file transfers through

network disconnections and computer restarts

Computer Browser This maintained list of resources (computers) is displayed in Network

Neighborhood and Server Manager If disabled user can still map drives

but cant browse the whole network

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 45: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

45

Error Reporting

Service

Report errors back to Microsoft in Redmond

Event Log Record system Security and Application Events

Fax Service Send and receive faxes

Human Interface

Device Access

Support for extra keyboard hot buttons and other multimedia input

devices

IMAPI CD-Burning

COM Service

CD-Rom Burning

MS Software Shadow

CopyProvider Service

Microsoft Backup Utility

Plug and Play Plug and play Do not disable this service

Server Support for peer-to peer file sharing print sharing and named pipe sharing

via SMB services

Shell Hardware

Detection

CD Auto play

System Restore

Service

Creates system snap shots [ RESOURCE HOG]

Task Scheduler or

Schedule

This service is required to schedule background tasks (run at a specific date

amp Time)

Telnet

(Win 2K)

Allows a remote user to log on to the system and run console programs

using the command line

Terminal Services Required for Fast User Switching Remote Desktop and Remote

Assistance

Volume Shadow

Copy

MS Backup - A volume shadow copy is a picture of the volume at a

particular moment in time That means a computer can be backed up while

files are open and applications running

Windows Audio Note that disabling the sound driver wont stop sounds from playing - user

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 46: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

46

just wont hear them

Windows Firewall (XP SP2) Network address translation addressing and name resolution services for

all computers on user home network through a dial-up connection

Windows Time Update the computer clock by reference to an internet time source

Table 72

User operations on system services

User can do following operations in most of the services

Stop

Start

Startup type

o Disable

o Automatic

o Manual

Dependencies in services

Some services are depending on other services Example Computer browser is dependent on Server

service When user disable Server service then computer browser service will not work

Sharing a printer

If user have a printer attached to user computer user can share it with anyone on the same network It

doesnt matter what type of printer it is as long as the printer is installed on user computer and directly

attached with a universal serial bus (USB) cable or other type of printer cable Whoever user choose to

share the printer with will be able to use it to print provided they can locate user computer on the

network

Note

Printers that are directly connected to a network rather than attached to a computer are available to

anyone on the same network Such printers must have a network port or wireless connection that allows

them to connect directly to the network

Configuring a Modem

Dial-up networking allows remote users (for example a person working from home or someone with a

laptop on a business trip) to dial into a corporate network or the Internet The most common method for

remote network access is using a modem

Configuring Modem Properties

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 47: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

47

User can set the following options

a) The Speaker Volume is used to troubleshoot a modem that was not working properly

b) The Maximum Port Speed (specified in bits per second) which should be left at the default value

c) Dial Control to wait for a dial tone before dialing so that dialing is not initiated prior to confirming

that a valid dial tone exists

Running Modem Diagnostics

We can query the modem This process can be used in troubleshooting to ensure that the modem is

properly responding to requests A Device Manager will test the modem by issuing a series of modem

commands These commands and the responses sent back from the modem are listed in the

CommandResponse section of the Diagnostics tab dialog box

The View Log button is used to view the log file that records all of the commands sent to the modem by

communication programs or the operating system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 48: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

48

Chapter - VIII

File Management System

81 Introduction to Files

File Management System is considered as a part of the operating system Input to applications is by means of

a file Output is saved in a file for long-term storage

Four terms are in use when discussing files

Field (A field is the basic element of data eg employee name date etc)

Record (Collection of related fields that can be treated as a unit)

File (Collection of similar records is called as File)

Database (Collection of related data is referred as Database)

File

It is a data collections which has the following properties

Long-term existence (since stored on disk)

Sharable between processes (by access permissions)

Structure ( convenient for particular applications)

Functions Operations that can be performed on files

Create Delete Open Close Read Write

82 File Management System

Set of system software(part of OS) that provides services to users and applications in the use of

files

The file system is actually the interface between operating system and storage devices When the

user software such as MS Word asks to read a file from the hard disk the operating system asks

the file system to open the file

Creating amp formatting of a file system

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 49: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

49

When a disk is formatted it receives a file system And it becomes organized and prepared to receive

data Formatting will remove all the information from the disk

Note OS cannot read data from a disk which uses an supported File System

Functions of File system

Identify and locate a selected file

Use a directory to describe the location of all files and their attributes

Allocate files to free blocks

Manage amp organize the free storage

On shared system describe user access control

83 Directory Folder

In OS directory it self is a special file It contains the information about the files in the directory For

each file in a directory OS stores it file name file type and following information

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 50: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

50

Table 81

84 Windows File System

If user are installing a new hard disk user need to partition and format it using a file system before user

can begin storing data or programs In Windows the three file system options user have to choose from

are NTFS FAT32 and the older and rarely used FAT (also known as FAT16)

NTFS

NTFS is the preferred file system for this version of Windows It has many benefits over the earlier

FAT32 file system including

The capability to recover from some disk-related errors automatically which FAT32 cannot

Improved support for larger hard disks

Better security because user can use permissions and encryption to restrict access to specific files

to approved users

FAT32

FAT32 and the lesser-used FAT were used in earlier versions of Windows operating systems including

Windows 95 Windows 98 and Windows Millennium Edition FAT32 does not have the security that

NTFS provides so if users have a FAT32 partition or volume on user computer any user who has

access to user computer can read any file on it FAT32 also has size limitations It cannot have partition

greater than 32GB and it cannot store a file larger than 4GB

The main reason to use FAT32 is to have a computer that will sometimes run Windows 98 or

Windows ME and at other times run Windows XP known as a multiboot configuration

Linux File system ext2 ext3 (EXTENDED FILE SYSTEM)

Max file size 16 TiB

ax number of files Set at filesystem creation

Max filename size Volume size

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 51: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

51

Max volume size 1024 PiB = 1 EiB

Allowed characters

in filenames

All bytes except NUL and

Dates recorded modification attribute modification access

date etc

Compression

Encryption

Available

Table 82

85 Partitioning

Disk partitioning is the act of taking the physical hard drive and creating logical partitions For example

if user have a 5GB hard drive user might partition it into two logical drives a C drive which might be

2GB and a D drive which might be 3GB

1MB (megabyte) = 1024KB (kilobytes) 1GB (gigabyte) = 1024MB 1TB (terabyte) = 1024GB 1PB (petabyte) = 1024TB

1EB (exabyte) = 1024PB

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 52: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

52

Chapter -IX

Windows Installation amp Troubleshooting Installation Problems

91 Preparing to Install Windows XP Professional

Before user begin the installation user should know what is required for a successful installation and

have all of the pieces of information userrsquoll need to supply during the installation process In preparing

for the installation user should make sure that user know the hardware requirements for Windows XP

Professional

Check the Hardware Compatibility List (HCL) for Windows XP

Check that user computerrsquos BIOS is compatible with Windows XP Professional

Check whether the devices in user computer have Windows XP drivers

Understand the difference between a clean install and an upgrade

Installation Options

User will need to make many choices during the Windows XP Professional installation process

Following are some of the options that user will configure

How user hard disk space will be partitioned

The file system user partitions will use

Whether the computer will be a part of a workgroup or a domain

The language and locale for the computerrsquos settings

Installation Method

User can install Windows XP Professional either from bootable CD or through a network

Note

Installation of Windows XP Professional is possible as an unattended process

It is called ―Automating the Windows XP Installation

Installation Process

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 53: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

53

The steps in the following sections assume that the disk drive is clean and that user are starting the

installation using the Windows XP Professional CD

There are four main steps in the Windows XP Professional installation process

Collecting information

Hardware details will be collected

Number of partitions size and file system information will be collected

Preparing the installation

All the files required by the Setup program will be copied to the hard drive

Installing Windows

Setup will gather information about user locale computer name and product key Workgroup or

Computer Domain

Finalizing the installation

Specifying how the computer will connect to the Internet

Activating Windows

Deciding whether user want to set up Internet access at the present time

Providing the name(s) of the user(s) who will use the computer

Dual-booting

Dual-booting or multi-booting allows user computer to boot multiple operating systems

Reason for dual-booting

It is to test various systems If user have a limited number of computers

in user test lab and user want to be able to test multiple configurations user dual-boot

It is for software backward compatibility

For example user may have an application that works with Windows 982000 but not under Windows

XP Professional

Here are some keys to successful dual-boot configurations

Make sure user have plenty of disk space Each operating system on a separate partition is

recommended

Put the simplest operating systems on first advanced OS next (eg Windows 98 then XP)

If user will dual-boot with Windows NT user must turn off disk compression or Windows XP

will not be able to read the drive properly

92 Automated Installation

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 54: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

54

If user needs to install Windows XP Professional on multiple computers automatic deployment will

make user job easier and more cost effective

The three options for automated installation are

Unattended installation ndashIn this method user use a distribution server to install Windows on a

target computer User can also use a Windows XP CD with an answer file on a floppy disk The

answer files can be used to provide installation instructions like additional language support

service packs and device driver

Remote Installation Services (RIS) -It allows user to remotely install Windows which requires

Windows 2000 Server The RIS server must have the RIS server software installed and

configured RIS clients are computers that have a Pre-boot execution Environment (PXE)

network adapter

System Preparation Tool -This is used to create disk imaging or cloning User can use disk

images to install Windows on several computers that have the same configuration To create a

disk image user install Windows on the source computer with the configuration applications

that user want to copy After userrsquove created the disk image user can copy the image to

destination computers through third-party software or through hardware disk duplication

PXE is a technology that is used to boot to the network when no operating system or has been installed

on a client computer

Answer files are automated installation scripts used to answer the questions that appear during a normal

Windowsinstallation

Table 81

93 Troubleshooting Installation Problems

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 55: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

55

The Windows installation process is designed to be as simple as possible The chances for installation

errors are greatly minimized through the use of wizards and the step-by-step process However it is

possible that errors may occur

Identifying Common Installation Problems

As most of user is aware installations seldom go off without a hitch Following table lists some possible

installation errors user might encounter

Table 82

Troubleshooting Installation Errors with the Bootini File

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 56: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

56

If the text-based portion of the installation completes successfully but the GUI-based portion of the

installation fails the error may be caused by a device driver that is failing to load properly If user

suspect that this is causing the installation error user can edit a file called Bootini to list the drivers that

are being loaded during the boot process The Bootini file is located in the root of the system partition

In order to cause the device drivers to be listed during the boot process user need to edit the Bootini file

to include the sos switch as shown

[Operating systems]

multi(0)disk(0)rdisk(0)partition(1)WINDOWS = Microsoft Windows XP Professional sos

Installing Non-Supported Hard Drives

If user computer is using a hard disk that does not have a driver included on the Windows CD user will

receive an error message stating that the hard drive cannot be found User should verify that the hard

drive is properly connected and functional User will need to obtain a disk driver from the manufacturer

for Windows XP and then specify that user are using a manufacturer-supplied driver (by pressing the F6

key when prompted) during the text-mode portion of the installation process

Troubleshooting with Installation Log Files

When user installs Windows XP Professional the Setup program creates several log files User can view

these logs to check for any problems during the installation process Two log files are particularly useful

for troubleshooting The action log includes all of the actions that were performed during the setup

process and a description of each action These actions are listed in chronological order The action log

is stored as Windowssetupactlog

The error log includes any errors that occurred during the installation For each error there is a

description and an indication of the severity of the error This error log is stored as

Windowssetuperrlog

If user cannot start Windows XP Professional several options and utilities can be used to identify and

resolve Windows errors The following is a broad list of

Troubleshooting options

If user have recently made a change to user computerrsquos configuration by installing a new device driver

or application and Windows will not load properly user can use the Last Known Good Configuration

roll back the driver or use System Restore to restore a previous system configuration

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 57: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

57

If user can boot user computer to Safe Mode and user suspect that user have a system conflict user can

temporarily disable an application or processes troubleshoot services or uninstall software

Use the Recovery Console to replace corrupted files or perform other recovery options manually For

example user should verify that the BOOTINI settings are correct

If necessary user can use the Backup utility to restore operating and data files from

Back up media User can also use the Automated System Recovery Wizard in conjunction with the

Backup utility to reformat the system partition and restore operating system files from backup media

user previously created

94 Windows utilities and options that can be used to assist in performing system recovery

Recovery Technique When to Use

Event Viewer If the Windows can be loaded through Normal or Safe Mode one of the first places to

look for hints about the problem is Event Viewer Event Viewer displays System Security and

Application logs

Safe Mode This is generally user starting point for system recovery Safe Mode loads the minimum of

services and drivers that are needed to boot Windows If user can load Safe Mode user may be able to

troubleshoot devices or services that keep Windows from loading normally

Last Known Good Configuration

This option can help if user made changes to user computer and are now having problems Last Known

Good Configuration is an Advanced Options menu item that user can select during startup It loads the

configuration that was used the last time the computer booted successfully This option will not help if

user has hardware errors

Driver Rollback It is used to restore a driver to a previous version that has been saved This option is

used when user updates a driver and it is not functioning properly

System Restore It is used to create known checkpoints of user systemrsquos configuration In the event that

user system becomes misconfigured user can restore the system configuration to one of the known good

checkpoints

Backup User should use this utility to safeguard user computer Through the Backup utility user can

back up the system or parts of the system and restore data from backups that user have made Use this if

none of the above techniques is not helping

Recovery Console User can use this option if none of the other options or utilities works The Recovery

Console starts Windows without the graphical interface and allows the administrator limited capabilities

such as adding or replacing files and enablingdisabling services

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources

Page 58: Operating System - Summer

ITSE 1202 Introduction to Operating Systems

IBRI COLLEGE OF TECHNOLOGY

58

95 Some terms on threats and security

bull Malware Entities that cause malicious effect to software in general

bull Worms A computer program which is self replicating in nature and which can spread itself

across computers

bull Virus A code that is written with the malicious intention of causing damage to the system

bull Security Refers to a set of measures taken to guard against theft attack etc

bull Audit Log A record of important events that occur in the computer system

bull Encryption Process of coding of information in order to keep it secret

bull Decryption Recovering the original message from encrypted data

bull Spyware is any technology such as tracking software that aids in gathering information about a

person or organization without their knowledge

bull Trojan horse or simply trojan is a piece of software which appears to perform a certain action

but in fact performs another such as transmitting a computer virus

bull Threats Refers to an entity that possersquos hard challenge to the system with a aim of damaging

system resources