Static memorylayout_shadow memory

Source: Internet
Author: User


Conventional memory: The first 640 KB of system memory is the famous regular memory. Every PC user knows it more clearly over time (and hate it more), it is a standard DoSProgram, DOS drivers, resident memory programs, and other available areas, all of which are placed in H ~ Between 9ffffh.

Upper memory area (upper memory area): The first 384 KB (1024 KB-640 KB) at the top of 1 Mbit/s memory is Uma, which follows the regular memory. That is to say, the first 1 MB memory is divided into 640kb regular memory and 384kb Uma. This region is a reserved region of the system and cannot be used by user programs. It is used by system devices (such as CGA and VGA) and Rom shadowing and drivers. Uma uses the memory region a0000h ~ Fffffh.
High memory area (HMA): The first 64 kB area of the system memory of 2nd MB. Technically speaking, it is the first 64 kB extended memory, but what is different from other extended memory areas is that it can be accessed directly in real mode, otherwise. Therefore, in the DOS era, later dos versions allow users to place the DOS itself in HMA through configuration, so that users can have more general memory to use. HMA occupies the address 100000h ~ 10 ffefh.
Extended memory: the area from the end of HMA to the maximum physical memory of the system is the extended memory. When an OS runs in protected mode, it can be accessed, but in real mode, it cannot be accessed (unless using some hacker methods ). Its address range is 10fff0h ~ Last address of system momory (maximum of 4G-1 m ). Technically, HMA is also an extended memory, depending on how you think about it.

1.1.3 upper memory area

The way the PC organizes memory is somewhat confusing-welcome to the most confusing part :). The 640 kb part above the 384 kb regular memory is called Upper memory area or Uma, which is a very busy zone. It is very important because it is the root cause of many system configuration problems.

One of the confusing reasons for UMA is that it is actually two overlapping memories. There is a section occupying the physical address aw.h ~ Fffffh Ram; however, there are also a different types of RoM which are shot to most of the segments of this segment. Among them, RAM with the same address as Rom is hidden by the system, and they are used as Rom shadowing by BIOS. Hidden parts can still be used by OS and application.

Why does this happen? Some of the reasons are for practicality: If a PC has 640 KB of regular memory and 384 KB of UMA, the physical memory you inserted into the motherboard is continuous-there is no practical method to construct a Simm (single in-line memory module, see the annotations at the end of this section) set aside a 384 kb physical block for UMA (technically, of course, but the cost is much higher than the cost of wasting the 384 kB RAM ). Other major reasons are: Ram provides you with an option to improve performance, such as when you use UMA to store drivers, or uma is used as Rom shadowing.

Ram covers the entire 384 kb region, while Rom only covers a part. So you can consider Ram and Rom in Uma as follows: Ram is a colored tape on the table, while Rom is a white tape of the same size, and some holes are cut in the white tape, then it is covered in the color belt. The colored parts exposed by holes are the UMA ram that can be used by OS and applications. The remaining parts are the ROM parts, which cannot be used by OS and applications.


First 16 K

Second 16 K

Third 16 K

fourth 16 k


VGA graphics mode video RAM


VGA monochrome text mode video RAM

VGA color text mode video RAM


VGA video BIOS Rom

IDE Hard Disk BIOS Rom

optional adapter rom bios or RAM umbs


optional adapter rom bios or RAM umbs


system BIOS Plug and Play extended Information


System BIOS Rom

Uma Layout

The following is an overview of the content in the above table:

VGA graphics mode video RAM: Memory a0000h ~ The 64 KB of affffh is reserved by the system as the VGA graphics display memory. The original VGA is in 320x200,256 color mode, which requires 64,000 bytes. Of course, modern graphics cards use more memory. This Ram region is retained by the system, and the application is forbidden to use it.
VGA monochrome text mode video RAM: This 32 kB RAM is used when the video card is in monochrome text mode. However, in modern systems, the video card almost never uses the black and white text mode. Even if you need to display the black and white text, you only use the color text mode to display the black and white text. In some environments, this memory can be used as a driver to save space for regular memory.
VGA color text mode video RAM: This 32 kB RAM is used when the video card is in color text mode. This Ram region is retained by the system, and the application is forbidden to use it.
VGA video bios rom: c0000 ~ C7fffh is the memory location of the video BIOS Rom. The video BIOS Rom contains Code . Note that this ROM stores the service code used by the BIOS int for 10 h, instead of the data displayed by the video card. If the data is displayed, it should be placed in Ram.
IDE Hard Disk bios rom: c8000h is the default location for storing the BIOS that controls IDE hard disk. This BIOS code will be called during system startup.
Optional adapter rom bios or RAM umbs: cc000h ~ Memory blocks between dffffh can be used by PC manufacturers at will. This memory can be used by hardware adapters to store ROM code (for example, some NICs or SCSI host adapters ). It can also be used as the upper-level memory block ram for loading drivers. This memory is usually empty unless you use the special hardware you just mentioned.
System BIOS Plug and Play extended information: e0000h ~ The memory between effffh is used by Plug and Play BIOSes to store its extended system configuration data (escd ).
System bios rom: The last 64 K of UMA is used to store the system BIOS code.

The following table lists the UMA memory layout except video RAM:

Address width Content Description

C000: 0-mirror/vga bios Rom (thru c7ff)
C400: 0-video adapter Rom Space
C600: 0 256 bytes PGA communication area
C800: 0 16 K hard disk adapter BIOS Rom
C800: 5-XT hard disk ROM format, Ah = drive, Al = interleave
D000: 0 32 K cluster adapter BIOS Rom
D800: 0-pcjr Conventional Software cartridge address
E000: 0 64 K expansion Rom space (hardwired on at +)
-128 k ps/2 system ROM (thru f000)
F000: 0-system monitor Rom
--Pcjr: Software cartridge override address
F400: 0-system expansion ROMs
F600: 0-IBM Rom basic ()
F800: 0-pcjr software cartridge override address
Fc00: 0-bios Rom
Ff00: 0-system ROM
Ffa6: E-Rom graphics character table
FFFF: 0-Rom Bootstrap code
FFFF: 5 8 bytes Rom date (not applicable for all clones)
FFFF: E 1 byte Rom machine ID

In most PCs, Uma contains a 384 kB RAM memory. If any address in the UMA region is used by the Rom, the ram after this address is hidden by the system. However, this does not mean that these hidden Ram instances are wasted.

One problem with these Rom used for system ROM and video Rom is that it is slower than Ram access. Generally, the access time of Rom is 120 to 200 nanoseconds, while that of Ram is generally 50 to 70 nanoseconds. What's more, the system Ram accesses 32-bit at a time, the Rom is 16-bit. The result is that accessing the BIOS code is very slow relative to accessing the system memory.

So, I'm sure you already know what to say: since Ram is hidden behind the Rom, We can picture the content in the ROM into RAM to improve performance. In fact, most systems do the same. This is called Rom shadowing. You can use a set of BIOS parameters to control which Rom areas are shot into RAM.

When shadowing in a memory area is enabled by configuring BIOS parameters, if the PC is powered on, the BIOS will copy the content in the Rom to the corresponding RAM (it should be copied to 0-640 kb first, then adjust Pam register in the North Bridge Chip so that its address line maps to the corresponding Ram, and decompress it to the ram Section), set the ram section as write protection, and then disable the use of Rom. At this time, these Ram looks like Rom. However, the performance is higher than the real rom.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.