[go: up one dir, main page]

0% found this document useful (0 votes)
70 views11 pages

WrittenTest DIP208 Q Aug2024

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)
70 views11 pages

WrittenTest DIP208 Q Aug2024

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/ 11

SEMESTER 3, 2024

WRITTEN TEST

Subject Code : DIP208


Subject Name : FUNDAMENTALS OF OPERATING SYSTEMS

This test carries 35% of the total assessment for this subject.

Examiner(s) Moderator(s)

MANIBELEN.R

Day :
Time :
Date :

Time allowed : 2 HOURS

INSTRUCTION(S):

1. This examination consists of TWO (2) sections.

SECTION A consists of THIRTY (30) multiple-choice questions. Answer ALL questions.

SECTION B consists of TWO (2) short answer questions. Answer ALL questions.

2. This is a CLOSED BOOK examination.

3. Students are NOT permitted to retain this examination paper.

(This examination paper consists of 2 sections in 9 printed pages, including this cover page)
SECTION A: MULTIPLE CHOICE QUESTIONS (30 MARKS)
Answer ALL questions in the MCQ sheet provided. Each question carries 1 mark.

1. The operating system provides many types of services to end-users, programmers and
system designers, including:

Select one or more:

a. Built-in user applications


b. Error detection and response
c. Relational database capabilities with the internal file system
d. Monitoring and Accounting

2. In multilevel feedback scheduling algorithm

Select one or more:

a. each queue uses FCFS algorithm


b. processes are permanently assigned to a queue with fixed priority
c. a process that waits too long in a lower-priority queue may be moved to a higher-priority
queue
d. a process can move between different ready queue

3. Which of the following features will characterize an OS as multiprogrammed OS ?

(a) More than one program may be loaded into main memory at the same time.
(b) If a program waits for certain event another program is immediately scheduled.
(c) If the execution of a program terminates, another program is immediately scheduled.

Select one:

a. (a) only
b. (a) and (b) only
c. (a) and (c) only
d. (a), (b) and (c) only

4. In which of the following scheduling criteria, context switching will never take place ?

Select one:

a. Shortest Remaining Time


b. Shortest Process Next
c. Round Robin
d. Multilevel Feedback
5. Possible causes for a running process to release CPU are:

Select one or more:

a. Process has finished processing


b. Process has caused a security violation
c. Operator/User ends the process
d. Process is blocked for an I/O operation

6. Identify the errors that will be handled by the operating system.

Select one or more:

a. lack of paper in printer


b. mouse malfunction
c. connection failure in the network
d. logical errors in source code

7. In polling or programmed I/O:

Select one or more:

a. the CPU receives an interrupt when the device is ready for the next byte
b. I/O operations go through the CPU
c. CPU checks the status of I/O periodically
d. I/O operations bypass the CPU

8. When a process is in the _______________ state it is in secondary memory but is


available for execution as soon as it is loaded into the main memory.

Select one:

a. Blocked/Suspend
b. Blocked
c. Ready/Suspend
d. Ready

9. Which of the following is TRUE about symmetric multiprocessor system (SMP)?

Select one or more:

a. Processors share I/O devices


b. SMP has two or more similar processors
c. Each processor has its own main memory
d. SMP uses an integrated operating system
10. What is the output of “ls -l” in ubuntu terminal?

a) Showing list of available folders


b) Display all files and folders with permissions
c) Showing list files in root folder
d) Sort files in the current directory

11. Which of the following will switch current user account to a root user?

a. Sudo
b. Sudo user change
c. User mode root
d. Sudo su

12. What would you write in the first line of a Linux shell script?

a. #!/bin/bash
b. Shell.script
c. Echo “shell”
d. Sudo .bash

13. How to print HelloWorld in screen using shell script?

a. Print “HelloWorld”
b. Echo “HelloWorld”
c. HelloWorld
d. Echo HelloWorld;

14. How would you solve the issue if you run a command and receive error for having not
enough permissions?

a. Adding sudo at the end of command


b. Put the command in a double quotations “”
c. Restart the system
d. Add sudo before the command

15. Which one of the following commands will show the output in screen?

a. Echo “helloWorld” >> a.txt


b. Ping 8.8.8.8 -c 2 > b.txt
c. ls -la
d. ls >> list.txt

16. What the command “cat” does?

a. Edit a text file


b. Make a new file
c. display content of a text file
d. copy a file
17. How to remove a file?

a. rm
b. rmdir
c. cp
d. del

18. A process can be terminated due to various reasons. Select [1 or more] the most
appropriate reason(s)

a. Normal exit
b. Fatal error
c. Terminated by parent process
d. The child of the process is terminated

19. In modern operating system the ………….. of a process can run independently.

a. Thread
b. Program
c. Miniprocess
d. Subprocess

20. The running process can be interrupted and later resumed because every process has

a. User Data
b. System Stack
c. Process Control Block
d. Heap

21. Which of the following is/are true regarding the relationship between processes and
threads?

a. It takes far less time to create a new thread in an existing process than to create a new
process
b. It takes less time to terminate a thread than a process
c. It takes less time to switch between two different processes than to switch between two
threads within the same process
d. It takes more time to create a new thread in an existing process than to create a new
process

22. Requirement(s) for mutual exclusion is/are

a. Only one process at a time can be allowed into a critical code section
b. A process remains in its critical code section for a finite time only
c. No assumptions can be made about relative process speeds
d. Process access shared resources
23. The permanent blocking of a set of processes that either compete for system resources or
communicate with each other is called:

a. Starvation
b. Deadlock
c. Prioritization
d. Blocked

24. The general role of an operating system is/are to:

a. Act as an interface between various computers


b. Provide a set of services to system users
c. Manage files for application programs
d. Manage hardware and software resources

25. The problem of internal fragmentation can be lessened in systems employing a fixed-
partition memory management scheme

a. Random size partitions


b. Equal size partitions
c. Unequal size partitions
d. Unplanned partitions

26. Which of the following allows multiple operating systems to work on the same hardware
simultaneously?

a. Virtualization
b. Clustering
c. Hyperthreading
d. Multitasking

27. What is the first step in the algorithm to load a job in a fixed partition?

a. Compare job size to size of largest partition


b. Determine job’s requested memory size
c. Set counter to 1
d. No partitions are available at this time, put job in waiting queue

28. Which of the following scheduling policies allow the O/S to interrupt the currently
running process and move it to the Ready state?

a. Preemptive
b. Non-Preemptive
c. Defensive
d. Proactive
29. A file is generally defined to be:

a. A basic element of data


b. A collection of related fields
c. A collection of similar records
d. A collection of accounts

30. In multi-level feedback queue schedulers that attempts to adjust a process's priority based
on the length of its CPU bursts. In such a scheduler, programs at the highest priority

a. have shorter timeslices than programs at any other priority


b. are not allowed to use more total CPU time than the programs at lower priority
c. will be demoted to a lower priority if they stop using the CPU before the end of their
timeslice
d. will be placed in the second queue
SECTION B: SHORT ANSWER QUESTIONS (20 MARKS)

Answer ALL questions.

1. a) The operating system typically provides such services in the following areas:
i) Controlled Access to files

Ans: The operating system controls access to files by setting permissions and
ensuring that only authorized users can read ,write or delete files.
ii) Error detection and response

Ans: The operating system detect errors and notifying the user to taking correct step
to resolve , if there is a problem in hard disk it would show bad sector.

Provide one explicit example for each of the services stated above to explain the
services. (4 marks)

b) Referring to the below process state diagram, answer the following questions.

Figure 1: Process State Diagram

i) What is timer interrupt? (2 marks)


Ans: A timer interruot is a signal from a timer that tells the CPU to stop the current
task and switch to another task.
ii) How does the OS use timer interrupt for process scheduling? (2 marks)
Ans: Use time slice method
iii) Assume you are running a Python program, the following statement is executed

username = input("Enter username:")

Explain mode switching based on the context above. (2 marks)

Ans: When the input () function is called, the program switches to the Blocked state
because it’s waiting for user input. Once the user provides the input, the program returns to
the Ready state, waiting for the CPU to resume and continue running.

(Total 10 marks)

2. Operating system (OS) has two objectives:


 Convenience
 Ability to evolve

i. Determine whether your operating system installed on your notebook/PCs 64-bit or 32-bit?
Take a screen shot of your Device Specifications. (2 marks)

64 BIT
ii. Explain the objectives with relevant example(s) based on your answer in part (i).
(2 marks)

Ans:
Convenience: A 64-bit system allows you to run more programs at the same time without
slowing down. For example, you can run multiple apps like browsers, games, and videos
smoothly with 16 GB of RAM.

Ability to evolve: A 64-bit system can support newer software and technology. As apps and
games get more advanced, they require more power, and 64-bit systems can handle those
demands better than 32-bit systems.

iii. Based on the Table below, compute the ‘average waiting time’ and the ‘average
turnaround time’ for First Come First Serve (FCFS) scheduling algorithm. Show all the
workings.
(6 marks)

(Total 10 marks)

For P1:
Waiting Time = 0 ms
Turnaround Time = Burst Time + Waiting time = 10 ms + 0 ms = 10 ms

For P2:
Waiting Time = Time when P1 finished - Arrival Time of P2 = 10 ms - 5 ms = 5 ms
Turnaround Time= Burst Time + Waiting time = 7 ms + 5 ms = 12 ms

For P3:
Waiting Time= Time when P2 finished - Arrival Time of P3 = 17 ms - 7 ms = 10 ms
Turnaround Time= Burst Time + Waiting Time = 2 ms + 10 ms = 12 ms

For P4:
Waiting Time = Time when P3 finished - Arrival Time of P4 = 19 ms - 10 ms = 9 ms
Turnaround Time = Burst Time + Waiting Time = 10 ms + 9 ms = 19 ms
For P5
Waiting Time = Time when P4 finished - Arrival Time of P5 = 29 ms - 14 ms = 15 ms
Turnaround Time= Burst Time + Waiting Time = 5 ms + 15 ms = 20 ms

Average Waiting Time = (0 + 5 + 10 + 9 + 15) / 5


= 39 / 5
= 7.8
Average Turnaround time = (10 + 12 + 12 + 19 + 20) / 5
= 73 / 5
= 14.6

END OF QUESTION PAPER.

You might also like