os

Q: What are the four main functions of a memory manager?
A: 1. Keep track of which parts of memory are in use.
A: 2. Allocate memory to processes when they require it.
A: 3. Protect memory against unauthorized accesses.
A: 4. Simulate the appearance of a bigger main memory by moving data automatically between main memory and disk.
 
Q: What is meant by a dirty page?
A: An unreferenced page that was modified when the clock hand reaches it, it is written out to disk (clearing the Modified bit) but is not made a candidate for replacement.
 
Q: How does memory compaction work?
A: Moves all processes into a single contiguous area at one end of memory, leaving an unused area at the other end. [Alternatively, one could create an unused area in the middle.]
 
Q: What are the three tricks used to resolve absolute addresses?
A: 1. Position Independent Code [PIC]
A: 2. Relocation
A: 3. Base and Limit Registers
 
Q: Why would an overlay be used?
A: Used as some programs require more main memory than the computer has.
 
Q: How can the problem of TLB during context switching be avoided?
A: Clear the TLB at the context switch, or include a Process ID in every TLB entry, and check these on every reference.
 
Q: What is swap space?
A: Memory images kept on disk.
 
Q: What is meant by SWAPPING IN a process?
A: Having its image brought into memory from disk.
 
Q: What are the problems that arise with absolute addresses in terms of swapping?
A: When a program is loaded into memory at different locations, the absolute addresses will not work without software or hardware tricks.
 
Q: What is the advantage of Base-Limit Registers in comparison to PIC and Relocation?
A: Guarantees Security:
A: 1. Compares every program-generated address with the limit register and generates an exception if the limit is exceeded.
A: 2. Allows the base and limit registers to be modified only in KERNEL mode.
 
Q: Where is the MMU located?
A: MMU is located between the CPU and the BUS.
 
Q: What does the physical address space of a machine contain?
A: One address for each memory cell.
 
Q: Why does FIFO have poor performance?
A: 1. Because it disregards the principle of locality.
A: 2. Pays no attention to page usage.
 
Q: What is a downfall of memory compaction?
A: It is very expensive, it can freeze all other activities for several seconds.
Q: What is the method of using Base and Limit registers?
A: Relies on extra hardware, when loading memory image of a process, the OS sets the base register to point to the start of the image. 
A: Hardware adds the value in the base register to every address generated by program before accessing memory.
 
Q: What does MMU stand for?
A: Memory Management Unit.
 
Q: What is compaction time dependant on? Explain where a dilemma could occur?
A: 1. More Memory [More Time]
A: 2. Better CPU/BUS [Less Time]
A: Dilemma: Better CPUs come with More Memory.
 
Q: What is meant by SWAPPING OUT a process?
A: Moving its memory to disk, to free up memory.
 
Q: Where is the 'area of memory' occupied by a process recorded?
A: In the Process Table.
 
Q: What is an overlay?
A: Divisions in a program is made into overlays. At any time only one overlay is in memory, when the program needs code or data in another overlay, the program commands the current overlay to be swapped out and the required overlay to be swapped in.
 
Q: What is a downfall of LFU?
A: If a page was once heavily referenced, LFU will leave it in memory even after it has outlived its usefulness.
 
Q: What is the aim of memory compaction?
A: To create a single unused area of memory.
 
Q: What maps virtual pages onto physical pages?
A: MMU
 
Q: What is your recommendation in the use of the silicon area on which TLBs are implemented?
A: Instead of using silicon space to handle misses [miss handler], it should go to making a larger TLB to reduce the miss rate.
 
Q: Give an example of a primitive MMU.
A: B-L registers and the hardware that uses them.
 
Q: What is a free list?
A: A list whose elements point to the unused blocks in the system.
 
Q: What is internal fragmentation?
A: Unused/Wasted space inside a region allocated to a process.
 
Q: What happens if a process exceeds the LIMIT in B-L resolution?
A: Generates an exception.
 
Q: What are the four classifications of pages in NRU algorithms [in order]?
A: 0: not Referenced, not Modified [Lowest Priority]
A: 1: not Referenced, Modified
A: 2: Referenced, not Modified
A: 3: Referenced, Modified [Highest Priority]
 
Q: What generates PIC?
A: Compiler.
 
Q: What is external fragmentation?
A: Fragmentation outside of allocated area.
 
Q: On memory access plots, what is the distribution of temporal locality?
A: Narrow horizontal slice, whose width is a single instruction or item of data, will show clumps in accesses.
 
Q: What is the method of relocation?
A: The compiler separates absolute addresses and passes this info to the OS, which can then adjust the contents of those words and registers when it loads the program at a new location.
 
Q: When does external fragmentation occur?
A: When a large process exits and is swapped out and is replaced by a smaller process.
 
Q: What are two page table structures?
A: 1. Split table organization
A: 2. Directory organization
 
Q: Why are BL, PIC, and Relocation limited in comparison to virtual memory?
A: Because they require the entire program code and data to be in main memory when the program is running.
 
Q: What is a trick that a process can use to bypass BL limit restrictions? How is the system safe from this trick?
A: A program could try to use negative addresses [which will always appear to be less than the LIMIT] to evade a comparison.
A: This will not work because addresses are unsigned.
 
Q: Why is a memory map used?
A: A memory manager uses a memory map to know for each word of memory, whether the word is free and if not, which process it belongs to.
 
Q: What is the problem with PIC?
A: References to variables now require an extra addition, which slows the program down.
 
Q: What is a page frame?
A: A physical page.
 
Q: What is the purpose of a physical page?
A: To hold a virtual page.
 
Q: Where do pages start out when a process is run?
A: Pages in virtual address space all start out on disk.
 
Q: A virtual address has two parts, what are they?
A: 1. Virtual Page Number
A: 2. Offset
 
Q: How is 'page size' determined?
A: 2^(Number of bits in offset)
 
Q: In a paged system, how is an address viewed?
A: Always viewed as:
A: page_number * page_size + offset
 
Q: Why are page sizes powers of two? Why is this necessary?
A: Division is trivial if a page_size is a power of two.
A: This is necessary, as the decomposition of an address into a page_number and offset requires division.
 
Q: What is a page map?
A: A mapping of virtual address to physical addresses and vice- versa.
 
Q: Where is the information required to do mapping contained?
A: Page Table.
 
Q: What is a page table?
A: Table recording the mapping of virtual addresses to physical addresses.
 
Q: What is the relation between page tables and processes?
A: Each process has its own virtual address space, and thus its own page table.
 
Q: What is contained within a page table entry?
A: 1. Physical Page Number
A: 2. Valid Bit
A: 3. Modified Bit
A: 4 Permission bits [Read/Write/Execute]
 
Q: What does the number of page table entries depend on?
A: #(Page Table Entries) = #(Virtual Pages)
A: One Entry per virtual page number
 
Q: What does the valid bit represent?
A: Whether the virtual page is in main memory or not.
 
Q: On many systems, if the page is not in memory, what happens to the physical page number field?
A: The physical page number field contains the address of the page on disk.
 
Q: Describe the steps involved in a page table operation?
A: 1. Virtual page # is found on page table.
A: 2. Valid and Permission bits are checked.
A: 3. Corresponding physical page# is located,
A: 4. Physical page offset = Virtual page offset.
 
Q: What checks the valid bit and permissions of a requested memory access in a PTE?
A: The MMU performs these checks.
 
Q: What is a page fault?
A: An EXCEPTION, in which the valid bit is 0 OR permissions do not permit.
 
Q: What throws a page_fault exception?
A: MMU
 
Q: During a check of a PTE using the MMU, what happens if permissions permit and valid bit = 1, and the request is a WRITE?
A: The modified bit in the PTE is set to 1.

No comments:

Post a Comment