Week 5 and 6 Flashcards
What are the three different stages of Binding Instructions and Data
- Compile (and linkage) time
- Load Time - When loader loads program into memory, addresses are resolved
- Execution Time - programs move in memory - hardware support required
Def: Execution time
Similar to Compile Time, but hardware looks after translation
Def: Logical Address
Address generated by CPU, also known as virtual address
Def: Physical Address
location in physical memory
What are the similarities and differences of Logical and Physical addresses ?
- are the same in compile and load time address binding
- differ in execution time binding
user program only deals with logical addresses (never sees physical)
Def: MMU
Hardware that maps virtual to physical address
- one simple approach is to have a single register that is added to every virtual address
What is contiguous allocation?
Main memory is divided into two parts:
- Operating system
- user memory (everything else)
with this approach each process is contained in a single contiguous section of memory
What are the three general storage allocation approaches?
- First Fit (use the first hold on the free list that is big enough, search from previous location/ only part of list)
- Best fit (smallest block that is large enough, search entire list)
- Worst Fit (largest block, worst algorithm)
Def: Internal fragmentation
if allocate memory in units larger than single byte, last block only partially used (some memory no used because more allocated to process then needed)
Def: external fragmentation
lots of small holes spread throughout memory, none big enough to satisfy a request (worst fit tries to reduce this, compaction - move blocks requires execution-time binding)
What is the 50 percent rule? (to do with Fragmentation Trade off)
N allocated blocks, 0.5 N lost to fragmentation (1/3 of memory unusable) `
What are the two Fragmentation Trade offs?
Allocate in smaller unit - less internal fragmentation, overhead in managing)
Allocate in larger units - easier to manage, more internal fragmentation
Def: Dynamic Loading
routines are loaded with needed (not necessarily when program loaded)
Does not require any special support from operating system
Def: Static linking
when all of the modules including system libraries are linked together at compile time
Def: Dynamic linking
uses indirect call through table
- table initially points at stubs
- when the routine is called the first time, the routing is leaded
(primarily used for common libraries)
Def: Overlays
program is broken into multiple parts - one common part of program always in memory - other parts of program are replaced as needed
Def: Swapping
Processes can be temporarily stored (swapped) from memory to a backing store
- make room for higher priority processes
Describe paging.
- Phys. mem. divided into frames (512 bytes to 8K sizes typically)
- Logical memory is divided into pages (same size as frames)
- if process needs n pages, find n free frames in memory
- table translates from each page to the appropriate frame
- no external fragmentation (still internal)
What is a page tables ?
A page table is the data structure used by virtual memory system in a computer operating system to store the mapping between virtual addresses and physical addresses
- each process has its own
What is a frame table?
Keeps track of allocated and free frames
Def: TLB
Translation look-aside buffer
- a memory cache that is used to reduce the time taken to access a user memory location (part of the the MMU)
What are the three ways to reduce the memory requirements of the page tables?
- Hierarchical Tables (multiple tables -> forward-mapped page table, page number is split into one or more sections)
- Hashed Page Tables (store page entries in a hash table, hashed by page number)
- Inverted pages (one entry for each frame - unlike other two which have separate tables per process)
What is virtual memory?
Separation of Logical address from Physical Address
Virtual memory is a memory management capability that uses hardware and software to allow a computer to compensate for physical memory shortages by temporarily transferring data from random access memory (RAM) to storage
What is Demand Paging?
- All pages of the process are swapped out
- swap each page in as it is needed
Locality of reference
same values , or related storage locations, are frequently accessed depending on the memory access pattern
Def: memory resident
Pages that are in memory
What is the Traditional I/O for memory mapped files?
Library accumulates until a buffer is filled and then calls O/S to write the buffer to the fule
What is over allocation?
running more processes than memory
What is the dirty bit?
Indicates that the page has been changed (dirty)