HOME
TOPICS
ABOUT ME
MAIL

 
Even if the PC has more than 640K of memory, the only part of RAM that DOS can run programs in is the area below 1 megabyte.
  technofile
Al Fasoldt's reviews and commentaries, continuously available online since 1983

How IBM messed up 'IBM-compatible' PCs forever


By Al Fasoldt
Copyright © 1993, The Syracuse Newspapers

   Life would have been easier for PC users if the IBM engineer who designed the PC's memory layout had taken a little longer to think things through.
   The engineer wrote a magazine article a few years ago explaining why he had stuck a barrier right at the 640-kilobyte mark.
   Basically, he did a quick job, not knowing at the time that he would be causing headaches for programmers and users for years to come.
   All PCs since then -- all compatibles and clones, and all genuine IBM models, too -- have had to use the same design. (After all, that's what "compatible" means.) The barrier is the place where the PC's random-access memory -- the place were all programs are run under MS-DOS -- runs out of breathing room.
   Just past that 640K mark, IBM stuck parts of the PC's operating system into a different kind of memory, called ROM (read-only memory).
   Even if a PC has its own RAM past 640K, that ROM gets in the way, and that means the maximum continuous block of memory that can be used by DOS is ordinarily 640K, minus a little for code that is stuck at the other end of RAM.
   Even if the PC has more than 640K of memory, the only part of RAM that DOS can run programs in is the area below 1 megabyte.
   Because of the way DOS was designed, it can't deal with more than 1 megabyte at a time.
   Obviously, 1 megabyte is a lot more than 640K. It's 384K more, in fact. (The total, 1024K, is exactly a megabyte -- which, as you can see, is more than a million bytes. Isn't computer math grand?) So the problem is this: DOS can work with 384K more than the 640K that's normally available, but the PC's ROM code gets in the way.
   The PC's code doesn't take up the full 384K, which means there are blank areas that DOS could use, scattered around that 384K -- a few hundred bytes here, a few thousand there.
   That's where a memory trick comes in handy. Software called a "memory manager" looks for empty regions within that 384K where it can place any of the small auxiliary programs that PCs run -- a mouse program, for example.
   Putting a few thousands bytes of mouse code into the area above 640K frees up the same amount of space in the main area of RAM.
   These memory managers sometimes do an even neater trick. They sometimes take the PC code that is located right past the 640K mark and move it somewhere else, higher in that 384K region.
   This takes the 640K barrier away and turns it into a 703K barrier or a 730K barrier, and so on.
   Technically, the ROM code isn't really moved. It's remapped. The addresses - the places in memory where DOS expects to find the code -- are forwarded to the new locations, in a method that's just like forwarding mail.
   All this isn't easy, and it only works on newer PCs that have actual RAM in that 384K area.
   But when it works, it helps a lot.