home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / doc / ems / disk3 / emm26_d.asm < prev    next >
Assembly Source File  |  1989-11-29  |  10KB  |  151 lines

  1. ;-----------------------------------------------------------------------------;
  2. ;      MODULE NAME:   EMM26_D.ASM                                             ;
  3. ;                                                                             ;
  4. ; OS FUNCTION NAME:   get_hw_info                                             ;
  5. ;                                                                             ;
  6. ;      DESCRIPTION:   This function returns an array containing expanded      ;
  7. ;                     memory hardware configuration information for use by an ;
  8. ;                     operating system/environment.                           ;
  9. ;                                                                             ;
  10. ;           PASSED:   &hw_info:                                               ;
  11. ;                        is a far pointer to a structure that the operating   ;
  12. ;                        system supplies where the memory manager will copy   ;
  13. ;                        expanded memory hardware information.                ;
  14. ;                                                                             ;
  15. ;         RETURNED:   status:                                                 ;
  16. ;                        is the status EMM returns from the call.  All other  ;
  17. ;                        returned results are valid only if the status        ;
  18. ;                        returned is zero.  Otherwise they are undefined.     ;
  19. ;                                                                             ;
  20. ;                     hw_info: is a structure ...                             ;
  21. ;                        is a structure returned by the memory manager which  ;
  22. ;                        contains expanded memory hardware information.       ;
  23. ;                        The structure members are described here:            ;
  24. ;                                                                             ;
  25. ;                        hw_info.raw_page_size_paragraphs:                    ;
  26. ;                           is the size of a raw mappable physical page in    ;
  27. ;                           paragraphs (16 bytes).  LIM standard pages are    ;
  28. ;                           always 16K bytes.  However, other implementations ;
  29. ;                           of expanded memory boards do not necessarily      ;
  30. ;                           comply with this standard and can emulate a       ;
  31. ;                           16K-byte page by mapping in multiple smaller      ;
  32. ;                           pages.  This member specifies the size of a       ;
  33. ;                           mappable physical page viewed from the hardware   ;
  34. ;                           implementation level.                             ;
  35. ;                                                                             ;
  36. ;                        hw_info.alt_reg_set_count:                           ;
  37. ;                           is the number of alternate mapping register sets. ;
  38. ;                           The additional mapping register sets are termed   ;
  39. ;                           alternate mapping register sets.                  ;
  40. ;                                                                             ;
  41. ;                           All expanded memory boards have at least one set  ;
  42. ;                           of hardware registers to perform the logical to   ;
  43. ;                           physical page mapping.  Some expanded memory      ;
  44. ;                           boards have more than one set of these mapping    ;
  45. ;                           registers.  This member specifies how many of     ;
  46. ;                           these alternate mapping register sets exist       ;
  47. ;                           (beyond the one set that all expanded memory      ;
  48. ;                           boards have) on the expanded memory boards in the ;
  49. ;                           system.  If an expanded memory card has only one  ;
  50. ;                           set of mapping registers (that is, no alternate   ;
  51. ;                           mapping register sets) this member has a value of ;
  52. ;                           zero.                                             ;
  53. ;                                                                             ;
  54. ;                        hw_info.context_size:                                ;
  55. ;                           is the number of bytes required for the array     ;
  56. ;                           required to save a mapping context.  The value    ;
  57. ;                           returned in this member is exactly the same as    ;
  58. ;                           that returned by the get_context_size function.   ;
  59. ;                                                                             ;
  60. ;                        hw_info.DMA_reg_set_count:                           ;
  61. ;                           is the number of register sets that can be        ;
  62. ;                           assigned to DMA channels.  These DMA register     ;
  63. ;                           sets, although similar in use to alternate        ;
  64. ;                           register sets, are for DMA mapping and not task   ;
  65. ;                           mapping.                                          ;
  66. ;                                                                             ;
  67. ;                           If the expanded memory hardware does not support  ;
  68. ;                           DMA register sets, care must be taken when DMA is ;
  69. ;                           taking place.  Essentially, DMA CANNOT take       ;
  70. ;                           place into an expanded memory page because a TSR  ;
  71. ;                           which uses expanded memory can be activated and   ;
  72. ;                           thus change the memory mapping context of the     ;
  73. ;                           region that DMA read/writes are occurring.        ;
  74. ;                                                                             ;
  75. ;                           In a multitasking operating system, when one task ;
  76. ;                           is waiting for DMA to complete, it is useful to   ;
  77. ;                           be able to switch to another task.  However, if   ;
  78. ;                           the DMA is taking place in memory that the second ;
  79. ;                           task will need to remap, remapping would be       ;
  80. ;                           disastrous.                                       ;
  81. ;                                                                             ;
  82. ;                           If the expanded memory hardware can detect when   ;
  83. ;                           DMA is occurring, the OS/E should allow task      ;
  84. ;                           switches and remapping during DMA.  If no special ;
  85. ;                           support for DMA is available, no remapping should ;
  86. ;                           be done when DMA is in progress.                  ;
  87. ;                                                                             ;
  88. ;                        hw_info.DMA_channel_operation:                       ;
  89. ;                           is a special operational case for the DMA         ;
  90. ;                           register sets.  A value of zero specifies that    ;
  91. ;                           the DMA register sets behave as described in      ;
  92. ;                           _DMA_reg_set functions.  A value of one specifies ;
  93. ;                           that the expanded memory hardware has only one    ;
  94. ;                           DMA register set.  In addition, if any channel is ;
  95. ;                           mapped through this register set, then all        ;
  96. ;                           channels are mapped through it.  For LIM standard ;
  97. ;                           boards, this value is zero.                       ;
  98. ;                                                                             ;
  99. ; C USE CONVENTION:   unsigned int   status;                                  ;
  100. ;                     HW_INFO_STRUCT hw_info;                                 ;
  101. ;                                                                             ;
  102. ;                     status = get_hw_info (&hw_info);                        ;
  103. ;-----------------------------------------------------------------------------;
  104. .XLIST
  105. PAGE    60,132
  106.  
  107. IFDEF SMALL
  108.    .MODEL SMALL, C
  109. ENDIF
  110. IFDEF MEDIUM
  111.    .MODEL MEDIUM, C
  112. ENDIF
  113. IFDEF LARGE
  114.    .MODEL LARGE, C
  115. ENDIF
  116. IFDEF COMPACT
  117.    .MODEL COMPACT, C
  118. ENDIF
  119. IFDEF HUGE
  120.    .MODEL HUGE, C
  121. ENDIF
  122.  
  123. INCLUDE emmlib.equ
  124. INCLUDE emmlib.str
  125. INCLUDE emmlib.mac
  126. .LIST
  127. .CODE
  128.  
  129. get_hw_info        PROC                                                  \
  130.             USES DI,                                              \
  131.             ptr_hw_info_struct:FAR PTR BYTE
  132.  
  133.     ;---------------------------------------------------------------------;
  134.     ;   do;                                                               ;
  135.     ;   .   get a structure describing the expanded memory H/W info       ;
  136.     ;   .   from EMM;                                                     ;
  137.     ;---------------------------------------------------------------------;
  138.     MOVE        AX, get_emm_hardware_info_fcn
  139.     MOVE        ES:DI, ptr_hw_info_struct
  140.     INT         EMM_int
  141.  
  142.     ;---------------------------------------------------------------------;
  143.     ;   .   return (EMM status);                                          ;
  144.     ;   end;                                                              ;
  145.     ;---------------------------------------------------------------------;
  146.     RET_EMM_STAT    AH
  147.  
  148. get_hw_info        ENDP
  149.  
  150. END
  151.