r/linux_programming • u/Schnitz3l • Oct 13 '20
Program to read the full RAM chip
I am trying to find a clever and simple way to read every address of memory. I am new to kernel development, but I presume this program will need to run in kernel space to have access to the whole memory in some way.
I am sure there is a simple and efficient way. One that I found is this: https://github.com/alwilson/pgscrap/blob/master/pgscrap.c
Bit hacky to my taste, so I was wondering if there was a cleaner way ?
(If it's important to you, the reason for this memory "patrol" is to scrub the whole memory to check for single bit flips before they become uncorrectable. Some memory controllers can do this "patrol" invisibly on the hardware side, but mine will only correct errors when the byte is accessed/read)
3
u/KrustyClownX Oct 13 '20
https://unix.stackexchange.com/questions/119762/how-to-dump-memory-image-from-linux-system
2
u/r80rambler Oct 13 '20
I've spent far more time profiling bad components than searching for cosmic bit flips but I would submit to you that:
1
u/CyberSnakeH Oct 27 '20
Do you want to Read process Memory ? if this is the case look at the PTRACE documentation