At 06:17 PM 4/12/01 +0100, Virginia Da Costa wrote the following:

>While testing my machine (P166, 128 MB RAM, Win 98 SE) for memory problems,
>I came across the following mystery ...
>
>If I boot from the start-up menu straight to Command Prompt and type "mem"
>I get the following:
>
>Memory Type        Total       Used       Free
>----------------  --------   --------   --------
>Conventional          640K        34K       606K
>Upper                 155K        68K        86K
>Reserved              384K       384K         0K
>Extended (XMS)    129,893K     2,421K   127,472K
>----------------  --------   --------   --------
>Total memory      131,072K     2,907K   128,165K
>
>Total under 1 MB      795K       102K       693K
>
>Largest executable program size       606K (620,560 bytes)
>Largest free upper memory block        86K  (88,304 bytes)
>MS-DOS is resident in the high memory area.
>
>... showing the full total amount of memory.
>
>Whereas, when I do the same thing from a Dos window, this is what I get:
>
>Memory Type        Total       Used       Free
>----------------  --------   --------   --------
>Conventional          640K        47K       593K
>Upper                 155K       155K         0K
>Reserved                0K         0K         0K
>Extended (XMS)     65,317K          ?   127,652K
>----------------  --------   --------   --------
>Total memory       66,112K          ?   128,245K
>
>Total under 1 MB      795K       202K       593K
>
>Largest executable program size       593K (606,816 bytes)
>Largest free upper memory block         0K       (0 bytes)
>MS-DOS is resident in the high memory area.
>
>Why the discrepancy in the left-hand column of total memory, and why the ?
>in the second column ??
>
>I thought it might be because of my intermittent memory problems with this
>machine, but I tested the same Dos commands on another Win98 machine and
>got the same results.
>
>Can anybody elucidate please? Thanks!

Once upon a time when the IBM PC was being proposed (circa 1980) to use an
Intel 8088 chip, it was decided that the addressable memory space supported
by the chip (1Mb) be divided. It was settled that DOS would occupy the first
640K of the address space. The rest of the addressable memory area would be
used to support ROM, monochrome monitors, color monitors and other uses.
Hence every chip after that had to be backward compatible to support DOS,
thus the Conventional Memory of 640K.

As PCs added more and more peripheral devices, operating systems grew more
involved, software demanded more and more features, CPUs changed, many
methods were proposed to increase the addressable memory. Some of these
method decided to use some of the addressable memory between 640K and the
1Mb boundary of DOS. This lead to Reserved Memory drivers that would use
some of this space if it was not used by some other device, for instance the
monochrome area if a color monitor was installed.

Because the original 8088 chip was limited to 1Mb addressable, newer ideas
were proposed to increase  space above this limit. After the delivery of the
80286 chip, Extended Memory Managers (EMM) were developed to use memory
above this 640K. One of the EMM's was the EMS (Expanded Memory System)
developed by Lotus, IBM and Microsoft (LIM specification).  EMS uses a 64K
page frame to address the Reserved Memory area between 640K and 1Mb. In 8086
or 8088 based systems this is the only way to use memory beyond conventional
memory.

After the delivery of the 80286 chip, XMS (Extended Memory Specification)
systems were developed to use memory above this Real Mode 1Mb. These used
XMM (Extended Memory Manager) software such as HIMEN and QEMM. This XMS
memory is not directly available in real mode, only through EMS (Expanded
Memory Sytems), UMB (Upper Memory Block),  XMS, or HMA (High Memory Area);
only applications executing in protected mode can use extended memory
directly.

In systems based on 80286 or later, XMS and HMA provide alternative methods.
The HMA (High Memory Area) device drivers use the first 64K above the 1Mb
(extended memory). The UMB (Upper Memory Block) uses up to 64K of the
expanded memory page frame above the first 64K.

When Windows 95 was developed it was decided to support the protected mode
features of the 80286 CPU. Prior to this, all Intel chips used Real-Mode.
Thus all versions of DOS and Windows 3.x where limited to Real-Mode CPU
instructions which also limited all application to 640K (DOS) of the 1Mb
addressable limit. With Win 9x and above, the extended memory is provided by
the protected-mode OS. The memory is "protected" in the sense that memory
assigned to a local "program" cannot be accessed by another program without
causing a hardware fault. This prevents programs running in protected mode
from interfering with each other's memory.

So the MEM program shows:
Conventional Memory - the first 640K of memory installed in the PC. DOS can
manage this conventional memory without any additional memory managers being
installed. The actual decimal value, 640, is derived from the hexadecimal
addresses between 0000 to 9FFF.  The next address, A000, marks the beginning
of upper memory.

Upper - (UMB) The upper memory area comprises the 384K (A000 to FFFF, in
hexadecimal) that DOS sets aside for system use. With older versions of DOS,
upper memory could only be used to map access to adapter memory, normally in
64K pages. The EMM386.EXE memory manager was added to later versions of DOS
and requires a 386 or higher CPU to run. The main trade-off in using upper
memory, is that memory set aside as upper memory by EMM386  can't be used
for extended memory by Windows.

High - HMA memory refers to the first page (64K) of memory located
immediately after the end of the first 1Mb. This translates into
addresses 10000 to 10FFF in hexadecimal. DOS can be loaded into high
memory, freeing up both conventional and upper memory for more efficient
use.  DEVICEHIGH commands are used in CONFIG.SYS to place device drivers in
the high memory area. Likewise, LOADHIGH commands are used in the
AUTOEXEC.BAT file to load them into the high memory area.

Extended - XMS memory (all memory above 1Mb) The DOS extended memory manager
is the HIMEM.SYS device driver.  Extended memory is used by Windows, memory
aware DOS programs, and DOS utilities like SMARTDRV and RAMDRIVE.

Expanded - EMS memory (access conventional memory above 1Mb in real-mode)
Also known as LIM (Lotus, Intel, Microsoft) specification memory, expanded
memory uses a page swapping scheme to give DOS programs mapped access to
additional memory. Originally, all expanded memory was added in the form of
expanded memory adapters installed on the I/O bus. Those expanded memory
adapters required their own memory management software which had to be added
to the CONFIG.SYS file. Expanded memory adapters are no longer used in PCs,
being both expensive and slow, but EMM386 can use extended memory to
simulate expanded memory for use with old programs.

If you are using a DOS Window (MS-DOS mode) then you are using Real-Mode.
Thus all the limits of a real-mode OS are imposed. Also remember that in
MS-DOS mode, the CONFIG.SYS and AUTOEXEC.BAT files are in use. Statements in
each of these cause varying amounts of conventional memory to be consumed.

Examples:
ANSI.SYS - 4K
COMMAND.COM - 8K
DOSKEY program - 5K
HIMEM driver - 1K
Buffer statement - 3K
etc.

You can see what items are loaded and how much memory each of them use by
running the MEM program with the /c switch. Also use the more pipe. That is,
mem /c | more

--
Gerry Boyd -- [EMAIL PROTECTED]
============= PCWorks Mailing List =================
Don't see your post? Check our posting guidelines &
make sure you've followed proper posting procedures,
http://pcworkers.com/rules.htm
Contact list owner <[EMAIL PROTECTED]>
Unsubscribing and other changes: http://pcworkers.com
=====================================================

Reply via email to