ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
First of all, thank you all for the help in advance.
I'll check the memory situation during the Linux running.
The memory would be exposed to some harsh environment, like radiation, which would occasionally erase the content of the memory. The aim of the testing is to find out the possibility this might happen.
I am thinking basically using the malloc() function, two arrays. For example, first allocate a certain area of the memory, then write a series of data 1,2,3..... as an array to it. Wait a certain amount of time, read back this series and compare with the origianal one.
I feel the idea rather rustic and looking for an idea. Anybody got any ideas?
if your aim is to check how memory is effected by environmental conditions then i would write a little bootsector that enables the a20 line, enters protected mode, sets up a segment that allows linear access to to the memory you want to test. and loops through writing a value to each byte based on its address, then loops through again reading and verifying sending any incorrect addresses/bytes through the serial port.
the reason i dont like your idea is you cant test kernel memory, or the memory of other processes.
Thank you all. I have checked out memtest86, but probably it is not the one for this problem. Since my aim is to verify if some of the memory content is changed during the system is running.
Hi Kev2, thank you very much for your idea. It sounds farely interesting. Would you give me some links on how to do the following?
1. How to write the bootsector in Linux that enables the a20 line, enters protected mode and set up a segment that allows linear access to to the memory you want to test? (sorry but I have never written any boot sector before and I have no idea about this)
2. If writing a value to each byte based on its address, do I modify the original content in the memory used by other process, or the kernel, as you have indicated?
ive just checked out memtest86 and it already does pretty much what i suggested, in my way there would be no operating system/kernel running either, only my tester. it makes no sense to try and run a memory checker with an operating system running because you cant check all the memory.
Quote:
during the system is running.
can you explain what you mean by this and why memtest86 is no good.
Many apologize for this reply in delay. It has been a while I am far from the internet.
Yes kev82 you are right. Originally I was planning to integrate the memory test in the major testing routin, including the USB, serial, parallel, etc. I realize now probably I need to test the memory seperately. Otherwise I could only use the statistics to calculate the P. Probably the same applys on the USB testing. (so far the easist way I've found is to retrieve the information tree from the USB file system under /proc, or, just attach a flash pen to see whether it works)
My target system has no development environment, pretty like an embeded system. In order words, I can only compile and link the software on the host PC and load ONLY the executable file into that flash memory. I'll see whether it is possible for the memtest86.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.