Shadow Memory

written by: Matthew Duncan; article published: year 2010, month 05;

In: Root » Computers and technology » Memory Processor Motherboards and buses

  Share  
|
  PL  |  NL  |  FR  |  ES  |  PT  |  IT  |  DE  |  DK  |  NO  |  SE  |  FI  |  GR  |  JP  |  CN  |  KR  |  RU  |  AE


32-bit and 64-bit computers provide a means to access memory through 8-, 16-, 32-, or 64-bit data buses. It's often most convenient to use a 16-bit data path for ROM BIOS memory (so only two expensive EPROM chips are needed instead of the four required by a 32-bit path or eight by a 64-bit path). Many expansion cards, which may have onboard BIOS extensions, connect to their computer hosts through 8-bit data buses. As a result, these memory areas cannot be accessed nearly as fast as the host system's 32-bit or 64-bit RAM. This problem is compounded because BIOS routines, particularly those used by the display adapter, are among the most often used code in the computer (at least when running DOS).

To break through this speed barrier, many designers of 80386 computers use shadow memory. They copy the ROM routines into fast 32-bit or 64-bit RAM and use the page virtual memory mapping abilities of the 80386 and newer microprocessors to switch the RAM into the address range used by the ROM. Execution of BIOS routines can then be speeded up by a factor of four or more-more because greater wait states often are imposed when accessing slower ROM memory. Of course, the shadow memory is volatile and must be loaded with the BIOS routines every time the computer is booted up.

Shadowing has some detrimental effects on its host PC. Any ROM memory that is shadowed must be duplicated in RAM, and the bytes used for the duplication will be stolen away from the total RAM in your system. This memory is reallocated for its purpose by your PC's BIOS and is invisible to the rest of your system-including your applications. Consequently, the total RAM installed in your PC often exceeds the amount reported by your system's POST (power-on self test).

The ROM that is moved must go somewhere. Almost any address space can be assigned to it because once it is relocated, it should not need to be called upon again. When shadowing first appeared in machines made by Compaq Computer Corporation, the company's engineers assigned the range just above 16MB for the relocation, because these systems were designed to address no more than 16MB of RAM. Letting the shadow fall up there prevented programs from bumping into it. Most computer and motherboard makers copied the Compaq prototype and chose this address space for ROM relocation.

This address choice posed no problems as long as PCs and their applications needed only a few megabytes. Today, however, 16MB is where many people want to start with memory. However, PCs that plant relocated ROM at the 16MB border can't go higher. Their memory must be contiguous and the relocated ROM puts a big hole in the address range that prevents any RAM at higher addresses from being used. In other words, in some PCs adding more physical RAM beyond 16MB won't yield any more useful RAM.

This problem has an easy solution-switch off ROM shadowing. Most modern PCs make shadowing an option that can be switched on or off during their advanced setup procedure. Switching shadowing off prevents the relocated ROM from interfering with normal RAM addressing. In modern PCs, there's little penalty for switching shadowing off, anyway. The most important effect of shadowing is to accelerate video BIOS routines. However, most advanced applications and operating systems (like Windows and OS/2) avoid the video BIOS and instead write directly to display memory. These operations are not aided by shadowing, so they operate at the same speed whether shadowing is on or off. In other words, if most of your work is in Windows, ROM shadowing doesn't have any effect, so you might as well switch it off.

The other problem with shadowing is that not all the ROM in a PC comes as standard equipment. Many peripherals-for example video boards, disk controllers, and network adapters-add their own ROM to your PC's native endowment. Most PCs make an effort at shadowing this ROM memory, too. Sometimes, however, the code in these add-in ROMs is not designed to be relocated, and trying to shadow it can crash your system even before it boots up. To avoid such problems, most PC makers give you the option of shadowing ROM in blocks, letting you switch shadowing on and off for each individual block. Switching on shadowing for a given address range should be approached carefully, particularly when you are uncertain whether the code in that address range is amenable to shadowing.

Share

Disclaimer

1) E-articles is not responsible for the information contained by this article as well for any and all copyright infringements by authors and writers. E-articles is a free information resource. If you suspect this article for any copyright infringement, please read the terms of service and contact us or use the "Report this article" button on this page to investigate the problem.
2) E-articles is not responsible for inaccuracies, falsehoods, or any other types of misinformation this article may contain and will not be liable for any loss or damage suffered by a user through the user's reliance on the information gained here.