Hello.
I'm trying to code a Memtest-like OS, that needs to test available memory for errors.
A very crude memory test could consist of overwriting a chunk of memory with a constant value, then go back and check if the value changed anywhere.
My question is: what can I do about the kernel's variables, which appear scattered in the memory?
Are there some segment relocation tricks that could help with this?
Thanks.
How to safely overwrite memory in use by variables?
Re: How to safely overwrite memory in use by variables?
1. test the region excluded by memtest
2. copy memtest to other region and jump there
3. test the region previously skipped.
This is easier to do with paging.
However, write-read test is only able to detect certain defeats, while sometime unstable ram (due to over-clock or mix of different brand of ram) may still pass the test.
2. copy memtest to other region and jump there
3. test the region previously skipped.
This is easier to do with paging.
However, write-read test is only able to detect certain defeats, while sometime unstable ram (due to over-clock or mix of different brand of ram) may still pass the test.
-
- Member
- Posts: 283
- Joined: Mon Jan 03, 2011 6:58 pm
Re: How to safely overwrite memory in use by variables?
I'm not sure how Memtest does it, but it is open source, so you can always look there: http://www.memtest.org/ That is my goto for memory testing *shrug*
- Monk
- Monk