home *** CD-ROM | disk | FTP | other *** search
- This file documents differences between the 3.0 version of 386|DOS-Extender
- (RUN386.EXE) and the third edition of the "386|DOS-Extender Reference Manual,"
- published in January 1991.
-
- New Switches
- ------------
-
- -DPMI[SIM] 0.9
- -DPMI[SIM] 1.0 Simulates running under either a version 0.9 or version 1.0
- DPMI host. It disables command line switches and system
- calls not supported under those versions of the DPMI
- interface, as documented in Appendix F of the reference
- manual.
-
- New System Calls
- ----------------
-
- INT 21h
- AX = 253Dh Read/Write IDT Descriptor
- In: BL = interrupt number
- ECX = 0, if reading descriptor contents
- 1, if writing descriptor contents
- DS:EDX = pointer to 8-byte buffer to hold descriptor
- Out: If success:
- Carry flag = clear
- If reading descriptor, buffer at DS:EDX filled in
- If failure:
- Carry flag = set
- EAX = error code
- = 130, if running under DPMI
-
- This system call is used to read and write hardware-level IDT descriptors
- directly, rather than reading and writing the internal 386|DOS-Extender
- "shadow" IDT (see section 6.2 of the reference manual).
-
- No checking of descriptor contents is done when writing the descriptor.
- Be sure to set the Descriptor Privilege Level (DPL) bits in the access
- rights byte of the descriptor equal to the Current Privilege Level (CPL),
- which can be obtained from the two LSBs of the CS register, or by making
- the Get Configuration Information system call (2526h).
-
- By installing handlers that are vectored to directly through the IDT, you
- can avoid the overhead of the 386|DOS-Extender "umbrella" interrupt
- handler that sets up the standard interrupt stack frame documented in
- section 6.5 of the manual.
-
- Normally, this call can only be used by programs that run at privilege level
- zero. The reason is the processor does not allow direct vectoring to
- a less privileged level when an interrupt occurs. However, direct vectoring
- is permissible if you know the interrupt can only occur while the application
- program is executing. An example of this is the INT 7, the Coprocessor Not
- Available exception that occurs when a 287/387 instruction is executed and
- the EM (emulate) bit of CR0 is set. 386|DOS-Extender never executes any
- coprocessor instructions in protected mode, so INT 7 is guaranteed to only
- occur when running at the application privilege level. Direct vectoring
- to an INT 7 handler can significantly enhance the performance of
- 387 emulation software.
-
- It is never possible to directly access the IDT under any DPMI host, so
- applications that use this call must be prepared for an error return if
- DPMI compatibility is desired.
-
- Modified System Calls
- ---------------------
-
- INT 21h
- AX = 2529h Load Flat Model .EXP or .REX File
- In: As documented in manual
- Out: As documented in manual
-
- An additional parameter is returned in the parameter block at ES:EBX.
- At offset 001Ch a flags doubleword is returned. Bit zero of the flags
- doubleword is set if the child was linked with the -UNPRIVILEGED switch,
- cleared if the child was linked with -PRIVILEGED. All other bits are
- reserved and are always cleared.
-
- STUB386 Stub Loader Utility Program
- -----------------------------------
-
- The STUB386.EXE stub loader program included on the distribution disks
- can be used to avoid having to type "run386" each time you run your
- application program.
-
- Bind the STUB386.EXE file to the application .EXP file to create an .EXE
- file that can be run by typing the file name, just like any other DOS
- program. This can be done with the MS-DOS COPY command. For example, to
- create a HELLO.EXE file by binding STUB386.EXE and HELLO.EXP:
-
- copy/b stub386.exe+hello.exp hello.exe
-
- 386|LINK can automatically bind STUB386 to create an .EXE output file
- if STUB386.EXE is given as one of the input object files in the link
- string. For example, to link HELLO.OBJ, and create an output .EXE file
- with the stub loader bound on the front:
-
- 386link hello stub386.exe
-
- An .EXE file with the stub loader bound into it can be run by typing
- the file name directly:
-
- hello
-
- If you need to specify 386|DOS-Extender switches for a program bound with
- the stub loader, you can configure them directly into the bound .EXE file
- with the CFIG386 utility program. For example, to limit the XMS memory
- usage of the bound program HELLO.EXE to one megabyte:
-
- cfig386 hello -maxxmsmem 100000h
-
- When you type the name of the .EXE file to run the program, DOS loads the
- stub loader bound to the front of the file. The stub loader searches the
- execution PATH for the RUN386.EXE file and loads it into memory. RUN386
- then loads the application program from the bound file. There is no extra
- memory consumed by the stub loader program; it is completely removed from
- memory after RUN386 is loaded. If you rename your RUN386.EXE file, you
- can specify the new name to the stub loader with the CFIG386 -DOSXNAME
- switch documented in section 1.8 of the CFIG386 Utility Guide.
-
- The stub loader cannot be used with 386|DOS-Extender versions prior to 3.0
- when bound to the application program as described above. However, it can
- be used with any 386|DOS-Extender version by copying it to a file
- with the same name as the application .EXP file, but with an .EXE filename
- extension. When used in this way, approximately 1500-2000
- bytes of conventional memory are consumed by the stub loader. The
- 386|ASM and 386|LINK programs are distributed in this fashion (as
- 386ASM.EXP and 386ASM.EXE, and 386LINK.EXP and 386LINK.EXE), for customers
- who want to use the 3.0 assembler and linker, and an older version
- of 386|DOS-Extender.
-
- New Example Code
- ----------------
-
- The EXAMPLES\LOADER directory on the distribution disks contains a program,
- LOAD.C, that demonstrates the use of the Load EXP File system call (2529h).
- It also includes a sample program (FARHELLO.ASM) that RETurns to the caller
- on completion rather than making a DOS program terminate call; this is
- required for programs loaded with the Load EXP File system call. The
- LOAD.EXP program takes the first argument on the command line as the name
- of a file to load and execute; to load and run FARHELLO.EXP, type:
-
- run386 load farhello.exp
-
- Miscellaneous Manual Changes and Errata
- ---------------------------------------
-
- Section 3.8 of the 386|DOS-Extender Reference Manual documents the amount
- of conventional memory needed to EXEC to a second copy of 386|DOS-Extender
- as 65K. That is actually the minimum required run-time memory for
- 386|DOS-Extender; 150K of conventional memory must be available for
- 386|DOS-Extender to load and initialize.
-