Ashish a écrit :
i got the solution ..... i wrote this code in VC++ 5.0
int *p = (int *)0x100000UL;
*p = 42;
I guess that your system is Windows. Some old versions could allow that,
but dont that on a NT based Windows (20000, XP).
it compiles correctly but at runtime it is giving error as expression
*p=42 cannot be evaluated .....
Big surprise !
i found that this code will be run only when the memory location is not
reserved by OS and that it should be the part of memory segment (RAM)
where variable is stored....
so i found that memory position and it works for me at address
0x0012ff92
On a 'Managed' system, the memory is virtual. The addresses are just
arbitrary numbers having no relationship with the physical memory at all.
What you want to do is (was?) only possible on very small systems, based
on very simple micro processors.
Nowadays, I work with Embedded Linux running on an MPC885 (a PowerPC
Micro-controller), and trust me, there is no way out of the 'Modules'
running in kernel mode that makes the address translation.