Basic Loader Functions

December 11, 2018 | Author: Surakshit Kumar | Category: N/A
Share Embed Donate


Short Description

System Software Basic Loader Functions...

Description

The basic functions of loaders 1. Loading – brings the object program into memory for execution 1. Bootstrapping a. Actions Actions taken taken when a compute computerr is first powered powered on on b. The hardware logic reads a program from address 0 of R! "Read nly !emory# 1. R! is instal installed led by the the manufac manufacturer turer $. R! contains bootstrapping program and some other routines routines that controls controls hardware "e.g. %&'# Bootstrapping is a loader $. Bootstrapping a. (oads (oads ' from disk disk into memory memory and makes makes it run run b. The location of ' on disk "or floppy# floppy# usually starts at the first sector sector c. 'tarting 'tarting address address in memory memory is is usually usually fixed fixed to 0 1. no need need of relo relocat cation ion d. This kind kind of of loader loader is simple simple 1. no relo reloca cati tion on $. no link linkin ing g ). called called *absol *absolute ute loader+ loader+

2. Relocation – modifies the object program so that it can be loaded at an address different from the location originally specified 1. Assembler review a. Assembler generates generates an object code assuming that that the program starts at memory memory address 0 b. (oader (oader decides decides the starting starting address address of a program program c. Assemble Assemblerr generates generates modificat modification ion record record $. Limits of modification record a. Reco Record rd for forma matt 1. "addre "address, ss, leng length# th# b. &t can be huge when direct direct addressing addressing is fre-uently fre-uently used used c. &f instruction format is fixed for absolute absolute addressing, addressing, the length length part can can be remoed remoed d. &nstead &nstead of address address field, field, bit/ector bit/ector can be used used 1. 1101100..... 1101100..... means means instruction 1 $  . .. need to be modified modified ). Hardware support for relocation a. %ase %ase reg regis iste terr 1. assembler and and loader loader do not not need to worry about relocation relocation

3. Linking – combines two or more separate object programs and also supplies the information needed to reference them. •

Background

a. A large problem is better broken into seeral seeral small pieces b. 2ach piece piece is better implemen implemented ted independ independently ently 1. assembled assembled "compile "compiled# d# independen independently tly c. There are many data data structures shared among among those pieces

1. ariables and procedures d. 'ome programs are used by many different programs 1. print"#, file operations, exp"#, sin"#, ... $. these are usually proided as library functions •

Requirements for linking

a. 2ach module defines 1. which symbols are used by other modules $. symbols undefined in a module are assumed to be defined in other modules 1. if these symbols are declared explicitly, it helps linker to resole •

rinciples



Assembler ealuates as much as possible



1. expressions &f some cannot be resoled, 1. proide the modification records

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF