home *** CD-ROM | disk | FTP | other *** search
- NAME
- VmmInit - Initialize Vmm for processing
-
- SYNOPSIS
-
- #include <vmm.h>
-
- SHORT VmmInit(sMemoryBytes,pcSwapFile)
- SHORT sMemoryBytes;
- PCHAR pcSwapFile
-
- DESCRIPTION
-
- Vmm will calloc sMemoryBytes for use as its main memory block.
- All subsequent operations are virtual operations within the memory
- block. The file pcSwapFile is used as the swap file for memory
- blocks which exist but are not current in memory.
-
- DIAGNOSTICS
-
- C_OK - Initialization successful
- !C_OK - Could not allocate memory or open disk file
-
-
- NAME
- VmmAlloc - Allocate a memory block
-
- SYNOPSIS
-
- #include <vmm.h>
-
- SHORT VmmAlloc(sOwner,sTotalBytes,psHandle)
- SHORT sOwner;
- SHORT sTotalBytes;
- PSHORT psHandle;
-
- DESCRIPTION
-
- Vmm will allocate for process sOwner sTotalBytes from the
- main memory block and return a handle identifying the
- memory block. The handle returned is to be used by the
- owner on all subsequent VmmPrep() and VmmFree() calls.
- Vmm does not currently distinguish between process owners.
- This can be implemented if a integration of Vmm and Mos
- supporting protected memory is desired.
-
- DIAGNOSTICS
-
- C_OK - block allocated
- !C_OK - error
-
-
- NAME
- VmmPrep - Prepare virtual memory for access
-
- SYNOPSIS
-
- #include <vmm.h>
-
- SHORT VmmPrep(sHandle,ppvVirtualPtr)
- SHORT sHandle;
- PPVOID ppvVirtualPtr;
-
- DESCRIPTION
-
- The application memory block identified by sHandle is
- prepared for access by the application. A pointer to
- the block is returned via ppvVirutalPtr.
-
-
- PVOID pvData;
- SHORT sHandle;
-
- C_STATUS = VmmInit(10240,"swap.dat"); /* use 10K ram */
-
- C_STATUS = VmmAlloc(1024,&sHandle); /* alloc 1K block */
-
- C_STATUS = VmmPrep(sHandle,&pvData); /* init pvData */
-
- memcpy(pvData,something,sizeof(something)); /* copy in */
-
-
-
- VmmPrep is necessary because the operating system itself
- is normally notified of memory block faults by the cpu.
- A memory block fault occurs when the cpu detects that
- an application memory access cannot complete because the
- intended memory has been swapped to disk. Because Vmm
- is not part of the operating system, the application must
- tell Vmm when it is going to access a block.
-
- Multiple operations can be performed on a memory block
- with a single to VmmPrep. VmmPrep must be called before
- memory access when a previous call to VmmPrep has occurred
- using a different handle.
-
- DIAGNOSTICS
-
- C_OK - memory ready
- !C_OK - block not found or other internal error
-
- NAME
- VmmFree - Process is freeing a memory block
-
- SYNOPSIS
-
- #include <vmm.h>
-
- SHORT VmmFree(sHandle)
- SHORT sHandle;
-
- DESCRIPTION
-
- The memory block identified by sHandle is freed.
-
- DIAGNOSTICS
-
- C_OK - block found and freed
- !C_OK - block not found or other error
-
-
-
- NAME
- VmmTerminate - Terminate Vmm processing
-
- SYNOPSIS
-
- #include <vmm.h>
-
- SHORT VmmTerm()
-
- DESCRIPTION
-
- Vmm will free up all allocated memory. The swap file is
- closed but not deleted.
-
- DIAGNOSTICS
-
- C_OK - termination successful.
- !C_OK - error
-
-