How do you read directly from physical memory?

前端 未结 7 901
灰色年华
灰色年华 2020-11-30 02:01

In C or C++ (windows), how do you read RAM by giving a physical (not virtual) address? That means without going trough virtual memory system (mmu tables), and being specific

7条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-30 02:29

    I guess its not possible to access the physical address directly. Not even with administrative privilege.

    Every address accessed by the the application is virtual address which is translated to physical address by hardware MMU.

    One way is to configure MMU for one to one mapping the virtual address to physical address. This is usually done in embedded systems with no OS or before loading the OS.

    With windows loaded. I believe your requirement is not possible.

提交回复
热议问题