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

  1. ;-----------------------------------------------------------------------------;
  2. ;      MODULE NAME:   EMM30_B.ASM                                             ;
  3. ;                                                                             ;
  4. ; OS FUNCTION NAME:   disable_OS_fcns                                         ;
  5. ;                                                                             ;
  6. ;      DESCRIPTION:   This function provides an OS/E with the ability to      ;
  7. ;                     disable all programs or device drivers from using the   ;
  8. ;                     OS/E specific functions.  The capability is provided    ;
  9. ;                     only for an OS/E which manages regions of mappable      ;
  10. ;                     conventional memory and cannot permit programs to use   ;
  11. ;                     any of the functions which would affect mappable        ;
  12. ;                     conventional memory regions.  When an OS/E disables     ;
  13. ;                     these functions and a program attempts to use them, the ;
  14. ;                     memory manager returns a status to the program          ;
  15. ;                     indicating that the OS/E has denied the program access  ;
  16. ;                     to the function.  In other words, the functions will    ;
  17. ;                     not work when disabled.                                 ;
  18. ;                                                                             ;
  19. ;                     The OS/E (Operating System) functions which are         ;
  20. ;                     disabled by this function are:                          ;
  21. ;                        get_hw_info               enable_DMA_reg_set         ;
  22. ;                        get_alt_reg_set           disable_DMA_reg_set        ;
  23. ;                        set_alt_reg_set           dealloc_DMA_reg_set        ;
  24. ;                        get_alt_context_size      enable_OS_fcns             ;
  25. ;                        alloc_alt_reg_set         disable_OS_fcns            ;
  26. ;                        dealloc_alt_reg_set       return_OS_access_key       ;
  27. ;                        alloc_DMA_reg_set                                    ;
  28. ;                                                                             ;
  29. ;           PASSED:   &access_key:                                            ;
  30. ;                        is a far pointer to an access key which EMM will     ;
  31. ;                        initialize.  The OS/E must use this key whenever it  ;
  32. ;                        needs to access the OS/E specific EMM functions.     ;
  33. ;                                                                             ;
  34. ;         RETURNED:   status:                                                 ;
  35. ;                        is the status EMM returns from the call.  All other  ;
  36. ;                        returned results are valid only if the status        ;
  37. ;                        returned is zero.  Otherwise they are undefined.     ;
  38. ;                                                                             ;
  39. ;                     access_key:                                             ;
  40. ;                        is an EMM initialized access key which the OS/E must ;
  41. ;                        use whenever it needs to access the OS/E specific    ;
  42. ;                        EMM functions.  Returned only on the first function  ;
  43. ;                        invocation, the memory manager returns a random      ;
  44. ;                        valued key which will be required thereafter for the ;
  45. ;                        execution of this function.  On all invocations      ;
  46. ;                        after the first, the correct key is not returned.    ;
  47. ;                                                                             ;
  48. ; C USE CONVENTION:   unsigned int  status;                                   ;
  49. ;                     unsigned long access_key;                               ;
  50. ;                                                                             ;
  51. ;                     status = disable_OS_fcns (&access_key);                 ;
  52. ;-----------------------------------------------------------------------------;
  53. .XLIST
  54. PAGE    60,132
  55.  
  56. IFDEF SMALL
  57.    .MODEL SMALL, C
  58. ENDIF
  59. IFDEF MEDIUM
  60.    .MODEL MEDIUM, C
  61. ENDIF
  62. IFDEF LARGE
  63.    .MODEL LARGE, C
  64. ENDIF
  65. IFDEF COMPACT
  66.    .MODEL COMPACT, C
  67. ENDIF
  68. IFDEF HUGE
  69.    .MODEL HUGE, C
  70. ENDIF
  71.  
  72. INCLUDE emmlib.equ
  73. INCLUDE emmlib.str
  74. INCLUDE emmlib.mac
  75. .LIST
  76. .CODE
  77.  
  78. disable_OS_fcns        PROC                                                  \
  79.             USES DI,                                              \
  80.             ptr_access_key:FAR PTR DWORD
  81.  
  82.     ;---------------------------------------------------------------------;
  83.     ;   do;                                                               ;
  84.     ;   .   disable the OS related functions & obtain an "access key"     ;
  85.     ;   .   required for future use of these functions;                   ;
  86.     ;---------------------------------------------------------------------;
  87.     MOVE        AX, disable_os_fcn_set_fcn
  88.     MOVE        ES:DI, ptr_access_key
  89.     MOVE        BX:CX, ES:[DI]
  90.     INT         EMM_int
  91.  
  92.     ;---------------------------------------------------------------------;
  93.     ;   .   pass the "access key" back to the OS;                         ;
  94.     ;---------------------------------------------------------------------;
  95.     MOVE        ES:[DI], BX:CX
  96.  
  97.     ;---------------------------------------------------------------------;
  98.     ;   .   return (EMM status);                                          ;
  99.     ;   end;                                                              ;
  100.     ;---------------------------------------------------------------------;
  101.     RET_EMM_STAT    AH
  102.  
  103. disable_OS_fcns            ENDP
  104.  
  105. END
  106.