Page 156 - DCAP103_Principle of operating system
P. 156

Unit 5: Memory Management



            Most systems allow a user process to reside in any part of the physical memory. Thus, although   Notes
            the address space of the computer starts at 00000, the first address of the user process does
            not need to be 00000. This arrangement affects the addresses that the user program can use. In
            most cases, a user program will go through several steps-some of which may be optional-before
            being executed. Addresses may be represented in different ways during these steps. Addresses
            in the source program are generally symbolic (such as count). A compiler will typically bind
            these symbolic addresses to relocatable addresses (such as “14 bytes from the beginning of this
            module”). The linkage editor or loader will in turn bind these relocatable addresses to absolute
            addresses  (such  as  74014).  Each  binding  is  a  mapping  from  one  address  space  to  another.
            Classically, the binding of instructions and data to memory addresses can be done at any step
            along the way:
               1.  Compile Time: If you know at compile time where the process will reside in memory,
                 then,

               2.  Absolute Code can be generated. For example, if you know a priori that a user process
                 resides starting at location R, then the generated compiler code will start at that location
                 and extend up from there. If, at some later time, the starting location changes, then it will
                 be necessary to recompile this code. The MS-DOS. COM-format programs are absolute
                 code bound at compile time.
              3.  Load Time: If it is not known at compile time where the process will reside in memory, then
                 the compiler must generate relocatable code. In this case, final binding is delayed until load

                             Figure 5.1: Multistep Processing of a user Program
















































                                             LOVELY PROFESSIONAL UNIVERSITY                                   149
   151   152   153   154   155   156   157   158   159   160   161