A comupter uses two types of memory: Main Memory and Secondary Memory.

Main Memory temporarily stores data and instructions to be executed by the comupter.

The CPU retrives the instructions from main memory and execute them.

As main memory is usually too small to accomodate all the data and programs, the information is stored in various secondary storage devices such as magnetic disks and magnetic tapes in form of files.

The part of operating system that manages the memory is called Memory Manager.

Memory management is the functionality of an operating system which handles primary memory.

Memory management keeps track of each and every memory location either it is allocated to some process or it is free.

It checks how much memory is to be allocated to processes.

It decides which process will get memory at what time.

It tracks whenever some memory gets freed or unallocated and correspondingly it updates the status.

Memory management provides protection by using two registers, a base register and a limit register.

The base register holds the smallest legal physical memory address and the limit register specifies the size of the range.

For example, if the base register holds 300000 and the limit register is 1209000, then the program can legally access all addresses from 300000 through 411999.

Instructions and data to memory addresses can be done in following ways

Compile time: When it is known at compile time where the process will reside, compile time binding is used to generate the absolute code.

Load time: When it is not known at compile time where the process will reside in memory, then the compiler generates re-locatable code.

Execution time: If the process can be moved during its execution from one memory segment to another, then binding must be delayed to be done at run time

Address Binding:

Assigning an address to an instruction is known as Address Binding.

Thus address Binding is a process of generating memory addresses where instructions and data of a program are to be stored.

The programs are usually stored in any secondary storage device. When a program is run, the computer reads the instruction and loads them in the ready queue.

The Operating System then selects a process from the ready queue and executes it.

Address binding is the process of mapping the program's logical addresses to corresponding physical addresses.

In other words, a given logical address is mapped by the MMU (Memory Management Unit) to a physical address.

Address binding is part of computer memory management and it is performed by the operating system on behalf of the applications that need access to memory.                      

No comments