0% found this document useful (0 votes)
74 views13 pages

Assignment of Operating System: Assigned by - Pinki Roy

The document discusses CPU scheduling algorithms in Windows and Linux operating systems and file management systems. 1. CPU scheduling in Windows uses priority levels and quantum-based preemptive scheduling. Linux uses tasks instead of processes and a completely fair scheduler that uses credits and priorities. 2. Both systems have real-time and timesharing scheduling classes but differ in their priority schemes and handling of priority inversion. 3. The document briefly discusses file management systems and notes that while businesses use advanced technologies, document management remains relatively untouched by technology.

Uploaded by

exe37 eatler
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views13 pages

Assignment of Operating System: Assigned by - Pinki Roy

The document discusses CPU scheduling algorithms in Windows and Linux operating systems and file management systems. 1. CPU scheduling in Windows uses priority levels and quantum-based preemptive scheduling. Linux uses tasks instead of processes and a completely fair scheduler that uses credits and priorities. 2. Both systems have real-time and timesharing scheduling classes but differ in their priority schemes and handling of priority inversion. 3. The document briefly discusses file management systems and notes that while businesses use advanced technologies, document management remains relatively untouched by technology.

Uploaded by

exe37 eatler
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

ASSIGNMENT OF OPERATING

SYSTEM
Assigned By – Pinki Roy

Topic
CPU Scheduling Algorithms in Windows and Linux and File Management System

Manish Upadhyaya
Scholar Id – 17-15-042
CPU SCHEDULING:
Scheduling basically deals with the selection of a process that exists in the
memory and ready to execute. The selected process is allocated with the CPU.
This function is performed by the CPU scheduler. The CPU scheduler makes a
sequence of “moves” that determines the interleaving of threads.

 Programs use synchronization to prevent “bad moves”.


 …but otherwise scheduling choices appear (to the program) to be
nondeterministic.

The scheduler’s moves are dictated by a scheduling policy.

A general overview of the scheduling is depicted by the below representation:

Windows process scheduling

1) Windows 3.1 xs used a non-preemptive scheduler, meaning that it did not


interrupt programs. It relied on the program to end or tell the OS that it didn’t
need processor so that it could move on to another process. This is usually
called cooperative multitasking. Windows 95 introduced a rudimentary
preemptive scheduler; however, for legacy support opted to let 16 bit
applications run without preemption

2) NT-based versions of Windows use a CPU scheduler based on a multilevel


feedback queue, with 32 priority levels defined. It is intended to meet the
following design requirements for multimode systems:

1. Give preference to short jobs.


2. Give preference to I/O bound processes.
3. Quickly establish the nature of a process and schedule the process
accordingly.

All processes receive a priority boost after a wait event, but processes that have
experienced a keyboard I/O wait get a larger boost than those that have
experienced a disk I/O wait.

“Foreground” processes given higher priority.

3) Windows XP uses a quantum-based, preemptive priority scheduling


algorithm. The scheduler was modified in Windows Vista to use the cycle
counter register of modern processors to keep track of exactly how many CPU
cycles a thread has executed, rather than just using an interval-timer interrupt
routine.
Get Help With Wer Essay
If We need assistance with writing Wer essay, our professional essay writing
service is here to help!

Linux Process Scheduling

From versions 2.6 to 2.6.23, the kernel used an O (1) scheduler. The Completely
Fair Scheduler is the name of a task scheduler which was merged into the 2.6.23
release of the Linux kernel. It handles CPU resource allocation for executing
processes, and aims to maximize overall CPU utilization while maximizing
interactive performance. It uses that uses red-black trees instead of queues.

Two classes of processes:

 real-time (soft deadlines)


 timesharing algorithm

Normal process scheduling uses a prioritized, preemptive, credit-based policy:

 Scheduler always chooses process with the most credits to run.


 On each timer interrupt one credit is deducted until zero is reached at
which time the process is preempted.
 If no ready process then all credits for a process calculated as credits =
credits/2 + priority.
 This approach favors I/O bound processes which do not use up their
credits when they run.

The Round Robin and FIFO scheduling algorithms are used to switch between
real-time processes

Windows is by far the most popular proprietary personal computer operating


system, while Linux is the most prominent free software operating system.

Windows Linux
1)Process 1) Process is called a Task

a)Address space, handle table, statistics and a)Basic Address space, handle table,
at least one thread statistics

b)No inherent parent/child relationship b)Parent/child relationship

c)Basic scheduling unit


2) Threads 2) Threads
a) Basic scheduling unit a)No threads per-se

b) Fibers – cooperative user-mode threads b)Tasks can act like Windows threads by
sharing handle table, PID and address
space

c)P-Threads – cooperative user-mode


threads
3)windowing 3)windowing

Windows has a kernel-mode Windowing Linux has a user-mode X-Windowing


subsystem. system.
4)Two scheduling classes 4)Has 3 scheduling classes

a)“Real time” (fixed) – priority 16-31 a)Normal – priority 100-139

b) Dynamic – priority 1-15 b)Fixed Round Robin – priority 0-99

c)Fixed FIFO – priority 0-99


5)Higher priorities are favored 5)Lower priorities are favored

a) Priorities of dynamic threads get boosted a) Priorities of normal threads go up


on wakeups (decay) as they use CPU

b)Thread priorities are never lowered b)Priorities of interactive threads go


down (boost)
 
 
6)Most threads run in variable priority 6)Most threads use a dynamic priority
levels policy

a)Priorities 1-15; a)Normal class – similar to the classic


UNIX scheduler
b)A newly created thread starts with a base
priority b)A newly created thread starts with a
base priority
c)Threads that complete I/O operations
experience priority boosts (but never higher c)Threads that block frequently (I/O
than 15) bound) will have their priority gradually
increased
d)A thread’s priority will never be below
base priority d)Threads that always exhaust their time
slice (CPU bound) will have their
priority gradually decreased
7)The Windows API function 7)“Nice value” sets a thread’s base
SetThreadPriority() sets the priority value priority
for a specified thread
a)Larger values = less priority, lower
a)This value, together with the priority values = higher priority
class of the thread’s process, determines the
thread’s base priority level b)Valid nice values are in the range of
-20 to +20
b)Windows will dynamically adjust
priorities for non-real-time threads c)Non-privileged users can only specify
positive nice value
8) Real time scheduling in windows. 8) Real time scheduling in Linux.

Windows xp supports static round-robin Linux supports two static priority


scheduling policy for threads with priorities scheduling policies: Round-robin and
in real-time range (16-31) FIFO (first in, first out)

a) Threads run for up to one quantum. a) Selected with the sched-setscheduler( )


system call
b) Quantum is reset to full turn on
preemption. b) Use static priority values in the range
of 1 to 99
c) Priorities never get boosted.
c) Executed strictly in order of
9) RT threads can starve important system decreasing static priority
services such as CSRSS.EXE
9) RT threads can easily starve lower-
Se-Increase Base Priority Privilege is priority threads from executing
required to elevate a thread’s priority into
real-time range. Root privileges or the CAP-SYS-NICE
capability are required for the selection
of a real-time scheduling policy
10) Some System calls and DPC/APC 10) Long running system calls can cause
handling can cause priority inversion priority-inversion
11) Scheduling timeslices in windows 11) Scheduling timeslices in Linux.

The thread time slice (quantum) is 10ms- The thread quantum is 10ms-200ms
120ms
a)Default is 100ms
a)When quanta can vary, has one of 2
values b)Varies across entire range based on
priority, which is based on interactivity
level
12) Windows NT has always had an O (1) 12) The Linux 2.4 scheduler is O(n)
scheduler based on pre-sorted thread
priority queues.
If there are 10 active tasks, it scans 10 of
them in a list in order to decide which
should execute next

This means long scans and long


durations under the scheduler lock

File Management System

In an age where businesses are using cutting-edge technologies like big data,
AI, and even blockchain to enhance different business functions like marketing,
product design, and customer service, the area of document management,
surprisingly, still remains untouched by technology. Businesses, who are
investing thousands, if not millions, in technology to increase the efficiency of
their operations, have somehow failed to recognize the impact of a good file
management system on their organization’s productivity, and are missing out on
saving huge amounts of time and resources.

File management system: what it is, what it isn’t

A file management system is an application that is used to store, arrange, and


access files stored on a disk or other storage location. The main purpose of a file
manager is to enable users to create and store new files on a device (laptop or
desktop), view all the files stored on the device, and to organize files in different
hierarchical arrangements, such as folders, for easy classification. The basic
operations possible with a file management system include:

 Creating new files


 Displaying all stored files
 Moving files between locations
 Adding and editing basic metadata
 Sorting files based on criteria such as date modified, date created, file
size, file format, etc.
A file management system provides We with a simple interface that can be used
to browse through folders and access different files using dedicated
applications, such as Excel for .xls, Acrobat for .pdf, and Word for .doc. The
default file management system provided for the users of Microsoft Windows
computers is Windows Explorer.

Windows Explorer: WER default file management system

We must be familiar with Windows Explorer, which enables its users to browse
through the contents of their machine’s hard drive on a single, simple window.
Windows Explorer provides We with the ability to create new files, sort files
according to different criteria, move files between locations, create file copies,
and perform other such file management functions on files. Both, Windows
Explorer and Finder for Mac machines, are quite good in satisfactorily
delivering the file management needs of an average personal user. However,
these default file management systems may not be ideal for business users,
especially if the user deals with a large number of business documents on a
daily basis. This is because, although these file management systems can
differentiate between files of different formats, there’s hardly any differentiation
service that they can offer beyond that.

Businesses usually deal with documents that are in the .doc, .pdf, or.xls formats.
When We have thousands of files in the same format, say .pdf, a basic file
management system cannot differentiate between a .pdf utility bill and a .pdf
customer invoice. To ascertain the exact contents of a document, We’ll have to
open files individually and read the contents. However, an advanced file
management system will be able to differentiate files, based on the contents in
them, no matter what their format.

Document management software: upgrading file management system

Document management software (DMS) is a highly advanced file management


system that provides a wide range of file functions and an array of helpful
document management tools. DMS offers numerous ways for file indexing,
allowing We to define file types and the attributes associated with those types.
For instance, We can define ‘customer invoice’ as a file type with specific
attributes and associated metadata. We can assign file attributes such as client
name, amount due, or payment status, which can be used to identify individual
invoices. Assigning such attributes enables the DMS to uniquely identify
different files, even if they all have the same format, such as .pdf or .doc.
In addition to improving the searchability of files, DMS can also be used for
automating document approval processes, sharing of files, and collaborative
editing, among other functions. Although there is no harm in using a standard
file management system, businesses can run faster and far more efficiently if
they use DMS that can provide a host of added features to enhance an office’s
productivity and complement an organization’s initiatives for process
improvement.

File
A file is a named collection of related information that is recorded on
secondary storage such as magnetic disks, magnetic tapes and optical disks. In
general, a file is a sequence of bits, bytes, lines or records whose meaning is
defined by the files creator and user.
File Structure
A File Structure should be according to a required format that the operating
system can understand.
 A file has a certain defined structure according to its type.
 A text file is a sequence of characters organized into lines.
 A source file is a sequence of procedures and functions.
 An object file is a sequence of bytes organized into blocks that are
understandable by the machine.
 When operating system defines different file structures, it also contains
the code to support these file structure. Unix, MS-DOS support
minimum number of file structure.
File Type
File type refers to the ability of the operating system to distinguish different
types of file such as text files source files and binary files etc. Many operating
systems support many types of files. Operating system like MS-DOS and
UNIX have the following types of files −

Ordinary files

 These are the files that contain user information.


 These may have text, databases or executable program.
 The user can apply various operations on such files like add, modify,
delete or even remove the entire file.
Directory files

 These files contain list of file names and other information related to
these files.

Special files

 These files are also known as device files.


 These files represent physical device like disks, terminals, printers,
networks, tape drive etc.
These files are of two types −
 Character special files − data is handled character by character as in
case of terminals or printers.
 Block special files − data is handled in blocks as in the case of disks and
tapes.
File Access Mechanisms
File access mechanism refers to the manner in which the records of a file may
be accessed. There are several ways to access files −

 Sequential access
 Direct/Random access
 Indexed sequential access

Sequential access

A sequential access is that in which the records are accessed in some sequence,
i.e., the information in the file is processed in order, one record after the other.
This access method is the most primitive one. Example: Compilers usually
access files in this fashion.

Direct/Random access

 Random access file organization provides, accessing the records directly.


 Each record has its own address on the file with by the help of which it
can be directly accessed for reading or writing.
 The records need not be in any sequence within the file and they need not
be in adjacent locations on the storage medium.

Indexed sequential access


 This mechanism is built up on base of sequential access.
 An index is created for each file which contains pointers to various
blocks.
 Index is searched sequentially and its pointer is used to access the file
directly.
Space Allocation
Files are allocated disk spaces by operating system. Operating systems deploy
following three main ways to allocate disk space to files.

 Contiguous Allocation
 Linked Allocation
 Indexed Allocation

Contiguous Allocation

 Each file occupies a contiguous address space on disk.


 Assigned disk address is in linear order.
 Easy to implement.
 External fragmentation is a major issue with this type of allocation
technique.

Linked Allocation

 Each file carries a list of links to disk blocks.


 Directory contains link / pointer to first block of a file.
 No external fragmentation
 Effectively used in sequential access file.
 Inefficient in case of direct access file.

Indexed Allocation

 Provides solutions to problems of contiguous and linked allocation.


 A index block is created having all pointers to files.
 Each file has its own index block which stores the addresses of disk space
occupied by the file.
 Directory contains the addresses of index blocks of files.
Comparing file system in Windows and Linux
File System in Linux :
Linux supports more than 12 file systems with NFS technology. When Linux
(that is, operating system code) is linked, the default file system option needs to
be specified. other file systems can be called dynamically depending on
requirements. Ext file system is the most popular option. It is similar to the
Berkeley file system.
This file system assumes that the disk begins with a boot block and then the
disk is created from a series of other blockgroups. Block groups are numbered
sequentially, and contain several subfields.
The overall organization is shown in figure.

The details of the sub-fields in a block group are as follows-

1. Super Block – Specifies the number of blocks, the number of i-nodes,


block size etc.
2. Group Description – Contains information about the bitmap location,
number of free blocks, i-nodes, directories in the group, etc.
3. Block Bitmap – Contains a list of free blocks.
4. I-node Bitmap – Contains a list of free I-nodes.
5. I-nodes – These are the actual i-nodes. Each I-node is 128 byte long.
Linux supports the following file types-
1. Directory – This is simply a list of names.
2. Ordinary File – This is a file containing data or application program or
executable.
3. Symbolic Link – This file is actually a link to (or path of) another file.
4. Special File – This refers to a device driver.
5. Named pipe – This is a common channel between two or more processes
for data exchange.
File System in Windows :- Windows 2000 (W2K) supports a number of file
systems including the file allocation table (FAT) that runs on Windows 95, MS-
DOS and OS/2. But the developers of W@K also designed a new file system,
the W2K file system (NTFS), that is intended to meet hogh-end requirements
for workststions and servers.
Examples of high-end applications include the following-
1. Client/server applications such as file servers, computer servers and
database servers.
2. Resource-intensive engineering and scientific applications.
3. Network applications for large corporate systems.
Key Features of NTFS :
NTFS is a flexible and powerful file system, built on a simple file system
model. The most notable features of NTFS include the following-
1. Recoverability
2. Security
3. Large disks and large files
4. Multiple data streams
5. General Indexing Facility

NTFS Volume and File Structure :

NTFS makes use of the following disk storage concepts-

1. Sector :
The smallest physical storage unit on the disk. The data size in bytes is a
power of 2 and is almost always 512 bytes.

2. Cluster :
One or more contiguous (next to each other on the same track) sectors. The
cluster size in sectors is a power of 2.

3. Volume :
A logical partition on a disk, consisting of one or more clusters and used by
a file system to allocate space. At any time, a volume consists of a file
system information, a collection of files, and any additional unallocated
space remaining on the volume that can be allocated to files. A volume can
be all or a portion of a single disk or it can extend across multiple disks. If
hardware or software RAID 5 is employed, a volume consists of stripes
spanning multiple disks.

You might also like