Page 124 - DCAP507_SYSTEM_SOFTWARE
P. 124

System Software




                    Notes          8.2 Other Loader Schemes


                                   8.2.1 Binders
                                   The implementation of any program requires four basic functionalities and those are allotment,
                                   relocation, linking and loading. As we have also observed in direct linking loader for execution of
                                   any program each time these four functionalities need to be performed. But performing all these
                                   functionalities each time is time and space consuming task. Furthermore if the program contains
                                   many subroutines or functions and the program requires to be executed repeatedly then this
                                   activity turns out to be annoyingly complex. Each time for implementation of a program, the
                                   allocation, relocation linking and loading requires to be done. Now performing these activities
                                   each time augments the time and space complexity. In fact, there is no requirement to redo all
                                   these four activities each time. Rather, if the results of some of these activities are accumulated in
                                   a file then that file can be utilized by other activities. And doing allocation, relocation, linking and
                                   loading can be avoided each time. The idea is to separate out these activities in separate groups.
                                   Therefore dividing the essential four functions in groups decreases the overall time complexity of
                                   loading process. The program which performs allocation, relocation and linking is called binder.
                                   The binder performs relocation, generates linked executable text and accumulates this text in a file
                                   in some systematic manner. Such type of module organized by the binder execution is called load
                                   module. This load module can then be in fact loaded in the main memory by the loader. This
                                   loader is also recognized as module loader. If the binder can generate the exact replica of executable
                                   code in the load module then the module loader just loads this file into the main memory which
                                   eventually decreases the overall time complexity. But in this process the binder should knew the
                                   existing positions of the main memory. Although the binder knew the main memory locations
                                   this is not the only thing which is sufficient. In multiprogramming environment, the area of main
                                   memory obtainable for loading the program is determined by the host operating system. The
                                   binder should also know which memory area is allocated to the loading program and it should
                                   adjust the relocation information consequently. The binder which performs the linking function
                                   and generates adequate  information  concerning allocation  and relocation  and  writes  this
                                   information along with the program code in the file is known as linkage editor. The module
                                   loader then accepts this rile as input, reads the information accumulated in and depending on this
                                   information about allocation and relocation it performs the task of loading in the main memory.




                                     Notes  Although the program is repeatedly executed the linking is finished only once.
                                     Furthermore, the flexibility of allocation and relocation aids efficient utilization of the
                                     main memory.




                                      Task  Illustrate the function of binders.

                                   8.2.2 Linkers

                                   As we have discussed earlier, the execution of program can be performed with the assistance of
                                   following steps:
                                   1.  Translation of the program (carried out by assembler or compiler).

                                   2.  Linking of the program with all other programs which are required for execution. This
                                       also includes preparation of a program called load module.
                                   3.  Loading of the load module prepared by linker to some mentioned memory location.



          118                               LOVELY PROFESSIONAL UNIVERSITY
   119   120   121   122   123   124   125   126   127   128   129