Misplaced Pages

DOS/4G

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

DOS/4G is a 32-bit DOS extender developed by Rational Systems (later Tenberry Software ). It allows DOS programs to eliminate the 640 KB conventional memory limit by addressing up to 64 MB of extended memory on Intel 80386 and above machines.

#718281

25-455: Functioning as a highly flexible and reusable memory extension library, DOS/4G allowed programmers to access extended memory without writing specialized code. It embeds itself in the executable file at linking time and executes before main application code, so usually DOS/4G initialization messages show up at launch. It can in principle operate within MS-DOS , PC DOS , DR-DOS and other DOS clones,

50-515: A linker or link editor is a computer system program that takes one or more object files (generated by a compiler or an assembler ) and combines them into a single executable file, library file, or another "object" file. A simpler version that writes its output directly to memory is called the loader , though loading is typically considered a separate process. Computer programs typically are composed of several parts or modules; these parts/modules do not need to be contained within

75-431: A monolithic whole and the ability to better define the purpose and responsibilities of each individual piece, which is essential for managing complexity and increasing long-term maintainability in software architecture . Typically, an object file can contain three kinds of symbols: For most compilers, each object file is the result of compiling one input source code file. When a program comprises multiple object files,

100-427: A shared library , the entire library has to be loaded during runtime as it is not known which functions or methods will be called during runtime. Library linking may thus be an iterative process, with some referenced modules requiring additional modules to be linked, and so on. Libraries exist for diverse purposes, and one or more system libraries are usually linked in by default. The linker also takes care of arranging

125-401: A few routines from a library does not require the entire library to be installed. As the compiler has no information on the layout of objects in the final output, it cannot take advantage of shorter or more efficient instructions that place a requirement on the address of another object. For example, a jump instruction can reference an absolute address or an offset from the current location, and

150-405: A linker (assembling object files into a program) was called loading (as in loading executable code onto a file). Additionally, in some operating systems, the same program handles both the jobs of linking and loading a program ( dynamic linking ). Many operating system environments allow dynamic linking, deferring the resolution of some undefined symbols until a program is run. That means that

175-423: A patch utility which updated the game executable with a new version 1.97 to fix the incompatibility. In case of problems, DOS/4G or DOS/4GW can be replaced with the newer and free DOS/32 ; a patch utility can even replace DOS/4G code embedded inside a compiled executable file. This DOS software-related article is a stub . You can help Misplaced Pages by expanding it . Linker (computing) In computing ,

200-417: A single object file , and in such cases refer to each other using symbols as addresses into other modules, which are mapped into memory addresses when linked for execution. While the process of linking is meant to ultimately combine these independent parts, there are many good reasons to develop those separately at the source -level. Among these reasons are the ease of organizing several smaller pieces over

225-474: A software project. A linker script may be passed to GNU ld to exercise greater control over the linking process. The GNU linker is part of the GNU Binary Utilities (binutils). Two versions of ld are provided in binutils: the traditional GNU ld based on bfd , and a "streamlined" ELF-only version called gold . The command-line and linker script syntaxes of GNU ld is the de facto standard in much of

250-417: Is finally loaded into memory (just before execution). This pass is usually omitted on hardware offering virtual memory : every program is put into its own address space, so there is no conflict even if all programs load at the same base address. This pass may also be omitted if the executable is a position independent executable. On some Unix variants, such as SINTRAN III , the process performed by

275-468: Is in the form and format of 80-byte punched-card images, so that updates can be introduced into a system using that medium. In later releases of OS/360 and in subsequent systems, load-modules contain additional data about versions of components modules, to create a traceable record of updates. It also allows one to add, change, or remove an overlay structure from an already linked load module. The term "linkage editor" should not be construed as implying that

SECTION 10

#1732863222719

300-463: Is the result of the linker copying all library routines used in the program into the executable image. This may require more disk space and memory than dynamic linking, but is more portable, since it does not require the presence of the library on the system where it runs. Static linking also prevents "DLL hell", since each program includes exactly the versions of library routines that it requires, with no conflict with other programs. A program using just

325-506: The linker relaxation pass subsequently reassigns addresses, which may in turn allow more potential relaxations to occur. In general, the substituted sequences are shorter, which allows this process to always converge on the best solution given a fixed order of objects; if this is not the case, relaxations can conflict, and the linker needs to weigh the advantages of either option. While instruction relaxation typically occurs at link-time, inner-module relaxation can already take place as part of

350-446: The DOS boxes of OS/2 , Microsoft Windows , Windows NT and Windows 95 , and DOS emulators such as DOSBox . However, in practice few DOS/4G games or other applications will run on non-DOS-based versions of Windows , including Windows NT , Windows 2000 and Windows XP , since none of these allow direct access to the hardware as was used for display rendering in those days. DOS/4GW 1.95

375-423: The additional capability of allowing the addition, replacement, and/or deletion of individual program sections. Operating systems such as OS/360 have format for executable load-modules containing supplementary data about the component sections of a program, so that an individual program section can be replaced, and other parts of the program updated so that relocatable addresses and other references can be corrected by

400-449: The executable code still contains undefined symbols, plus a list of objects or libraries that will provide definitions for these. Loading the program will load these objects/libraries as well, and perform a final linking. This approach offers two advantages: There are also disadvantages: Contained or virtual environments may further allow system administrators to mitigate or trade-off these individual pros and cons. Static linking

425-427: The linkage editor, as part of the process. One advantage of this is that it allows a program to be maintained without having to keep all of the intermediate object files, or without having to re-compile program sections that haven't changed. It also permits program updates to be distributed in the form of small files (originally card decks ), containing only the object module to be replaced. In such systems, object code

450-430: The linker combines these files into a unified executable program, resolving the symbols as it goes along. Linkers can take objects from a collection called a library or runtime library . Most linkers do not include all the object files in a static library in the output executable; they include only those object files from the library that are referenced by other object files or libraries directly or indirectly. But for

475-543: The linker is known as "ld". Origins of the name "ld" are "LoaDer" and "Link eDitor". The term "loader" was used to describe the process of loading external symbols from other programs during the process of linking. The GNU linker (or GNU ld) is the GNU Project 's free software implementation of the Unix command ld. GNU ld runs the linker, which creates an executable file (or a library) from object files created during compilation of

500-420: The objects in a program's address space . This may involve relocating code that assumes a specific base address into another base. Since a compiler seldom knows where an object will reside, it often assumes a fixed base location (for example, zero ). Relocating machine code may involve re-targeting absolute jumps, loads, and stores. The executable output by the linker may need another relocation pass when it

525-526: The offset could be expressed with different lengths depending on the distance to the target. By first generating the most conservative instruction (usually the largest relative or absolute variant, depending on platform) and adding relaxation hints , it is possible to substitute shorter or more efficient instructions during the final link. In regard to jump optimizations this is also called automatic jump-sizing . This step can be performed only after all input objects have been read and assigned temporary addresses;

SECTION 20

#1732863222719

550-407: The optimizing process at compile-time . In some cases, relaxation can also occur at load-time as part of the relocation process or combined with dynamic dead-code elimination techniques. In IBM System/360 mainframe environments such as OS/360 , including z/OS for the z/Architecture mainframes, this type of program is known as a linkage editor . As the name implies a linkage editor has

575-414: The program operates in a user-interactive mode like a text editor. It is intended for batch-mode execution, with the editing commands being supplied by the user in sequentially organized files, such as punched cards , DASD , or magnetic tape . Linkage editing ( IBM nomenclature) or consolidation or collection ( ICL nomenclature) refers to the linkage editor's or consolidator's act of combining

600-609: The various pieces into a relocatable binary, whereas the loading and relocation into an absolute binary at the target address is normally considered a separate step. In the beginning linkers gave users very limited control over the arrangement of generated output object files. As the target systems became complex with different memory requirements such as embedded systems, it became necessary to give users control to generate output object files with their specific requirements such as defining base addresses' of segments. Linkers control scripts were used for this. On Unix and Unix-like systems,

625-511: Was a free limited edition of DOS/4G and was included with the Watcom C compiler with a commercial re-distribution license. It was made widely popular by computer games like Doom or Tomb Raider . Initial versions of DOS/4G had trouble with secondary DMA channels on the ISA bus , which prevented 16-bit devices like Gravis Ultrasound series from normally functioning; Gravis even had to develop PREPGAME,

#718281