Operating Systems Final Flashcards
- What advantage does RAID 4&5 have over RAID1?
- What disadvantage does RAID 4&5 have when compared to RAID1? Hint:
How is data retrieved when a drive is lost?
The advantage of RAID 4&5 is that redundancy is obtained with only a single
additional drive that maintains the stripe’s parity information. (unlike RAID1 which
requires 2x the drives).
When RAID 4&5 loses a data drive the raid operates in reduced mode. To
reconstruct the data on the lost drive, each block retrieved from the RAID must
be reconstructed dynamically by reading from each of the remaining data blocks
in the missing block’s strip plus the parity block. That is, N-1 block reads are
needed to reconstruct blocks from the missing drive. This is significantly slower
than the Raid 1 where both drives maintain the same blocks and no
reconstruction is needed.
- What are three advantages of RAID1 (mirroring) given in the book? (Assume
a two drive RAID) - What is the primary disadvantage of RAID1?
Raid 1 is also known as “disk mirroring” where data is duplicated across (written
to and read from) two drives.
1. Data on the logical RAID drive is protected from a single-drive failure.
2. A read request can be serviced by either of two drives allowing two read
requests to be executed concurrently.
3. Even though both drives need to be updated for a write operation, the write
can be executed concurrently on both drives.
Disadvantage: Because blocks are mirrored on two drives, RAID1 provides only
half the storage capacity provided by two physical drives.
- Describe why we describe drives as block devices.
- Explain how data is addressed and retrieved from block devices.
- Describe the steps required to update the data (e.g. a record) stored on a
block device.
- Block devices stores and manages its data in fixed sized blocks of 4096 bytes
of data. Data is transferred to / from these devices as blocks of data rather
than one word / byte at a time. Block devices are typically drives. - The OS commands the block device to retrieve data or save data at specific
block address. Blocks are addressed starting at block 1 (the first block)
though block N where N is the number of blocks maintained by a drive
partition. - Block Data Update:
a. The block containing the record must be read from the device into a region
of memory. The block is identified by its block address.
b. The record within the block is updated in memory.
c. The modified block is written back to the drive. This includes the data
surrounding the record which was not updated.
As presented in lecture and slides, what are the five parameters used to create a
virtual machine?
- The Guest OS e.g. Windows or Linux.
- The number of Virtual CPU (vCPU) allocated to the VM.
- The amount of memory allocated to the VM.
- The file system that will be attached to the VM.
- The Virtual Private Network (VPN) the VM will run in.
What are the four generic functions provided by the Hypervisor?
- Construction and management of Virtual Machines.
- Allocation of host processor resources to virtual machines e.g., cores,
memory, I/O bandwidth. - Emulation of device controllers for the guest operating systems.
- Handling syscalls (traps) from the guest operating systems.
Consider a simple paging system with the following parameters:
* 232 bytes of physical memory address range.
* A page size of 210 bytes.
1. What is the size of a frame?
2. How many bits of a logical address are used to identify (index) a page table
entry?
3. How many entries are needed in the process’s page table?
4. How many bits are needed in each page table entry?
- A frame is the same size as a page, 210 bytes.
- 10 bits are used as the offset into the page / frame, so 22 (32-10) bits remain
to index into the page table. - There is one Page Table Entry for each page in the logical address space, so
222 entries are needed. - Ignoring the present and modified bits, 22 bits are needed in each PT Entry to
specify the base address of the frame in physical memory.
Describe both the logical and physical views of a process image’s memory
addresses.
What is the system component that translates logical to physical addresses?
Logical View: The logical view of the process image is the illusion that the image
is installed in a contiguous range of memory addresses that starts at address
zero and extends to N (the image size). The process logical address space is
owned by the process and is separate from all other process images. That is,
that every process has its own private 0-N address space.
Physical View: The physical view of the process image is the reality that all
process images share common physical memory range of 0–M where M is the
amount of system memory. Each process is installed into a memory partition at
unique addresses in physical memory. Partitions can be relocated to new
addresses, and with paged memory management can be placed in non-
contiguous (non-adjacent) memory regions.
Translation from logical to physical addresses is primarily accomplished by the
system’s Memory Management Unit hardware.
- Describe a process’s Resident Set.
- What occurs when a process’s resident set size is too small?
- What occurs when a process’s resident set size is too large?
The resident set is the set of process pages that are resident in memory i.e. are
contained in a memory frame.
A resident set that is too small will cause an increase in the number of page
faults and can cause the process to begin thrashing.
A resident set that is too large wastes memory (frames) by maintaining process
pages in memory that are no longer being referenced by the process (no longer
in the process’s working set). This has the effect of reducing the overall number
of processes that can be maintained in memory.
- Describe a process’s Working Set.
- Describe the relationship between the size of a process’s working set and its
resident set. - Describe what happens when a process’s working set size exceeds its
resident set.
- The Working Set is the set of pages that the process currently needs to
execute i.e. the process’s locality. Any page in the working set that is not
resident must be paged in. - The working set size should smaller than the resident set size i.e. the resident
set should include at least the working set. - When a process’s working set size exceeds its resident set the condition
triggers page faults needed to make the missing working set pages resident.
Describe the problem with fairness with Preemptive Round-Robin scheduling
WRT I/O-bound processes vs. compute-bound processes.
RR scheduling allows a process to complete its quantum (time-slice) and then
schedules the next process at the head of the ready queue. A compute-bound
process will likely execute for its full quantum without blocking. However, an I/O-
bound process is more likely not to use its entire quantum before being blocked
(I/O) and rescheduled when the I/O operation completes. Thus, because an I/O-
bound process seldom finishes its quantum before blocking, it will receive
less processor time than a compute-bound process.
How does Virtual Round-Robin scheduling (as described in text) solve the
problem described in question 4?
Virtual RR scheduling maintains a second queue for “Returned From Blocked”
processes that have completed their I/O operation and have not completed their
current quantum. See Figure 9.7 in the text. When a process is placed in the
RFB queue, the dispatcher will preempt the currently executing process in favor
of the returned-from-blocked process which will be allowed to complete the
remainder of its previously interrupted quantum before being placed into the
ready queue.
Describe the purpose of the File Descriptor
File descriptors are a resource created and managed by the operating
system.
- File descriptors are a data structure created by system calls that create new
files or open existing files.
- The file descriptor is used by system calls that manipulate the contents of a
file i.e. read, write, seek, etc.
- The file descriptor maintains state information about the open file e.g. the
stream index (position) of the next read or write operation on the open file.
- A process’s open file descriptors are maintained in the process’s Process
Control Block (PCB).
- Describe the purpose of the File Allocation Table.
- Describe the purpose of the Unallocated Block List.
- File Allocation Table (FAT) is the data structure used to maintain the
association between a file and the blocks allocated to storing the file’s
contents including the ordering of the file’s blocks. - Unallocated Block List (UBL) is the list (set) of blocks that are currently not
allocated to any file. It is the file system’s free space.