简体   繁体   English

如何从用户空间获取 FreeBSD 中任何地址的物理地址?

[英]How to get physical address for any address in FreeBSD from userspace?

For some investigation, I need to find out the physical address of a pointer on FreeBSD 12. On Linux, I would do that with /proc/self/pagemap but on FreeBSD, I have not found a way to do it.对于某些调查,我需要在 FreeBSD 12 上找出指针的物理地址。在 Linux 上,我会使用/proc/self/pagemap来做到这一点,但在 FreeBSD 上,我还没有找到一种方法来做到这一点。

So, is there a way to get the physical address of any virtual address from user-space in FreeBSD?那么,有没有办法从 FreeBSD 中的用户空间获取任何虚拟地址的物理地址?

For FreeBSD, See macro vtop对于 FreeBSD,请参阅宏vtop

find(1) and xargs(1) are your friends: find(1) 和 xargs(1) 是你的朋友:

find /usr/include /usr/src/sys -type f -name '*.h' -print0 \
| xargs -0 egrep -i vtop | less

I think this is a good starting point ;)我认为这是一个很好的起点;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM