Professional Documents
Culture Documents
Student ID 00000100258
Assignment Instructions
1. Students are to ensure all work done are NOT plagiarized and are properly referenced.
2. Students must use this designated cover sheet when handing in assignments.
3. Use the above page as your first page.
Your answer for each question should not exceed 500 words.
Use appropriate diagrams if needed.
Use the following format:
o Heading – Heading 1
o Sub heading – heading 2
o Font - Times New Roman and Size – 12, 1.5 spacing
Any assignment submitted after the deadline will not be entertained. You will be assigned ‘0’
marks automatically.
Submit your assignment personally to me at Block A, Level 2.
Marks will be deducted for the assignment submitted later than the deadline.
No hand-written assignment is accepted
Neatly format, print your assignment and submit.
CLO: 1
Explain how computing resources (such as CPU and memory) are managed by the operating
system. (C2, PLO1)
Marks:
An operating system has three main functions: (1) manage the computer's resources, such as the
central processing unit, memory, disk drives, and printers, (2) establish a user interface, and (3)
execute and provide services for applications software. Keep in mind, however, that much of the
work of an operating system is hidden from the user; many necessary tasks are performed behind the
scenes. In particular, the first listed function, managing the computer's resources, is taken care of
without the user being aware of the details. Furthermore, all input and output operations, although
invoked by an applications program, are actually carried out by the operating system. Although
much of the operating system functions are hidden from view, you will know when you are using an
applications software package, and this requires that you invoke-call into action-the operating
system. Thus, you both establish a user interface and execute software.
Operating systems for mainframe and other large computers are even more complex because they
must keep track of several programs from several users all running in the same time frame. Although
some personal computer operating systems-most often found in business or learning environments-
can support multiple programs and users, most are concerned only with a single user. We begin by
focusing on the interaction between a single user and a personal computer operating system.
The primary objective of the job scheduler is to provide a balanced mix of jobs, such as I/O bound
and processor bound. It also controls the degree of multiprogramming. If the degree of
multiprogramming is stable, then the average rate of process creation must be equal to the average
departure rate of processes leaving the system.
On some systems, the long-term scheduler may not be available or minimal. Time-sharing operating
systems have no long term scheduler. When a process changes the state from new to ready, then
there is use of long-term scheduler.
Short-term schedulers, also known as dispatchers, make the decision of which process to execute
next. Short-term schedulers are faster than long-term schedulers.
1. FCFS Scheduling
This is a simple scheduling algorithm which means first come first serve form of an algorithm.
This kind of algorithm generally not provides the fastest service.
Consider the example: a disk queue with a request for I/O to blocks on cylinder 97, 182, 37, 128,
and 15 in that order. If the disk head is initially at cylinder 52, so it will first move from 52 to 97,
then 182, 37, 128, 15. There is a drastic change in the moment like 37 to 128 and then back to
15, it can generate the problem with this schedule.
2. SSTF scheduling
This is an algorithm which is termed as shortest seek time first algorithm. This type of algorithm
selects the request with the minimum seek time from the current head position, as seek time is a
time in which the arm has to move the head to the cylinder containing the desired sector. Seek
time will be increased if the number of the head will be traversed by the head, as SSTF choose
the request closest to the head position.
3. SCAN Scheduling
SCAN scheduling algorithm is also called the elevator algorithm because in such kind of
algorithm arm behaves just like an elevator for building the way. In the SCAN algorithm, the arm
will start at the one end of the disk and then move towards another end of the disk. At the last
end, the head of the arm will be reversed and then this process continues.
4. C-SCAN Scheduling
This kind of algorithm is termed as circular scan scheduling algorithm. This is designed to
provide a uniform wait time. The C-SCAN algorithm treats the cylinder as the circular lists
which will wrap the final cylinder to the first one. Although it is same as SCAN, in this also the
head will move from one end to the another, when the head reaches the end it immediately return
at a position of the beginning of the disk, without any request.
5. LOOK scheduling
This is the same as a SCAN algorithm, this algorithm kindly check the LOOKS to see whether
there is any request which is pending in the direction of a head moment. Generally, according to
the LOOK algorithm, the arm goes only as far as possible in each direction and then reverse
direction without going to the end. The variant like scan is called LOOK scheduling because at
last, they will look for a request before to move in a given direction.
A file allocation table (FAT) is a file system developed for hard drives that originally used 12 or 16
bits for each cluster entry into the file allocation table. It is used by the operating system (OS) to
manage files on hard drives and other computer systems. It is often also found on in flash memory,
digital cameras and portable devices. It is used to store file information and extend the life of a hard
drive.
Most hard drives require a process known as seeking; this is the actual physical searching and
positioning of the read/write head of the drive. The FAT file system was designed to reduce the
amount of seeking and thus minimize the wear and tear on the hard disc.
FAT was designed to support hard drives and subdirectories. The earlier FAT12 had a cluster
addresses to 12-bit values with up to 4078 clusters; it allowed up to 4084 clusters with UNIX. The
more efficient FAT16 increased to 16-bit cluster address allowing up to 65,517 clusters per volume,
512-byte clusters with 32MB of space, and had a larger file system; with the four sectors it was
2,048 bytes.
In this article, you will learn exactly what virtual memory is, what your computer uses it for and
how to configure it on your own machine to achieve optimal performance.
Windows 98 is an example of a typical operating system that has virtual memory. Windows 98
has an intelligent virtual memory manager that uses a default setting to help Windows allocate
hard drive space for virtual memory as needed. For most circumstances, this should meet your
needs, but you may want to manually configure virtual memory, especially if you have more than
one physical hard drive or speed-critical applications.
To do this, open the "Control Panel" window and double-click on the "System" icon. The system
dialog window will open. Click on the "Performance" tab and then click on the "Virtual
Memory" button.
7. What is swapping?
Swapping is one of the several methods of memory management. In swapping an idle or a blocked
process in the main memory is swapped out to the backing store (disk) and the process that is ready
for execution in the disk, is swapped in main memory for execution. We will be discussing swapping
in more detail.
As we all know, a process must be placed in main memory for its execution. But the fact is that we
have a limited amount of main memory. The memory needed by all the processes in the system is
often more than the main memory we have in the system.
Consider a real-time example:
In Windows operating system, as soon as the system is booted 50-100 process starts executing, these
processes do nothing but check for application updates. Such processes take up to 5-10 MB memory
space. The other processes start checking for the incoming network, incoming mails and the other
things.
This all happens before a user has started any process. A single user application nowadays takes
about 500 MB of memory space just to start up. So, keeping all these processes in main memory
would require a large amount of main memory. And the increasing the size of main memory would
increase the cost of the system. To deal with these memory overloads we have come up with the two
approaches, swapping and virtual memory.
Several users create thousands and millions of files in a file system. To organize these files properly
file system uses directory structure. The directory structure has the entries of the all the files related
to that directory. We can consider that a directory is a file, that contains information about the other
files.
Single-level directory structure
Single level directory structure has only one directory which is called the root directory. The users
are not allowed to create subdirectories under the root directory. All the files created by the several
users are present in the root directory only.
As you can see in the diagram below all the file F1, F2, F3, F4 created by the different users are
present at the root directory.
Two-level directory structure
In Two-level directory structure, the users create directory directly inside the root directory. But once
a user creates such directory, further he cannot create any subdirectory inside that directory. Observe
the figure below, 4 users have created their separate directory inside the root directory. But further,
no subdirectory is created by the users.
This two-level structure allows each user to keep their files separately inside their own directory.
This structure allows to use the same name for the files but under different user directories.
The tree directory structure provides an asymmetric way for the user to access the shared files of a
different user. For example, a user can access a file of its own user directory with a shorter path than
the other user.
9. Explain the necessary conditions that may lead to a deadlock situation.
1. Mutual exclusion
The resources involved must be unshakeable; otherwise, the processes would not be prevented from
using the resource when necessary.
2. Hold and wait or partial allocation
The processes must hold the resources they have already been allocated while waiting for other
(requested) resources. If the process had to release its resources when a new resource or resources
were requested, deadlock could not occur because the process would not prevent others from using
resources that it controlled.
3. No pre-emption
The processes must not have resources taken away while that resource is being used. Otherwise,
deadlock could not occur since the operating system could simply take enough resources from
running processes to enable any process to finish.
4. Resource waiting or circular wait
A circular chain of processes, with each process holding resources which are currently being
requested by the next process in the chain, cannot exist. If it does, the cycle theorem (which states
that "a cycle in the resource graph is necessary for deadlock to occur") indicated that deadlock could
occur.
Do not grant a resource request if this allocation have the potential to lead to a deadlock.
Deadlock Detection.
Always grant resource request when possible. Periodically check for deadlocks. If a deadlock
exists, recover from it.
Ignore the problem
Assignment Rubrics:
Rubrics/Marking Scheme (Written Assignment)
Category 5 4 2 1
Organization Information is very Information is Information is The
Overall organized in a well- organized in a organized, but information
constructed well- paragraph(s) are not appears to be
paragraph or constructed well-constructed. disorganized.
paragraphs. paragraph or
paragraphs.
Amount of All topics are All topics are All topics are One or more
Information addressed and all addressed and addressed, and most topics
questions most questions answered were not
answered questions with 1 sentence addressed.
with at least 2 answered about each.
sentences about with at least 2
each. sentences
about
each.