home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c220 / 7.ddi / DOCS / RUN386.DOC < prev   
Encoding:
Text File  |  1991-03-26  |  6.6 KB  |  151 lines

  1. This file documents differences between the 3.0 version of 386|DOS-Extender
  2. (RUN386.EXE) and the third edition of the "386|DOS-Extender Reference Manual,"
  3. published in January 1991.
  4.  
  5. New Switches
  6. ------------
  7.  
  8. -DPMI[SIM] 0.9
  9. -DPMI[SIM] 1.0    Simulates running under either a version 0.9 or version 1.0
  10.         DPMI host.  It disables command line switches and system
  11.         calls not supported under those versions of the DPMI 
  12.         interface, as documented in Appendix F of the reference
  13.         manual.  
  14.  
  15. New System Calls
  16. ----------------
  17.  
  18. INT 21h
  19. AX = 253Dh    Read/Write IDT Descriptor
  20. In:    BL = interrupt number
  21.     ECX = 0, if reading descriptor contents
  22.           1, if writing descriptor contents
  23.     DS:EDX = pointer to 8-byte buffer to hold descriptor
  24. Out:    If success:
  25.         Carry flag = clear
  26.         If reading descriptor, buffer at DS:EDX filled in
  27.     If failure:
  28.         Carry flag = set
  29.         EAX = error code
  30.             = 130, if running under DPMI
  31.  
  32. This system call is used to read and write hardware-level IDT descriptors
  33. directly, rather than reading and writing the internal 386|DOS-Extender
  34. "shadow" IDT (see section 6.2 of the reference manual).
  35.  
  36. No checking of descriptor contents is done when writing the descriptor.
  37. Be sure to set the Descriptor Privilege Level (DPL) bits in the access
  38. rights byte of the descriptor equal to the Current Privilege Level (CPL),
  39. which can be obtained from the two LSBs of the CS register, or by making
  40. the Get Configuration Information system call (2526h).
  41.  
  42. By installing handlers that are vectored to directly through the IDT, you
  43. can avoid the overhead of the 386|DOS-Extender "umbrella" interrupt
  44. handler that sets up the standard interrupt stack frame documented in
  45. section 6.5 of the manual.
  46.  
  47. Normally, this call can only be used by programs that run at privilege level
  48. zero.  The reason is the processor does not allow direct vectoring to
  49. a less privileged level when an interrupt occurs.  However, direct vectoring
  50. is permissible if you know the interrupt can only occur while the application
  51. program is executing.  An example of this is the INT 7, the Coprocessor Not
  52. Available exception that occurs when a 287/387 instruction is executed and
  53. the EM (emulate) bit of CR0 is set.  386|DOS-Extender never executes any
  54. coprocessor instructions in protected mode, so INT 7 is guaranteed to only
  55. occur when running at the application privilege level.  Direct vectoring
  56. to an INT 7 handler can significantly enhance the performance of
  57. 387 emulation software.
  58.  
  59. It is never possible to directly access the IDT under any DPMI host, so
  60. applications that use this call must be prepared for an error return if
  61. DPMI compatibility is desired.
  62.  
  63. Modified System Calls
  64. ---------------------
  65.  
  66. INT 21h
  67. AX = 2529h    Load Flat Model .EXP or .REX File
  68. In:    As documented in manual
  69. Out:    As documented in manual
  70.  
  71. An additional parameter is returned in the parameter block at ES:EBX.
  72. At offset 001Ch a flags doubleword is returned.  Bit zero of the flags
  73. doubleword is set if the child was linked with the -UNPRIVILEGED switch,
  74. cleared if the child was linked with -PRIVILEGED.  All other bits are
  75. reserved and are always cleared.
  76.  
  77. STUB386 Stub Loader Utility Program
  78. -----------------------------------
  79.  
  80. The STUB386.EXE stub loader program included on the distribution disks
  81. can be used to avoid having to type "run386" each time you run your
  82. application program.
  83.  
  84. Bind the STUB386.EXE file to the application .EXP file to create an .EXE
  85. file that can be run by typing the file name, just like any other DOS
  86. program.  This can be done with the MS-DOS COPY command.  For example, to
  87. create a HELLO.EXE file by binding STUB386.EXE and HELLO.EXP:
  88.  
  89.     copy/b stub386.exe+hello.exp hello.exe
  90.  
  91. 386|LINK can automatically bind STUB386 to create an .EXE output file
  92. if STUB386.EXE is given as one of the input object files in the link
  93. string.  For example, to link HELLO.OBJ, and create an output .EXE file
  94. with the stub loader bound on the front:
  95.  
  96.     386link hello stub386.exe
  97.  
  98. An .EXE file with the stub loader bound into it can be run by typing
  99. the file name directly:
  100.  
  101.     hello
  102.  
  103. If you need to specify 386|DOS-Extender switches for a program bound with
  104. the stub loader, you can configure them directly into the bound .EXE file
  105. with the CFIG386 utility program.  For example, to limit the XMS memory
  106. usage of the bound program HELLO.EXE to one megabyte:
  107.  
  108.     cfig386 hello -maxxmsmem 100000h
  109.  
  110. When you type the name of the .EXE file to run the program, DOS loads the
  111. stub loader bound to the front of the file.  The stub loader searches the
  112. execution PATH for the RUN386.EXE file and loads it into memory.  RUN386
  113. then loads the application program from the bound file.  There is no extra
  114. memory consumed by the stub loader program;  it is completely removed from
  115. memory after RUN386 is loaded.  If you rename your RUN386.EXE file, you
  116. can specify the new name to the stub loader with the CFIG386 -DOSXNAME
  117. switch documented in section 1.8 of the CFIG386 Utility Guide.
  118.  
  119. The stub loader cannot be used with 386|DOS-Extender versions prior to 3.0
  120. when bound to the application program as described above.  However, it can
  121. be used with any 386|DOS-Extender version by copying it to a file
  122. with the same name as the application .EXP file, but with an .EXE filename
  123. extension.  When used in this way, approximately 1500-2000
  124. bytes of conventional memory are consumed by the stub loader.  The 
  125. 386|ASM and 386|LINK programs are distributed in this fashion (as 
  126. 386ASM.EXP and 386ASM.EXE, and 386LINK.EXP and 386LINK.EXE), for customers
  127. who want to use the 3.0 assembler and linker, and an older version
  128. of 386|DOS-Extender.
  129.  
  130. New Example Code
  131. ----------------
  132.  
  133. The EXAMPLES\LOADER directory on the distribution disks contains a program,
  134. LOAD.C, that demonstrates the use of the Load EXP File system call (2529h).
  135. It also includes a sample program (FARHELLO.ASM) that RETurns to the caller
  136. on completion rather than making a DOS program terminate call;  this is
  137. required for programs loaded with the Load EXP File system call.  The
  138. LOAD.EXP program takes the first argument on the command line as the name
  139. of a file to load and execute;  to load and run FARHELLO.EXP, type:
  140.  
  141.     run386 load farhello.exp
  142.  
  143. Miscellaneous Manual Changes and Errata
  144. ---------------------------------------
  145.  
  146. Section 3.8 of the 386|DOS-Extender Reference Manual documents the amount
  147. of conventional memory needed to EXEC to a second copy of 386|DOS-Extender
  148. as 65K.  That is actually the minimum required run-time memory for 
  149. 386|DOS-Extender;  150K of conventional memory must be available for
  150. 386|DOS-Extender to load and initialize.
  151.