More About Memory

Knowing the physical properties of memory is one thing, you must know how it works.  We will look at in data error control.

Data Parity

The first component you must know is Parity.  Parity memory systems use an extra bit of information when transferring data.  This parity bit is used to ensure that data is transferred accurately and completely.  The parity bit consists is a single bit of information that is used to convert data to either one or another forms of parity.  There is even parity and odd parity, but they both function in the same manner.  In even parity, if the total number of one bits is even, the parity bit is zero.  If the one-bits add up to an odd number, the parity bit is one.  This means that in the total 9 bit string, there will always be an even number of one bits.  In odd parity, the same system is used expect to create an odd number of one bits in either case.

So what exactly does this do?  Well, if the data received is in an even parity system but comes out odd or vice versa, the computer knows there is an error.  But that is all it knows.  For every error, it must re-send the entire 9 bit sequence.  This is cumbersome, but was the first error control system computers had.  

Error Correction Code

The second type of error control used is called Error Correction Code, or EEC.  It is more commonly used on current computer systems.  

ECC can detect a 4 bit error in a memory system.  Unfortunately, it can only correct a 1 bit error.  This means that it is not a complete error-fixing mechanism, but can correct small errors in memory data.  1 bit errors are much more common then 4 bit errors, so correcting them is important.  If you get an error bigger then 1 bit, the computer will report it as a parity error.

Timing

Another aspect of memory systems in the memory access time.  Memory access time is the amount of time it requires for a memory system to make a bit of data available, and is measured in nanoseconds.  Most current RAM is in the 5-10 ns access time, but older systems used RAM that had access times of around 70 ns.    There are a couple issues to remember with RAM timing, so be aware;

  • Most older motherboards require you to use the same speed of RAM in the same bank.  This does not affect SDRAM because each DIMM is in it's own bank.  But for older SIMM memory, it is important to know that all RAM must be of the same type and speed.  

  • Put slower RAM in the first bank.  Most motherboards look to the first bank for their memory timing.  If you put slower RAM in the 2nd or 3rd bank, the computer will assume it is running at the same speed as the 1st bank.  This could lead to a multitude of errors.

Logical Memory

Memory systems on computers are broken down into 4 distinct categories.  They are presented below;

Category Description
Conventional Memory The first 640K of RAM.  This memory is used by anything that runs in DOS, as well as device drivers and TSR (Terminate, Stay Resident) programs
Upper Memory The 384K above Conventional Memory.  It is also called Expanded Memory or reserved memory, and is used for system devices and BIOS shadowing.
High Memory The first 64K above the 1st megabyte of memory.  This memory is used by DOS to preserve conventional memory.
Extended Memory Any memory above the High Memory area.  This is used by Windows for data in protected mode.

Conventional Memory

Conventional memory is exactly 640K because of two early system decisions by manufacturers.  First, most early processors could not see or address more them 1MB or RAM.  Because of this,  the manufactures decided to divide RAM into two sections; Application RAM and Utilities RAM. Conventional RAM is the application RAM, and is where operating system files, application programs, and device drivers run.

Upper Memory

The upper memory block makes up the remainder of the 1st megabyte of RAM above conventional memory.  It is reserved for special motherboard and operating system purposes, such as video RAM, BIOS ROM, and adaptor ROM shadowing.

Seeing as the decision to separate the only accessible RAM that early processors could see left developers so little room to operate, special programs were generated to allow the use of unused Upper memory by applications.  This area of memory is known as expanded memory. 

The most common program to allow the use of this unused space is called EMM386.exe.  It stands for Expanded Memory Manager 386, which is the first processor that could access this expanded memory.  Expanded memory is used for DOS device drivers and memory-resident programs, which until that time had to be placed in conventional memory.  By moving these files, more application-able RAM was freed up.

You probably will never use EMM386, as since Windows 95 there has been no need for it.  In case you come across a question or an old system that requires you to use EMM386, here's a quick refresher on it's uses.

  1. At the DOS prompt, type "edit Config.sys"

  2. Ensure the line "DEVICE=EMM386.EXE" is listed

  3. Ensure that right after the previous line, the line "DOS=UMB" is in place.

  4. Save the file and exit.

After loading the EMM386 file, the expanded memory area is created.  The DOS=UMB (UMB = Upper Memory Block) moves all the TSRs and DOS drivers into the Expanded Memory area.  A sub-section of this application is the NOEMS tag.  This allows TSRs and drivers to be loaded into upper memory without EMS emulation.  Simple add the NOEMS command at the end of the DEVICE line after the EMM386.EXE file name.

High Memory

This section is the first 64K beyond the first MB of RAM.  This is the only section of extended memory that a program in real mode can access.  This section allows DOS to load a large section of itself into the High memory area, freeing up 45K of conventional memory.  This is done with the command "DOS=HIGH" inputted into the CONFIG.SYS file after the EMM386 file is loaded.  

Extended Memory

Extended memory is everything above the high memory area, from 64K above the 1MB area to the limits of the RAM the processor can address.  Don't confuse this with expanded memory, as extended memory is quite different. 

 Try to remember the differences between expanded and extended RAM, and what the high memory area is for.

Bringing it all together

One of the fundamental principles you must know is how to access and optimize the high and extended memory blocks.  Once the ability of the processor to address RAM in great values then 1MB was realized, a new problem was discovered.  DOS was never meant to address more then 1MB of RAM.  This meant that new software had to be developed to allow DOS to see the new extended limits of RAM.

The most common program to solve this problem is called HIMEM.SYS.  It is called in much the same way EMM386 is called, with a line in the CONFIG.SYS file reading "DEVICE=HIMEM.SYS".  It should come before the "DOS=HIGH, UMB listing as it will generate an error if you try to move your TSRs and DOS files into the high memory area if you haven't told DOS it exists yet.

Additional Software

MEM Type the command "MEM" at the DOS prompt to see the usage of RAM in all the memory blocks.  If you type "MEM /C" to see a report that classifies how your memory is being used, and where memory is available.  The switch "/p" gives you the report at a given instant.
MemMaker MemMaker allows you better memory management utilities, and automatically optimizes your memory settings in DOS 6.0 and above.

Know the switches for MEM, and that MemMaker is only available for DOS 6.0 and above.

For those of you now scratching your head wondering what Real Mode is, it's actually very simple.  Real mode, or a programming or device running in real mode, is using the first 1MB of RAM.  It's opposite, called protected mode, can see above the 1MB memory restriction.  Protected mode files are also separated from each other in RAM, so that no one fault or error in one driver or file can cause an error in another.

Windows Memory Management

The advent of windows brought about the need for virtual memory systems.  In order to allow for the larger applications and multitasking features of Windows, more RAM was needed than was physically possible with the processors available.  So instead of using physical RAM, virtual memory was used.

Virtual memory is memory on your hard drive rather then on your mother board.  It is kept in files called swap files.  Essentially, whenever the system requires more physical memory then it has, it asks the Virtual Memory Manager for more RAM.  The VMM assigns it hard drive space equal to the extra space it needs.  The application proceeds as if nothing is different, and the VMM handles the shifting of memory between the physical memory and the hard drive.  **Virtual memory is slower then physical memory because it is stored on the hard drive.  Because of this, you should direct your memory manager program to use as much physical RAM as it can before it starts using virtual RAM**

Windows 3.1 uses three main files to manage memory.  They are KRNL386.EXE, GDI.EXE, and USER.EXE.  Each performs a specific function, as shown below;

  • KRNL386.EXE: This file, also known as the kernel, manages memory as well as loading and executing Windows applications

  • GDI.EXE: The Graphical Device Interface handles all the functions needed to produce images on your screen, including keyboard and mouse functions, as well as print services.

  • USER.EXE:  The user interface handles user input, communication ports, and the display and interaction of icons, windows, and dialog boxes.

When you run out of memory for these files in Windows 3.1, simply go to the Virtual Memory Manager screen and allocate more hard drive space for your swap file.

Windows 95 manages memory in a slightly different way.  It eliminated DEVICE entries in the CONFIG.SYS file by replacing these files with protected mode drivers, or Virtual Device Drivers (VXD).  These files have .386 or .VXD extensions and are loaded into extended memory when the computer boots.

Windows NT has the best memory management system of all.  It doesn't require protected areas of RAM, allowing files to access memory in any amounts that they require.  The building of Windows NT from scratch allowed it to by-pass many DOS hang-ups that were left in for compatibility with Windows 95 and Windows 3.1.


 

Hosted by www.Geocities.ws

1