Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Small C program to exclude bad RAM? 1

Status
Not open for further replies.

JuanPedro

Technical User
Dec 5, 2004
1
US
OS: Windows XP Home SP2
CPU/Ram: Mobile AMD Duron 4, 1GHz / 256MB
System Manufacturer: Compaq Presario 730us

Using windiag.exe to test my RAM I get a consistent error for the following address: 0b5d9270. The system returns the wrong value, e.g. expects value f7f7f7f7 and instead gets f7f7e7f7. This RAM is on the motherboard and it's about as expensive to replace it than to buy a new computer.
Is there any small program that could be written so as to reserve/exclude this specific RAM address at boot so that it's not used? Unfortunately I know little programming ...
Somebody suggested an approach via C that may have some of the following lines (but didn't elaborate more). Does this approach have any chance of success?


char far *pointer=(char far *) 0x0b5d9270; /* pointer to address*/
or one could point to the previous address 0x0b5d926f

and then try from there (not sure how because the following functions transfer memory from pre-established places)

#include "malloc.h"
#include "stdlib.h"
#include "stdio.h


void main(void){

char far *pointer=(char far *) 0x0b5d9270; /* pointer to address*/
/* char huge *pointer; - original code that asks from a pre-established place*/
if ((pointer=halloc(1,128000))==NULL {
printf("allocation error -aborting");
exit(1);
}
/* do not free memory*/
/* hfree(pointer); */

}

Program should be called and left resident as a service or driver during boot.


THANK YOU very much for your response, I really appreciate it.

Juan



 
Unless your RAM is physically soldered to the motherboard, it is easily replaceable. RAM usually comes on small cards that plug into the motherboard. Also, RAM is still cheap, less than 50 cents US per megabyte.

The code you posted will definitely not work on any operating system that uses virtual or paged memory, which includes all major operating systems (Windows, Linux, BSD, Mac OSX, etc.) The reason is, the physical address that does not work can be assigned almost any virtual address, and it is the virtual address that your program's pointer receives. There is usually no way for you to know or control the actual physical address.

Even if there was a way for you to avoid using that physical address in your program, you would still need to change the underlying operating system, to keep it from using that memory location as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top