# The memory management algos vary from primitive bare-machine to paging and segmentation strategies.
# Memory contains large array of words and bytes each having its own address.
# The computer fetches the instructions from the cpu , according to the value in program counter.
# The memory unit just sees the streams of memory addresses , it does not know how they are created or what they are for.
# The binding of actual address and the logical address has to be seen as far as memory management has to be considered.
Basic Hardware
# Main memory and the processor’s registers build into the cpu memory is what cpu can access directly.
# There are machine instructions that take memory addresses as arguments.?? What are those instructions like.
# Thus any instruction in execution or any data used by these instructions must be in any of these (direct-access)storage devices. If they are not they have to moved before cpu can operate them.
# The registers that are build into the cpu are accessible in one cycle of the cpu clock.
# Most cpu’s can decode the instructions in registers and perform simple operations at the rate of one operation per clock tick. This is not the case for the main memory which is held via memory bus.
# The memory access may take many cycles to complete during which the processor has to stall. In the case of main memory.
# The remedy is install a fast memory b/w cpu and main memory called cache.
# The issues are more than this, like protecting the os from the user process.
# This protection is provided by the hardware.
# We need to make sure each process has a separate memory space.
# This can be done by using base and limit register.
# The base register holds the smallest legal phy add. and the limit register holds size of the range.
# The hw protection is obtained by comparison bw these registers.
# If add beyond or below is issued a fatal error is a result of this.
# These registers can only be loaded by kernel.
# The os is only allowed to do such modifications.Thus allowing it dump the code in case of errors.
Address Binding
# The process that are waiting to be brought for the execution form the input queue.
# As the process executes it accesses the data and the instructions from the memory.
# After this its memory space becomes available.
# Many os allow process to reside any where in the memory.
# Add. in the source program are generally symbolic.
# The compiler binds these symbolic add to relocatable add.
Logical vs physical add.
# The add generated by the cpu is generally called the logical add.
# But the add in the memory is generally referred to as physical add.
# In the execution time the add can be referred to as logical add.
# The set of all logical add generated by the program is called the logical add space.
# The set of all physical add corresponding to these logical add is called physical add space.
# In the run time the logical to physical add is done by a hardware called MMU(memory management unit).
# The very basic example is of ms-dos which uses relocation register .
# In relocation register each add is added with the relocation value to form the phy add.
# The program never sees the real add. It can have a pointer pointing to 346 and can do what ver with it ie. add compare.