SlideShare a Scribd company logo
Linking In MS-DOS
Shubham Shah
Yashashwi Mahindrakar
Sagar Nadgauda
Linking In MS Dos System
 First of All lets see what is linking…
 Linking is the Process of collecting and combining various pieces of code
and data into single fie.
 Thus this file can be Loaded (Copied) into Main MEMORY and executed.
 Linking can be performed at compile time, when the source code is
translated into machine code, at load time, when the program is loaded
into memory and executed by the loader, and even at run time, by
application programs.
Linkers Intro.
 On early computer systems, linking was performed manually.
 On modern systems, linking is performed automatically by programs called
linkers.
 Linkers play a crucial role in software development because they enable
separate compilation.
 Instead of organizing a large application as one monolithic source file, we
can decompose it into smaller, more manageable modules that can be
modified and compiled separately.
 When we change one of these modules, we simply recompile it and relink
the application, without having to recompile the other files
Understanding Linkers will do???
 Understanding linkers will help you build large programs. Programmers
who build large programs often encounter linker errors caused by
missing modules, missing libraries, or incompatible library versions. Unless
you understand how a linker resolves references, what a library is, and
how a linker uses a library to resolve references, these kinds of errors will
be baffling and frustrating.
 Understanding linkers will help you avoid dangerous programming
errors. The decisions that Unix linkers make when they resolve symbol
references can silently affect the correctness of your programs.
Programs that incorrectly define multiple global variables pass through
the linker without any warnings in the default case. The resulting
programs can exhibit baffling run-time behavior and are extremely
difficult to debug.
 Understanding linking will help you understand other important systems
concepts. The executable object files produced by linkers play key
roles in important systems functions such as loading and running
programs, virtual memory., paging, and memory mapping.
 Understanding linking will enable you to exploit shared libraries. For
many years, linking was considered to be fairly straightforward and
uninteresting. However, with the increased importance of shared
libraries and dynamic linking in modern operating systems, linking is
a sophisticated process that provides the knowledgeable
programmer with significant power. For example, many software
products use shared libraries to upgrade shrink-wrapped binaries at
run time. Also, most Web servers rely on dynamic linking of shared
libraries to serve dynamic content.
===== LinKing =====
 The Linker Diagram:-
More about Linking
 Static Linking
 all code modules are copied into a single executable file
the same shared module may exist in many files
 a location in this file implies the location in the memory image
 target address for cross-module reference can be determined before
run time
 Dynamic Linking
 needs help from OS ( that means the scheme varies depending on OS)
 library modules are usually linked dynamically
 inserts symbolic references in the executable file
 these symbols are resolved at run time
Object Model Format
 The Object Module of MS DOS differs from the intel specification in
some respects .We also make some simplification for the purpose of this
discussion. Details of the object module are as follows:
 “An Object module is a sequence of object records.”
 There are 14 types of object records, in which they contain 5 kinds of
information :-
 Binary Image , i.e the code and data generated by translator.
 External references.
 Public Definitions
 Debugging information such as line number in the source program.
 Miscellaneous information such as comments in the source program.
Object Records Of Intel 8088
Record Type Id(Hex) Description
THREADR 80 Translator header record
LNAMES 96 List of names record
SEGDEF 99 Segment definition record
EXTDEF 8C External names definition
PUBDEF 91 Public names definition record
LEDATA A1 Enumerated data(Binary Image)
LIDATA A3 Repeated data(binary Image)
FIXUPP 9D Fix up (i.e. relocation) record
MODEND 8B Module end record
Sample MS DOS assembly language
program
Sr.no Statement Offset
0001 NAME FIRST
0002 COMPUTE SEGMENT
0003 EXTERN
PHI:BYTE,PSI:WORD
0004 PUBLI APLHA, BETA
0007 ALPHA . . . . . . . 0015
. . .
. . .
. . .
0012 MOV AX, SEG PHI 0028
. . .
. . .
. . .
0029 BETA .. . . . . . . . . 0084
0036 COMPUTE ENDS
Design of Linker
 For linking in MS Dos system we will design a program named LINKER which
performs both linking and relocation of absolute segments and of re
locatable segments that cannot be combined with other re
locatable segments.
 Its output is a binary program which resembles a program with .COM
extension in MS DOS.
 This program is not relocated by the loader prior the execution .
 (Note:- the difference between the LINKER and the LINK program of MS DOS
:LINK produces a program with .EXE extension, which is relocated by the
loader prior to execution)
Specification
 The LINKER invocation command has the following format:
 LINKER <object module names> ,<executable file>,
<load origin>, <list of library files>
 The linker performs relocation and linking of all named object modules to
produce a binary program with the specified load origin.
 The program is stored in the file with the name <executable file>.If the
LINKER comes across an external symbol that is not defined in any of the
object modules named in th LINKER command, it locates ian object
module in one of the library files included in <list of library files>that contains
a public definitions.
 This method of resolving an external reference by automatically including
an object module form a library file is called “AUTOLINKING”.
Datastructures.
 Here the linker program has two pass organization .
 In first pass object modules are processed to collect information concering
segments and public definations into name table(NTAB)
 The second pass performs relocation and linking to produce a binary
program.
General Shortcut to remember of ms
dos linking
 pass 1:
allocates segments defined in SEGDEF
resolve external symbols
 pass 2:
prepare memory image
if needed, disk space is also used
expand LIDATA
relocations within segment
write .EXE file
General Difference between linux and
ms dos linker
 Linux linker GOT(Global Offset table ) & lazy modeling.
 Where as the ms dos linker does pass 1 & pass2 linking wise
Thank you
 Any questions

More Related Content

What's hot

Single Pass Assembler
Single Pass AssemblerSingle Pass Assembler
Single Pass Assembler
Satyamevjayte Haxor
 
Single pass assembler
Single pass assemblerSingle pass assembler
Single pass assembler
Bansari Shah
 
Language processing activity
Language processing activityLanguage processing activity
Language processing activity
Dhruv Sabalpara
 
MACRO PROCESSOR
MACRO PROCESSORMACRO PROCESSOR
MACRO PROCESSOR
Bhavik Vashi
 
Fundamentals of Language Processing
Fundamentals of Language ProcessingFundamentals of Language Processing
Fundamentals of Language Processing
Hemant Sharma
 
Introduction to systems programming
Introduction to systems programmingIntroduction to systems programming
Introduction to systems programming
Mukesh Tekwani
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1Manoj Patil
 
Two pass Assembler
Two pass AssemblerTwo pass Assembler
Two pass Assembler
Satyamevjayte Haxor
 
System Programming Unit II
System Programming Unit IISystem Programming Unit II
System Programming Unit IIManoj Patil
 
Linker and Loader
Linker and Loader Linker and Loader
Linker and Loader
sonalikharade3
 
Design of a two pass assembler
Design of a two pass assemblerDesign of a two pass assembler
Design of a two pass assembler
Dhananjaysinh Jhala
 
Compiler Design Basics
Compiler Design BasicsCompiler Design Basics
Compiler Design Basics
Akhil Kaushik
 
Compiler design
Compiler designCompiler design
Compiler design
Thakur Ganeshsingh Thakur
 
Macro-processor
Macro-processorMacro-processor
Macro-processor
Temesgen Molla
 
loaders and linkers
 loaders and linkers loaders and linkers
loaders and linkers
Temesgen Molla
 
Unit 2
Unit 2Unit 2
Unit 2
pm_ghate
 
Compiler Chapter 1
Compiler Chapter 1Compiler Chapter 1
Compiler Chapter 1
Huawei Technologies
 
Unit 3 sp assembler
Unit 3 sp assemblerUnit 3 sp assembler
Unit 3 sp assembler
Deepmala Sharma
 
Assemblers: Ch03
Assemblers: Ch03Assemblers: Ch03
Assemblers: Ch03
desta_gebre
 

What's hot (20)

Single Pass Assembler
Single Pass AssemblerSingle Pass Assembler
Single Pass Assembler
 
Single pass assembler
Single pass assemblerSingle pass assembler
Single pass assembler
 
Language processing activity
Language processing activityLanguage processing activity
Language processing activity
 
MACRO PROCESSOR
MACRO PROCESSORMACRO PROCESSOR
MACRO PROCESSOR
 
Fundamentals of Language Processing
Fundamentals of Language ProcessingFundamentals of Language Processing
Fundamentals of Language Processing
 
Introduction to systems programming
Introduction to systems programmingIntroduction to systems programming
Introduction to systems programming
 
Pass 1 flowchart
Pass 1 flowchartPass 1 flowchart
Pass 1 flowchart
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1
 
Two pass Assembler
Two pass AssemblerTwo pass Assembler
Two pass Assembler
 
System Programming Unit II
System Programming Unit IISystem Programming Unit II
System Programming Unit II
 
Linker and Loader
Linker and Loader Linker and Loader
Linker and Loader
 
Design of a two pass assembler
Design of a two pass assemblerDesign of a two pass assembler
Design of a two pass assembler
 
Compiler Design Basics
Compiler Design BasicsCompiler Design Basics
Compiler Design Basics
 
Compiler design
Compiler designCompiler design
Compiler design
 
Macro-processor
Macro-processorMacro-processor
Macro-processor
 
loaders and linkers
 loaders and linkers loaders and linkers
loaders and linkers
 
Unit 2
Unit 2Unit 2
Unit 2
 
Compiler Chapter 1
Compiler Chapter 1Compiler Chapter 1
Compiler Chapter 1
 
Unit 3 sp assembler
Unit 3 sp assemblerUnit 3 sp assembler
Unit 3 sp assembler
 
Assemblers: Ch03
Assemblers: Ch03Assemblers: Ch03
Assemblers: Ch03
 

Viewers also liked

MASM -UNIT-III
MASM -UNIT-IIIMASM -UNIT-III
MASM -UNIT-III
Dr.YNM
 
Introduction to loaders
Introduction to loadersIntroduction to loaders
Introduction to loadersTech_MX
 
UNIX introduction
UNIX introductionUNIX introduction
UNIX introduction
MUFIX Community
 
Lecture11 syntax analysis_7
Lecture11 syntax analysis_7Lecture11 syntax analysis_7
Lecture11 syntax analysis_7
Mahesh Kumar Chelimilla
 
C LANGUAGE - BESTECH SOLUTIONS
C LANGUAGE - BESTECH SOLUTIONSC LANGUAGE - BESTECH SOLUTIONS
C LANGUAGE - BESTECH SOLUTIONS
BESTECH SOLUTIONS
 
Unix Introduction
Unix IntroductionUnix Introduction
Unix Introduction
Ananthi
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
Rutvik Pensionwar
 
Loader
LoaderLoader
Structure of c_program_to_input_output
Structure of c_program_to_input_outputStructure of c_program_to_input_output
Structure of c_program_to_input_output
Anil Dutt
 
Inline functions & macros
Inline functions & macrosInline functions & macros
Inline functions & macros
Anand Kumar
 
Solaris basics
Solaris basicsSolaris basics
Solaris basics
Ashwin Pawar
 
C material
C materialC material
C material
tarique472
 
Direct linking loaders
Direct linking loadersDirect linking loaders
Direct linking loaders
Satyamevjayte Haxor
 
Linkers And Loaders
Linkers And LoadersLinkers And Loaders
Linkers And Loaders
Satpal Parmar
 
System software
System softwareSystem software
System software
Senthil Kanth
 
SYSTEM SOFTWARE
SYSTEM SOFTWARESYSTEM SOFTWARE
SYSTEM SOFTWAREKak Yong
 
Direct linking loader
Direct linking loaderDirect linking loader
Direct linking loaderbabyparul
 
Overview of c language
Overview of c languageOverview of c language
Overview of c languageshalini392
 

Viewers also liked (20)

Linkers
LinkersLinkers
Linkers
 
MASM -UNIT-III
MASM -UNIT-IIIMASM -UNIT-III
MASM -UNIT-III
 
Introduction to loaders
Introduction to loadersIntroduction to loaders
Introduction to loaders
 
UNIX introduction
UNIX introductionUNIX introduction
UNIX introduction
 
Lecture11 syntax analysis_7
Lecture11 syntax analysis_7Lecture11 syntax analysis_7
Lecture11 syntax analysis_7
 
C LANGUAGE - BESTECH SOLUTIONS
C LANGUAGE - BESTECH SOLUTIONSC LANGUAGE - BESTECH SOLUTIONS
C LANGUAGE - BESTECH SOLUTIONS
 
Unix Introduction
Unix IntroductionUnix Introduction
Unix Introduction
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
 
Loader
LoaderLoader
Loader
 
Structure of c_program_to_input_output
Structure of c_program_to_input_outputStructure of c_program_to_input_output
Structure of c_program_to_input_output
 
Structure of a C program
Structure of a C programStructure of a C program
Structure of a C program
 
Inline functions & macros
Inline functions & macrosInline functions & macros
Inline functions & macros
 
Solaris basics
Solaris basicsSolaris basics
Solaris basics
 
C material
C materialC material
C material
 
Direct linking loaders
Direct linking loadersDirect linking loaders
Direct linking loaders
 
Linkers And Loaders
Linkers And LoadersLinkers And Loaders
Linkers And Loaders
 
System software
System softwareSystem software
System software
 
SYSTEM SOFTWARE
SYSTEM SOFTWARESYSTEM SOFTWARE
SYSTEM SOFTWARE
 
Direct linking loader
Direct linking loaderDirect linking loader
Direct linking loader
 
Overview of c language
Overview of c languageOverview of c language
Overview of c language
 

Similar to Linking in MS-Dos System

Loaders and Linkers
Loaders and LinkersLoaders and Linkers
Loaders and Linkers
kunj desai
 
Linkers in compiler
Linkers in compilerLinkers in compiler
Linkers in compiler
Asaad Al-nour
 
Hm system programming class 1
Hm system programming class 1Hm system programming class 1
Hm system programming class 1
Hitesh Mohapatra
 
DLL Tutor maXbox starter28
DLL Tutor maXbox starter28DLL Tutor maXbox starter28
DLL Tutor maXbox starter28
Max Kleiner
 
Linkers
LinkersLinkers
Linkers
Rahul Dhiman
 
An isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra dasAn isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra das
Vikash Chandra Das
 
Automatic answer checker
Automatic answer checkerAutomatic answer checker
Automatic answer checker
Yesu Raj
 
Revers engineering
Revers engineeringRevers engineering
Revers engineering
AbdusSalam ALJBRI
 
Nt1310 Unit 3 Language Analysis
Nt1310 Unit 3 Language AnalysisNt1310 Unit 3 Language Analysis
Nt1310 Unit 3 Language Analysis
Nicole Gomez
 
Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008
guestd9065
 
.Net framework interview questions
.Net framework interview questions.Net framework interview questions
.Net framework interview questionsMir Majid
 
Address Binding Scheme
Address Binding SchemeAddress Binding Scheme
Address Binding Scheme
Rajesh Piryani
 
C++ shared libraries and loading
C++ shared libraries and loadingC++ shared libraries and loading
C++ shared libraries and loading
Rahul Jamwal
 
Aspect Oriented Programming Through C#.NET
Aspect Oriented Programming Through C#.NETAspect Oriented Programming Through C#.NET
Aspect Oriented Programming Through C#.NET
Waqas Tariq
 
Interview Question of Aspdotnet
Interview Question of AspdotnetInterview Question of Aspdotnet
Interview Question of Aspdotnet
MohitKumar1985
 
Module-4 Program Design and Anyalysis.pdf
Module-4 Program Design and Anyalysis.pdfModule-4 Program Design and Anyalysis.pdf
Module-4 Program Design and Anyalysis.pdf
Sitamarhi Institute of Technology
 

Similar to Linking in MS-Dos System (20)

Loaders and Linkers
Loaders and LinkersLoaders and Linkers
Loaders and Linkers
 
Linkers in compiler
Linkers in compilerLinkers in compiler
Linkers in compiler
 
Hm system programming class 1
Hm system programming class 1Hm system programming class 1
Hm system programming class 1
 
DLL Tutor maXbox starter28
DLL Tutor maXbox starter28DLL Tutor maXbox starter28
DLL Tutor maXbox starter28
 
Linkers
LinkersLinkers
Linkers
 
An isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra dasAn isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra das
 
Linkers
LinkersLinkers
Linkers
 
Automatic answer checker
Automatic answer checkerAutomatic answer checker
Automatic answer checker
 
Revers engineering
Revers engineeringRevers engineering
Revers engineering
 
Project seminar
Project seminarProject seminar
Project seminar
 
Nt1310 Unit 3 Language Analysis
Nt1310 Unit 3 Language AnalysisNt1310 Unit 3 Language Analysis
Nt1310 Unit 3 Language Analysis
 
Microsoft data access components
Microsoft data access componentsMicrosoft data access components
Microsoft data access components
 
Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008
 
.Net framework interview questions
.Net framework interview questions.Net framework interview questions
.Net framework interview questions
 
dot NET Framework
dot NET Frameworkdot NET Framework
dot NET Framework
 
Address Binding Scheme
Address Binding SchemeAddress Binding Scheme
Address Binding Scheme
 
C++ shared libraries and loading
C++ shared libraries and loadingC++ shared libraries and loading
C++ shared libraries and loading
 
Aspect Oriented Programming Through C#.NET
Aspect Oriented Programming Through C#.NETAspect Oriented Programming Through C#.NET
Aspect Oriented Programming Through C#.NET
 
Interview Question of Aspdotnet
Interview Question of AspdotnetInterview Question of Aspdotnet
Interview Question of Aspdotnet
 
Module-4 Program Design and Anyalysis.pdf
Module-4 Program Design and Anyalysis.pdfModule-4 Program Design and Anyalysis.pdf
Module-4 Program Design and Anyalysis.pdf
 

More from Satyamevjayte Haxor

Processes and threads
Processes and threadsProcesses and threads
Processes and threads
Satyamevjayte Haxor
 
Patterns
PatternsPatterns
Uml class Diagram
Uml class DiagramUml class Diagram
Uml class Diagram
Satyamevjayte Haxor
 
Uml Common Mechanism
Uml Common MechanismUml Common Mechanism
Uml Common Mechanism
Satyamevjayte Haxor
 
Types and roles
Types and rolesTypes and roles
Types and roles
Satyamevjayte Haxor
 
States machine
States machineStates machine
States machine
Satyamevjayte Haxor
 
What is symbol table?
What is symbol table?What is symbol table?
What is symbol table?
Satyamevjayte Haxor
 
Lexical
LexicalLexical
Linker
LinkerLinker
sCode optimization
sCode optimizationsCode optimization
sCode optimization
Satyamevjayte Haxor
 
Nested micro
Nested microNested micro
Nested micro
Satyamevjayte Haxor
 
Multiplier control unit
Multiplier control unitMultiplier control unit
Multiplier control unit
Satyamevjayte Haxor
 
Control unit design
Control unit designControl unit design
Control unit design
Satyamevjayte Haxor
 
Compilers
CompilersCompilers
Keyword Presentation
Keyword PresentationKeyword Presentation
Keyword Presentation
Satyamevjayte Haxor
 

More from Satyamevjayte Haxor (15)

Processes and threads
Processes and threadsProcesses and threads
Processes and threads
 
Patterns
PatternsPatterns
Patterns
 
Uml class Diagram
Uml class DiagramUml class Diagram
Uml class Diagram
 
Uml Common Mechanism
Uml Common MechanismUml Common Mechanism
Uml Common Mechanism
 
Types and roles
Types and rolesTypes and roles
Types and roles
 
States machine
States machineStates machine
States machine
 
What is symbol table?
What is symbol table?What is symbol table?
What is symbol table?
 
Lexical
LexicalLexical
Lexical
 
Linker
LinkerLinker
Linker
 
sCode optimization
sCode optimizationsCode optimization
sCode optimization
 
Nested micro
Nested microNested micro
Nested micro
 
Multiplier control unit
Multiplier control unitMultiplier control unit
Multiplier control unit
 
Control unit design
Control unit designControl unit design
Control unit design
 
Compilers
CompilersCompilers
Compilers
 
Keyword Presentation
Keyword PresentationKeyword Presentation
Keyword Presentation
 

Recently uploaded

Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
KrzysztofKkol1
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
Jelle | Nordend
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
XfilesPro
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
Sharepoint Designs
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
NaapbooksPrivateLimi
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
ayushiqss
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 

Recently uploaded (20)

Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 

Linking in MS-Dos System

  • 1. Linking In MS-DOS Shubham Shah Yashashwi Mahindrakar Sagar Nadgauda
  • 2. Linking In MS Dos System  First of All lets see what is linking…  Linking is the Process of collecting and combining various pieces of code and data into single fie.  Thus this file can be Loaded (Copied) into Main MEMORY and executed.  Linking can be performed at compile time, when the source code is translated into machine code, at load time, when the program is loaded into memory and executed by the loader, and even at run time, by application programs.
  • 3. Linkers Intro.  On early computer systems, linking was performed manually.  On modern systems, linking is performed automatically by programs called linkers.  Linkers play a crucial role in software development because they enable separate compilation.  Instead of organizing a large application as one monolithic source file, we can decompose it into smaller, more manageable modules that can be modified and compiled separately.  When we change one of these modules, we simply recompile it and relink the application, without having to recompile the other files
  • 4. Understanding Linkers will do???  Understanding linkers will help you build large programs. Programmers who build large programs often encounter linker errors caused by missing modules, missing libraries, or incompatible library versions. Unless you understand how a linker resolves references, what a library is, and how a linker uses a library to resolve references, these kinds of errors will be baffling and frustrating.  Understanding linkers will help you avoid dangerous programming errors. The decisions that Unix linkers make when they resolve symbol references can silently affect the correctness of your programs. Programs that incorrectly define multiple global variables pass through the linker without any warnings in the default case. The resulting programs can exhibit baffling run-time behavior and are extremely difficult to debug.
  • 5.  Understanding linking will help you understand other important systems concepts. The executable object files produced by linkers play key roles in important systems functions such as loading and running programs, virtual memory., paging, and memory mapping.  Understanding linking will enable you to exploit shared libraries. For many years, linking was considered to be fairly straightforward and uninteresting. However, with the increased importance of shared libraries and dynamic linking in modern operating systems, linking is a sophisticated process that provides the knowledgeable programmer with significant power. For example, many software products use shared libraries to upgrade shrink-wrapped binaries at run time. Also, most Web servers rely on dynamic linking of shared libraries to serve dynamic content.
  • 6. ===== LinKing =====  The Linker Diagram:-
  • 7. More about Linking  Static Linking  all code modules are copied into a single executable file the same shared module may exist in many files  a location in this file implies the location in the memory image  target address for cross-module reference can be determined before run time  Dynamic Linking  needs help from OS ( that means the scheme varies depending on OS)  library modules are usually linked dynamically  inserts symbolic references in the executable file  these symbols are resolved at run time
  • 8. Object Model Format  The Object Module of MS DOS differs from the intel specification in some respects .We also make some simplification for the purpose of this discussion. Details of the object module are as follows:  “An Object module is a sequence of object records.”  There are 14 types of object records, in which they contain 5 kinds of information :-  Binary Image , i.e the code and data generated by translator.  External references.  Public Definitions  Debugging information such as line number in the source program.  Miscellaneous information such as comments in the source program.
  • 9. Object Records Of Intel 8088 Record Type Id(Hex) Description THREADR 80 Translator header record LNAMES 96 List of names record SEGDEF 99 Segment definition record EXTDEF 8C External names definition PUBDEF 91 Public names definition record LEDATA A1 Enumerated data(Binary Image) LIDATA A3 Repeated data(binary Image) FIXUPP 9D Fix up (i.e. relocation) record MODEND 8B Module end record
  • 10. Sample MS DOS assembly language program Sr.no Statement Offset 0001 NAME FIRST 0002 COMPUTE SEGMENT 0003 EXTERN PHI:BYTE,PSI:WORD 0004 PUBLI APLHA, BETA 0007 ALPHA . . . . . . . 0015 . . . . . . . . . 0012 MOV AX, SEG PHI 0028 . . . . . . . . . 0029 BETA .. . . . . . . . . 0084 0036 COMPUTE ENDS
  • 11. Design of Linker  For linking in MS Dos system we will design a program named LINKER which performs both linking and relocation of absolute segments and of re locatable segments that cannot be combined with other re locatable segments.  Its output is a binary program which resembles a program with .COM extension in MS DOS.  This program is not relocated by the loader prior the execution .  (Note:- the difference between the LINKER and the LINK program of MS DOS :LINK produces a program with .EXE extension, which is relocated by the loader prior to execution)
  • 12. Specification  The LINKER invocation command has the following format:  LINKER <object module names> ,<executable file>, <load origin>, <list of library files>  The linker performs relocation and linking of all named object modules to produce a binary program with the specified load origin.  The program is stored in the file with the name <executable file>.If the LINKER comes across an external symbol that is not defined in any of the object modules named in th LINKER command, it locates ian object module in one of the library files included in <list of library files>that contains a public definitions.  This method of resolving an external reference by automatically including an object module form a library file is called “AUTOLINKING”.
  • 13. Datastructures.  Here the linker program has two pass organization .  In first pass object modules are processed to collect information concering segments and public definations into name table(NTAB)  The second pass performs relocation and linking to produce a binary program.
  • 14. General Shortcut to remember of ms dos linking  pass 1: allocates segments defined in SEGDEF resolve external symbols  pass 2: prepare memory image if needed, disk space is also used expand LIDATA relocations within segment write .EXE file
  • 15. General Difference between linux and ms dos linker  Linux linker GOT(Global Offset table ) & lazy modeling.  Where as the ms dos linker does pass 1 & pass2 linking wise
  • 16. Thank you  Any questions

Editor's Notes

  1. Differnce between ms dos linker and linux linker