Sie sind auf Seite 1von 10

Operating System

Homework-1

Submitted By:

Name: Suraj Kumar Singh

Section: E - 3004

Roll_No: RE3004B77

Group: 2

Course_code: 1604

Subject_code: CAP316

Date_Of_Submission: 02/09/2010

Submitted To:

Miss Jasleen
1 Enumerate the benefits of Micro-kernel design.
Ans:
A microkernel is an operating system kernel that provides only a small set
core functionality which is required to execute with kernel privileges. A
microkernel is a computer kernel that provides the mechanisms needed to
implement an operating system, such as low-level address space
management, thread management, and inter-process communication

Benefits of Micro_kernel

• Smaller kernel. (hand-held devices ?)

• OS is more modular, flexible, extensible and customizable.

• More than one implementation possible of various services.

• May even run concurrently, if needed.

• Easy crash recovery (only servers crash)

• Easier development, unit testing, maintenance and portability


2. Enumerate certain advantages of SMP over uniprocessor
architecture. Also, state the design considerations for a multi-
processor operating system.

Ans:
Symmetric Multiprocessing (SMP) has been used extensively in the PC
market to bring high performance to the desktop PC. SMP allows multiple
identical processing subsystems on a single chip, SMP will allow advances in
mobile applications and devices

Benefits of SMP

• Increasing CPU performance


• Affecting reliability and production costs
• SMP provides additional power management flexibility, running a
single CPU when the system is under utilized
• SMP architecture allows power control with voltage

A multiprocessor operating system is one that can run on computer


systems that contain more than one processor

Example
Linux.
Unix
Windows 2000
3. Determine the causes behind certain errors that the designer of
an Operating System might face.

Ans:

• The problems of achieving satisfactory levels of system


performance and reliability are amongst the most difficult that
operating system designers and implementers have to face.

• They have to face when he design operating system to make


compatible to the pervious versions.

• Some time operating confuse which process execute or not when more
then one process are running suddenly close all the process and
operating system does not work it hanged.

• Due to lack of Primary memory it work slowly.

• Sometimes errors in the operating system will cause the computer not
to work correctly with some peripheral devices such as printers.

• Protect system to bad resources or programs.


4.

a) : Compare various CPU scheduling algorithms (particularly: FCFS,


SJF, and RR) on the grounds of throughput, response time,
overhead, mode (pre-emptive or non-pre-emptive), starvation
factor, fairness level to certain processes.

Ans:

FCFS: The first is the First-Come, First-Served algorithm. In this scheduling


algorithm the first process to request the CPU is the one that is allocated the
CPU first.
The First-Come, First-Served algorithm is very simple to implement. It
can be managed using a First-In First-Out (FIFO) queue. When the
CPU is free, it is allocated to the first process waiting in the FIFO
queue. Once that process is finished the CPU goes back to the queue
and selects the first job in the queue.

SJF: the Shortest-Job-First (SJF) scheduling algorithm. In this scheduling


scheme the process with the shortest next CPU burst will get the CPU first.

Round Robin(RR): The Round-Robin scheduling scheme is similar to that of


FCFS emption is added to it. In the RR scheduling scheme the CPU picks a
process from the ready queue and sets a timer to interrupt after one time
quantum.

Pre-emptive or, non-preemptive


Non-preemptive: once a process starts, it is allowed to run until it
Finishes (or gives up CPU by calling .yield (). or wait ())
Simple and efficient to implement
Pre-emptive: process switched between ready and running state
Throughput : How much process complete in unit time.

Starvation : Increase a process’s priority as waiting time increases.

Response Time : Time to give response at first time.

Overhead : The additional time taken by the memory manager while the
program is running

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

4.
b) Also, prepare Gantt charts and determine the average waiting
time for the following set of processes using FCFS, SJF (non-pre-
emptive) and RR (quantum=4 ms):

Process P1 P2 P3 P4 P5 P6
Name:
Burst Time 5 12 7 2 10 4
(in ms):

Ans:
FCFS

SJF
Round Robin (RR)
Quantum = 4

5.
a) Suggest a few reasons behind suspension of a process.

Some of the reasons when the process suspend.

1.If one process is ready to execute, but there is no space


in the main memory, then it is suspended.

2. when one process in main memory which was blocked & there
is another process ready to execute, but waiting in
secondary memory, then the process in main memory is
suspended.

3. when the parent process suspends, then the sub process is


also suspended.

5.
b) A process switch may occur any time that the OS has gained
control from the currently running process. Suggest the possible
events that may give the control to OS.

Ans:

Some applications may be causing a conflict. Many times Runtime errors are a result of
incompatibility between two or more programs. Close all the applications are currently
using (opened programs) .

We can solve that type of problem using open the Windows Task Manager box and fix
the problems.

There are three ways to access the Task Manager.

(1) Ctrl + Alt + Delete opens the dialog box of Windows Security, in that it contains a
Task Manager button; click on that.

(2)Ctrl + Shift + Esc


(3) Open Task Manager by going to Start menu: Click the Start button on task bar go to
Run > enter this “taskmgr”, in the text area.

6.

a) Explore the role of Long Term scheduler to control the degree of

multiprogramming in the system.

Long-term scheduler

Ans: Long term scheduling obviously controls the degree of


multiprogramming in multitasking systems, following certain policies to
decide whether the system can honor a new job submission or, if more than
one job is submitted, which of them should be selected.

The long-term scheduler decides which jobs or processes are to be admitted


to the ready queue that is, when an attempt is made to execute a program,
its admission to the set of currently executing processes is either authorized
or delayed by the long-term scheduler.

Simple policies for long term scheduling are:

• First Come First Served (FCFS): it's essentially a FIFO scheme. All job
requests (e.g. a submission of a batch program) those jobs come first
that are execute first.

• Priority schemes. In the context of long term scheduling “priority” has


a different meaning than in dispatching: here it affects the choice of a
program to be entered the system as a process, there the choice of
which is in ready process should be executed.
Long-term scheduling is also important in large-scale systems such as batch
processing systems, computer clusters, and super computer.

6.
b) Suppose that a short term scheduler favours those processes that
have used the CPU for least amount of time in the recent past.
Justify, why this algorithm will eventually (or indirectly) favour the
I/O-bound processes and not yet starve the CPU-bound processes
completely.

Ans:
The short-term scheduler, often termed the dispatcher, executes most
frequently(every few hundredths of a second) making fine-grained decisions
as to which process to move to Running next.
The short-term scheduler is invoked whenever an event occurs which
provides the opportunity, or requires, the interruption of the current process
and the new (or continued) execution of another process.

Such opportunities include:


• clock interrupts, provide the opportunity to reschedule every few
milliseconds.
• expected I/O interrupts, when previous I/O requests are finally satisfied.
• operating system calls, when the running process asks the operating
system to perform an activity on its behalf.
• unexpected, asynchronous, events, such as unexpected input, user-
interrupt, or a fault condition in the running program.

Das könnte Ihnen auch gefallen