Академический Документы
Профессиональный Документы
Культура Документы
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
Thread scheduling
Interrupt & Exception Handling
Low-Level Processor Synchronization
Recovery (After A Power Failure)
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
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 .
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
Kernel Space
Kernel Subsystems
Hardwar
e
Table 1
Page
Table 2
2
Page 7
Table 3
Page Table
Table 4
Page Table
Page Table
Page 1
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
11