• No se han encontrado resultados

MÉTODO DE CARGA INTELIGENTE

5. SISTEMAS DE RECARGA

5.6.3. MÉTODO DE CARGA INTELIGENTE

The original Intel 8086 and 8088 microprocessors had only the one mode of operation, and within this was implemented the segment:offset addressing archi- tecture that we have discussed above. It is this architecture that is used by the bootstrap system and by MS-DOS, dating from the days of the original PC. In order to maintain backward compatibility with the MS-DOS operating system, all subse- quent Intel microprocessor chips in the PC range have included an operating mode that provides this segment:offset addressing mechanism. It is known asreal mode, and within it we can only address up to 1 Mbyte of memory because of the internal segment:offset design and the 20 bit external address lines of the original chips. The Intel 80286 and i386SX microprocessors have in fact 24 bit external address lines and can thus address up to 224– 1 = 16,777,215 or 16 Mbyte of memory and the Intel i386DX, i486 and the early Pentium microprocessors have 32 bit external address lines and can thus address up to 232– 1 = 4,294,967,295 or 4 Gbyte of memory. These greatly enhanced addressing capabilities only work, however, when the micropro- cessor is switched to a completely different operating mode, calledprotected mode59, within which an entirely different form of addressing architecture is employed60. In protected mode, memory can be addressed right up to 4 Gbyte, and it is not unusual to find PCs these days with one or more Gbyte of RAM fitted. Any memory above the 1 Mbyte real mode limit is known asextended memory.

In order to discuss the various memory issues, an expanded version of Fig. 5.12 is shown at Fig. 5.22. Here we see the 1 Mbyte memory area that is addressable in real mode. In fact, it extends above the 1 Mbyte point because of a design “flaw” that was made into a feature. The segment:offset addressing scheme clearly permits at the top of the memory the following segment:offset values61:

FFFF:000F = FFFF0 + 000F = FFFFFh = 1,048,575 1 Mbyte – 1 FFFF:0010 = FFFF0 + 0010 = 100000h = 1,048,576 1 Mbyte exactly

59 There is a third mode, known asvirtual 8086orV86mode, which we will not consider any further here.

60 The segment register no longer provides part of the address itself but now acts as a

selectorinto one of two tables: the Global Descriptor Table (GDT), common to all applications, or the Local Descriptor Table (LDT), specific to a task. Each table contains 8 byte (64 bit) entries which include a 32 bit base address to which a 16 or 32 bit offset address may be added, a 16 bit limit address and access flags. The hidden descriptor cache registers referred to earlier are used in this process. For more details see Collins (2003).

FFFF:0011 = FFFF0 + 0011 = 100001h = 1,048,577 1 Mbyte + 1 ...

FFFF:FFFF = FFFF0 + FFFF = 10FFEFh = 1,114,095

which is all but 16 bytes of the next 64 kbyte block above the top of memory In the original PC there were only 20 address lines (A0 to A19), so programs which tried to address 100000h or above using the permitted segment:offset values of FFFF:0010 up to FFFF:FFFF caused awraparound. That is, the leading 1 bit (which would be address line A20 if it existed) was ignored and the external memory addresses of 100000 up to 10FFEFh became 00000h up to 0FFEFh instead, resulting in awraparoundfrom the top of memory back to the bottom. This design “flaw” was turned into a useful feature when the Intel 386 microprocessor came along and memory above 1 Mbyte could be addressed in protected mode. In this case, address lines A20 and higher are physically implemented for protected mode addressing beyond 1 Mbyte and it was decided to utilize address line A20 in real mode as well. A switch was provided to activate address line A20 and with that active, instead of wraparound occurring, all but 16 bytes of the 64 kbyte segment above 1 Mbyte became addressable in real mode. This became known as thehigh memory area. The A20 switch has to be controlled carefully because some early versions of MS-DOS rely on the wraparound feature being present. Control of the switch is invested in the software driver HIMEM.SYS, which not only gives real mode access to the high memory area but also enables controlled access to the rest of the extended memory (XMS, 1991). It does this by switching the processor into protected mode in order to

IO.SYS MSDOS.SYS COMMAND.COM COMMAND.COM (transient) Application programs 0K 640K Video RAM 768K BIOS extensions 896K 0000:0000 1M System BIOS FFFF:000F FFFF:0010 FFFF:FFFF High memory area

Addressable in

real mode DOS data BIOS data INT vectors Extended memory Upper memory block area 1st page 48K 2nd page 32K 3rd page 16K 4th page 0K EMS window A000:0000 C000:0000 E000:0000

access data in extended memory and then back again into real mode in order to permit MS-DOS to function properly. It often does this in conjunction with another software driver,EMM386.SYS. This driver takes the extended memory provided by HIMEM.SYSand uses it to emulateexpanded memoryor to provideUpper Memory Blocks (UMBs) or both (EMS, 1987).

Expanded memory was a concept jointly developed by Lotus, Intel and Microsoft (LIM Expanded Memory System or LIM EMS) to provide access on the original 8086 PC to a much larger memory area than was possible using the 20 bit external address lines directly. The concept (see Fig. 5.22) entails allocating a spare 64 kbyte slot in the upper memory area where the adaptor card and BIOS extension ROMs are usually fitted. This slot is then viewed as an EMS window which contains four 16 kbyte pages. The pages can be physically mapped onto four 16 kbyte areas of memory on a card populated with up to 8 Mbyte of memory. The four pages can each be switched to accessany16 kbyte memory area on the card, and thus programs can have real mode access to a maximum of 8 Mbyte of memory, albeit only 64 kbyte at a time.

As mentioned above, the driverEMM386.SYSprovides an emulation of the EMS card facility. Almost no systems these days have separate EMS memory cards. Instead,EMM386.SYStakes the high memory made available byHIMEM.SYSand uses that as though it were being accessed from an EMS memory card. This therefore gives us one means of providing real mode access to extended memory blocks. There are a number of other proprietarymemory managersthat operate in a similar fashion.

The expanded memory provided byEMM386.SYSmay be used in a number of ways to reduce the loading of the very limited 640 kbyte region. Software drivers may be loaded in emulated expanded memory by means of theDEVICEHIGHcommand in CONFIG.SYSand terminate and stay resident programs may similarly be loaded in emulated expanded memory by means of theLOADHIGHcommand inAUTOEXEC.BAT. In addition, BIOS code can be copied into emulated expanded memory and the addressing and interrupt vectors adjusted accordingly. The advantage of this is that execution of code in, for example, 64 bit extended memory DRAM tends to be faster than execution of the same code in 8 bit BIOS ROM (Intel, 1998a, p. 12). Extended memory used in this way is often calledShadow RAMand this may be specified in the BIOS SETUP program. Finally, usingHIMEM.SYS, parts of MS-DOS can be loaded directly into the high memory area by means of theDOS=HIGHcommand.

Documento similar