• 沒有找到結果。

The Memory and I/O System

在文檔中 THE INTEL MICROPROCESSORS (頁 36-44)

The memory structure of all Intel-based personal computers is similar. This includes the first per-sonal computers based upon the 8088, introduced in 1981 by IBM, to the most powerful high-speed versions of today, based on the Pentium 4 or Core2. Figure 1–7 illustrates the memory map of a personal computer system. This map applies to any IBM personal computer or to any of the many IBM-compatible clones that are in existence.

The memory system is divided into three main parts: TPA (transient program area), system area, and XMS (extended memory system). The type of microprocessor in your computer deter-mines whether an extended memory system exists. If the computer is based upon a really old 8086 or 8088 (a PC or XT), the TPA and systems area exist, but there is no extended memory

Memory system Microprocessor I/O system

FIGURE 1–6 The block diagram of a microprocessor-based computer system.

15M bytes in the 80286 or 80386SX 31M bytes in the 80386SL/SLC 63M bytes in the 80386EX

4095M bytes in the 80386DX, 80486, and Pentium 64G bytes in the Pentium Pro, Pentium II, Pentium III, Pentium 4, and Core2

1M bytes of real (conventional) memory FIGURE 1–7 The memory

map of a personal computer.

area. The PC and XT computers contain 640K bytes of TPA and 384K bytes of system memory, for a total memory size of 1M bytes. We often call the first 1M byte of memory the real or con-ventional memory system because each Intel microprocessor is designed to function in this area by using its real mode of operation.

Computer systems based on the 80286 through the Core2 not only contain the TPA (640K bytes) and system area (384K bytes), they also contain extended memory. These machines are

often called AT class machines. The PS/l and PS/2, produced by IBM, are other versions of the same basic memory design. Sometimes, these machines are also referred to as ISA (industry standard architecture) or EISA (extended ISA) machines. The PS/2 is referred to as a micro-channel architecture system, or ISA system, depending on the model number.

A change beginning with the introduction of the Pentium microprocessor and the ATX class machine is the addition of a bus called the PCI (peripheral component interconnect) bus, now being used in all Pentium through Core2 systems. Extended memory contains up to 15M bytes in the 80286 and 80386SX-based computers, and up to 4095M bytes in the 80386DX, 80486, and Pentium microprocessors, in addition to the first 1M byte of real or conventional memory. The Pentium Pro through Core2 computer systems have up to 1M less than 4G or 1 M less than 64G of extended memory. Servers tend to use the larger 64G memory map, while home/business computers use the 4G-byte memory map. The ISA machine contains an 8-bit peripheral bus that is used to interface 8-bit devices to the computer in the 8086/8088-based PC or XT computer system. The AT class machine, also called an ISA machine, uses a l6-bit peripheral bus for interface and may contain the 80286 or above microprocessor. The EISA bus is a 32-bit peripheral interface bus found in a few older 80386DX- and 80486-based systems.

Note that each of these buses is compatible with the earlier versions. That is, the 8-bit interface card functions in the 8-bit ISA, l6-bit ISA, or 32-bit EISA bus system. Likewise, a l6-bit inter-face card functions in the l6-bit ISA or 32-bit EISA system.

Another bus type found in many 80486-based personal computers is called the VESA local bus, or VL bus. The local bus interfaces disk and video to the microprocessor at the local bus level, which allows 32-bit interfaces to function at the same clocking speed as the microproces-sor. A recent modification to the VESA local bus supports the 64-bit data bus of the Pentium microprocessor and competes directly with the PCI bus, although it has generated little, if any, interest. The ISA and EISA standards function at only 8 MHz, which reduces the performance of the disk and video interfaces using these standards. The PCI bus is either a 32- or 64-bit bus that is specifically designed to function with the Pentium through Core2 microprocessors at a bus speed of 33 MHz.

Three newer buses have appeared in ATX class systems. The first to appear was the USB (universal serial bus). The universal serial bus is intended to connect peripheral devices such as keyboards, a mouse, modems, and sound cards to the microprocessor through a serial data path and a twisted pair of wires. The main idea is to reduce system cost by reducing the number of wires. Another advantage is that the sound system can have a separate power supply from the PC, which means much less noise. The data transfer rates through the USB are 10 Mbps at pre-sent for USB1; they increase to 480 Mbps in USB2.

The second newer bus is the AGP (advanced graphics port) for video cards. The advanced graphics port transfers data between the video card and the microprocessor at higher speeds (66 MHz, with a 64-bit data path, or 533M bytes per second) than were possible through any other bus or connection. The latest AGP speed is 8X or 2G bytes per second. This video sub-system change has been made to accommodate the new DVD players for the PC.

The latest new buses to appear are the serial ATA interface (SATA) for hard disk drives and the PCI Express bus for the video card. The SATA bus transfers data from the PC to the hard disk drive at rates of 150M bytes per second or 300M bytes for SATA-2. The serial ATA standard will eventually reach speeds of 450M bytes per second. Today PCI Express bus video cards operate at 16X speeds.

The TPA. The transient program area (TPA) holds the DOS (disk operating system) operating system and other programs that control the computer system. The TPA is a DOS con-cept and not really applicable in Windows. The TPA also stores any currently active or inactive DOS application programs. The length of the TPA is 640K bytes. As mentioned, this area of memory holds the DOS operating system, which requires a portion of the TPA to function.

MSDOS program

Free TPA

Interrupt vectors BIOS communications area DOS communications area

IO.SYS program MSDOS program Device drivers such as MOUSE.SYS

COMMAND.COM 9FFFF

9FFF0

08E30 08490

02530 01160 00700 00500 00400

00000 FIGURE 1–8 The memory

map of the TPA in a personal computer. (Note that this map will vary between systems.)

9MSDOS is a trademark of Microsoft Corporation and version 7.x is supplied with Windows XP.

In practice, the amount of memory remaining for application software is about 628K bytes if MSDOS9version 7.x is used as an operating system. Earlier versions of DOS required more of the TPA area and often left only 530K bytes or less for application programs. Figure 1–8 shows the organization of the TPA in a computer system running DOS.

The DOS memory map shows how the many areas of the TPA are used for system grams, data, and drivers. It also shows a large area of memory available for application pro-grams. To the left of each area is a hexadecimal number that represents the memory addresses that begin and end each data area. Hexadecimal memory addresses or memory locations are used to number each byte of the memory system. (A hexadecimal number is a number repre-sented in radix 16 or base 16, with each digit representing a value from 0 to 9 and A to F. We often end a hexadecimal number with an H to indicate that it is a hexadecimal value. For exam-ple, 1234H is 1234 hexadecimal. We also represent hexadecimal data as 0xl234 for a 1234 hexadecimal.)

The Interrupt vectors access various features of the DOS, BIOS (basic I/O system), and applications. The system BIOS is a collection of programs stored in either a read-only (ROM) or flash memory that operates many of the I/O devices connected to your computer system. The system BIOS and DOS communications areas contain transient data used by programs to access I/O devices and the internal features of the computer system. These are stored in the TPA so they can be changed as the DOS operates.

The IO.SYS is a program that loads into the TPA from the disk whenever an MSDOS sys-tem is started. The IO.SYS contains programs that allow DOS to use the keyboard, video display, printer, and other I/O devices often found in the computer system. The IO.SYS program links DOS to the programs stored on the system BIOS ROM.

The size of the driver area and number of drivers changes from one computer to another.

Drivers are programs that control installable I/O devices such as a mouse, disk cache, hand scan-ner, CD-ROM memory (Compact Disk Read-Only Memory), DVD (Digital Versatile Disk), or installable devices, as well as programs. Installable drivers are programs that control or drive devices or programs that are added to the computer system. DOS drivers are normally files that have an extension of .SYS, such as MOUSE.SYS; in DOS version 3.2 and later, the files have an extension of .EXE, such as EMM386.EXE. Note that even though these files are not used by Windows, they are still used to execute DOS applications, even with Windows XP. Windows uses a file called SYSTEM.INI to load drivers used by Windows. In newer versions of Windows such as Windows XP, a registry is added to contain information about the system and the drivers used by the system. You can view the registry with the REGEDIT program.

The COMMAND.COM program (command processor) controls the operation of the computer from the keyboard when operated in the DOS mode. The COMMAND.COM program processes the DOS commands as they are typed from the keyboard. For example, if DIR is typed, the COMMAND.COM program displays a directory of the disk files in the current disk direc-tory. If the COMMAND.COM program is erased, the computer cannot be used from the key-board in DOS mode. Never erase COMMAND.COM, IO.SYS, or MSDOS.SYS to make room for other software, or your computer will not function.

The System Area. The DOS system area, although smaller than the TPA, is just as important.

The system area contains programs on either a read-only memory (ROM) or flash memory, and areas of read/write (RAM) memory for data storage. Figure 1–9 shows the system area of a typical personal computer system. As with the map of the TPA, this map also includes the hexa-decimal memory addresses of the various areas.

The first area of the system space contains video display RAM and video control programs on ROM or flash memory. This area starts at location A0000H and extends to location C7FFFH.

The size and amount of memory used depends on the type of video display adapter attached to the system. Display adapters generally have their video RAM located at A0000H–AFFFFH, which stores graphical or bit-mapped data, and the memory at B0000H–BFFFFH stores text data. The video BIOS, located on a ROM or flash memory, is at locations C0000H–C7FFFH and contains programs that control the DOS video display.

The area at locations C8000H–DFFFFH is often open or free. This area is used for the expanded memory system (EMS) in a PC or XT system, or for the upper memory system in an AT system. Its use depends on the system and its configuration. The expanded memory system allows a 64K-byte page frame of memory to be used by application programs. This 64K-byte page frame (usually locations D0000H through DFFFFH) is used to expand the memory system by switching in pages of memory from the EMS into this range of memory addresses.

Memory locations E0000H–EFFFFH contain the cassette BASIC language on ROM found in early IBM personal computer systems. This area is often open or free in newer computer systems.

Finally, the system BIOS ROM is located in the top 64K bytes of the system area (F0000H–FFFFFH). This ROM controls the operation of the basic I/O devices connected to the

BIOS system ROM

Video BIOS ROM

Video RAM (text area)

Video RAM (graphics area) BASIC language ROM

(only on early PCs)

Free area

Hard disk controller ROM LAN controller ROM FFFFF

F0000

E0000

C8000

C0000

A0000 B0000 FIGURE 1–9 The system

area of a typical personal computer.

computer system. It does not control the operation of the video system, which has its own BIOS ROM at location C0000H. The first part of the system BIOS (F0000H–F7FFFH) often contains programs that set up the computer; the second part contains procedures that control the basic I/O system.

Windows Systems. Modern computers use a different memory map with Windows than the DOS memory maps of Figures 1–8 and 1–9. The Windows memory map appears in Figure 1–10 and has two main areas, a TPA and a system area. The difference between it and the DOS memory map are the sizes and locations of these areas.

The Windows TPA is the first 2G bytes of the memory system from locations 00000000H to 7FFFFFFFH. The Windows system area is the last 2G bytes of memory from locations 80000000H to FFFFFFFFH. It appears that the same idea used to construct the DOS memory map was also used in a modern Windows-based system. The system area is where the system BIOS is located and also the video memory. Also located in the system area is the actual Windows program and drivers. Every program that is written for Windows can use up to 2G bytes of memory located at linear addresses 00000000H through 7FFFFFFFH. This is even true in a 64-bit system, which does allow access to more memory, but not as a direct part of Windows.

Information that is larger than 2G must be swapped into the Windows TPA area from another area of memory. In future versions of Windows and the Pentium, this will most likely be changed. The current version of Windows 64 (which is now a part of Windows Vista) supports up to 8G bytes of Windows memory.

FIGURE 1–10 The memory map used by Windows XP.

Does this mean that any program written for Windows will begin at physical address 00000000H? No, the memory system physical map is much different for the linear programming model shown in Figure 1–10. Every process in a Windows Vista, Windows XP, or Windows 2000 system has its own set of page tables, which define where in the physical memory each 4K-byte page of the process is located. This means that the process can be located anywhere in the mem-ory, even in noncontiguous pages. Page tables and the paging structure of the microprocessor are discussed later in this chapter and are beyond the scope of the text at this point. As far as an application is concerned, you will always have 2G bytes of memory even if the computer has less memory. The operating system (Windows) handles assigning physical memory to the application and if not enough physical memory exists, it uses the hard disk drive for any that is not available.

I/O Space. The I/O (input/output) space in a computer system extends from I/O port 0000H to port FFFFH. (An I/O port address is similar to a memory address, except that instead of addressing memory, it addresses an I/O device.) The I/O devices allow the microprocessor to communicate between itself and the outside world. The I/O space allows the computer to access up to 64K different 8-bit I/O devices, 32K different 16-bit devices, or 16K different 32-bit devices. The 64-bit extensions support the same I/O space and I/O sizes as the 32-bit version and does not add 64-bit I/O devices to the system. A great number of these locations are available for expansion in most computer systems. Figure 1–11 shows the I/O map found in many personal computer systems. To view the map on your computer in Windows, go to the Control Panel, Performance and Maintenance, System, Hardware tab, Device Manager, View tab, then select resources by type and click on the plus next to Input/Output (I/O).

FIGURE 1–11 Some I/O locations in a typical personal computer.

The I/O area contains two major sections. The area below I/O location 0400H is consid-ered reserved for system devices; many are depicted in Figure 1–11. The remaining area is available I/O space for expansion that extends from I/O port 0400H through FFFFH. Generally, I/O addresses between 0000H and 00FFH address components on the main board of the com-puter, while addresses between 0100H and 03FFH address devices located on plug-in cards (or on the main board). Note that the limitation of I/O addresses between 0000 and 03FFH comes from the original PC standard, as specified by IBM. When using the ISA bus, you must only use addresses between 0000H and 03FFH. The PCI bus uses I/O address between 0400H and FFFFH.

Various I/O devices that control the operation of the system are usually not directly addressed.

Instead, the system BIOS ROM addresses these basic devices, which can vary slightly in location and function from one computer to the next. Access to most I/O devices should always be made

through Windows, DOS, or BIOS function calls to maintain compatibility from one computer system to another. The map shown in Figure 1–11 is provided as a guide to illustrate the I/O space in the system.

在文檔中 THE INTEL MICROPROCESSORS (頁 36-44)