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

OPERATING

SYSTEM
ASSIGNMEN
T
Details On Linux &
Windows Operating
PRASH
System
ANT
Its Working Principle
KUMA
Which Type Of CPU
R
Scheduling
Algorithm
ND
MCA 2
Deadlock
SEMEST
Page ER
Replacement
ROLL
Algorithm

NO.92/1
3

Windows Operating System


2

Windows OS is a graphical interface operating system developed by Microsoft


Corporation . The first OS was developed in 1985 as MS DOS and after that in
1995 Windows 95 was released with fully integrated Windows including MS DOS
and Internet Explorer web browser.
Design Goals
For the operating system to fulfill its market requirements certain features such
as security had to be incorporated from the outset. The designers of Windows
assembled a set of software design goals to facilitate decision making as the
coding process evolved .E.g. if two design options conflicted, the design goals
were used to help determine which was better.
When they are designed Windows networking OS were influenced by several OS
models using already existing frameworks while introducing new features .The
use an object model to manage OS resources and to allocate them to users in a
consistent manner. They use symmetric multiprocessing to achieve maximum
performance from multiprocessor computers.
To accommodate the various needs of user community and to optimize resources
the Windows team identified five design goals: Extensibility , Portability ,
Reliability, Compatibility and Performance .
Single User Multitasking
One of the most important feature of Windows OS is that they are single user still
they are multitasking operating systems. Two main development have occurred
the need for multitasking on personal computers i.e. Workstations & Servers with
the increased speed and memory capacity of microprocessors. Also with the
support for virtual memory.
For example, a user wants to work with MS Word , Paint and MS Excel
simultaneously to make a new complete document , without multitasking it can
be done by
Step 1: Open Paint.
Step 2: Draw the drawing and save it in a file .
Step 3: Close the paint program .
Step 4: Open the Word program and insert the drawing in correct location .
If user wants to make any change then user will have to first close Word program
, open the drawing program , edit the image then save it and after that Word
program is opened and image is inserted .
In multitasking environment the user open as many applications as per
requirement and information is moved among number of applications .
2nd thing is Client Server Computing . With Client Server computing a personal
computer or workstation and a host system are connected to perform tasks . It
can be done in a local area network by means of link .

Windows is considered flexible and designed to execute on various hardware


platforms . Windows is only implemented on Intel Pentium X86 and Itanium
hardware platforms.

Working Principle of Windows Operating System :


Windows does not have pure microkernel architecture. Each system function is
managed by one component of the operating system. Its kernel is object oriented
and remains in memory also it never allows preemption. It has four
responsibilities

Thread scheduling
Interrupt & Exception Handling
Low-Level Processor Synchronization
Recovery (After A Power Failure)

Logon POSIX OS/2


Process
Applicatio
Applicati

Win 16
Applicatio

SecurityPOSIX OS/2
Subsyste
Subsyste
Subsyste

Win 18
VDM

Win 32
Applicatio

MS-DOS
Applicatio

MS-DOS
VDM

Authenticat
ion Package

Security
Object
Account
Manag
er

I/O
Manager

Security
Referen
ce
Monitor

Proces
s
Manag
er

Win
32 Local
Plug
Virtual
Susbsyste
And
Memor Procedure
Play
y
Call Facility
Manag Manag
er
er

EXECUTIVE

File
System
Cache
Manager

Windo
w
Manag

Device
Drivers
Network
Drivers

user
mode

4KERNEL

Hardware
Abstraction Layer
HARDWARE

Graphi
c
Device

Scheduling
Windows uses processes and threads for executable code. Each process has one
or more threads each of which is executable and dispatched by the Kernel .A
thread runs while executing on processor until it is preempted by a higher
priority thread until its allotted quantum ends .Scheduling occurs when thread
enters into ready state or waiting state. When a higher priority thread becomes
ready while lower priority is already running the lower priority thread is
preempted.
The process Scheduler relies on a process scheduling algorithm to allocate the
CPU and move jobs through the system .Early OS used non-preemptive policies
designed to move batch jobs through the system as efficiently as possible. There
are six process scheduling algorithms that have been used extensively
1. First-Come First-Served
It is a non-preemptive scheduling algorithm that handles jobs according to their
arrival time .There are no WAIT queues.
2. Shortest Job Next
It is a non-preemptive scheduling algorithm also known as SJF that handles jobs
based on the length of their CPU cycle time.
3. Priority Scheduling
It is a non-preemptive algorithm and one of the most common scheduling
algorithm in batch system even though it may give slower turn around to some
users. This algorithm allows the programs with the highest priority to be
processed first and they are not interrupted until their CPU cycles are completed
or a natural wait occurs.
4. Shortest Remaining Time
It is the preemptive version of the SJN algorithm . The processor is allocated to
the job closest to completion but even this job can be preempted if a newer job
in the ready queue has a time to completion thats shorter.
5. Round Robin
It is a preemptive process scheduling algorithm that is used extensively in
interactive systems .Its easy to implement and is not based on job
characteristics but on a predetermined slice of time that is given to each job to
ensure that the CPU is equally shared among all active process and is not
monopolized by any one job.
6. Multiple-Level Queues

Multiple Level Queues is not really a separate scheduling algorithm but works in
conjunction with several of the schemes already discussed and is found in
systems with jobs that can be grouped according to a common characteristics.
Deadlock
Deadlock is more serious than indefinite postponement or starvation because it
affects more than one job. E.g. Traffic Jam
Deadlock became prevalent with the introduction of interactive systems which
generally improve the use of resources through dynamic resource sharing but
this capability also increases the possibility of deadlocks.
Seven Cases Of Deadlock
a)
b)
c)
d)
e)
f)
g)

Deadlocks
Deadlocks
Deadlocks
Deadlocks
Deadlocks
Deadlocks
Deadlocks

on File Requests
in Databases
in Dedicated Device Allocation
In Multiple Device Allocation
In Spooling
in a Network
In Disk Sharing

Deadlock is preceded by four conditions: Mutual Exclusion , Resource Holding ,


No Preemption and Circular Wait .
Strategies for Handling Deadlocks

Prevent one of the four condition from occurring.


Avoid the deadlock if it becomes probable.
Detect the deadlock when it occurs and recover from it gracefully.

The mutex available in the Kernel mode provides Deadlock free mutual exclusion.
A Semaphore object controls the number of threads accessing a resource.
Page Replacement
The virtual address translation in Windows uses multilevel page table .VM
manager pages out individual tables to disk when necessary.
Page
Directory
Entry 0

Page
Table
Entry
0

4K
Page

Page
Table 0

Page
Directory
Entry 1023

Page
Directory

Pag
e
Tabl
e

Page
Table
Entry
1023

4K
Page

4K
Page

Page
Table 1023

Pag
e
Tabl
e

4K
Page

The page directory and page tables are referenced by the hardware using
physical address .To avoid the overhead of translating every virtual address by
looking PDE and PTE processor use TLB (Translation Lookaside Buffer).It contains
and associative memory cache to map virtual page to PTE. A physical page can
be in valid state , free state , zeroed state , modified state , standby state , bad
state or transition state .

Linux Operating System


Linux is open source program it means that its source code is freely available
.Torvalds is the author of Linux .The first Linux OS required typed and sometimes
cryptic commands but now we can enter commands using command driven
interface or a menu driven interface or graphical user interface . The first
primary supporter of Linux was Red Hat .Linux has three design goals :
1. Modularity
2. Simplicity
3. Portability
Linux is written and distributed under the General Public License .Everyone is
permitted to copy and distribute the document but changing is not allowed .Also
Linux is case sensitive .It is a multiuser , preemptively multitasking system with a
full set of UNIX compatible tools .Linux runs on a variety of platforms and was
originally developed exclusively on PC architecture .
Components Of Linux System :Linux is composed of three bodies
1. Kernel
2. System Libraries
3. System Utilities
System
User Processes
Management
Programs
System Shared Libraries
Linux Kernel
Loadable Kernel Modules

User Utility
Program

Compilers

The Linux Kernel is a monolithic kernel i.e. main OS services run in Kernel. The
there is a microkernel where the most of the work is done by external processes.
Linux Kernel is now modular and the core functions are in the kernel file we can
see them in /boot as vmlinuz-version and the optional drivers are built as
separate modules in /lib/modules. Linux uses libraries to share code between the
applications .It means that there is only one copy of the code on our system and
if there is found a bug in the code it will be fixed for both .The great flexibility of
Linux is that most elements can be changed ,default applications , desktops ,
even kernels can be swapped around .
The kernel also manages the systems hardware .Nearly all architectures
including all systems that Linux supports provide the concept of interrupts. When
8

hardware wants to communicate with the system it issues and interrupt that
literally interrupts the processor which in turn interrupts the Kernel. A number
identifies interrupts and the Kernel uses this number to execute a specific
interrupt handler to process and respond to the interrupt .
E.g. If we typed the keyboard controller issues and interrupt to let the system
know that there is new data in the keyboard buffer. The kernel notes the
interrupts number of the incoming interrupt and executes the correct interrupt
handler. The interrupt handler processes the keyboard data and lets the
keyboard controller know it is ready for more data. These contents represent the
breadth of the kernels activities.

Application 1

Application 2

Application 3

User
Space

System Call Interface

Kernel Space

Kernel Subsystems

Hardwar
e

Linux allocates 1 GB memory to kernel and 3 GB of memory to executing


processes while allocating memory . This 3 GB address space is divided among 1. Process Code
2. Process Data
3. Shared Library
9

4. Data used by the Process


5. Stack used by the Process
Linux also offers memory protection based on the type of information according
to address space of a process . If a process modifies access authorization
assigned to a memory region the Kernel changes the protection information
assigned to memory pages .Virtual memory in Linux is implemented through
Demand Paging .

Table 1
Page

Table 2

2
Page 7

Table 3

Page Table

Table 4

Page Table
Page Table

Page 1

Page with Line

Page 5
Page 4

Page Table
Page 1
Page 2
Page3
Page 4

Page Directory

Page Table

Page Middle
Directions

Page Frames

Each page has its own entry in the main directory and each page table directory
has pointers to the actual page frame .The page replacement algorithm is an
expanded version of clock page replacement policy. Linux uses 8-bit byte to keep
track of a page activity and each time this page is referenced the variable is
incremented .
Deadlocks
Deadlock is a condition involving one or more threads of execution and one or
more resources such that each thread waits for one of the resources but all the
resources are already held. The threads all wait for each other but they never
make any progress toward releasing the resources that they already hold.
Therefore, none of the threads can continue which results in a deadlock.

10

The simplest example of a deadlock is the self-deadlock: If a thread of execution


attempts to acquire a lock it already holds it has to wait for the lock to be
released. But it will never release the lock because it is busy waiting for the lock
and the result is deadlock:
acquire lock
acquire lock again
wait for lock to become available
Linux is characterized by its power, flexibility and constant maintenance by
programmers worldwide.

11

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