|
||
|
| All About...Memory |
Email This
View My Personal Library |
|
System Hardware February 1998 Vol.4 Issue 2 |
All About...Memory | ||
|
Jump to first occurrence of: [CONFIG.SYS] It's unfortunate that memory—one of the most important gauges in measuring your computer's capabilities—is made so intimidating by the coded language used to describe it. But don't be scared off. It's worth your time to sort out all the letters because you'll use that information to understand your current components and decide if you want to, or can, make a change. But before we delve into the subtle difference between EPROM and EEPROM, let's cover the basics. Though the information is tedious, a background knowledge of how memory works will help you understand how your computer works. Then we will show you how to reallocate your memory resources so your computer will operate at maximum efficiency. For now, think of memory as a station wagon, complete with a cartop carrier and a trailer, transporting a full load of passengers and all their baggage. The passenger area in the station wagon represents conventional memory, where the passengers and their belongings reside. This small space becomes cramped quickly if it isn't organized properly. Similarly, your computer's 640 kilobytes (KB) of conventional memory is expected to accommodate the Windows operating system along with DOS and the programs that run from DOS, such as games or word processors. Conventional memory, just like passenger space, clutters easily, and if you run out of it, your programs won't run. The back of the station wagon signifies upper memory. Though the passenger area is overflowing, the back tends to be rather empty except for a spare tire, a jack, and perhaps a few tools. Likewise, your computer's upper memory is composed of 384 virtually uncluttered kilobytes. That's where system hardware information, such as video data destined for the screen, is stored. Conventional and upper memory together make up the first megabyte of memory in a computer, just as the passenger space and the back storage area make up the station wagon. The empty space in the back of the station wagon represents the upper memory blocks (UMBs). Up to 160 of the 384 kilobytes in upper memory are usually empty. These are the upper memory blocks, and later in the article, you'll find out how to fill them. Remember: Your computer comes with the first two levels (conventional and upper) of memory; you must activate any extra storage space in your computer. The cartop carrier represents the extended memory (XMS) that can be activated in your computer. Cartop carriers free up valuable passenger space by storing baggage overhead. Likewise, extended memory is storage space for your computer. Its size depends upon the amount of RAM in your computer. Among other things (you'll learn which ones later), you can free up space in conventional memory by storing DOS itself in the first 64KB of extended memory. This new home for DOS is called the high memory area (HMA). Even with a cartop carrier, passenger space might be a bit cramped. Suppose there are items you can't store in the cartop carrier because the heat of the sun would harm them. You try to store this baggage in the passenger area, but there's simply no room. You have to expand into a trailer pulled behind the station wagon. The trailer represents expanded memory (EMS) in your computer. Programs that need it can use it as a separate reservoir of memory. Here's how expanded memory works. As your travels progress, one of the passengers decides he needs to do some homework, but his books have been stored in the trailer. He retrieves four books from the trailer and puts them in the back of the station wagon. He then can reach for one book at a time, and when he's finished with those, can return them to the trailer and get four more books. There isn't room in the back of the station wagon for all of his luggage, but as he needs books for homework, you can retrieve them, four at a time. That's how your computer runs programs whose information has been loaded into expanded memory. When a program calls for information, it gets it, piece by piece. You did not load the whole suitcase into the back of the station wagon when your passenger needed only one book. In the same way, only 64KB of information from expanded memory are made available at a time. The 64KB section, called a page frame, is placed in upper memory where it is easily accessible to programs running in conventional memory. The page frame is divided into four 16KB pages, and a program is shown only one page at a time. These four pages switch in and out of upper memory as they are needed. Memory itself comes in the form of memory chips, the integrated circuits that hold information. These chips store information in binary form, consisting of 0s and 1s that represent on and off. Each unit of information, a 0 or 1, is known as a bit, which is short for binary digit. Eight bits make up a byte, and all the information in your computer is processed in these bytes. Memory is also measured in these terms, so you'll hear users describe their RAM capacity, for instance, as something like 16 megabytes (about 16 million bytes). Memory can be sorted into two categories with vastly different tasks: RAM and ROM. Most often, when you hear about memory, you're hearing about RAM, the place a computer temporarily holds information currently being used so the data can move quickly between the central processing unit (CPU), and the operating system. Essentially, RAM is where the CPU, the computer's main processing chip, does its "thinking." Information in RAM can be stored and accessed randomly, and therefore, more rapidly (as opposed to the linear information access on, for example, a tape cassette). RAM should not be confused with storage, which is where information is permanently held on your computer, much like a file cabinet where you keep your folders. This is an important distinction that often confuses people. Just remember that when you open an application or data file, it's loaded from storage (usually your hard drive or a diskette) into memory. RAM is the vital workspace of computing; the more RAM a system contains, the more information it can handle, and the more programs it can run at one time. (Note that the arrangement of information in RAM also determines how much data your PC can handle.) RAM is often compared to the top of a desk, where you spread out a group of files so you can quickly access information in any of them. The programs you use determine how much RAM you need. Graphical programs, for example, handle a lot of information and require much more RAM than word processors and spreadsheets. Though RAM holds your information while you're working on it, it's no place to leave data between work sessions. When the computer loses power, RAM loses all the information it contained. Even if power is gone for only a few seconds, RAM still forgets be cause it is volatile (nonpermanent). That means a blink in the power can erase hours of work on a big report if you haven't been continually saving your work to permanent storage on a hard drive or diskette. RAM's volatility comes in handy, however, when you can "fix" a computer by just turning it off and then on again to clear memory. Aside from its unfortunate acronym, you might have a bad association with RAM because it usually introduces itself by punching you in the face with a notice that you're short on memory. Though these warning messages can be maddening, their bright side is that you can free up memory by shifting some files around. Even if you need to physically add more RAM chips to meet your needs, the news isn't all bad. Upgrading your RAM often is the cheapest way to speed up your computer. The other common type of memory, ROM, as its full name of read-only memory implies, is a type of memory that—for the most part—only can be read and not changed; it also retains its contents even when the computer is off. ROM is important to personal computer users because it contains many of the basic instructions a computer needs to operate in the Basic Input/Output System (BIOS, pronounced "bye-ose"). Without looking at the BIOS instructions stored on ROM, a computer won't even know how to read important files such as the Config.sys and Autoexec.bat files that are integral parts of starting up DOS. The BIOS is always stored in ROM, and for the most part, it's all that's stored there. For that reason, ROM and BIOS are so interconnected that you'll hear the terms ROM BIOS and BIOS ROM used interchangeably. BIOS controls a computer's start-up processes and basic components such as the keyboard, display, and disk drives. "It's a layer between the hardware and the software," says Frank Lazaro, marketing specialist at American Megatrends Inc., which manufactures BIOS. "It controls all the information between them. If the software wants to access the hard drive, it has to go through the BIOS to make sure that the hard drive is working." The BIOS translates between the two because hardware speaks a machine language and software speaks a programming language. Because of this, BIOS is considered a type of firmware, which is neither hardware nor software. BIOS is like software in that it contains instructions; but unlike software, it is an intricate part of the motherboard's circuitry that generally isn't changed by the user. (The motherboard is the computer's main circuit board.) The BIOS traditionally was built into the ROM chip during the manufacturing process. Later technology allowed ROM to be programmed after the manufacturing process—but only once. Now, as we'll explain later, an increasing number of computers have ROM that can be erased and reprogrammed with special tools or processes. Instead of being stuck with the original BIOS instructions, users can customize ROM to fit user needs. Note that your computer's main ROM and BIOS—located on the motherboard—are usually the ones you hear mentioned, and they're the ones on which we will focus. Your computer, however, may have other components with their own BIOS and ROM. For instance, a video card used to speed up graphics may have ROM programmed with video BIOS, which contains instructions that initialize the hardware on the video card. The technology of the chips themselves might be the same as chips on the main ROM, but they're programmed differently. (For more information about BIOS, see "All About . . . The BIOS" in this section.) Now that you have a general idea about how RAM and ROM work, you're ready to sort things out a little further. We mentioned earlier that RAM loses the information it contains after the computer loses electricity. RAM's way of remembering anything, for any length of time, is one of the major factors leading to different types of RAM. The most common type of RAM, known as dynamic RAM (DRAM, pronounced "d-ram"), has such poor retention that it must remind itself every few milliseconds what it's supposed to remember. That's because the electric charges representing information only store data for a brief time, like a bucket with holes in it. To compensate, the chips continuously read and rewrite the information in a process known as refreshing. If the computer loses power, all the water drains away. DRAM chips contrast with static RAM (SRAM, pronounced "s-ram") chips. SRAMs consist of tiny transistors that are on/off switches. These switches don't require refreshing, although they still lose their memory if the PC loses power. SRAMs are faster but more expensive and bulky than DRAMs, so your computer probably uses DRAM chips. SRAM is used only in special situations where speed is most crucial. DRAM is broken down even further, but the "guts" of the three main types of DRAM are all the same, says Lucas King, a memory product manager at Kingston Technology Corp., a memory module manufacturer. The chips are manufactured in a process similar to developing film, involving a complex layering of materials exposed to chemicals, X-rays, and light and laid out in rows and columns, with each square a memory cell. The type of DRAM used depends upon the computer. If you have a 386 or 486 microprocessor, you most likely have fast-page mode (FPM) memory, which locates information like you would in a book—by turning to a particular page, then selecting the appropriate information from that page. Most Pentium microprocessors, on the other hand, have RAM that uses a technology called extended data out (EDO), which is almost the same as FPM but faster. EDO lets the computer begin accessing new data even before it has finished reading the previous data. This shaves off enough time so that the chip can operate about 10% to 15% faster. When you enter the realm of 200 megahertz (MHz) Pentium and Pentium Pro CPUs, you start seeing synchronous DRAM. Synchronous DRAM has a clock connecting the memory to the system clock, which controls the operations of the microprocessor's different chips. Having the input and output processes in sync makes the computer operate more efficiently. In essence, says Gary MacDonald, vice president of marketing at Kingston, "each one of these is incrementally a bit faster than the preceding architecture. It's part of the game of catch up with the microprocessor." That's because microprocessors, right now, perform so quickly that the memory often acts as a bottleneck between the microprocessor and the operating system. When it comes to types of RAM, your computer has what it has. You can't upgrade from, say, EDO RAM to synchronous DRAM, and the type of RAM isn't one of the key considerations even when it comes to buying a computer. What's important is how much RAM you have. Understanding different types of RAM, however, will help you when the time comes to add more RAM to your machine—if for no other reason than you'll be able to nod intelligently at the salesperson and boast to your friends that your RAM is the grooviest. Separate from all of this is a type of RAM called video RAM (VRAM, pronounced "v-ram"), a special, more expensive type of RAM chip. VRAM chips can send information to the monitor at the same time they receive new information. This type of chip, which is frequently needed for graphics-intensive software, such as three-dimensional (3-D) games and graphics applications, often is placed on a video card to speed the creation of on-screen images. ROM has about as many variations as RAM. Remember how we said that ROM instructions usually were built in during the manufacturing process and couldn't be changed? Exceptions to the rule lead to the different types of ROM. For cases where the ROM isn't being manufactured in extremely large capacities, with the BIOS instructions as part of the manufacturing process, newer technologies allow ROM to be programmed. This type of ROM is often called, not surprisingly, programmable ROM (PROM, pronounced like that infamous high school dance). Some PROM can be written to only one time. Today, however, the most popular kind of PROM is erasable PROM (EPROM, pronounced "e-prom"), which can be erased and reprogrammed when removed from the motherboard and exposed to ultraviolet light. Almost all new computers will have some type of PROM, but you probably will want to check which kind of ROM a computer has before you buy it, just for future reference. EPROMs have a clear window covered with a label. Lifting the label exposes the semiconductor chip and lets it be reprogrammed with different BIOS instructions. Normal indoor lighting, which contains little ultraviolet light, won't erase the chip, but bright sun shine over several years can erase EPROMs. The correct dosage of ultraviolet light erases the chips in a short length of time, and manufacturers change EPROMs with a special hardware device called a PROM blaster. Electrically erasable PROM (EEPROM, called "double-e-prom") can be erased and reprogrammed with an electrical process in which a higher-than-normal voltage is applied to the chip. The BIOS can be rewritten without being removed from the machine, but because EEPROM is more expensive than EPROM, it's less popular and is rarely used on the motherboard of a PC. Newer computers store BIOS on flash ROM, which is similar to EEPROM in that it can be electrically rewritten. It started becoming common in about 1995 because it's cheaper than EPROM and easier to reprogram, says Robert Braver, president of Micro Firmware, a BIOS manufacturer. After you find the correct installation diskette, updating the BIOS instructions is—theoretically—a simple task, thanks to flash ROM. You won't even have to remove the CPU's cover. Now that you have a primer about how your computer's memory works, it's helpful to know how your computer's memory can work for you, especially if you own an older computer. First, some computing history. In the early days of DOS, there weren't any problems fitting both DOS and the programs that ran from it into 1MB of memory. DOS' creators didn't realize that programs such as word processors and games eventually would become so large and full of graphics that they would require more space. However, the new versions of DOS still need to be compatible with the programming of the older versions, so users are limited to only 1MB for running DOS and its programs. To maximize your computer's memory, you need to find the solution that leaves as much free space as possible in conventional memory. If you have DOS 6.0 or newer, the best method is to let MemMaker automatically handle memory allocation (which we'll discuss later in this article), but if you have an older version, you should follow the steps below. Before you start restructuring your computer's memory, it's best to see what it looks like now. This is where the MEM command comes in (if you have DOS 4.0 or newer). Exit to the DOS prompt and type mem at the C> prompt. Here is what you will find. • The types of memory and the total amount of memory in your computer. Remember: You won't see any information about extended memory if you have less than 640KB of RAM, nor will you see anything on expanded memory unless it already has been activated. Upper memory won't be mentioned either unless you've activated both expanded memory and the upper memory blocks for storage. (NOTE: Before you begin restructuring your memory, it's advisable to create a backup of your current system files just in case something goes wrong. To do this, insert a diskette into the diskette drive and type copy c:\config.sys a: at the C> prompt. Copy one more file by typing copy c:\autoexec.bat a: at the next prompt.) Now you should be ready to go. If you ran the MEM command and the computer did not say DOS was loaded in high memory, follow the instructions listed below. It is possible that extended and expanded memory already have been activated in your computer, and you probably will benefit the most from the DEVICEHIGH and LOADHIGH commands that will be explained later. But in case extended and expanded memory have not been activated, here are the steps to do that. 1. Begin by opening the Config.sys file by typing edit c:\config.sys at the DOS prompt. (Config.sys is an abbreviation for CONFIGure the SYStem and is a file that helps programs open and run more quickly. It knows which device drivers to load into memory, and it tells DOS which command processor to load.) You'll see a blue screen pop up with the contents of your Config.sys file. Here's where you'll make the changes. (NOTE: If you have DOS 4.0 or older, you would type edlin instead of edit.) 2. At the top of the list, type device= c:\dos\himem.sys. (Just place your cursor at the top of the screen and press ENTER to create an extra space for this new line.) When you load the station wagon for a trip, you usually need some help, so you assign one passenger to be in charge of the cartop carrier. That passenger represents Himem.sys, the extended memory manager, which tells your computer how to use extended memory and the high memory area. Adding this command to Config.sys opens up the high memory area for use by DOS. 3. Directly below that line, type device= c:\dos\emm386.exe. The passenger you assign to be in charge of the trailer represents Emm386.exe, the expanded memory manager. (Emm386.exe tells your computer how to use the expanded memory needed for many of today's popular DOS programs.) You now need to make some decisions about how you want your upper memory space filled. These decisions will affect what you add to the end of the Emm386.exe command line. Emm386.exe can be configured in three different ways to provide you with access to only expanded memory, to only the upper memory blocks, or to both at the same time. Your decision will be based upon your computer needs. Remember how we compared memory to a station wagon? Suppose you need trailer storage space, and you want to use the storage space in the back of the station wagon. If you play the elaborate games that use expanded memory and receive information through page frames, you need to make the above command line look like this: device=c:\dos\emm386. exe ram Suppose, however, that you don't have anything that needs to be stored in the trailer. Obviously, without a trailer, you won't have passengers needing items temporarily moved from the trailer to the back of the station wagon, and you won't need to save room in the back for this purpose. Similarly, if you don't have programs that need expanded memory and page frames, don't create them. The 64KB page frame would only be a waste of upper memory space. To maximize storage space in upper memory, modify the Emm386. exe command line like this: device=c:\dos\emm386.exe noems But what if you have certain baggage that must go in the trailer, and you don't have anything in the passenger space that could be loaded in the back of the station wagon? If you use MS-DOS applications or play DOS games, you need expanded memory to hold the page frames in upper memory. But you may not need upper memory blocks to hold device drivers (special programs in conventional memory that let the computer communicate with peripheral devices, such as printers and keyboards) and terminate-and-stay-resident programs (TSRs; programs that sit in conventional memory, taking up space, until called on for use). If this is your situation, modify the Emm386.exe command line to look like this: device=c:\dos\emm386. exe [ ramvalue] By the time you're ready to load the back of the station wagon, you've probably already packed the biggest suitcases, hanging bags, and boxes in the cartop carrier or the trailer. Of the remaining items cluttering the passenger space, you start moving the largest ones to the back, such as ice chests and duffel bags, until there are only small nooks and crannies left to be filled. You then reach for little things such as backpacks, purses, and coats. A combination of large and small items efficiently fills the back and frees up passenger space. On the computer, you begin by loading the largest TSRs and device drivers into upper memory. You then load the smaller ones until the entire space is filled. You might have to experiment with different combinations before you find the perfect mix of large and small items to load into upper memory. At the C> prompt, type mem/c/p to bring up a list of installed programs and drivers along with their sizes in kilobytes and where they currently reside in your computer. Now you can view the files, looking for the most efficient way to arrange them within the available memory. When you choose to load a program into upper memory, you will need to use the LOADHIGH command found in the Autoexec.bat file. (That's short for the AUTOmatically EXECuted BATch file. In this case, all commands in the file will be carried out when your PC starts up.) At the DOS prompt, type edit c:\autoexec.bat. Simply type lh (for loadhigh) in front of the program you want placed in upper memory. Remember: This only will work if your computer has at least a 386 microprocessor, and you've already added Emm386.exe to your Config.sys file. Some programs that are especially good to load into upper memory include Doskey, the DOS Shell, Keyb, Graphics, Nlsfunc, Mode, Share, Print, and Append. DEVICEHIGH is a command that you enter into your Config.sys file. It's used to load device drivers into high memory. At the DOS prompt, type edit c:\config.sys. DEVICEHIGH commands only can be used below the Himem.sys and Emm386.exe command lines, which you should already have entered into Config.sys. In the file, you should see a number of device drivers listed, each command line beginning with DEVICE. All you need to do is change DEVICE to DEVICEHIGH, and the driver will load into upper memory. If the computer finds no space in upper memory, it will load the driver into conventional memory as usual. Because you're running Emm386.exe, you can move some of the DOS utilities into upper memory by changing the command line "DOS=high" to read dos=high,umb. If you use DOS 6.0 or newer, you can enjoy the relative ease of using MemMaker to organize your computer's memory. In a few short steps, this user-friendly program reorganizes the data within memory to optimize efficiency. Even though few problems are likely to arise while running MemMaker, it's still a good idea to back up your Autoexec.bat and Config.sys files before you start. To do this, follow the same instructions for saving given earlier in the article. 1. Type memmaker at the C> prompt and press ENTER to start the program. 7. This time, both you and the computer watch for snags in the startup process. Press ENTER if you don't see any problems. It is best and easiest to use MemMaker rather than trying to configure your computer manually. But however you choose to divide up your PC's memory, don't let DOS intimidate you; say good-bye to "insufficient memory" without getting burned by your acronym soup. by Sarah Scalet and Hannah Henry
|
|
Home Copyright & Legal Information Privacy Policy Site Map Contact Us