Memory partitions

protection

We need to stop processes stomping all over each other.

software

Could prove that all loaded code will be well-behaved. When the code was written in a strongly-typed language, this may be possible. For example, the JavaOS only loads Java code, which may be mathematically proved to not corrupt memory. The JavaOS therefore protects processes from each other by proving that they cannot violate each others' memory.

In general, esp. with software written in C---and moreso with compiled machine code---proof of this kind is impossible. Software protection of this kind does not work when you want to just load an arbitrary compiled program in and run it.

hardware--limit register

Another approach, closely allied to the base register idea, is the notion of a limit register. The base register says where a process's virtual memory starts; the limit register says where it stops. If a process attempts to access an address beyond the value in the limit register, a memory fault will occur, and the OS terminates the process.

Obviously, only the OS should have access to the base and limit registers, so they should only be accessable to the processor in kernel mode, not when the processor is in user mode.

hardware--protection codes

An alternative approach to the protection problem, used by IBM on their 360 machines, was to assign a protection code to every 2K block of memory. Only processes with a protection key matching the protection code were allowed to access a particular block.


last updated 27 February 1998