home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / diverses / text_cla / vmm.man < prev    next >
Encoding:
Text File  |  1992-05-12  |  3.5 KB  |  143 lines

  1. NAME
  2.         VmmInit - Initialize Vmm for processing
  3.  
  4. SYNOPSIS
  5.  
  6.         #include <vmm.h>
  7.  
  8.         SHORT  VmmInit(sMemoryBytes,pcSwapFile)
  9.         SHORT  sMemoryBytes;
  10.         PCHAR  pcSwapFile
  11.  
  12. DESCRIPTION
  13.  
  14.         Vmm will calloc sMemoryBytes for use as its main memory block.
  15.         All subsequent operations are virtual operations within the memory
  16.         block.  The file pcSwapFile is used as the swap file for memory
  17.         blocks which exist but are not current in memory.
  18.  
  19. DIAGNOSTICS
  20.  
  21.         C_OK - Initialization successful
  22.         !C_OK - Could not allocate memory or open disk file
  23.  
  24.  
  25. NAME
  26.         VmmAlloc - Allocate a memory block
  27.  
  28. SYNOPSIS
  29.  
  30.         #include <vmm.h>
  31.  
  32.         SHORT  VmmAlloc(sOwner,sTotalBytes,psHandle)
  33.         SHORT  sOwner;
  34.         SHORT  sTotalBytes;
  35.         PSHORT psHandle;
  36.  
  37. DESCRIPTION
  38.  
  39.         Vmm will allocate for process sOwner sTotalBytes from the
  40.         main memory block and return a handle identifying the 
  41.         memory block.  The handle returned is to be used by the
  42.         owner on all subsequent VmmPrep() and VmmFree() calls.
  43.         Vmm does not currently distinguish between process owners.
  44.         This can be implemented if a integration of Vmm and Mos
  45.         supporting protected memory is desired.
  46.                
  47. DIAGNOSTICS
  48.  
  49.         C_OK - block allocated
  50.         !C_OK - error
  51.  
  52.  
  53. NAME
  54.         VmmPrep - Prepare virtual memory for access
  55.  
  56. SYNOPSIS
  57.  
  58.         #include <vmm.h>
  59.  
  60.         SHORT  VmmPrep(sHandle,ppvVirtualPtr)
  61.         SHORT  sHandle;
  62.         PPVOID ppvVirtualPtr;
  63.  
  64. DESCRIPTION
  65.  
  66.         The application memory block identified by sHandle is 
  67.         prepared for access by the application.  A pointer to
  68.         the block is returned via ppvVirutalPtr.
  69.  
  70.         
  71.         PVOID  pvData;
  72.         SHORT  sHandle;
  73.  
  74.         C_STATUS = VmmInit(10240,"swap.dat");  /* use 10K ram */
  75.  
  76.         C_STATUS = VmmAlloc(1024,&sHandle);    /* alloc 1K block */      
  77.  
  78.         C_STATUS = VmmPrep(sHandle,&pvData);   /* init pvData */
  79.  
  80.         memcpy(pvData,something,sizeof(something));  /* copy in */
  81.  
  82.         
  83.  
  84.         VmmPrep is necessary because the operating system itself
  85.         is normally notified of memory block faults by the cpu.
  86.         A memory block fault occurs when the cpu detects that
  87.         an application memory access cannot complete because the
  88.         intended memory has been swapped to disk.  Because Vmm
  89.         is not part of the operating system, the application must
  90.         tell Vmm when it is going to access a block.  
  91.  
  92.         Multiple operations can be performed on a memory block
  93.         with a single to VmmPrep.  VmmPrep must be called before 
  94.         memory access when a previous call to VmmPrep has occurred 
  95.         using a different handle.
  96.  
  97. DIAGNOSTICS
  98.  
  99.         C_OK - memory ready
  100.         !C_OK - block not found or other internal error
  101.  
  102. NAME
  103.         VmmFree - Process is freeing a memory block
  104.  
  105. SYNOPSIS
  106.  
  107.         #include <vmm.h>
  108.  
  109.         SHORT  VmmFree(sHandle)
  110.         SHORT  sHandle;
  111.  
  112. DESCRIPTION
  113.  
  114.         The memory block identified by sHandle is freed.
  115.  
  116. DIAGNOSTICS
  117.  
  118.         C_OK - block found and freed
  119.         !C_OK - block not found or other error
  120.  
  121.  
  122.  
  123. NAME
  124.         VmmTerminate - Terminate Vmm processing
  125.  
  126. SYNOPSIS
  127.  
  128.         #include <vmm.h>
  129.  
  130.         SHORT  VmmTerm()
  131.  
  132. DESCRIPTION
  133.  
  134.         Vmm will free up all allocated memory.   The swap file is
  135.         closed but not deleted.
  136.  
  137. DIAGNOSTICS
  138.  
  139.         C_OK - termination successful.
  140.         !C_OK - error
  141.  
  142.  
  143.