Thursday, 29 April 2021

Practice and Doubts Set - 1

1.)          Which of these expressions will make the rightmost set bit zero in an input integer x?

A).    x = x | (x-1)

B).    x = x & (x-1)

C).    x = x | (x+1)

D).   x = x & (x+2)

2.)          Which of these expressions will isolate the rightmost set bit?

A).    x = x & (~x)

B).    x = x ^ (~x)

C).    x = x & (-x)

D).   x = x ^ (-x)

3.)          Applications like Banking and reservations require which type of OS?

A).    Real Time

B).    Hard Real Time

C).    Soft Real Time

D).   None of the above

4.)          Throughput of a multiprogramming OS that processes n programs over the period of time that starts t0 and ends at tf is

A).    (tf-t0)/n

B).    tf*n/t0 

C).    n/(tf-t0)

D).   n*tf*t0 

E).    None of these

5.)          What in multiprogramming OS provides a foolproof method of implementing memory protection to avoid program interference?

A).    Privileged mode

B).    Memory Protection

C).    Both of Them

D).   None of These

6.)          Restricting the child process to a subset of the parent’s resources prevents any process from __________

A).    Overloading the system by using a lot of secondary storage

B).    Under-loading the system by very less CPU utilization

C).    Overloading the system by creating a lot of sub-processes

D).   Crashing the system by utilizing multiple resources

7.)          Which of the following need not necessarily be saved on a context switch between processes?

A).    General purpose registers

B).    Translation Look-Aside buffer

C).    Program counter

D).   All of the mentioned

8.)          Bounded capacity and Unbounded capacity queues are referred to as __________

A).    Programmed buffering

B).    Automatic buffering

C).    User defined buffering

D).   No buffering

 

 







Answer and Explanation:

Qus : 1

(B)

Qus : 2

(C)

Qus : 3

(C)

Types of Real Time OS

Hard Real Time System (HRTS) and Soft Real Time System (SRTS)

When deadlines are absolute, Real Time Systems are called Hard Real Time Systems. The tasks in HRTS are governed by rigid time constraints. When the deadlines are relaxed, Real Time System is called Soft Real Time System. Tasks in SRTS do not have rigid time constraints.

Hard Real Time Operating Systems necessarily perform the task within the given specified deadline. A formal guarantee of always meeting the hard deadline is required. Examples include air traffic control, vehicle subsystems control and Nuclear power plant control.

Soft Real Time Operating Systems are the RTOS that perform task almost in the specified deadline. They do not guarantee a hard deadline. Task can be performed even after the time has elapsed. Examples of Soft Time Operating Systems include multimedia transmission and reception, networking, telecom (cellular) networks, web sites and services and computer games.

Qus : 4

(C)

Throughput of multiprogramming OS is the ratio of the no. of programs/processes processed and total time taken to process them. Throughput = n / (tf-t0)

Turnaround time is the time taken to complete a process i.e. TAT= (tf-t0) / n

Qus : 5

(C)

Privileged and Non-Privileged Mode in OS

Privileged or kernel mode is the processing mode that allows code to have direct access to all hardware and memory in the system. Kernel mode means when any process or program wants to use any functionality controlled by Operating System, so in that case, we make a system call to execute any particular set of instructions stored in O.S. So these set of instructions are executed in Kernel mode.

The Instructions that can run only in Kernel Mode are called Privileged Instructions.

Super user mode means a root user or administrative user who has all the permissions to run or execute any program in the O.S.

The Instructions that can run only in User Mode are called Non-Privileged Instructions.

Qus : 6

(C)

A process creates a child process; child process requires certain resources to complete its task. A child process can demand required resources directly from the system, but by doing this system will be overloaded. So to avoid overloading of the system, the parent process shares its resources among children.

Qus – 7

(B)

Translation Look-aside Buffer (TLB) need not necessarily be saved on a context switch between processes. A special, small, fast-lookup hardware cache is called Translation Look-aside Buffer. TLB used to reduce memory access time.

Qus – 8

(B)

Bounded capacity and Unbounded capacity queues are referred to as Automatic buffering. Buffer capacity of the Bounded capacity queue is finite length and buffer capacity of the Unbounded queue is infinite.

Buffer is a region of memory used to temporarily hold data while it is being moved from one place to another. A buffer is used when moving data between processes within a computer.

 

What is Buffering?

In Buffering, whether the communication is direct or indirect, message exchanged by communicating processes reside in a temporary queue.

Types of Buffering:

Zero Capacity –

This queue cannot keep any message waiting in it. Thus it has maximum length 0. For this, a sending process must be blocked until the receiving process receives the message. It is also known as no buffering.

Bounded Capacity –

This queue has finite length n. Thus it can have n messages waiting in it. If the queue is not full, new message can be placed in the queue, and a sending process is not blocked. It is also known as automatic buffering.

Unbounded Capacity –

This queue has infinite length. Thus any number of messages can wait in it. In such a system, a sending process is never blocked.


No comments:

Post a Comment