Dirk Gently wrote:
Can anyone provide sample C++ code to access an absolute memory address?
This won’t work because it yields the data at location 0x100 in the virtual
address space of the process, correct?
unsigned char *ptr = 0x100; // address 0x100
unsigned char chr;
chr = *ptr;
Cincinnati, OH USA
You need to map that physical address+range into the address space. You
can do so via:
vaddr = mmap64(0, , PROT_READ|PROT_WRITE, MAP_PHYS|MAP_SHARED,
Now the pointer ‘vaddr’ will allow you to access that physical location.
Check the docs on mmap() for more flags (like PROT_NOCACHE etc) and
With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <firstname.lastname@example.org>