OS FINAL

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Explain how the Process Page Table is used in Logical-to-Physical Address Translation, Figure 7.12

1. Extract the segment number as the leftmost n bits of the logical address 2. Use the segment number as an index into the process segment table to find the starting physical address of the segment. 3. Compare the offset, expressed in rightmost m bits, to the length of the segment. If the offset is greater than or equal to the length, the address is invalid. 4. The desired physical address is the sum of the starting physical address of the segment plus the offset.\

What requirements is memory management intended to satisfy?

1. Relocation - A process that has been swapped out to a disk can be moved to a different memory location than the one it was in previously. 2. Protection - Each process should be protected from unwanted interference by other processes, so programs in other processes should not be able to reference memory locations in a process for reading or writing purposes without permission; satisfied by the processor (hardware) 3. Sharing - Allowing several processes to access the same portion of main memory. Memory management system must allow controlled access to shared areas of memory without compromising essential protection 4. Logical organization - Enabling the OS and computer hardware to deal with user programs and data in the form of modules of some sort 5. Physical organization - The organization of the flow of information between main and secondary memory

List and briefly describe some of the defenses against buffer overflows that can be implemented when running existing, vulnerable programs.

1. executable address space protection: it makes the stack and heap non executable 2. address space randomization: manipulates the location of key data structures in the address space of a process 3. guard pages: placed between critical regions of memory in the process address space. These gaps are flagged as illegal address, and attempting to access them reports the process

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 pre cleaning?

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.

What are the distinctions among logical, relative, and physical addresses?

A logical address is a reference to a memory location independent of the current assignment of data to memory; a translation must be made to a physical address before the memory access can be achieved. A relative address is a particular example of logical address, in which the address is expressed as a location relative to some known point, usually a value in a processor register. A physical address is an actual location in main memory.

Briefly define shortest-process-next scheduling. SPN

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 frame?

A page is a part of a process, while a frame is a part of memory.

What is usually the critical performance requirement in an interactive OS?

Adequate response time.

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.

What is the relationship 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 the two broad categories of defenses against buffer overflows?

Compile-time defenses - harden programs to resist attacks in new programs. Run time defenses - detect and abort attacks in existing programs.

Explain how the buddy system works

Compromise between the fixed and dynamic partitioning scheme. In the buddy system memory blocks are available in 2^k words. Sets the boundaries for size of the block allocated for memory.

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.

Be able to explain Direct versus Associative Lookup for Page Table Entries, Figure 8.8

Direct mapping will take the page number and look at the page table to get the frame number while assocaitate mapping looks at the TLB's corresponding PTE to get the frame number

Briefly define the disk scheduling policies illustrated in Figure 11.7. Be sure to include any strengths and weaknesses

FIFO - Processes items in the queue in sequential order, this strategy is very fair, however struggles if there are many processes in queue SSTF - Select the I/O request that requires the smallest movement of the disk arm; This lowers average response time, but may cause starvation. SCAN - The arm moves in one direction and processes requests in its path, then reverses direction. It has a consistent average response time, but has a long wait time for requests just visited by the arm C-SCAN - Same as SCAN, but only in one direction; It provides a more uniform wait time than scan but has a more inconsistent average response time than SCAN

Be able to explain the Translation Lookaside Buffer, Figure 8.6.

Given a virutal address, the CPU examines the TLB, If the desired page is present (TLB HIT), the the frame number is retrieved and the real address is formed, If it is not found (TLB MISS), the CPU used the page number to index the process table and find the corresponding PTE, If the "present bit" is set, the CPU will retrieve the frame number to from the real addrss. The CPU updates the TLB. If the "present bit" is not in main memory, a page fault is called.

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 highest-response-ratio-next scheduling. HRRN

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 mean there is wasted space internal to a partition due to the fact that the block of data loaded is smaller than the partition. External fragmentation occurs when memory is allocated and a small piece is left over that cannot be effectively used.

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 shortest-remaining-time scheduling. SRT

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 represent a low priority or a high priority?

It represents a high priority.

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 - Individual who is not authorized to use the computer. Looks to exploit user account. Misfeasor - A legitimate user who accesses data that they are not authorized to access. Clandestine User - A individual who seizes supervisory control of the system

What are typical access rights that may be granted or denied to a particular user for a particular file?

None Knowledge Execution Reading Appending Updating Changing protection Deletion

What is the difference between preemptive and nonpreemptive 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 types of programming languages are vulnerable to buffer overflows?

Ones that do not include code that enforces range checks automatically.

Be able to explain each of the four Page Replacement Algorithms.

Optimal - Selects for replacement that page for which the time to the next reference is longest Least Recently Used (LRU) - Replaces thee page in memory that has not been referenced for the longest time First in First Out (FIFO) - Pages that's been in the longest is the first to be removed. (Circular Buffer) Clock - In a circular buffer, each page is given a bit of 0 or 1, if the bit is 0, when the pointer goes over the page, it gets selected for removal. if its 1 it gets changed to 0, If all are 1s, the pointer does one full cycle, and sets all bits to 0

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.

In a fixed-partitioning scheme, what are the advantages of using unequal-size partitions?

Processes are assigned in such a way as to minimize wasted memory within a partition (internal fragmentation). Larger programs can be accommodated without overlay.

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 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.

Be able to explain address translation in a Two-Level Paging System, Figure 8.4.

Root page always remains in main memory, the first 10 bits of a virtual address index into the root page for the PTE of the user page table, (if not found a fault occurs), Otherwise, the next 10 bits of the virtual address index the user PTE page to find the PTE for the page referenced by the virtual address.

Be able to explain the Inverted Page Table Structure, Figure 8.5.

Saves the page number's virtual address to a hash value, which points to the inverted page table. There is one entry per page table. A chaining technique is used for managing overflow. The hashing technique results in chains that are typically short. (1-2 entries),

What delay elements are involved in a disk read or write?

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.

What is the difference between a page and a segment?

Segmentation is visible to the programmer and is provided as a convenience for organizing programs and data, while paging is invisible to the programmer.

In general terms, what are four means of authenticating user's identity?

Something the individual knows Something the individual possesses Something the individual is (static biometrics) Something the individual does (dynamic biometrics)

Why is it not possible to enforce memory protection at compile time?

The OS cannot anticipate all the memory references a program will make, and even if it could, it would be prohibitively time consuming to screen each program in advance for possible memory-reference violations.

What elements are typically found in a page table entry? 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.

Be able to explain Translation Lookaside Buffer and Cache Operations, Figure 8.9.

The virtual memory mechanism must interact with the cache system, first the memory systems consults the TLB to see if the matching table entry is present, If it is, the real address is generated. Once the real address is generated, the cache is consulted to see if the block containing word is present. If so, it is returned to the CPU, if not the word is retrieved from main memory

Briefly define feedback scheduling. FB

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.

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.

Be able to explain address translation in a paging system, Figure 8.2

To translate in a paging system, we must hold it in main memory to be accessed, first a register holds the starting address of the page table, then the page number of a virtual address is used to index that table and look up the corresponding frame number, this is combined with the offset portion of the virtual address to produce the desired real address

What is the difference between turnaround time and response time?

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).


Ensembles d'études connexes

EMT Chapter 6 JBL Vocab/Quiz Questions

View Set

Real Estate Principles 10a Online

View Set

Sociology Chapter 10: Race and Ethnicity

View Set

Distribution & Combine Like Terms

View Set