
November 17th, 2007, 11:35 PM
|
 |
Trapped on the forums...help
|
|
Join Date: Aug 2003
Location: /Users/edman007
|
|
|
your need to learn a bit more about memory on a computer, generally the kernel manages the physical RAM with the help of the MMU, the kernel tells the MMU what pages are for the user process then it loads the userspace app and the CPU lets the process run for a bit until something like an interrupt or an access to an unknown page occurs (the userspace process just sees the whole 4GB address space and accesses what it wants, if the CPU does not know about it triggers a page fault and tells the kernel)
what your seeing with your C code is virtual addresses, you probably have a similar architecture and kernel on both systems, that and the compiler used can determine the default value of a pointer (its undefined by C so never expect it to be a constant), the hardware address used is mapped with the help of the MMU to the virtual address the process sees
for accessing a hardware address directly you generally need to be running in kernel mode, though there are often ways to get the kernel to access the hardware address you want for you
|