Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Apr 2006 12:14:53 -0300 (BRT)
From:      scuba@centroin.com.br
To:        FreeBSD Daemon <free.bsd@gmx.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: memtest86 & memory test
Message-ID:  <20060419121110.K44588@trex.centroin.com.br>
In-Reply-To: <000801c66393$a06c6b00$0601a8c0@kojo>
References:  <000801c66393$a06c6b00$0601a8c0@kojo>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

	I think memtest86 is the best, but you could use something like 
this bellow. Just adjust the value of N_MEGABYTES, and start as many 
process as you want to full the fisical memory.

[start of code]

#include <stdio.h>
#define N_MEGABYTES 160
#define TOTAL (N_MEGABYTES * 1024 * 1024)
int main(void)
{
        int i;
        char *p;
        char *mem = malloc(TOTAL);

        if ( mem == NULL )
        {
                perror("malloc");
                return 1;
        }

        while ( 1 )
        {
                for (i = 0, p = mem; i < TOTAL; i++, p++)
                {
                        if ( *p == 0 )
                                *p = 1;
                        *p <<= 1;
                }
        }
        return 0;
}           


[end of code]

On Wed, 19 Apr 2006, FreeBSD Daemon wrote:

|Dear list
|
|Is there a memory test suite other them memtest86/memtest86+
|
|TIA
|
|zheyu
|
|_______________________________________________
|freebsd-questions@freebsd.org mailing list
|http://lists.freebsd.org/mailman/listinfo/freebsd-questions
|To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
|


- Marcelo




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060419121110.K44588>