Professional Documents
Culture Documents
Operating Systems: Biyani's Think Tank
Operating Systems: Biyani's Think Tank
Operating Systems
(MCA-II SEm)
Priyamvada Pareek
MCA
Poonam Sharma
MCA, M.Sc.(IT)
Lecturer
Deptt. of Information Technology
Biyani Girls College, Jaipur
Published by :
Think Tanks
Biyani Group of Colleges
While every effort is taken to avoid errors or omissions in this Publication, any mistake or
omission that may have crept in is not intentional. It may be taken note of that neither the
publisher nor the author will be responsible for any damage or loss of any kind arising to
anyone in any manner on account of such errors and omissions.
Preface
the students. The book has been written keeping in mind the general weakness
in understanding the fundamental concepts of the topics. The book is selfexplanatory and adopts the Teach Yourself style. It is based on questionanswer pattern. The language of book is quite easy and understandable based
on scientific approach.
Any further improvement in the contents of the book by making corrections,
omission and inclusion is keen to be achieved based on suggestions from the
readers for which the author shall be obliged.
I acknowledge special thanks to Mr. Rajeev Biyani, Chairman & Dr. Sanjay
Biyani, Director (Acad.) Biyani Group of Colleges, who are the backbones and
main concept provider and also have been constant source of motivation
throughout this Endeavour. They played an active role in coordinating the various
stages of this Endeavour and spearheaded the publishing work.
I look forward to receiving valuable suggestions from professors of various
educational institutions, other faculty members and students for improvement of
the quality of the book. The reader may feel free to send in their comments and
suggestions to the under mentioned address.
Author
Content
S. No.
1.
Name of Topic
Computer Software
Page No.
9-15
2.
Operating System
16-20
3.
Information Management
21-24
4.
Process Management
25-31
5.
Memory Management
32-37
6.
Deadlocks
38-42
7.
43-44
8.
Parallel Processing
9.
46-49
10.
Commands of DOS
50-67
11.
68-73
12.
Commands of UNIX
74-77
13.
78-80
14.
81-86
45
Chapter-1
Computer Software
Q.1.
Q.2
Q.3.
(i)
(ii)
(iii)
(iv)
(v)
(v)
Chapter-2
Operating System
Q.1.
(2)
(3)
(5)
Q.3.
Q.4.
(1)
Processor Management
(2)
Memory Management
(3)
(4)
File Management
(5)
Disk Management
Chapter-3
Information Management
Q.1.
Q.2.
Size : The current size of the file and possibly the maximum
allowed size are included in this attribute.
Q.3.
Q.5
(1)
First-In-First-Served : The simplest form of scheduling is first-infirst-out (FIFS) scheduling, which processes items from the queue
in sequential order.
(2)
Shortest Seek Time First : The SSTF policy is to select the disk I/O
request that requires the least movement of the disk arm from its
current position.
(3)
Scan : In this scheme, the read/write keeps moving from one end
to another end and when it reaches to the other end, the direction
of head movement is reserved and servicing continues.
(4)
Ans.: (i)
(ii)
request ,there is no need to declare the size of a file when that file is
created. A file can continue to grow as long as there are free blocks.
(iii)
Q.6
Ans.: Directories : The Directories are treated as files which keep track of all
other files. The directory contain information about the files such as
location and owner of the file etc. the directory is itself a file, owned by the
operating system and accessible by various file management routines.
Q.7
(2)
(3)
(4)
(5)
Chapter-4
Process Management
Q.1. What is Process? Define different Process states.
Ans.: The term "process" was first used by the designers of the MULTICS in
1960's. Since then, the term process, used somewhat interchangeably with
'task' or 'job'. The process has been given many definitions for instance
A program in Execution.
An asynchronous activity.
New
Terminated
Interrupt
Admitted
Exit
Ready
I/O or Event
Completion
Running
Scheduler
Dispatch
I/O or
Event Wait
Waiting
Diagram of Process State
A process goes through a series of discrete process states :
Ans.: Process Control Block (PCB) : To control the various processes the
Operating System maintains a table called the process table. The process
table contains one entry per process. These entries are referred to as
Process Control Block. It contains many piece of information related
Like processes threads share CPU and only one thread active
(running) at a time.
And like process, if one thread is blocked, another thread can run.
Differences :
Unlike processes, all threads can access every address in the task.
Unlike processes, threads are design to assist one other. Note that
processes might or might not assist one another because processes
may originate from different users.
Q.7. What is Process Scheduling? Define its objectives.
Ans.: The assignment of physical processors to processes allows processors to
accomplish work. The problem of determining when processors should be
assigned and to which processes is called processor scheduling or CPU
scheduling.
When more than one process is run able, the operating system must
decide which one first. The part of the operating system concerned with
this decision is called the scheduler, and algorithm it uses is called the
scheduling algorithm.
Goals of Scheduling (Objectives) : In this section we try to answer
following question: What the scheduler try to achieve?
Many objectives must be considered in the design of a scheduling
discipline. In particular, a scheduler should consider fairness, efficiency,
response time, turnaround time, throughput, etc., Some of these goals
depends on the system one is using for example batch system, interactive
system or real-time system, etc. but there are also some goals that are
desirable in all systems.
General Goals :
Fairness : Fairness is important under all circumstances. A scheduler
makes sure that each process gets its fair share of the CPU and no process
can suffer indefinite postponement. Note that giving equivalent or equal
time is not fair. Think of safety control and payroll at a nuclear plant.
Policy Enforcement : The scheduler has to make sure that system's policy
is enforced. For example, if the local policy is safety then the safety control
processes must be able to run whenever they want to, even if it means
delay in payroll processes.
Efficiency : Scheduler should keep the system (or in particular CPU) busy
cent percent of the time when possible. If the CPU and all the
Input/Output devices can be kept running all the time, more work gets
done per second than if some components are idle.
Response Time : A scheduler should minimize the response time for
interactive user.
Turnaround : A scheduler should minimize the time batch users must
wait for an output.
Throughput : A scheduler should maximize the number of jobs processed
per unit time.
A little thought will show that some of these goals are contradictory. It can
be shown that any scheduling algorithm that favors some class of jobs
hurts another class of jobs. The amount of CPU time available is finite,
after all.
Q.8.
Job Queue : As processes enters in the system they are put into a
job queue.
Q.9.
(2)
Ready Queue : The processes that are residing in the main memory
and are ready and waiting to execute are kept in the ready queue.
(3)
Device Queue : This queue contain a list processes waiting for I/O
devices.
(2)
(3)
(2)
(3)
(4)
Mechanisms
Preemptive
scheduling
(1)
(2)
(3)
Chapter-5
Memory Management
Q.1.
Q.2.
What is Paging?
Ans.: When a program is selected for execution, the system brings it into virtual
storage, divides it into pages of four kilobytes, transfers the pages into
central storage for execution. To the programmer, the entire program
appears to occupy contiguous space in storage at all times. Actually, not
all pages of a program are necessarily in central storage, and the pages
that are in central storage do not necessarily occupy contiguous space.
A page, a frame, and a slot are all the same size: Four kilobytes. An active
virtual storage page resides in a central storage frame. A virtual storage
page that becomes inactive resides in an auxiliary storage slot (in a paging
data set). Figure 1 shows the relationship of pages, frames, and slots.
In Figure 1, z/OS is performing paging for a program running in virtual
storage. The lettered boxes represent parts of the program. In this
simplified view, program parts A, E, F, and H are active and running in
central storage frames, while parts B, C, D, and G are inactive and have
been moved to auxiliary storage slots. All of the program parts, however,
reside in virtual storage and have virtual storage addresses.
Q.5
a name and a length. The address specifies both the segment number and
the offset thus the logical address consists of two parts :
<Segment-number, offset>
Q.10 What do you understand by Demand Paging?
Ans.: Demand Paging : A demand paging is similar to a paging system with
swapping. When we want to execute a process, we swap it into memory.
Rather than swapping the entire process into memory. When a process is
to be swapped in, the pager guesses which pages will be used before the
process is swapped out again Instead of swapping in a whole process; the
pager brings only those necessary pages into memory. Thus, it avoids
reading into memory pages that will not be used in anyway, decreasing
the swap time and the amount of physical memory needed.
Q.11 What are the various methods of Page Replacement?
Ans.: Page Replacement Algorithm : There are many different page
replacement algorithms. Some are :
(1)
(2)
(3)
LRU Algorithm : The LRU replaces the page that has not been used
for the longest period of time. LRU replacement associates with
each page the time of that page's last use. When a page must be
replaced, LRU chooses that page that has not been used for the
longest period of time.