13/10/2022, 22:42 IIIT Delhi Mail - OS Midsem
OS Midsem
1 message
Google Forms <[email protected]> Thu, Oct 15, 2020 at 6:07 PM
To:
[email protected] Thanks for filling out OS Midsem
Here's what we got from you:
OS Midsem
Your email address ([email protected]) was recorded when you submitted this form.
Name *
Shubham Lohan
Roll Number *
2019275
Suppose you have opened a file for reading that has a lot of text. Now you call the
system call read() to read its content, with a buffer size of 100. What will the read()
function return?
100
String of length 100
Anything between 0 and 100
https://mail.google.com/mail/u/1/?ik=dca342bcf2&view=pt&search=all&permthid=thread-f%3A1680621373514005916&simpl… 1/7
13/10/2022, 22:42 IIIT Delhi Mail - OS Midsem
The function of the accumulator register in Intel X86 is as follows:
Performing ALU operations and storing the results.
Performing memory read/write operations.
Deciding if the outcomes of ALU operations for the sake of making appropriate jumps and / or
returns.
None of the options.
Suppose you call the write() system call to write "ABCD" to an empty file and then
immediately a different program reads the same file. What is the expected
behavior?
(A) It will read "ABCD"
(B) It will find the file empty
(C) It will get an error
(D) Either (A) or (B)
How does our system deal with paging and segmentation where it is in real-mode?
Using a smaller page table and segmentation register
Using a smaller page table, but without using segmentation register
Does not use page table, but uses segmentation register
None of the options
What is the output of the following program?
https://mail.google.com/mail/u/1/?ik=dca342bcf2&view=pt&search=all&permthid=thread-f%3A1680621373514005916&simpl… 2/7
13/10/2022, 22:42 IIIT Delhi Mail - OS Midsem
43
34
33
44
Which of the following problems does round robin scheduling suffer from?
starvation
lack of adaptation to workload
priority inversion
none of the options
Suppose you try to boot your computer without a RAM? At what stage will this
problem be flagged?
real-mode operation
extended-mode operation
Loading of GRUB
POST
https://mail.google.com/mail/u/1/?ik=dca342bcf2&view=pt&search=all&permthid=thread-f%3A1680621373514005916&simpl… 3/7
13/10/2022, 22:42 IIIT Delhi Mail - OS Midsem
Suppose you want to write exactly 100 bytes to disk using write system call. Which
of the following calls to write would lead to the fastest write?
Buffer size of 1, with O_SYNC flag
Buffer size of 100, with no additional flags
Buffer size of 1, with no additional flags
Buffer size of 50, with O_SYNC flag
Suppose you have a global variable x initialized to 0. You create a total of three
threads, each of which increment the value of x by 1. What will be the value of x at
the end of the program?
Any one among 1, 2 or 3.
Which of the following tasks is not supported by a general purpose computer?
Soft real-time tasks
Interactive tasks
Hard real-time tasks
Soft real-time, Interactive and Hard real-time tasks are supported
Fork(), pthread_create() and vfork() differ in the following ways:
Vfork() does a lazy copy while fork() creates copies of all program memories – code, stack,
data, BSS, heap and RODATA.
pthread_create() and vfork() do a lazy copy while fork() creates copies of all program memories
– code, stack, data, BSS, heap and RODATA.
https://mail.google.com/mail/u/1/?ik=dca342bcf2&view=pt&search=all&permthid=thread-f%3A1680621373514005916&simpl… 4/7
13/10/2022, 22:42 IIIT Delhi Mail - OS Midsem
Both vfork() and fork() do the same thing. Pthread_create() however is different, in that it is
used for thread creation.
None of the options
Which of the following is true about the `init’ process.
It is a kernel thread.
It is a background process (zombie) and no PCB is allocated for it.
It does not have any PID, as it is a kernel thread, which anyways do not have PIDs associated.
It does not itself handle any signals, but allows child processes to do so.
Which of the following is NOT true about most process scheduling schemes:
✓ May take into consideration potential race conditions.
✓ Takes into consideration blocking system calls.
The task scheduler also needs to take care of process memory allocation, so as to improve
✓
task scheduling efficiency, upon process creation.
Usually makes use of process priorities to allocate appropriate timeslices to various processes.
None of the options
FIFOs differ from sockets in the following ways:
FIFOs work through message passing schemes while sockets communicate via byte streams.
Read and write to a FIFO cannot be pre-empted as it involves pre-empting and context
switching two processes, unlike the case of sockets where the messages are queued.
Bytes are queued in a FIFO, unlike that in a socket, where unread messages are lost.
Because Bytes are queued in a FIFO, unlike that in a socket, where unread messages are lost.
FIFOs cannot be used for real time communication, while sockets can.
None of the options
https://mail.google.com/mail/u/1/?ik=dca342bcf2&view=pt&search=all&permthid=thread-f%3A1680621373514005916&simpl… 5/7
13/10/2022, 22:42 IIIT Delhi Mail - OS Midsem
Which of the following cannot be used while modifying or adding code to the Linux
kernel?
C data types
structure
Library function
Macros
What of the following is one of the disadvantages of having a monolithic kernel, like
Linux?
Slow performance
Requires assembly programming
Lack of support for isolation of execution among modules
Unsuitable for embedded systems
Suppose a new Intel processor adds an additional opcode which the Linux kernel
wants to use. How would it be able to use it?
Using a C statement
Using a system call
Using inline assembly
Cannot use it until compiler supports
Suppose you have an array of size 10. You try to access position 15 in C. What
behavior do you expect?
Segmentation fault
Return of garbage value
Process would abort
Either Segmentation fault or return of garbage value
https://mail.google.com/mail/u/1/?ik=dca342bcf2&view=pt&search=all&permthid=thread-f%3A1680621373514005916&simpl… 6/7
13/10/2022, 22:42 IIIT Delhi Mail - OS Midsem
Which of the following system calls returns control from the function only in case of
failure?
Fork
Clone
Exec
Wait
Suppose you want to run a (a) 32-bit executable program on a 64-bit Intel
processor, and (b) a 64-bit executable program on a 32-bit Intel processor. Which
of the following is correct, without using any simulator or emulator?
Both (a) and (b) are impossible
(a) is possible, but (b) is impossible
(a) is impossible, but (b) is possible
Both (a) and (b) are possible
Create your own Google Form
https://mail.google.com/mail/u/1/?ik=dca342bcf2&view=pt&search=all&permthid=thread-f%3A1680621373514005916&simpl… 7/7