Quiz
OS final
This quiz has question types that open in the usual player.
Questions in this quiz (42)
1Deadlocks
Multiprogramming environment characterized by several process competing for a limited number of resources- ATrue
- BFalse
2Deadlock can arise if four conditions hold simultaneously
- AMutual exclusion
- BHold and wait
- CNo preemption
- DCircular wait
- ERecursive wait
- FMutual Inclusion
3Deadlock Characterization
[blank_start]Mutual exclusion[blank_end] - Only one process at a time can use a resource
[blank_start]Hold and wait[blank_end] - A process holding at least one resource is waiting to acquire additional resources held by other processes
[blank_start]No preemption[blank_end] - A resource can be released only voluntarily by the process holding it, after that process has completed its task
[blank_start]Circular wait[blank_end] - There exists a set {P0, P1, ..., Pn} of waiting processes- AMutual exclusion
- BHold and wait
- CNo preemption
- DCircular wait
4Rule of Thumb for Deadlock
If graph contains no cycles = no deadlock
If graph contains a cycle (closed cycle):
if only one instance per resource type = Deadlock
if several instances per resource type = Possibility of deadlock- ATrue
- BFalse
5.

- AY
- B.
6.

- AY
- B.
7The deadlock-avoidance algorithm is based on resource-allocation state
The # of available resources + allocated resources + maximum demands of the processes- ATrue
- BFalse
8Safe State
If a system is in safe state = no deadlocks
If a system is in unsafe state = possibility of deadlock- ATrue
- BFalse
9https://www.youtube.com/watch?v=w0LwGqffUkg
Bankers Algorithm - Safety:
1) Let Work and Finish be vectors of length ‘m’ and ‘n’ respectively.
Initialize: Work = Available
Finish[i] = false; for i=1, 2, 3, 4….n
2) Find an i such that both
a) Finish[i] = false
b) Needi <= Work
if no such i exists goto step (4)
3) Work = Work + Allocation[i]
Finish[i] = true
goto step (2)
4) if Finish [i] = true for all i
then the system is in a safe state- ATrue
- BFalse
10Bankers Algorithm - resource request
1) If Requesti <= Needi
Goto step (2) ; otherwise, raise an error condition, since the process has exceeded its maximum claim.
2) If Requesti <= Available
Goto step (3); otherwise, Pi must wait, since the resources are not available.
3) Have the system pretend to have allocated the requested resources to process Pi by modifying the state as
follows:
Available = Available – Requesti
Allocationi = Allocationi + Requesti
Needi = Needi– Requesti- ATrue
- BFalse
11Several Instances of a Resource Type
Data structure
[blank_start]Available[blank_end]:
Vector of length m indicates the number of available resources of each type
[blank_start]Allocation[blank_end]:
n x m matrix defines the number of resources of each type currently allocated to each process
[blank_start]Request[blank_end]:
n x m matrix indicates the current request of each process- AAvailable
- BAllocation
- CRequest
12Detection Algorithm:
Let Work and Finish be vectors of length m and n respectively. Initialize Work= Available. For i=0, 1, …., n-1, if Requesti = 0, then Finish[i] = true; otherwise, Finish[i]= false.
Find an index i such that both
a) Finish[i] == false
b) Requesti <= Work
If no such i exists go to step 4.
Work= Work+ Allocationi
Finish[i]= true
Go to Step 2.
If Finish[i]== false for some i, 0<=i<n, then the system is in a deadlocked state. Moreover, if Finish[i]==false the process Pi is deadlocked.- ATrue
- BFalse
13Abort all deadlocked processes
Costly since it results in loss of all computations performed up to the time of the processes termination- ATrue
- BFalse
14Abort one process at a time until the deadlock cycle is eliminated
Significant overhead:
every time a process is terminated the deadlock-detection algorithm should run again to find if the system is in a deadlocked state- ATrue
- BFalse
15Base and Limit Registers:
User processes are restricted to this limit
A pair of base and limit registers define the logical address space
CPU must check every memory access generated in user mode to be sure it is between base and limit for that user- ATrue
- BFalse
16Address Space
[blank_start]Logical[blank_end] address:
Generated by the CPU
Also referred to as virtual address
set of all logical addresses generated by a process
[blank_start]Physical[blank_end] address:
Address seen by the memory unit
set of all _____ addresses corresponding to these _____ addresses generated by a process- ALogical
- BPhysical
17The user program deals with physical addresses
It never sees the real logical addresses- ATrue
- BFalse
18Memory-Management Unit (MMU)
Hardware device that maps virtual to physical address- ATrue
- BFalse
19processes who are not currently using the CPU may have their memory swapped out to a fast local disk called the backing store
not used by modern OS such as UNIX, Linux, and Windows- ATrue
- BFalse
20Paging is a memory management scheme that eliminates the need for contiguous allocation of physical memory.
[blank_start]Page number(p)[blank_end]: Number of bits required to represent the pages in Logical Address Space or Page number
[blank_start]Page offset(d)[blank_end]: Number of bits required to represent particular word in a page or page size of Logical Address Space or word number of a page or page offset.
[blank_start]Frame number(f)[blank_end]: Number of bits required to represent the frame of Physical Address Space or Frame number.
[blank_start]Frame offset(d)[blank_end]: Number of bits required to represent particular word in a frame or frame size of Physical Address Space or word number of a frame or frame offset.- APage number(p)
- BPage offset(d)
- CFrame number(f)
- DFrame offset(d)
21Virtual memory–separation of user logical memory from physical memory
Only part of the program needs to be in memory for execution- ATrue
- BFalse
22What happens if there’s no free frame on the physical memory to store the needed page?
- APage replacement – find some page in memory that is not in use and replace it
- BPage algorithm - find the least used page not in use and swap with the most used page
23First in First Out
Initially all slots are empty, so when 1, 3, 0 came they are allocated to the empty slots —> 3 Faults.
when 3 comes, it is already in memory so —> 1 Hit.
Then 5 comes, it is not available in memory so it replaces the oldest page slot i.e 1. —>1 Fault
6 comes, it is also not available in memory so it replaces the oldest page slot i.e 3 —>1 Fault.
Finally when 3 come it is not available so it replaces 0 --> 1 fault
total faults: 6
total hits: 1
- AY
- B.
24Optimal
Initially all slots are empty, so when 7 0 1 2 are allocated to the empty slots —> 4 faults
0 is already there so —> 1 hit.
when 3 came it will take the place of 7 because it is not used for the longest duration of time in the future.—>1 fault
0 is already there so —> 1 hit.
4 will takes place of 1 —> 1 Fault.
Now for the further page reference string —> all hits because they are already available in the memory
total faults: 6
total hits: 8
- AY
- B.
25LRU least recently used
Initially all slots are empty, so when 7 0 1 2 are allocated to the empty slots —> 4 faults
0 is already their so —> 1 hit
when 3 came it will take the place of 7 because it is least recently used —>1 fault
0 is already in memory so —> 1 hit.
4 will takes place of 1 —> 1 Fault
the further page reference string —> hits because they are already available in the memory.
total faults: 6
total hits: 8
- AY
- B.
26Principles of Protection
[blank_start]Principle of least privilege[blank_end]:
Programs, users and systems should be given just enough privileges to perform their tasks
[blank_start]“Need to know” principle[blank_end]:
Process should be able to access only those resources that it currently requires to complete its tasks- APrinciple of least privilege
- B“Need to know” principle
27Domain Structure
[blank_start]Domains as users[blank_end]:
The set of objects depends on the user ID
Domain switching occurs when user changes
[blank_start]Domains as processes[blank_end]:
The set of objects depends on the PID.
Domain switching occurs when a processes send a message to another process and then waits for a response
[blank_start]Domains as procedure[blank_end]:
The set of objects can be the local variables
Domain switching occurs when a procedure call is invoked- ADomains as users
- BDomains as processes
- CDomains as procedure
28Access Matrix

- AY
- B.
29ACL - Access control list

- AY
- B.
30Capability list

- AY
- B.
31File Attributes
[blank_start]Name[blank_end] – only information kept in human-readable form
[blank_start]Identifier[blank_end] – unique tag (number) identifies file within file system
[blank_start]Type[blank_end] – needed for systems that support different types
[blank_start]Location[blank_end] – pointer to file location on device
Size – current file size
[blank_start]Protection[blank_end] – controls who can do reading, writing, executing
Time, date, and user identification – data for protection, security, and usage monitoring- AName
- BIdentifier
- CLocation
- DProtection
- EType
32Access Methods
Sequential Access:
Simplest access method
Supports a few operations:
[blank_start]read next[blank_end] - read a record and advance the tape to the next position.
[blank_start]write next[blank_end] - write a record and advance the tape to the next position.
rewind
[blank_start]skip n records[blank_end] - May or may not be supported.- Aread next
- Bwrite next
- Cskip n records
33Access Methods
Direct Access
Jump to any record and read that record.
Operations supported include:
[blank_start]read n[blank_end] - read record number n.
[blank_start]write n[blank_end] - write record number n.
[blank_start]jump to record n[blank_end] - could be 0 or the end of file- Aread n
- Bwrite n
- Cjump to record n
34Disk Structure
Physical disk can be broken up into multiple partitions
Multiple physical disks can be combined into one volume- ATrue
- BFalse
35File Sharing
Multiple Users
[blank_start]Ownership[blank_end]–The user who owns the file and who can control its access.
[blank_start]Group[blank_end]–Permissions and Polices defined by group
Remote File Systems
[blank_start]FTP[blank_end]-based access - Allow individual files to be transported across systems as needed- AOwnership
- BGroup
- CFTP
36Incredible variety of I/O devices
- AStorage
- BTransmission
- CHuman-interface
- DHardware
37Polling – busy waiting
Process where the computer or controlling device waits for an I/O device until it is ready- ATrue
- BFalse
38Threat is potential security violation
Attack is attempt to breach security- ATrue
- BFalse
39Breach of [blank_start]confidentiality[blank_end] - Unauthorized reading of data
Breach of [blank_start]integrity[blank_end] - Unauthorized modification of data
Breach of [blank_start]availability[blank_end] - Unauthorized destruction of data- Aconfidentiality
- Bintegrity
- Cavailability
40Authentication
Encryption is a way of constraining a set of possible [blank_start]receivers[blank_end] of a message
Authentication is a way of constraining the set of possible [blank_start]senders[blank_end] of a message
Authentication also supports the [blank_start]integrity[blank_end] of the message- Areceivers
- Bsenders
- Cintegrity
41Digital Certificate – An organizations name and public that is encrypted and certified by an authorized third party
- ATrue
- BFalse
42Data Integrity
Digital Signature
Technique where a document is encrypted using a private key
A number attached to a message that informs whether or not the message has been modified- ATrue
- BFalse
Information
- Description
- Computer Science Quiz on OS final, created by Duncan Levings on 27/11/2019.
- Author
- Duncan Levings
- Language
- English
- Views
- 3
- Tags
- Rating
- No ratings yet Rate this quiz