[go: up one dir, main page]

0% found this document useful (0 votes)
14 views5 pages

Course Work MR Kamba Operating System

Uploaded by

godgiven.ug
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)
14 views5 pages

Course Work MR Kamba Operating System

Uploaded by

godgiven.ug
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/ 5

MULINDWA KENEDY 1938

justanobody2029@gmail.com

With reference to the book

OPERATING SYSTEM CONCEPTS

By

ABRAHAM SILBERSCHATZ

Yale University

PETER BAER GALVIN

Pluribus Networks

GREG GAGNE

Westminster College

1.(I) ROUND-ROBIN Scheduling algorithm (RR)

According to Operating Systems textbook written by Abraham Silverschatz, published in 9th 12


2012.

“This algorithm is designed especially for time sharing systems”.

The CPU scheduler goes around the ready queue allocating the CPU to each process for a time
interval of Up to 1 time quantum.

Consider the Following set of processes that arrive at time 0, with the length of the CPU burst
Given in milliseconds

Process Burst Time

P1 24

P2 3

P3 3

| 2024/DCS/DAY/1938
MULINDWA KENEDY
If we use a time quantum of 4 milliseconds, then process P1 gets the first 4 Milliseconds. Since
it requires another 20 milliseconds, it is preempted after the first-time quantum, and the CPU is
given to the next process in the queue,

Process P2. Process P2 does not need 4 milliseconds, so it quits before its time Quantum
expires. The CPU is then given to the next process, process P3. Once each process has received
1 time quantum, the CPU is returned to process P1

For an additional time quantum. The resulting RR schedule is as follows


P1 P2 P3 P1 P1 P1 P1 P1
0 4 7 10 14 18 22 26

Let’s calculate the average waiting time for this schedule. P1 waits for 6 Milliseconds (10 – 4),
P2 waits for 4 milliseconds, and P3 waits for 7 milliseconds.

Thus, the average waiting time is 17/3 = 5.66 milliseconds.

In the RR scheduling algorithm, no process is allocated the CPU for more than 1 time quantum
in a row unless it is the only runnable process. If a process’s CPU burst exceeds 1 time quantum,
that process is preempted and is put back in the ready queue. The RR scheduling algorithm is
thus preemptive.

(II) First -come First-served (FCFS) Scheduling algorithm

With reference to the above-mentioned book,

“This is the simplest CPU scheduling algorithm.” The process that requests the CPU first is
allocated the CPU first.

The implementation of the FCFS policy is managed by First In First Out FIFO queue.

Consider the following set of processes that arrive at time 0 with the length of the CPU burst
Given in Milliseconds

Process Burst Time

P1 24

P2 3

P3 3

| 2024/DCS/DAY/1938
MULINDWA KENEDY
If they arrive in the order P1, P2, P3. They are served in FCFS order

Below is the Gantt chart for the processes


P1 P2 P3
0 24 27
P1 waits for 0 Milliseconds,

P2 waits for 24 Milliseconds

P3 waits for 27 Milliseconds

Thus, the average waiting time

= (0+24+27)/3

=17 Milliseconds

QN 2

FUNCTIONS OF THE OPERATING SYSTEM

According to his book, the hardware—the central processing unit (CPU), the memory, and the
Input/output (I/O) devices—provides the basic computing resources for the System. The
application programs—such as word processors, spreadsheets, Compilers, and Web browsers—
define the ways in which these resources are Used to solve users’ computing problems. The
operating system controls the Hardware and coordinates its use among the various application
programs for the various users.

He continues to say that. “We can also view a computer system as consisting of hardware,
software, And data. The operating system provides the means for proper use of these
Resources in the operation of the computer system. An operating system is Similar to a
government. Like a government, it performs no useful function by Itself. It simply provides an
environment within which other programs can do Useful work. He further says,

“To understand more fully the operating system’s role, we next explore Operating systems
from two viewpoints that of the user and that of the system.”

The user’s view of the computer varies according to the interface being Used. Most computer
users sit in front of a PC, consisting of a monitor, Keyboard, mouse, and system unit. Such a
system is designed for one user to monopolize its resources. The goal is to maximize the work
(or play) that the user is performing. In this case, the operating system is designed mostly for
ease of use, with some attention paid to performance and none paid

User Interface. The OS provides a user interface (UI) that allows users to interact with the
computer. This can be graphical (GUI) or command-line (CLI).

| 2024/DCS/DAY/1938
MULINDWA KENEDY
File Management. It manages files and directories, enabling users to create, delete, modify, and
organize their data easily.

Task Management. The OS handles multitasking, allowing users to run multiple applications
simultaneously and switch between them.

Device Management. The OS controls hardware devices through drivers, allowing users to
interact with peripherals like printers, keyboards, and storage devices.

Security and Access Control. It provides security features such as user authentication and
permissions, protecting data and resources from unauthorized access.

Networking. The OS facilitates network connections, enabling users to communicate and share
resources over local or wide-area networks.

Error Handling. It manages errors and system failures, providing feedback to users and taking
corrective actions when necessary.

System Monitoring. It provides tools for users to monitor system performance and resource
usage, helping identify issues.

Functions of the operating system to the system itself

1. Process Management
The OS is responsible for creating, scheduling, and terminating processes. It
maintains information about the processes, such as their state and priority. Thus,
OS allocates the processor
OS de-allocates the processor
OS keeps track of the processor
2. Memory Management
The OS allocates memory to processes and manages the storage and retrieval of
data. This includes maintaining a memory map to track allocated and free
memory spaces. Thus
OS keeps track of the main memory/primary memory.
OS allocates memory to a process when it calls for it.
OS de-allocates memory in case the process is terminated.

| 2024/DCS/DAY/1938
MULINDWA KENEDY
In multi-programming, the OS decides which process will get memory, when and
how much.
3. File System Management
The OS organizes data into files and directories, manages file permissions, and
provides a user interface for file manipulation.
4. Device Management
The OS acts as an intermediary between hardware devices and software
applications, managing device communication through drivers and ensuring
efficient resource allocation. Thus
OS allocates the device.
OS de-allocates the device.

| 2024/DCS/DAY/1938
MULINDWA KENEDY

You might also like