Loader- Machine Dependent Loader Features

Slides:



Advertisements
Similar presentations
Part IV: Memory Management
Advertisements

Loaders Dr. Monther Aldwairi 10/21/2007 Dr. Monther Aldwairi.
1 Loaders and Linkers Chapter 3 System Software An introduction to systems programming Leland L. Beck.
1 Loaders and Linkers Chapter 3 System Software An introduction to systems programming Leland L. Beck.
Chapter 3 Loaders and Linkers
Linkage Editors Difference between a linkage editor and a linking loader: Linking loader performs all linking and relocation operations, including automatic.
3. Loaders & Linkers1 Chapter III: Loaders and Linkers Chapter goal: r To realize how a source program be loaded into memory m Loading m Relocation m Linking.
Chapter 3 Loaders and Linkers
COP 3402 Systems Programming Dr. Ali Orooji School of EECS University of Central Florida.
Chapter 3 Loaders and Linkers. Purpose and Function Places object program in memory Linking – Combines 2 or more obj programs Relocation – Allows loading.
Loader. Role of Loader Source Program Translator Object Program Loader Object program ready for execution Memory Translator – Assembler/Compiler.
Loaders and Linkers CS 230 이준원. 2 Overview assembler –generates an object code in a predefined format »COFF (common object file format) »ELF (executable.
Machine Independent Assembler Features
Loaders and Linkers Object Program contains the information:
Chapter 3 System Software
Machine-Independent Loader Features
Chap 3 Loaders and Linkers. Object program contains translated instructions and data values from the source program. Loading, which brings the object.
CS2422 Assembly Language and System Programming Loader Department of Computer Science National Tsing Hua University.
1 Machine-Independent Features Automatic Library Search automatically incorporate routines from a subprogram library Loading Options.
Chapter 6: Machine dependent Assembler Features
CS2422 Assembly Language and System Programming Linking Loader Department of Computer Science National Tsing Hua University.
CS2422 Assembly Language & System Programming January 2, 2007.
Loader- Machine Independent Loader Features
Memory Management 1 CS502 Spring 2006 Memory Management CS-502 Spring 2006.
An introduction to systems programming
CS-3013 & CS-502, Summer 2006 Memory Management1 CS-3013 & CS-502 Summer 2006.
1 Chapter 3 Loaders and Linkers Source Program Assembler Object Code Loader Executable Code Linker.
CS2422 Assembly Language & System Programming December 26, 2006.
Machine-Independent Assembler Features
Assembler (Basic Functions)
Assembler – Machine Independent Features. Literals Design idea  Let programmers to be able to write the value of a constant operand as a part of the.
CS2422 Assembly Language & System Programming December 14, 2006.
MIPS coding. SPIM Some links can be found such as:
Assemblers.
Chapter 1 Computer architecture Languages: machine, assembly, high
Chapter 8 – Main Memory (Pgs ). Overview  Everything to do with memory is complicated by the fact that more than 1 program can be in memory.
PART I SISTEM UTILITIES LECTURE 4.1 LINK_LOAD Ştefan Stăncescu 1.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
1 Assemblers System Programming by Leland L. Beck Chapter 2.
Machine-Independent Assembler Features Literals, Symbol-Defining Statements, Expressions, Program Blocks, Control Sections and Program Linking.
2 : Assembler 1 Chapter II: Assembler Chapter goal: r Introduce the fundamental functions that any assembler must perform. m Assign machine address m Translate.
Chapter - 3 Loaders & Linkers. Overview of Chapter 3 Basic Loader Functions Design Issues of: An Absolute Loader Simple Bootstrap Loader Machine-Dependent.
G.Umamaheswari Lect/IT R.M.D.EC system software
Loader and Linker.
Linking Loader untuk SIC/XE Machine. Lebih Lanjut mengenai Absolute Loader Shortcoming of an absolute loader –Programmer needs to specify the actual address.
UNIT III LOADERS AND LINKERS. This Unit gives you… Basic Loader Functions Machine-Dependent Loader Features Machine-Independent Loader Feature Loader.
CC410: System Programming Dr. Manal Helal – Fall 2014 – Lecture 10 – Loaders.
Loaders and Linkers T 李俊葦. 1. Loader Accepts the object programs , prepares these programs for execution by the computer , and indicates the execution.
CC410: System Programming Dr. Manal Helal – Fall 2014 – Lecture 4 - Assembler 1.
CC410: System Programming Dr. Manal Helal – Fall 2014 – Lecture 10 –Linkers.
CC410: System Programming Dr. Manal Helal – Fall 2014 – Lecture 9 - Assembler 4.
Machine dependent Assembler Features
System Programming and administration
System Software by Leland L. Beck Chapter 2
Machine Independent Assembler Features
Assembler Design Options
Loaders and Linkers CSCI/CMPE 3334 David Egle.
Loaders and Linkers: Features
Machine Independent Features
Loaders and Linkers.
Optional Assembler Features 2
System Programming by Leland L. Beck Chapter 2
Machine Independent Assembler Features
Loaders and Linkers.
Chapter 1 Computer architecture Languages: machine, assembly, high
Machine Independent Assembler Features
An introduction to systems programming
UNIT III LOADERS AND LINKERS
Chapter 3 Loaders and Linkers
Presentation transcript:

Loader- Machine Dependent Loader Features

Relocating Loaders Motivation Two methods for specifying relocation Efficient sharing of the machine with larger memory and when several independent programs are to be run together Support the use of subroutine libraries efficiently Two methods for specifying relocation Modification record (Fig. 3.4, 3.5) Relocation bit (Fig. 3.6, 3.7) Each instruction is associated with one relocation bit These relocation bits in a Text record is gathered into bit masks

Modification Record For complex machines Also called RLD specification Relocation and Linkage Directory Modification record col 1: M col 2-7: relocation address col 8-9: length (halfbyte) col 10: flag (+/-) col 11-17: segment name

Fig. 3.4

Fig. 3.5

Relocation Bit For simple machines Relocation bit 0: No modification is necessary 1: Modification is needed Twelve-bit mask is used in each Text record Since each text record contains less than 12 words Unused words are set to 0 Any value that is to be modified during relocation must coincide with one of these 3-byte segments e.g. line 210 Text record col 1: T col 2-7: starting address col 8-9: length (byte) col 10-12: relocation bits col 13-72: object code

Fig. 3.6

Fig. 3.7

Program Linking Goal Example Resolve the problems with EXTREF and EXTDEF from different control sections (sec 2.3.5) Example Program in Fig. 3.8 and object code in Fig. 3.9 Use modification records for both relocation and linking Address constant External reference

Fig. 3.8-1

Fig. 3.9-1

Fig. 3.8-2

Fig. 3.9-2

Fig. 3.8-3

Fig. 3.9-3

Program Linking Example Fig. 3.10 Load address for control sections PROGA 004000 63 PROGB 004063 7F PROGC 0040E2 51 Load address for symbols LISTA: PROGA+0040=4040 LISTB: PROGB+0060=40C3 LISTC: PROGC+0030=4112 REF4 in PROGA ENDA-LISTA+LISTC=14+4112=4126 T0000540F000014FFFFF600003F000014FFFFC0 M00005406+LISTC

Fig. 3.10(a)

Fig. 3.10(b)

Algorithm and Data Structure Two Passes Logic Pass 1: Assign addresses to all external symbols Pass 2: Perform the actual loading, relocation, and linking ESTAB (external symbol table) + +

Pass 1 Program Logic Pass 1: Variables & Data structures Fig. 3.11(a) Assign addresses to all external symbols Variables & Data structures PROGADDR (program load address) from OS CSADDR (control section address) CSLTH (control section length) ESTAB Fig. 3.11(a) Process Define Record

Fig. 3.11(a)

Pass 2 Program Logic Pass 2: Modification record Perform the actual loading, relocation, and linking Modification record Lookup the symbol in ESTAB End record for a main program Transfer address Fig. 3.11(b) Process Text record and Modification record

Fig. 3.11(b)

Improve Efficiency Use local searching instead of multiple searches of ESTAB for the same symbol Assign a reference number to each external symbol The reference number is used in Modification records Implementation 01: Control section name Other: External reference symbols Example Fig. 3.12

Fig. 3.12 (1/3)

Fig. 3.12 (2/3)

Fig. 3.12 (3/3)