Home About
No Memory Abstraction
The simplest memory abstraction is no abstraction at all.
- Early computers did not have any memory abstraction at all, which means all programs had direct access to physical memory.
- This means we could not have 2 programs running in main memory at once, as this would cause inconsistency in data.
- Processes could erase each others' written output/input and cause severe inconsistencies.
- It is possible to run multiple programs without having memory abstraction.
- The idea is to have just one running process in main memory at any point of time.
- Whenever a process leaves main memory, all of its current state and values are copied out of main memory and another process is brought onto main memory.
- Whenever the process returns to main memory, all of the saved contents are brought back to main memory.
- With addition of special hardware, it is possible to run multiprogramming without swapping.
- Early models of IBM 360 followed this approach:
- Memory was divided into 2 KB blocks and each block was assigned a 4-bit protetion key held in special registers inside the CPU.
- A machine with 1 MB memory needed only 512 of these 4 bit registers for a total of 256 bytes of key storage.
- The PSW [Program Status Word] also contained a 4-bit key.
- The 360 hardware trapped any attempt by a running process to access memory with a protection code from the PSW key.
- Only the OS is permitted to change the protection keys, hence, user processes could not interfere with one another and also with the OS process.
- The main problem with having two programs in memory without memory abstraction is
- it is difficult to determine the name of each program
- each program will have different ideas about what the CPU should be doing
- each program can overwrite the memory of the other
- none of the above
- Without memory abstraction we can still have multiprogramming
- by only running one program at a time and completely swapping each successive program in and out of memory
- by using VT
- by taking advantage of an MMU
- with paging
- Even without swapping or memory abstraction we can multiprogram
- if we write our code very carefully
- if we have an MMU
- if we have special hardware to divide memory between different programs
- all of the above
1. c; 2. a; 3. c;