Operating Systems: Three Easy Pieces Ch. 15
- Limited Direct Execution (LDE)
- Make the program run directly on the hardware
- OS gets involved and makes sure the “right” thing happens
- Efficient virtualization, interposing at that critical point
- interposing at those critical point in the time, OS ensure that it maintains the control
- Flexibility
- we like for program to be able to use their address spaces in whatever way they would like
- Address translation
- Hardware-based address translation(address translation)
- Virtual address provided by the instruction to a physical address where the desired location
- OS get involved at key points to set up hardware
- Manage memory
- Illusion of program has own memory, own code and own data
- Hardware-based address translation(address translation)
- Assumption
- Small space
- less than size of physical memory, and all are in same size
- Address space starts at address 0 and grows to a maximum of 16 KB
- relocate and transparent?
- Dynamic relocation
- base and bound(limit) register as dynamic relocation
- Translation (Address translation)
- Each memory reference generated by the process is a virtual address
- Hardware in turn adds the contents of the base register to this address
- Result is a physical address
- Due to relocationof the address happens at runtime, we can move address spaces even after the process started running → dynamic relocation
- Making sure memory reference is within bounds
- Memory management unit
- size of the address space
- holds the physical address at the end of the address space
- OS Issues
- First, the OS must take actions when a process is created, finding space for its address space in memory
- Os will have to search a data structure(free list) to find room for new address space
- Taken actions when a process is terminated, reclaiming all of its memory for x
- Third, the OS must also be taken action when a context switch occurs and needs to save and restore the base-and-bound pairs when it switches between processes
- It is privileged operations
- Required to access base-and-bounds registers; if a process, running in user mode, attempts to do so, the CPU will raise an exception and the OS will likely terminate the process
- Process Structure or Process Control Block
- Summary
- Address translation
- Key to the efficiency of this technique is hardware support
- Transparent the process
- Base and bound register
- Protection