Operating Systems Test 3
In a fixed partitioning scheme, what are the advantages of using unequal-size partitions? By using unequal-size fixed partitions:
1. It is possible to provide one or two quite large partitions and still have a large number of partitions. The large partitions can allow the entire loading of large programs. 2. Internal fragmentation is reduced because a small program can be put into a small partition.
What is the difference between a page and a frame?
A Frame is a fixed length block of main memory where a page is in secondary memory. A page of data may be temporarily copied into a frame of main memory.
What is the difference between block-oriented devices and stream-oriented devices? Give a few examples of each.
A block-oriented device stores info in blocks that are usually of fixed size, and transfers are made one block at a time. Generally, it is possible to reference data by its block number. Disks and USB keys are examples of these devices. A stream-oriented device transfers data in and out as a stream of bytes, with no block structure. Terminals, printers, mouse and other pointing devices, and most other devices that are not secondary storage are stream oriented.
What is the difference between demand cleaning and precleaning?
A cleaning policy is the opposite of a fetch policy: it is concerned with determining when a modified page should be written out to secondary memory. With demand cleaning, a page is written out to secondary memory only when it has been selected for replacement. A pre cleaning policy writes modified pages before their page frames are needed so that pages can be written out in batches.
Why is it not possible to combine a global replacement policy and a fixed allocation policy?
A fixed allocation policy gives a process a fixed number of frames in main memory. This number is decided at initial load time (process creation time). In this policy, when a page fault occurs in the execution of a process, one of the pages of that process must be replaced. A global replacement policy considers all unlocked pages in main memory as candidates for replacement, regardless of which process owns a particular page.
Briefly define SPN (shortest-processes-next) scheduling.
A non-preemptive policy in which the process with the shortest expected processing time is selected next.
What is the difference between a page and a segment?
A page is a fixed length block of data in secondary memory where as a segment is a variable length block of data in secondary memory. A segment may be temporarily copied into an available region of main memory (segmentation) or the segment may be divided into a page then copied to main memory
Briefly define FCFS scheduling.
Also known as FIFO. As each process becomes ready, it joins the ready queue. When the currently running process ceases to execute, the process that has been in the ready queue the longest is selected for running. First-Come-First-Serve performs much better for long processes than short ones.
Why would you expect improved performance using a double buffer rather than a single buffer for I/O?
Because a process is now transferring data to (or from) one buffer while the OS empties (or fills) the other.
Why is it not possible to enforce memory protection at compile time?
Because the location of a program in main memory is unpredictable, it is impossible to check absolute addresses at compile time to assure protection. Furthermore, most programming languages allow the dynamic calculation of addresses at run time, for example by computing an array subscript or a pointer into a data structure. Hence all memory references generated by a process must be checked at run time to ensure that they refer only to the memory space allocated to that process.
What is the relation between FIFO and clock page replacement algorithms?
Both treat the page frames allocated to a process as a circular buffer, with which a pointer is associated
What are two broad categories of defenses against buffer overflows that can be used when compiling new programs.
Compile-time defenses - harden programs to resist attacks in new programs. Run time defenses - detect and abort attacks in existing programs.
Briefly describe the difference between DAC and RBAC.
DAC systems define the access rights of individual users and groups of users. RBAC is based on the roles that users assume in a system rather than the user's identity. Users are assigned to roles in an RBAC system.
Briefly define the alternative page fetch policies.
Demand paging - A page is brought into main memory only when a reference is made to a location on that page. Prepaging - Pages other than the one demanded by a page fault are brought in.
List and briefly describe some of the defenses against buffer overflows that can be implemented when running existing vulnerable programs.
Executable Address Space Protection: this is setting a no-execute bit in the Memory Management Unit (MMU) to tag pages of virtual memory as being non-executable. Address Space Randomization: this is changing that address at which the stack or a library is located in a random manner for each process. Guard Pages: These pages lie between critical regions of memory. Any attempt to access them results in the process being aborted.
What are some reasons to allow two or more processes to all have access to a particular region of memory?
If a number of processes are executing the same program, it is advantageous to allow each process to access the same copy of the program rather than have its own copy. Processes that are cooperating on some task may need to share access to the same data structure.
What is the difference between simple paging and virtual memory paging?
In contrast to simple paging, not all pages of a process have to be in main memory for the process to run. Pages may be read in as needed. Also, in virtual memory paging, reading a page into main memory may require writing a page out to disk.
Briefly define HRRN (highest-response-ratio-next) scheduling.
In this, a formula determines which process is chosen next. When the current process completes or is blocked, you choose the ready process with the greatest response ratio value. While shorter jobs are favored, aging without service increases the ratio so that a longer process will eventually get past competing shorter jobs.
What is the difference between internal and external fragmentation?
Internal fragmentation is when allocated memory may be slightly larger than the requested memory, the size difference is memory internal to a partition but not being used, where as External fragmentation is total memory space exists to satisfy a request but is not contiguous.
Briefly define round-robin scheduling
It incorporates the use of preemption based on a clock. The clock interrupt is generated at periodic intervals, and when it occurs, the currently running process is placed in the ready queue, and the next ready job is selected on a FCFS basis. This technique is known as time slicing, because each process is given a slice of time before being preempted.
Briefly define SRT (shortest-remaining-time) scheduling.
It is a preemptive version of shortest-process-next. The scheduler always chooses the process that has the shortest expected remaining process time. As with SPN, there is a risk of starvation of longer processes.
Why is the capability to relocate processes desirable?
It is limiting to declare that when a process is swapped back in, that it has to be placed in the same memory location it had before
For process scheduling, does a low-priority value represents a low priority or a high priority?
It represents a high priority value.
What is the difference between logical I/O and device I/O?
Logical I/O - Deals with the device as a logical resource and is not concerned with the details of actually controlling the device. Concerned with managing general I/O functions on behalf of user processes. Device I/O - The requested operations and data are converted into appropriate sequences of I/O instructions, channel commands, and controller orders.
Briefly describe the three types of processor scheduling.
Long-term is the decision to add to the pool of processes to be executed. Medium-term is the decision to add to the number of processes that are partially or fully in main memory(part of swapping function). Short-term is the decision as to which available process will be executed by the processor.
List and briefly define three classes of intruders
Masquerader - Someone not authorized to use the computer and who penetrates a system's access controls to exploit an actual user's account. Misfeasor - A legitimate user who accesses data, programs, or resources for which such access is not authorized, or who is authorized for such access but misuses their privileges. Clandestine user - Someone who seizes supervisory control of the system and uses this control to evade auditing and access controls or to suppress audit collection.
What is the difference between preemptive and non-preemptive scheduling?
Nonpreemptive - Once a process is in the Running state, it continues to execute until (a) it terminates or (b) it blocks itself to wait for I/O or to request some OS service. Preemptive - The currently running process may be interrupted and moved to the Ready state by the OS
What type of programming languages are vulnerable to buffer overflows?
Ones that do not include code that enforces range checks automatically
What is accomplished by page buffering?
Page buffering essentially creates a cache of pages by assigning a replacement page to one of two lists: the free page list or the modified page list. The page to be replaced remains in memory.
What are the distinctions among logical, relative, and physical addresses?
Physical: Address seen by the memory unit - system level Logical: Referred to as virtual address - user level Relative: Address specified by indicating its distance from the base address
List and briefly define three techniques for performing I/O
Programmed I/O - The processor issues an I/O command, on behalf of a process, to an I/O module; that process then busy waits for the operation to be completed before proceeding. Interrupt-driven I/O - The processor issues an I/O command on behalf of a process. There are then two possibilities. If the I/O instruction from the process is nonblocking, then the processor continues to execute instructions from the process that issued the I/O command. If the I/O instruction is blocking, then the next instruction that the processor executes is from the OS, which will put the current process in a blocked state and schedule another process. Direct memory access (DMA) - A DMA module controls the exchange of data between main memory and an I/O module. The processor sends a request for the transfer of a block of data to the DMA module and is interrupted only after the entire block has been transferred.
What requirements is memory management intended to satisfy?
Relocation Protection Sharing Local and Physical Organization
What is the difference between resident set management and page replacement policy?
Resident set management - how many page frames are to be allocated to each active process, and whether the set of pages to be considered for replacement should be limited to those of the process that caused the page fault or encompass all the page frames in main memory. Replacement policy - Among the set of pages considered, which particular page should be selected for replacement.
What delay elements are involved in a disk read or write? Name and define each element.
Seek time is the time required to move disk arm to the required track. Rotational delay is the time required for the addressed area of the disk to rotate into a position where it is accessible by the read/write head. Seek time + rotational delay = access time. Transfer time is the time required for the data transfer.
In general terms, what are four means of authenticating a user's identity?
Something the individual knows Something the individual possesses Something the individual is (static biometrics) Something the individual does (dynamic biometrics)
What elements are typically found in a page table entry? Briefly define each element.
The frame number, which tells the corresponding page in main memory. A modify (M) bit, which indicates whether the contents of the corresponding page have been altered since the page was last loaded into main memory. A present (P) bit, which indicates whether the corresponding page is in main memory or not.
Why is the principle of locality crucial to the use of virtual memory?
The principle of locality states that program and data references within a process tend to cluster. This validates the assumption that only a few pieces of a process are needed over a short period of time. This also means that it should be possible to make intelligent guesses about which pieces of a process will be needed in the near future, which avoids thrashing. These two things mean that virtual memory is an applicable concept and that it is worth implementing.
What is the difference between a resident set and a working set?
The resident set is the portion of a process that is actually in main memory at any time. A working set is the set of pages of a process that have been referenced within a certain time period.
Briefly define FB (feedback) scheduling.
This is used if there is no indication of the length of various processes. Feedback scheduling penalizes jobs that have been running longer. Hierarchical queues are used to keep track of how long processes are taking.
Explain thrashing.
Thrashing is when the system spends most of its time swapping pieces of a process rather than executing instructions. To overcome this, the OS essentially guesses which pieces are least likely to be used in the near future, based on recent history, and will swap those out of main memory.
Be able to explain Direct versus Associative Lookup for Page Table Entries, Figure 8.8.
To Edit
Be able to explain Translation Lookaside Buffer and Cache Operations, Figure 8.9
To Edit
Be able to explain address translation in a Two-Level Paging System, Figure 8.4
To Edit
Be able to explain address translation in a paging system, Figure 8.2.
To Edit
Be able to explain each of the four Page Replacement Algorithms.
To Edit
Be able to explain the Inverted Page Table Structure, Figure 8.5
To Edit
Be able to explain the Translation Lookaside Buffer, Figure 8.6.
To Edit
Briefly define the disk scheduling policies illustrated in Figure 11.7. Be sure to include any strengths and weaknesses.
To Edit
Explain how the Buddy System works.
To Edit
Explain how the Process Page Table is used in Logical-to-Physical Address Translation, Figure 7.12
To Edit
Given a Processing Scheduling Example like Table 9.4 be prepared to write a corresponding Comparison of Scheduling Policies diagram like Figure 9.5.
To Edit
Given a stream of page requests be able to diagram the behavior of each of the Page Replacement Algorithms, Figure 8.14.
To Edit
What is usually the critical performance requirement in an interactive operating system? Explain why.
To Edit
What is the purpose of a translation lookaside buffer?
To reduce the memory access time of a virtual memory scheme. It acts as a cache for page table entries that have been most recently used.
What is the difference between turnaround time and response time? Give examples.
Turnaround time is the interval between the submission of a process and its completion (an appropriate measure for a batch job). Response time is the time from the submission of a request until the response begins to be received (better measure than turnaround time from the user's point of view).
What are typical access rights that may be granted or denied to a particular user for a particular file? Name and define each right.
a. None -users cannot know of files existence (without access) b. Knowledge -users can know the file exists and ownership (but may not access) c. Execution -users can load and execute file d. Reading -users may read data from file e. Appending -users may add data to file f. Updating -users may add/update/delete data from file g. Changing protection -users can alter access permissions on file h. Deletion -user can remove file from file system