Quiz
Pintos
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (32)
1(a) Consider the program below, called fork-test.
int main(void) {
int pid1 = 0;
pid1 = fork();
int pid2 = 0;
pid2 = fork();
printf("PID1: %d, PID2: %d\n", pid1, pid2); return 0; }
Which of the lines below could have been produced by the first process that was started when running fork-test?- AA) PID1: 0, PID2: 0
- BB) PID1: 0, PID2: 28252
- CC) PID1: 28250, PID2: 0
- DD) PID1: 28250, PID2: 28251
2(b) Which of of the following events will take place when switching from one process (old) to another (new).
- AA) Changing the set of currently open files to match with the new process.
- BB) Copying data from the process control block (PCB) of the new process into the interrupt vector table.
- CC) Storing CPU register states into the PCB of the old process.
- DD) Updating registers relating to memory management (e.g., base address pointer).
3c) Assume a single-CPU system and the following set of processes with arrival times (in milliseconds), expected maximum execution time (ms), and priority (1 is highest, 5 is lowest priority). The time quantum is 2ms, and to break a tie between two processes arriving simultaneously to the queue, you can assume that a newly arrived process will be put first.
Which of the scheduling policies below could result in the following execuction trace? P1, P1, P2, P2, P1, P1, P2, P3, P4, P4, P1, P1, P5, P5, P4- AA) FIFO
- BB) Round-robin
- CC) Shortest-job first with preemption
- DD) Priority scheduling with preemption
4(d) Which of the following mechanisms will prevent deadlocks?
- AA) Only use safe resources
- BB) Always acquire resources according to a globally defined order
- CC) Ensure that ∀j : Rj ≥ P i D(i, j), where Rj is the number of instances of resource j and D(i, j) is the maximum demand of resource type j from process i.
- DD) Only request a resource when it is really needed.
5(e) Which of these parameters will affect the effective access time (EAT) of demand paging?
- AA) Page fault rate (probability of page fault)
- BB) Segment table length
- CC) Time to swap page in from disk
- DD) Disk size
6(f) Which of the terms below refer to methods used for allocation of disk space for a file?
- AA) Virtual allocation
- BB) Indexed allocation
- CC) Segment allocation
- DD) Contiguous allocation
7(g) Which of the following concepts relate to multiprocessor scheduling?
- AA) Segmentation
- BB) Task migration
- CC) Hard vs. soft affinity
- DD) Co-scheduling
8(h) Given a virtual memory system with 4 page frames, how many page faults occur with the Least-Recently Used replacement strategy when pages are accessed in the following order:
1, 2, 3, 4, 5, 1, 3, 4, 2, 3, 1, 5, 4.- AA) 7
- BB) 9
- CC) 11
- DD) 13
9(i) Virtualization has been an enabler for cloud-based services. Which of the following file are true regarding this technique?
- AA) Full virtualization allows multiple operating system instances running on a single machine.
- BB) A computer with an Intel architecture and a full virtualization solution can only run a guest OS built for an Intel architecture.
- CC) Paravirtualization requires support in the guest OS.
- DD) Virtualization removes the need for having priviledged instructions in the CPU.
10(j) Which of the following mechanisms reduce the impact of buffer overflow attacks?
- AA) Marking certain parts of the data as non-executable (e.g., non-executable stack, non- executable pages)
- BB) Arrays with built-in bound checks
- CC) Making sure that the source and destination buffers are of appropriate length when copying memory
- DD) Validate user input before processing it
11(k) Consider the program below. How many times will it out the line “Hello”?
#include
#include
int main() { fork();
printf("Hello\n"); fork(); printf("Hello\n"); return 0;
}- AA) 2 times
- BB) 3 times
- CC) 4 times
- DD) 6 times
12(l) Which of the following alternatives are potential mechanisms for inter-process communication (IPC):
- AA) Shared memory
- BB) Interrupt
- CC) Mailbox
- DD) Dispatcher
13(m) Which of the following memory management tasks can be performed by the MMU:
- AA) Memory protection
- BB) Page table lookup
- CC) Page replacement
- DD) TLB lookup
14Consider a parallel program where semaphores are used to protect concurrent
access to shared data. Assume that the semaphores have been used correctly, and
that the semaphores are implemented in the operating systems using blocking and
queues. Which of the following concurrency problems could still occur?- Aa. One process crashes while it is in its critical section, thereby preventing other
processes from making progress. - Bb. Mutual exclusion is not maintained since a semaphore does not work like a lock.
- Cc. Two processes get stuck because they called the wait operation at the same time,
and the operating system is not able to determine who came first. - Dd. Reduced performance when increasing the number of processes due to the
bottleneck of waiting to access shared data.
- Aa. One process crashes while it is in its critical section, thereby preventing other
15Which of the following scheduling algorithms (or family of algorithms) exists as both a preemptive and non-preemptive variant.
- Aa. First come first served (FCFS)
- Bb. Priority-based scheduling
- Cc. Round-robin scheduling
- Dd. Shortest-job first
16When a file is opened in a modern operating system, two data structures are
created, one system-wide file table and a per-process table. Which of the following information items are stored in the per-process file table (and thus potentially differ between processes)?
- Aa. The access mode (e.g., read, write, read-write) that the file has been opened
with - Bb. The file owner
- Cc. File permissions (who is allowed to read/modify the file)
- Dd. The seek position (where in the file the next read/write operation will take place)
- Aa. The access mode (e.g., read, write, read-write) that the file has been opened
17Which of the following operations will result in a system call for a normal operating system?
- Aa. Performing a jump (JMP) instruction
- Bb. Creating a new file
- Cc. Reading the value of a variable stored on the stack
- Dd. Allocating memory on the heap
18Which of the following statements are true?
Select one or more:- Aa. A thread is only run when there is no process that wants to use the CPU.
- Bb. Threads are guaranteed to be deadlock-free.
- Cc. Different threads belonging to the same process share memory with each other.
- Dd. A process in a modern operating system has its own protected memory.
19A hypervisor is used in virtualization solutions to allow multiple operating systems to run on the same physical hardware. The hypervisor can let the OSs take care of some things on their own, but must have at least some support for certain concepts. Which of the following must be supported by the hypervisor?
- Aa. User management for the guest OSs
- Bb. Special instructions (i.e., that require the CPU to be in protected mode)
- Cc. File table for files opened by guest OSs
- Dd. Memory management
20(n) Which of the following items are found in a POSIX inode for a regular file?
- AA) File size
- BB) Pointer to the directory that the file is located in
- CC) Pointers to blocks on disk where the file is stored
- DD) The file position indicator (as set by an fseek command)
21(o) Which of the following are security attributes?
- AA) Integrity
- BB) Protection
- CC) Authentication
- DD) Availability
22(p) Which of the following virtualization configurations are possible when using paravirtualization:
- AA) Host running Ubuntu Linux on a x86-64 machine, Guest running Windows 10 for x86-64
- BB) Host running Ubuntu Linux on a x86-64 machine, Guest running Linux for ARM
- CC) Host running Windows 10 on a x86-64 machine, Guest running Ubuntu Linux for x86-64
- DD) Host running Ubuntu Linux on an IA-32 machine, Guest running Ubuntu Linux for x86-64
23(b) Which of the following are possible states for a system process (as described in the course literature):
- AA) Waiting
- BB) Ready
- CC) Forking
- DD) Controlling
24(g) Which of the following are classical scheduling algorithms (as described in the course literature):
- AA) Shortest-job first scheduling
- BB) Burst-first scheduling
- CC) Priority scheduling
- DD) Timer scheduling
25(h) Which of the following virtualization configurations are possible when using paravirtualization:
- AA) Host running Ubuntu Linux on a x86-64 machine, Guest running Windows 10 for x86-64
- BB) Host running Windows 10 on a x86-64 machine, Guest running Ubuntu Linux for x86-64
- CC) Host running Ubuntu Linux on a x86-64 machine, Guest running Linux for ARM
- DD) Host running Ubuntu Linux on an IA-32 machine, Guest running Ubuntu Linux for x86-64
26(j) Which of the following can be said to constitute vulnerabilities
- AA) Lack of input validation in a program
- BB) An email with a virus attached
- CC) The Android operating system
- DD) Clear-text storage of passwords
27(a) Which of the following events will always trigger an interrupt (hardware or software).
- AA) A user program requesting to read data from a file.
- BB) A user program requesting to read data from main memory
- CC) A key being pressed on the keyboard.
- DD) A byte being transferred from disk to main memory.
28(b) Consider the program below. How many times will it output the line “Hello”?
#include #include
int main()
{ printf("Hello\n"); fork();
fork(); printf("Hello\n"); return 0;
}- AA) 2 times
- BB) 3 times
- CC) 5 times
- DD) 7 times
29(c) Which of the following statements are about true deadlocks:
- AA) If there is only a single instance of every resource, a cycle in the resource allocation graph means that there is a deadlock.
- BB) All four Coffman conditions must me met for there to be a deadlock.
- CC) Banker’s algorithm is used to detect and remove deadlocks.
- DD) Banker’s algorithm guarantees freedom from starvation.
30(f) Given a virtual memory system with 4 page frames, how many page faults occur with the FIFO replacement strategy when pages are accessed in the following order:
2, 3, 5, 1, 2, 4, 2, 3, 1, 3, 2, 1, 4- AA) 7
- BB) 9
- CC) 11
- DD) 13
31(g) The following is an excerpt from the Wikipedia article on the WannaCry ransomware (accessed 2017-06-01):
The WannaCry ransomware attack was a worldwide cyberattack by the WannaCry ransomware cryptoworm, which targeted computers running the Microsoft Windows operating system by encrypting data and demanding ransom payments in the Bitcoin cryptocurrency. The attack began on Friday, 12 May 2017, and within a day was reported to have infected more than 230,000 computers in over 150 countries. Parts of Britain’s National Health Service (NHS), Spain’s Telefonica, FedEx and Deutsche Bahn were hit, along with many other countries and companies worldwide. Shortly after the attack began, a web security researcher who blogs as ”MalwareTech” discovered an effective kill switch by registering a domain name he found in the code of the ransomware. This greatly slowed the spread of the infection, effectively halting the initial outbreak on Monday, 15 May 2017, but new versions have since been detected that lack the kill switch. Researchers have also found ways to recover data from infected machines under some circumstances. 3 WannaCry propagates using EternalBlue, an exploit of Windows’ Server Message Block (SMB) protocol. Much of the attention and comment around the event was occasioned by the fact that the U.S. National Security Agency (NSA) had discovered the vulnerability in the past, but used it to create an exploit for its own offensive work, rather than report it to Microsoft. It was only when the existence of this vulnerability was revealed by The Shadow Brokers that Microsoft became aware of the issue, and issued a ”critical” security patch on 14 March 2017 to remove the underlying vulnerability on supported versions of Windows. but many organizations had not yet applied it. Which of the following protection measures could have reduced the impact of this attack?- AA) Two-factor authentication
- BB) Faster updates of critical security patches
- CC) Proper backup procedures
- DD) Encryption
32(j) Which of the following mechanisms reduce the impact of buffer overflow attacks?
- AA) Marking certain parts of the data as non-executable (e.g., non-executable stack, non- executable pages)
- BB) Arrays with built-in bound checks
- CC) Making sure that the source and destination buffers are of appropriate length when copying memory
- DD) Validate user input before processing it
Information
- Description
- Quiz on Pintos, created by Rebecka H on 22/03/2021.
- Author
- Rebecka H
- Language
- English
- Views
- 12
- Rating
- No ratings yet Rate this quiz