Книга: Microsoft Windows Embedded CE 6.0 Exam Preparation Kit
Dynamically Accessing Physical Memory
Dynamically Accessing Physical Memory
If a driver requires physically contiguous memory, as in the case of buffers required for DMA operations, the driver can allocate contiguous physical memory by using the AllocPhysMem function. If the allocation is successful, AllocPhysMem returns a pointer to the virtual address that corresponds to the specified physical address. Because the system allocates memory, it is important to free the memory later on when it is no longer needed by calling FreePhysMem.
On the other hand, if a driver requires non-paged access to a physical memory region defined in Config.bib, you can use the MmMapIoSpace function. MmMapIoSpace returns a non-paged virtual address that is directly mapped to the specified physical address. This function is typically used to access device registers.
- Statically Reserving Physical Memory
- EVENT MEMORY SIZE
- Accessing the Command Line
- 12.2.1 Port-Mapped vs. Memory-Mapped I
- Displaying Free and Used Memory with free
- Passwords and Physical Security
- Accessing Variable Values
- Physical Structure of the File System on the Disk
- 2.3.1. Flash Memory
- 2.3.5. Memory Space
- 2.3.7. Process Virtual Memory
- 9.3. MEMORY MANAGEMENT IN CHORUS