LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-21-2016, 01:55 PM   #1
danmartinj
Member
 
Registered: Oct 2009
Posts: 94

Rep: Reputation: 1
How To Create Linux Memory Test Program


Hello,

Recently I have been trying to learn about memory testing (specifically RAM) which seems pretty complex so my initial thought is to just use existing open code to get something working. So far I have found http://www.barrgroup.com/Embedded-Sy...y-Test-Suite-C which contains some basic test cases that seem fairly general and looks portable.

I have also quickly scanned github but have not found anything that seems general and reliable. My current requirements are:
1. General Memory Testing C Program.
2. Needs to be built from source so it can run on ARM

Any advice or comments would be greatly appreciated,

Joe
 
Old 03-21-2016, 03:53 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,424
Blog Entries: 13

Rep: Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741
What we used to do was:
  1. Clear all and verify
  2. Write full 1's to all and verify
  3. Write alternating patterns to all and verify 0x66
  4. Write opposite alternating patterns to all and verify 0xAA
Be careful running this on all RAM of a system, the RAM is used for the system itself. Instead you can check an allocated segment from the heap versus try to test all of RAM. Because testing of RAM is typically done from a ROM based bootloader where total over-write of RAM doesn't matter to the operating program.
 
2 members found this post helpful.
Old 03-21-2016, 04:44 PM   #3
danmartinj
Member
 
Registered: Oct 2009
Posts: 94

Original Poster
Rep: Reputation: 1
rtmistler,

Thanks for the information. I was told we would be given a start/stop address range so maybe this would avoid the problem you mentioned where we would not want to test all of RAM. Also, I found a couple tools online that look like they might do the trick. For example, I just found https://github.com/jnavila/memtester which looks like it might be a good tool to use. I am hoping to avoid building my own tool although you make it sound easy.

Do you by chance know/recommend any good quality tools that are light weight and open? Also, do you know of any good learning materials out there on this subject.

Thanks again for your help,

Joe
 
Old 03-21-2016, 05:56 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 19,514

Rep: Reputation: 3014Reputation: 3014Reputation: 3014Reputation: 3014Reputation: 3014Reputation: 3014Reputation: 3014Reputation: 3014Reputation: 3014Reputation: 3014Reputation: 3014
memtest is out there. Not sure how hard it would be to port it to arm if it isn't already.
 
Old 03-21-2016, 07:49 PM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,424
Blog Entries: 13

Rep: Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741
You want to learn about it, then best to write it. Sounds like an assignment the way you say it. Look for memtest source and mimic that.
 
Old 03-21-2016, 10:42 PM   #6
danmartinj
Member
 
Registered: Oct 2009
Posts: 94

Original Poster
Rep: Reputation: 1
Hey rtmistler,

I marked your initial reply as helpful. This is not a school assignment. I am not a programmer so I am trying to find the most optimal starting point referring to a good existing tool which is light and easily configurable/modifiable. Anyhow, thanks for your help. My intension is to try to get memtester to work.

Joe
 
Old 03-22-2016, 08:28 AM   #7
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,424
Blog Entries: 13

Rep: Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741
The original article which you cited, includes a link for code matching exactly what they talk about in the article here.

It's two files, memtest.c and memtest.h. Best suggestion is that you try to build those on the ARM target and modify them to suite your needs. Note that you will need to write your own main() function because what they've given are the utilities and their article talks about how to employ those, but does not provide a sample main() function.

That second link you cited is also very good, and much more inclusive where they've provided a more full application, they also do more tests, I forgot about walking ones and walking zeros.

Understand that your initial post stated that you were looking at open source, you've been scanning github, and that the two requirements were a "General Memory Testing C Program", and "Need to be build from source so it can run on ARM". So while you state you are not a programmer, be aware that these tacts will take you very much down the exact path of acting as a programmer. If that is not your desire, then best you should do is to search for pre-compiled memory test utilities built for ARM.

Do you need to write diagnostics to validate a product? Or is there a situation on a system where you fear there are problems with the RAM devices?
 
1 members found this post helpful.
Old 03-23-2016, 02:12 PM   #8
danmartinj
Member
 
Registered: Oct 2009
Posts: 94

Original Poster
Rep: Reputation: 1
Hey rtmistler,

As usual thanks for your input. I am not a programmer (network/security engineer by trade) I am not afraid to try and understand code and make simple changes as needed. I have decided to put my effort into the github code because it is already ready to go. The team I am helping has tools that are suppose to "some-what automate" the cross-compilation process so at this point my attitude is to understand how that code works "as best as possible", possibly look into trying to modify it "I was originally told a requirement was going to be give the program a start-stop memory address" so I don't think the current program takes a stop address as a command line option, and then somehow try to figure out if the program is working correctly.

As far as why I am doing this, I think it is more to validate a custom-card. Although I do not know all the high level details. How much experience do you have into this kind of work?
 
Old 03-23-2016, 03:07 PM   #9
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,424
Blog Entries: 13

Rep: Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741Reputation: 3741
Quote:
Originally Posted by danmartinj View Post
How much experience do you have into this kind of work?
I've been an embedded engineer since 1985, so 30 years.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I run test my program with less memory then I have? tfnc99 Programming 6 04-15-2013 03:54 AM
How do I test memory DIMMs for a linux server Langton Linux - Newbie 4 05-16-2011 06:21 AM
Program to create and manage exam, quizzes and test Hiko Linux - Desktop 4 07-27-2008 07:18 AM
Memory test on Gnu Linux system Neuzen Linux - Hardware 3 04-05-2008 12:12 AM
can i install linux if i get 9 errors in memory test.... pradeep2002gs Linux - Newbie 7 12-04-2007 08:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration