Detecting Memory (x86): Difference between revisions

→‎Theoretical introduction: Additional info and a explanation of how the computer can be damaged.
[unchecked revision][unchecked revision]
(→‎Theoretical introduction: Additional info and a explanation of how the computer can be damaged.)
Line 256:
 
===== Theoretical introduction =====
Direct memory probing is only useful for very old systems with buggy and/or non-updateable BIOSes, or maybe a system with modified hardware that does not muchmatch the firmware anymore. So if you don't intend to support this sort of computers, you don't need memory probing. Period. Even if you need, you may decide that it's safer to run will less memory than is available.
 
Anyway, don't think that this will save you from the effort of understanding how to call the complicated BIOS APIs. Before launching a probe, you will always need to detect '''if''' the computer where your OS is running really needs it, and '''which''' memory areas really need to be probed (because for other memory areas you should always consider the information provided by the BIOS as authoritative). You also need to take into account the appropriate memory holes and/or memory mapped devices, which may vary from system to system.
 
When perfectly implemented, directly probing memory may allow you to detect extended memory on systems where the BIOS fails to provide the appropriate support. However, the algorithm will always need to take into account potential holes in system memory or previously detected memory mapped devices, such as frame buffering SVGA cards, etc. Maybe you will want to probe just a specific range of memory that is known to be otherwise undetectable on a specific computer model.
 
However, the BIOS is part of the computer, and may know things (see [[#Practical obstacles to memory probing]]) you ignore about your memory, motherboard and PCI devices. Probing memory-mapped PCI devices may have '''unpredictable results'''. The (most likely crashresult is crashing you computer, but may theoretically '''damage your system permanently'''{{how}}, such as clearing firmware chips or setting unsafe device operation parameters. Just remember the [https://en.wikipedia.org/wiki/CIH_(computer_virus) Chernobyl] computer virus.
 
Note: You will never get an error from trying to read/write memory that does not exist -- this is important to understand: you will not get valid results, but you won't get an error, either.
Anonymous user