System Programming
System Programming
In this way, the loader is an essential part of an operating system that makes
sure programs are loaded, connected, and ready to run. Without a loader,
programs would not be able to execute properly on a computer.
Differentiate between Loaders and Linkers:
Loaders Linkers
1. Absolute Loader:
The simplest type of loader.
responsible for loading an executable file into memory at a predefined
address without any modification.
No relocation or linking is done.
Advantages:
Simple and fast since no address modification is needed.
4. Bootstrap Loader:
A special type of loader that loads the operating system (OS) into
memory when a computer starts.
Stored in ROM (Read-Only Memory) or firmware.
It initializes hardware components and loads the OS kernel into RAM.
Advantages:
Essential for starting the system.
Always available because it is stored in ROM.
5. Dynamic Linking Loader:
Loads and links programs dynamically at runtime.
Useful in shared libraries (DLLs in Windows, .so in Linux).
Saves memory by sharing common code among multiple processes.
Advantages:
Reduces memory consumption.
Allows updating libraries
Absolute Loader No No
Direct Linking
Yes Yes
Loader
Bootstrap Loader No No
Dynamic Linking
Yes Yes
Loader
In this way, the loader is an essential part of an operating system that makes
sure programs are loaded, connected, and ready to run. Without a loader,
programs would not be able to execute properly on a computer.
2. Text Records:
These contain the actual machine instructions and data that need to be
loaded into memory.
Each instruction is associated with a specific memory address.
Example: If a text record contains
Address: 1000 → Instruction: A0B5
Address: 1002 → Instruction: C3D4
The loader will place A0B5 at memory location 1000 and C3D4 at 1002.
3. End Record:
This marks the end of the program file.
It may also specify the starting address for execution.
Updated Memory
Instruction
Address
Now, the program can run correctly from 5000 without needing any changes to
the original code.
Start
|
V
Reads the object file’s record.
|
V
Allocate Memory.
|
V
Scans the definition records.
|
V
Build Symbol Table
|
V
Reads text records.
|
V
Applies changes using modification records.
|
V
Loads the modified program into memory.
|
V
Transfer Control to Program.
|
V
Execution Starts.
|
V
End.
2. Dynamic Linkage Editor: This type of linkage editor links some parts of the
program at runtime instead of during compilation. It loads external libraries
only when needed.
Advantages of Dynamic Linkage Editor:
✔ Reduces the size of the executable file.
✔ Makes it easy to update or modify libraries.
Example: Most modern applications, like web browsers, use dynamic linking to
load external resources only when required.
In this way, a Linkage Editor is an important system software component that
takes or processes object file modules and prepares them for execution.