0% found this document useful (0 votes)
111 views9 pages

Operating System Marking Guide

The document contains a marking scheme for the Operating Systems course at The Federal Polytechnic, Ado-Ekiti. It includes questions and answers on topics like the definition of an operating system, its objectives, types of operating systems (batch, time-sharing, real-time, multiprogramming, distributed), and functions like process management, memory management, file management. It also discusses concepts like spooling, dual-mode operation, and race conditions.

Uploaded by

akin
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)
111 views9 pages

Operating System Marking Guide

The document contains a marking scheme for the Operating Systems course at The Federal Polytechnic, Ado-Ekiti. It includes questions and answers on topics like the definition of an operating system, its objectives, types of operating systems (batch, time-sharing, real-time, multiprogramming, distributed), and functions like process management, memory management, file management. It also discusses concepts like spooling, dual-mode operation, and race conditions.

Uploaded by

akin
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/ 9

THE FEDERAL POLYTECHNIC, ADO-EKITI

Department of Computer Science


Marking Scheme
COURSE CODE:COM 315COURSE TITLE: Operating System CLASS:

Question 1
a
An Operating System (OS) is an interface between computer user and computer hardware.
An operating system is software which performs all the basic tasks like file management,
memory management, process management, handling input and output, and controlling
peripheral devices such as disk drives and printers.

An Operating System (OS) is a set of programs that control the execution of application
programs and act as an intermediary between a user of a computer and the computer hardware.
OS is software that manages the computer hardware as well as providing an environment for
application programs to run. Examples of OS are Windows, Windows/NT, OS/2, MacOS, etc

B
The objectives of OS are:
(1) To make the computer system convenient and easy to use for the user.
(2) To use the computer hardware in an efficient way.
(3) To execute user programs and make solving user problems easier.

C
i. Implementing user interface.
ii. Sharing hardware among users.
iii. Allowing users to share data among themselves.
iv. Preventing users from interfering with one another.
v. Scheduling resource among users.
vi. Facilitating I/O operations.
vii. Recovering from errors.
viii. Accounting for resource storage.
ix. Facilitating parallel operations.
x. Organizing data for secure and rapid access.
xi. Handling network communications.

D
i. Increase throughput.
ii. Economy scale (less cost).
iii. Increase reliability.
iv. Clustered system: it consists of multiple computer systems connected by a
local area network
Question 2
i. Batch System: In this type of OS, users submit jobs on regular schedule (e.g. daily,
weekly, monthly) to a central place where the user of such system did not
interact directly with computer system. To speed up the processing, jobs with similar
needs were batched together and were run through the computer as a group. Thus, the
programmer would leave the programs with the operator. The output from each job
would send to the appropriate programmer. The major task of this type was to transfer
control automatically from one job to the next.
Disadvantages of Batch System
i. Turnaround time can be large from user standpoint.
ii. Difficult to debug program.

ii. Time-Sharing System: This type of OS provides on-line communication between the
user and the system, the user gives his instructions directly and receives intermediate
response, and therefore it called interactive system. The time sharing system allows
many users simultaneously share the computer system. The CPU is multiplexed
rapidly among several programs, which are kept in memory and on disk. A program
swapped in and out of memory to the disk. Time sharing system reduces the CPU
ideal time. The disadvantage is more complex.

iii. Real-Time Sharing: Real-Time Operating System is characterized by supplying


immediate response. It guarantees that critical tasks complete on time. This type must
have a pre-known maximum time limit for each of the functions to be performed on
the computer. Real-time systems are used when there are rigid time requirements on
the operation of a processor or the flow of data and real-time systems can be used as a
control device in a dedicated application. The airline reservation system is an example
of this type.
iv. Multiprogramming
In multiprogramming several programs are kept in main memory at thesame time, and
the CPU is switching between them, thus the CPU always has a program to be
executed. The OS begins to execute one program from memory, if this program
need wait such as an I/O operation, the OS switches to another program.
Multiprogramming increases CPU utilization. Multiprogramming system provide an
environment in which the various system resources are utilized effectively, but
they do not provide for user interaction with the computer system.

Advantages
i. High CPU utilization.
ii. It appears that many programs are allotted CPU almost simultaneously.

Disadvantages
i. CPU scheduling is requires.
ii. To accommodate many jobs in memory, memory management is required.
Distributed system
Distribute the computation among several physical processors. It involves connecting two or
more independent computer systems via communication link. So, each processor has its own OS
and local memory; processors communicate with one another through various communications
lines, such as high-speed buses or telephone lines.

Advantages
v. Resources Sharing – You can share files and printers.
vi. Computation speed up – A job can be partitioned so that each
vii. processor can do a portion concurrently (load sharing).
viii. Reliability – If one processor failed the rest still can function with no problem.
ix. Communications – Such as electronic mail, ftp

Question 3
A
i. Spooling System: Spooling uses the disk as a very large buffer. Spooling is useful
because device access data has different rates. The buffer provides a waiting station
where data can rest while the slower device catches up. Spooling allows overlapping
between the computation of one job and I/O of another job.
ii. Hardware interval timer:

i. Program execution: Operating system loads a program into memory and executes the
program. The program must be able to end its execution, either normally or abnormally.
ii. I/O Operation: I/O means any file or any specific I/O device. Program may require
any I/O device while running. So operating system must provide the required I/O.
iii. File system manipulation: Program needs to read a file or write a file. The operating
system gives the permission to the program for operation on file.
iv. Communication: Data transfer between two processes is required for some time. The
processes are on the one computer or on different computer but connected through
computer network. Communication may be implemented by two methods, which are
Shared memory and Message passing.
v. Error detection: error may occur in CPU, in I/O devices or in the memory hardware. The
Operating System constantly needs to be aware of possible errors. It should take the
appropriate action to ensure correct and consistent computing.
vi. Resource allocation: For simultaneously executing job.
vii. Accounting: For account billing and usage statistics.
viii. Protection: Ensure access to system resource is controlled.

C
Dual-Mode Operation
We must be able to distinguish between the execution of operating-system code and user defined
code. The approach is to separate the two modes of operation: user mode and kernel mode (also
called supervisor mode, system mode, or privileged mode). A bit, called the mode bit is added to
the hardware of the computer to indicate the current mode, which may be kernel (0) or user (1).
The dual mode of operation provides us with the means for protecting the operating system from
errant users from one another. System calls provide the means for a user program to ask the
operating system to perform tasks reserved for the operating system on the user program's behalf.

Question 4

A
Processor manager
1. Allocates Cpu to the next process that tops the ready list/queue upon complete execution
of currently running process.
2. Deallocate CPU from currently running process when run to finish state or upon
expiration of the allotted CPU time.
3. In multiprocessing system, it keeps tracks of which processor is attached/allotted to which
process or thread

Memory Manager
1. It keeps track of the available memory locations in the computer.
2. It allocates memory space to running process.
3. It deallocates allotted memory space when a process is completely executed.
4. It maintains a table of memory spaces assigned to each memory processor on the system,

Device Manager
It keeps track of the available devices on the system.
It allocates devices to each running process as required.
It allocates devices from a running process when execution is completed.
It sets ON/OFF flags to indicate whether or not device is available for use.

File Managers
1. It helps to organize file system into folders and sub folders; directives and sub directories.
2. It helps to keep track of the available folders/subfolders; directories and sub directories
3. It helps to delete files/folders and sub folders.
4. It raises alert whenever an illegal attempt is made to assign the same name to an existing
file/folder.

B
Race Condition
A race condition is a situation that may occur inside a critical section. This happens when the
result of execution of multiple processes / threads in critical section differs according to the order
in which the processes / threads are executed. It occurs when a software program depends on the
timing of one or more processes to function correctly. If a program relies on processes / threads
that run in an unpredictable sequence, a race condition may occur.
A race condition occurs when two or more threads / processes can access shared data and each of
them attempts to change or update it at the same time. On the ground that it possible for a process
/ thread scheduling algorithm to swap between processes / threads at any time, it is difficult to
know the order in which running processes / threads will attempt to access shared data for an
update or change operation.
Question 5

A
Critical Section / Region
In a code segment, the critical section is a situation whereby shared variables can be accessed by
many processes threads simultaneously to perform such operations as file or record update.
Atomic action is required in a critical section in which only one process can execute in its critical
section at a time. That is, allowed to perform record update at a time. All other processes have to
wait to execute in their critical sections after the current process has finished or come out of
critical condition.
The critical section problem needs a mechanism to synchronise the different processes. In
summary, the solution to the critical section problem must satisfy the following conditions:
B
A process is basically a program in execution. The execution of a process must
progress in a sequential fashion.
A process is defined as an entity which represents the basic unit of work to be
implemented in the system.
Non-preemptive algorithms are designed so that once a process enters the running
state, it cannot be preempted until it completes its allotted time, whereas the
preemptive scheduling is based on priority where a scheduler may preempt a low
priority running process anytime when a high priority process enters into a ready state.

C
Wake-up event

Turnaround

Dispatch
I/O event/Blocked

Question 6
A
Components of a Process
A Process along with its program / source code, comprises of program counter value,
Processor register contents, values of variables, stack and program data.

Program counter indicates the address of the next instruction to be executed for this process.

CPU Registers include index registers, stack pointer and general purpose registers.
B
A Process Control Block is a data structure maintained by the Operating System for
every process. The PCB is identified by an integer process ID (PID). A PCB keeps all
the information needed to keep track of a process as listed below in the table.

1 Process State
The current state of the process i.e., whether it is ready, running, waiting, or
whatever.

2 Process privileges
This is required to allow/disallow access to system resources.

3 Process ID
Unique identification for each of the process in the operating system.

4 Pointer
A pointer to parent process.

5 Program Counter
Program Counter is a pointer to the address of the next instruction to be executed for
this process.

6 CPU registers
Various CPU registers where process need to be stored for execution for running
state.

7 CPU Scheduling Information


Process priority and other scheduling information which is required to schedule the
process.

8 Memory management information


This includes the information of page table, memory limits, Segment table depending
on memory used by the operating system.

9 Accounting information
This includes the amount of CPU used for process execution, time limits, execution
ID etc.

1 IO status information
0
This includes a list of I/O devices allocated to the process.

QUESTION 7
A
 Priority: Priority scheduling is a non-preemptive algorithm and one of the most common
scheduling algorithms in batch systems.

 Each process is assigned a priority. Process with highest priority is to be executed first
and so on.

 Processes with same priority are executed on first come first served basis.

 Priority can be decided based on memory requirements, time requirements or any other
resource requirement.

Given: Table of processes, and their Arrival time, Execution time, and priority. Here we are
considering 1 is the lowest priority.

First Come First Serve (FCFS)

 Jobs are executed on first come, first serve basis.

 It is a non-preemptive, pre-emptive scheduling algorithm.

 Easy to understand and implement.

 Its implementation is based on FIFO queue.

 Poor in performance as average wait time is high.

Shortest Job Next (SJN)

 This is also known as shortest job first (SJF)

 This is a non-preemptive, pre-emptive scheduling algorithm.


 Best approach to minimize waiting time.

 Easy to implement in Batch systems where required CPU time is known in advance.

 Impossible to implement in interactive systems where required CPU time is not known.

 The processer should know in advance how much time process will take.

Shortest Remaining Time

 Shortest remaining time (SRT) is the preemptive version of the SJN algorithm.

 The processor is allocated to the job closest to completion but it can be preempted by a
newer ready job with shorter time to completion.

 Impossible to implement in interactive systems where required CPU time is not known.

 It is often used in batch environments where short jobs need to give preference.

Round Robin Scheduling

 Round Robin is the preemptive process scheduling algorithm.

 Each process is provided a fix time to execute, it is called a quantum.

 Once a process is executed for a given time period, it is preempted and other process
executes for a given time period.

 Context switching is used to save states of preempted processes.

Job scheduler arranges incoming jobs on the ready queue using any specified scheduling
algorithm such as Priority, FCFS, etc while processor Schedular determines the next job to be
assigned the CPu for execution and consequently assign CPU to it for a given time determined
by the implementation scheduling algorithm.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy