I'm not very good at remembering faces which can be embarrassing at times. I have on many occasions been stopped by people in the street who obviously know me and asked some quite technical question. Afterward I wander down the road thinking 'who the hell was that?'

I have no idea why I should be so bad at faces, but it seems to me most people have difficulty at remembering some things but not others. There are probably a number of people who could explain all about memory and why some of us can't remember certain things. But - I have a theory. It's not a very good theory and I expect most of you could find holes in it, but I like it. And by an amazing coincidence my theory also fits in with what I want to talk about this month. :-)

My theory is that we only have a small amount of short term or conventional memory, although we have a lot of long term storage. Since we have a limited amount of conventional memory we have make sure that we configure it properly ie put stuff we don't need very often into long term storage. In my case my brain has decided that remembering faces is not very important and so it has bunged all the faces into long term storage. Then when people stop me and ask questions I'm too busy thinking about their problem to recall their faces from my long term storage. See I told you it was amazing :-)

Just as, according to my theory, you have to configure your memory in order to get it to work best, so you must configure the memory on your PC. The thing is that trying to sort out memory on a PC can appear to be a daunting task. However, in practice it does not take much to make a big difference and what I would like to do this month is explain how you can better organise your memory.

Thanks for the Memory

~~~~~~~~~~~~~~~~~~~~~

When the IBM Personal Computer first came out it was a pretty good specification machine. Not, perhaps the best but it was made by IBM and hence immediately became the standard. At that time a lot of micro-computers had 64 Kilobytes of memory and used cassette tape for storage. The real power users did have floppy disk drives which were quicker than tape but not always as reliable. Then the IBM PC came out. The top of the range machine had 640 Kilobytes of memory, a floppy disk drive and a 20 Megabyte hard disk. This was real power user stuff, and there was no way any one was going to need more. Well not in the near future, say 15 to 20 years or so.

Have you ever noticed that there is one thing which is 100% reliable. It never fails, ever. And anyone can use it with out any training at all. It's called Hind Sight. Looking back now it's obvious that micro-computers would evolve and grow. It was also obvious that sooner or later we would need a lot more memory and disk storage than was available. What was not so obvious was the speed at which the changes came. But, none of that would have mattered except for one thing, which none of us could have anticipated. The success of the IBM PC.

The exact number of PC's in the world to day is not known but most estimates put it at around 60 million. This very success has caused a number of problems, mainly in ensuring that any new hardware or software is compatible with what came before.

This backwards compatibility has caused a number of problems with Dos itself. Ideally Dos should be thrown away and a new operating system written from scratch. Both IBM, with OS/2 and Microsoft with Windows 95 have tried to do this, but in both cases they also needed to make sure that Dos programs would run. Thus while both OS/2 and Windows 95 are nice operating systems they are big, bulky and don't work as well as they should do. For example one of the main selling points of OS/2 and Windows is their ability to run more than one program at the same time, known as multi-tasking. The thing is that the Macintosh and even the 'lowly' Amiga have been able to do that for many years and with a lot less hardware.

One of the drawbacks of Dos is the way it uses memory. [By the way when I talk about memory I mean Ram and Rom and not disk storage. I mention this cos I know that some people can get confused since both use the same units.] When the IBM PC was developed the CPU chosen was the Intel 8086. This processor was capable of addressing a 'massive' 1 megabyte, which was far more than anyone would ever need. Thus when Dos was written it was decided that 360 kilobytes of memory, between the 640 Kb mark and the 1 Mb mark, would be reserved for system use. This left 640 Kb available for programs. An amazing 10 times or more than people had been used to.

At first 640 Kb was enough, but before long people started to see what could be done and then they wanted more. This meant that programs had to get bigger, and soon the programmers were hitting the 640 Kb barrier. By now we had moved on from the 8086 to the 80286, more commonly referred to as the 286, and the 386 [actually the 80386 but who's counting]. These processors were capable of using much more than 1 Mb of memory and naturally the programmers wanted to use it. The trouble was that Dos had nicked this 360 Kb area and furthermore it didn't even know that there was more.

The other problem with memory was that in practice the full 640 Kb was never available. Most people had various programs loaded in memory all the time. These included things like keyboard drivers, pop up calendars and diaries and so on.

It wasn't long before programmers started looking around to see if they could find some more memory somewhere. The first thing they looked at was the bit between 640 Kb and 1 Mb, which now a days is called the Upper Memory Area. They noticed that a lot of this area was unused most of the time and so they came up with various memory managers which were designed to make use of this area. These memory managers allowed you to put things like your Keyboard drivers in the upper memory area, thus leaving more room for your programs.

The next area they looked at was the memory above 1 Mb, which is known as Extended Memory or XMS for short. While the CPU's in use by then were capable of accessing this extended memory, the motherboards were not. Therefore three of the big players in the PC industry at that time, Lotus, Intel and Microsoft got together and came up with a method of adding memory using an expansion board. This method was known as the Lotus, Intel, Microsoft Expanded Memory Specification or LIM EMS. Needless to say this quickly got abbreviated to EMS.

Nowadays all the memory is stored on the motherboard. That is the memory above 1 Mb is all Extended memory or XMS. However, some programs still use Expanded memory so some or all of the XMS can be configured to be EMS. Confusing isn't it?

Time for a diagram:-

       +------------------------------------------------------------+
       |                                                            |
       |                                                            |
       |                                                            |
       |                                                            |
       |                       Expanded (EMS)                       |
       |                                                            |
       |                           and/or                           |
       |                                                            |
       |                       Extended (XMS)                       |
       |                                                            |
       |                           Memory                           |
       |                                                            |
       |                                                            |
  1 Mb +------------------------------------------------------------+
       |                                                            |
       |                                                            |
       |                                                            |
       |                     Upper Memory Area                      |
       |                                                            |
       |                                                            |
       |                                                            |
640 k  +------------------------------------------------------------+
       |                                                            |
       |                                                            |
       |                                                            |
       |                         User Area                          |
       |                                                            |
       |                                                            |
       |                                                            |
 64 k  +------------------------------------------------------------+
       |                   Reserved for system use                  |
  0    +------------------------------------------------------------+

For those of you who would like a more detail there is a bigger table at the end of this article.

So to summarise, we have conventional memory which is below 640 Kb. The Upper Memory area, which is between 640 Kb and 1 Mb and the rest, which can be either Extended or Expanded or both.

Now, you may think that since we now have access to the memory above 1 Mb our memory problems are over. If you need more memory all you have to do is buy some.

Right?

Wrong.

The problem is that Dos is still restricted to the 1 Mb region and it still needs the area above 640 Kb for the system. This effectively means that all your programs must fit within the 640 Kb limit. Once they are loaded they can make use of the bit above 1 Mb but the main program must fit below 640 Kb. This incidentally is true even with Windows 3.x and 95. However, Windows does some clever things with programs and memory so things loaded after Windows are much less restricted, especially with Windows 95. That having been said, with Windows 3.x, and in some cases Windows 95, it is necessary to load things during start up. For example CD Rom drivers, sound card drivers and so on. When this happens conventional memory is used up and this can cause problems, even with Windows 95.

So how can we configure conventional memory to prevent these problems?

Well, I mentioned earlier that the Upper Memory Area has a lot of unused space in it. At one time it was not possible to directly make use of this area, but then various programs were written to allow you access. QEMM is probably the most famous program of this type. Then with Dos 5 Microsoft provided the tools necessary to access the Upper Memory Area. Basically Dos 5 introduced two new commands, DeviceHigh and LoadHigh.

The first of these, DeviceHigh, allows you to put device drivers such as you keyboard driver in the upper memory. To put it another way, if you load it in Config.Sys then DeviceHigh will load it in upper memory.

The LoadHigh command is a Dos command which can be used to load TSR's in upper memory. [A TSR in case you don't know is a Terminate and Stay Resident program, ie one which sits in memory waiting for you to do something. An example is the DosKey program.] That is anything you load in Autoexec.Bat can be loaded into the upper memory area by using LoadHigh.

In order for these two commands to work it is necessary to first load two device drivers, HiMem.Sys and EMM386.Exe and tell Dos that the upper memory area is available.

HiMem.Sys allows Dos access to extended memory, while EMM386.Exe configures some or all of this extended memory as expanded memory. It also provides access to the upper memory area.

The command to tell Dos that the upper memory area is available is Dos=UMB. Incidentally Dos itself, or at least part of it can be placed in the upper memory area with the command Dos=High.

So then all that is required to get more convention memory is load HiMem.Sys and EMM386.Exe, add the Dos=High,UMB command, change all the Device= commands to DeviceHigh= command and use LoadHigh for everything in Autoexec.Bat?

Well - not quite. That will certainly give you more conventional memory, but may not give you the maximum possible. Also some programs will not work very well in the upper memory area. Finding out which programs will not work very well in the upper memory area is, I'm sorry to say a matter of trial and error. Getting the maximum amount of conventional memory on the other hand is reasonably easy.

Continued...

Dave Wadler (dwadler@cix.compulink.co.uk)

| Contents | Reviews | Features | News | Tips | Links | Contributors |
Game-Over! magazine is produced and published by Game-Over
Editor: Tony Burnett - Web Editor: Gary Kinson
All material © Game-Over! 1997