Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

University of Sialkot, Pakistan

Midterm Examination-Spring-2021
Course Code:CS-2730 Course Title: Operating System
Total Time: 80 Minutes Total Marks: 20 Marks
Department: Computer Science Program: BSCS
Instructor Name: Mubeen Iqbal Instructor Sign:
Student’s Name: Kh.Ibraheem Roll No.: 18101002-063

Answer 1: A process control block contains information about the process, i.e., registers,


quantum, priority, etc. The process table is an array of PCB’s, that means logically contains a
PCB for all the current processes in the system.
Components of a process:
 Process state
 Process number
 Program counter
 Registers
 Memory limits
 List of open files
Answer 2:
Independent process Cooperating processes
i. Independent process is the i. Cooperating process is affected
process that can not affect or be or be affected by the other
affected by the other processes. processes executing in the
ii. Independent processes do not system.
share any data like temporary ii. Cooperating process shares
or persistent with any other data with other processes.
process.

Answer 3: No, a process can’t make transition from ready state to blocked state, because the
OS switches processes between the running and ready states. A running process can switch
itself into the blocked state, and the OS may ``wake up'' a process by switching from blocked
to ready state.

Answer 4: Kernel mode: The system starts in kernel mode when it boots and after the
operating system is loaded, it executes applications in user mode a system is in user
mode when the operating system is running a user application such as handling a text editor.
User mode transition:
The transition from user mode to kernel mode occurs when the application requests the help
of operating system or an interrupt or a system call occurs.
Answer 5: A process is removed from the running state by the scheduler if a process with a
higher priority becomes runnable.
Diagram:

Answer 6:  The two primary models of inter process communication:


i. Shared memory: Shared memory is memory that may be simultaneously
accessed by multiple programs with an intent to provide communication among
them or avoid redundant copies. Shared memory is faster because the data is not
copied from one address space to another, memory allocation is done only once.

ii. Message passing: Message passing is a technique for invoking behavior (i.e.,
running a program) on a computer. In message-passing systems, one system
makes a request, and another provides a response. The requestor is called
the client, and the responder is called server.

Answer 7: It is said that modern Operating Systems are ‘Interrupt Driven’ because interrupts
are important, they give the user better control over the computer. When an interrupt occurs,
it causes the CPU to stop executing the current program. The control then passes to a special
piece of code called an interrupt handler. The interrupt handler will process the interrupt and
resume the interrupted program, without interrupts, a user may have to wait for a given
application to have a higher priority over the CPU to be ran. This ensures that the CPU will
deal with the process immediately.

Answer 8: Cascading Termination: When a process creates a new process, the identity of
the newly created process is passed to its parent. When a parent process is terminating, then
all its children process is also terminated. This phenomenon is known as "Cascading
Termination" and is normally initiated by the operating system.

Answer 9: Process state: A process state represents status of the process. It may be new,
ready, running or waiting.
Diagram:

 New: when a new process is being created.


 Running: A process is said to be in running state when instructions are being
executed.
 Waiting: The process is waiting for some event to occur (such as an I/O operation).
 Ready: The process is waiting for processor.
 Terminated: The process has finished execution.

Answer 10: The kernel connects the system hardware to the application software, and every
operating system has a kernel while A bootstrap is the program that initializes the operating
system (OS) during startup.

You might also like