Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Blinker 5.10 Online Reference - <b> dos extenders</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DOS extenders
------------------------------------------------------------------------------
 The 80286 processor and above will run in real mode until otherwise
 instructed, and DOS itself is written in such a way that it can only run in
 real mode. The purpose of a DOS extender is to run the actual program in
 protected mode, giving it access to all the extra memory and features
 available, and then temporarily switch back to real mode whenever a DOS or
 BIOS service is required which cannot be fielded in protected mode.

 A DOS extender will typically have a real mode code portion loaded in DOS
 conventional memory and a protected mode code portion loaded in extended
 memory. The real mode portion will load and execute the user program, and
 will receive control any time a request for, or access to, a system resource
 is made by the program. The protected mode portion will usually contain
 replacement code for some of the services offered by DOS or the BIOS, so in
 many cases it will perform the function and then return to the user program
 without having to leave protected mode.

 If the request will require DOS or the BIOS to be activated, however, the
 DOS extender will save the current protected mode status of the processor,
 switch back to real mode and then invoke its real mode portion. This portion
 may then field the request itself or pass it on to DOS or BIOS in the normal
 way. Once the request has been processed, control returns to the real mode
 portion which will return to protected mode and the protected mode portion.
 This can now restore the protected mode status and continue execution of the
 user program.

 DOS extenders are able to use the specific features of the 80286 or the
 80386, and obviously require a minimum of the processor for which they have
 been written. In all cases, because the 80x86 processors are backwards
 compatible, the DOS extender will also run on any processor more advanced
 than the one for which it is written.

 80286 DOS extenders run in 16 bit protected mode, which provides access to
 up to 16 Mb of memory in 64 Kb segments. Because it is still managed in 64
 Kb segments, most high level language code will run in 16 bit protected mode
 with only minor modifications and incompatibilities. Typically a recompile
 and relink with some replacement .OBJ and .LIB files provided as part of the
 DOS extender will allow a program to be up and running in 16 bit protected
 mode, at which point the programmer can start to iron out any remaining
 incompatibilities.

 80386 DOS extenders run in 32 bit protected mode, which provides up to 4 Gb
 of memory in one or more segments, so most programs will treat the memory as
 a linear address space contained in one segment. Because the address space
 is linear and segments are not limited in size to 64 Kb, more major
 incompatibilities in existing programs will arise. In the case of high level
 languages, 32 bit versions of the compiler are usually necessary in order to
 make use of 32 bit protected mode, and these compilers will automatically
 prohibit most of the constructs which are not allowed when executing in
 protected mode.

 Windows 3.x enhanced mode and Windows 95/98 and NT native mode are actually
 this 32 bit protected mode. The DOS extender provided with Blinker will run
 on any processor from an 80286 processor with 2 Mb of memory up to the
 largest Pentium Pro.

 Because of the potential problems in a DOS environment of multiple programs
 wishing to switch back and forth into protected mode, particularly between
 EMS emulators and DOS extenders, two major programming interfaces were
 proposed to manage protected mode switching. The first of these was the
 Virtual Control Program Interface (VCPI) which is specific to 80386 and
 80486 processors, and the second and more general is DOS Protected Mode
 Interface (DPMI), which applies to the 80286 and above. Please refer to the
 section enitled `Further reading' in the online help for more details on
 these specifications and how to program to them.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson