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)