由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - cpp指针地址是virtual memory address还是physical address?
相关主题
C一个问题搞不懂问个数组地址的问题
关于void指针一个interview问题,关于内存泄漏
C++ questionsdereference a NULL pointer in C
C++ Q87: What is wrong with this swap function? (转载)请教一个逻辑地址到物理地址映射的问题 (转载)
有个关于stack address的问题Java 问题,请教如何找出一个array里的duplicate segments?
问个c++指针问题请问java /c++ 双修的大牛,java和c++最主要的区别是什么?c++程序员转java您认为最需要补充的知识是什么
a question about virtual memory为什么Cache LRU多用doubly linked list而不是single linked list来实现呢?
linux内存分配中page的几个问题大家有讨论 王垠新博文《未来计划》吗?
相关话题的讨论汇总
话题: address话题: physical话题: addr话题: virtual话题: memory
进入Programming版参与讨论
1 (共1页)
s*i
发帖数: 388
1
比如,
int * p
在win7和linux下debug看到的值,比如0x12345678 ,是virtual memory address还是
physical address?
如果是vm addr,如何能够访问到physical addr?
thanks.
h****e
发帖数: 2125
2

mlock() or mlockall()

【在 s*i 的大作中提到】
: 比如,
: int * p
: 在win7和linux下debug看到的值,比如0x12345678 ,是virtual memory address还是
: physical address?
: 如果是vm addr,如何能够访问到physical addr?
: thanks.

s*i
发帖数: 388
3
so u mean that addr we see during debug is vm addr? thanks

【在 h****e 的大作中提到】
:
: mlock() or mlockall()

h****e
发帖数: 2125
4

of course

【在 s*i 的大作中提到】
: so u mean that addr we see during debug is vm addr? thanks
t****t
发帖数: 6806
5
what you saw is the address in segment. add the base address (invisible in
user space) in segment, you get linear address. linear address is translated
to physical address via page table (again invisible in user space).
i think it is impossible to get physical address from given segment address
in user space.

【在 s*i 的大作中提到】
: 比如,
: int * p
: 在win7和linux下debug看到的值,比如0x12345678 ,是virtual memory address还是
: physical address?
: 如果是vm addr,如何能够访问到physical addr?
: thanks.

t****t
发帖数: 6806
6
mlock and mlockall doesn't get you physical address at all.

【在 h****e 的大作中提到】
:
: of course

D*******a
发帖数: 3688
7
unless there is a kernel exploit that gets you to ring 0...

translated
address

【在 t****t 的大作中提到】
: what you saw is the address in segment. add the base address (invisible in
: user space) in segment, you get linear address. linear address is translated
: to physical address via page table (again invisible in user space).
: i think it is impossible to get physical address from given segment address
: in user space.

g**w
发帖数: 969
8
在windows下,可以用windbg转换,还可以看physical address的内容
不过实在kernel debugger mode下

【在 s*i 的大作中提到】
: 比如,
: int * p
: 在win7和linux下debug看到的值,比如0x12345678 ,是virtual memory address还是
: physical address?
: 如果是vm addr,如何能够访问到physical addr?
: thanks.

a****l
发帖数: 8211
9
I doubt it is even possible for user applications, on modern advanced
operating systems.

【在 s*i 的大作中提到】
: 比如,
: int * p
: 在win7和linux下debug看到的值,比如0x12345678 ,是virtual memory address还是
: physical address?
: 如果是vm addr,如何能够访问到physical addr?
: thanks.

s****n
发帖数: 786
10
对没有MMU的处理器还是可能的。

【在 a****l 的大作中提到】
: I doubt it is even possible for user applications, on modern advanced
: operating systems.

s*i
发帖数: 388
11
恩,以前开发嵌入式的时候用的uclinux的早期版本就没有mmu,裸搞mem addr

【在 s****n 的大作中提到】
: 对没有MMU的处理器还是可能的。
1 (共1页)
进入Programming版参与讨论
相关主题
大家有讨论 王垠新博文《未来计划》吗?有个关于stack address的问题
芯片應該為軟件服務,譬如硬件加速的虛擬內存MMU、虛擬GPU、虛问个c++指针问题
编程语言选择问题a question about virtual memory
C++ and threading interview questionslinux内存分配中page的几个问题
C一个问题搞不懂问个数组地址的问题
关于void指针一个interview问题,关于内存泄漏
C++ questionsdereference a NULL pointer in C
C++ Q87: What is wrong with this swap function? (转载)请教一个逻辑地址到物理地址映射的问题 (转载)
相关话题的讨论汇总
话题: address话题: physical话题: addr话题: virtual话题: memory