[comp.sys.ibm.pc] Extended memory

jpn@teddy.UUCP (John P. Nelson) (04/12/88)

>Confused? Wait until someone tries to explain how this fits with OS/2.

Actually, that's pretty easy.  OS/2 uses protected mode, and extended memory.
OS/2 doesn't (cannot?) use expanded memory at all.  Sorry, folks.

On a different subject, is anyone else hoping that OS/2 flops as strongly
as I am?  I don't have any particular prejudice against Microsoft:  what
I mean, is that I would hope that ANY operating system based on the
80286 processor would fail, since the architecture is exceedingly
brain-damaged (I thought the 8088 was bad until I looked at the 80286!)

I still don't see why IBM/Microsoft couldn't have based OS/2 on the
80386 instead.  Intel announced their P9 (80386 in a 80286 compatible
package) pretty early in the game:  IBM could have supported their
AT base by insisting that customers upgrade their processor before
upgrading their operating system.

Certainly, I believe that bringing out the PS/2 models 50 and 60 with
80286 processors was a serious mistake, wasn't it?  Couldn't they have
put slower memory and slow 80386 processors into them, and still been
able to differentiate the high-end model 80?
-- 
     john nelson

UUCP:            {decvax,mit-eddie}!genrad!teddy!jpn
ARPA (sort of):  talcott.harvard.edu!panda!teddy!jpn

frank@isrnix.UUCP (Frank Burleigh) (04/12/88)

In article <4704@teddy.UUCP> jpn@teddy.UUCP (John P. Nelson) writes:
>>Confused? Wait until someone tries to explain how this fits with OS/2.
>
>Actually, that's pretty easy.  OS/2 uses protected mode, and extended memory.
>OS/2 doesn't (cannot?) use expanded memory at all.  Sorry, folks.
>
os/2's address space obviates the whole notion of extended memory, as
you say.  applications in the dos compatibility window should still be
able to utilize expanded memory as implemented by an ems driver.  the
last point is made "in principle."
-- 
 Frank C. Burleigh
 Institute for Social Research - Indiana University - Bloomington, IN 47405
 ihnp4!inuxc!isrnix!frank
 {pur-ee,kangaro,iuvax}!isrnix!frank

stevewa@upvax.UUCP (Steve Ward) (04/14/88)

In article <4704@teddy.UUCP> jpn@teddy.UUCP (John P. Nelson) writes:
>[...]  Intel announced their P9 (80386 in a 80286 compatible
>package) pretty early in the game:  IBM could have supported their
>     john nelson

What's this?  How much does it cost?  Where can I get one?

Steve Ward
stevewa@upvax.UUCP
!tektronix!upvax!stevewa

davidsen@steinmetz.ge.com (William E. Davidsen Jr) (04/15/88)

In article <4704@teddy.UUCP> jpn@teddy.UUCP (John P. Nelson) writes:
| >Confused? Wait until someone tries to explain how this fits with OS/2.
| 
| Actually, that's pretty easy.  OS/2 uses protected mode, and extended memory.
| OS/2 doesn't (cannot?) use expanded memory at all.  Sorry, folks.

Yes, all the people who bought expanded memory are going to get the
shaft yet again. I say again, note how fast the software uses new LIM
standards which may not be supported by your hardware.
-- 
	bill davidsen		(wedu@ge-crd.arpa)
  {uunet | philabs | seismo}!steinmetz!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me

bkliewer@iuvax.cs.indiana.edu (Bradley Dyck Kliewer) (04/15/88)

In article <405@upvax.UUCP> stevewa@upvax.UUCP (Steve Ward) writes:
>In article <4704@teddy.UUCP> jpn@teddy.UUCP (John P. Nelson) writes:
>>[...]  Intel announced their P9 (80386 in a 80286 compatible
>>package) pretty early in the game:  IBM could have supported their
>>     john nelson
>
>What's this?  How much does it cost?  Where can I get one?

The P9 is not scheduled to be released until the second quarter of this 
year.  It will not be pin compatible with the 80286, although there is 
speculation that it will be very easy to adapt to 80286 machines.  So, 
keep your eyes open, we're in the second quarter now!

Source: PC Week, V4 N6, Feb 9, 1988.

Bradley Dyck Kliewer                Hacking...
bkliewer@iuvax.cs.indiana.edu       It's not just an adventure
                                    It's my job!

chasm@killer.UUCP (Charles Marslett) (04/20/88)

In article <4704@teddy.UUCP>, jpn@teddy.UUCP (John P. Nelson) writes:
> On a different subject, is anyone else hoping that OS/2 flops as strongly
> as I am?  I don't have any particular prejudice against Microsoft:  what
> I mean, is that I would hope that ANY operating system based on the
> 80286 processor would fail, since the architecture is exceedingly
> brain-damaged (I thought the 8088 was bad until I looked at the 80286!)
> 
And I thought the '286 was bad til I tried to do some work with the '386.
Seriously, the '386 is a great chip -- its a somewhat faster '286 with a
neat feature to speed up MSDOS execution under a real OS.  Mostly, though,
it is not much faster than an equivalent clock speed '286 in real applications.
My cursory examination of real software shows up branches every 15-30 bytes
so the 32-bit wide fetch helps less than you'd expect (especially when you
factor in the typical size of tight loops -- they are small so they are fast
so the '386 buys you the least performance increase).  10 MHz '286 -->
16 MHz '386 resulted in a 60% increase in speed for a compute bound screen
graphics generation program and a RAM based video BIOS doing text mode screens.
That's not as good as the ratio of the clock speeds (the '286 is no waits,
the '386 is Compaq's -- 1.2 waits?).  And data accesses are faster only for
alligned 32-bit operations -- once in a blue moon from the code I've seen.
On top of that, the '386 looks like it has more
bugs than features, it seems -- see Microsoft's MASM 5.0 manual.  At least
the newer '286s really do what they are documented to do.

> I still don't see why IBM/Microsoft couldn't have based OS/2 on the
> 80386 instead.  Intel announced their P9 (80386 in a 80286 compatible
> package) pretty early in the game:  IBM could have supported their
> AT base by insisting that customers upgrade their processor before
> upgrading their operating system.

The P9 is still not available to the unwashed masses, and all the rumors
I have heard indicate it is not a drop-in replacement.  The P9 is just
an 8088-style '386.  That is, it lets you build a 16-bit '386 computer
(a cheap 386 box?) but not upgrade a current '286 box.  It is not necessarily
functional with an AT bus without custom glue either (comments from the
guys at Faraday or C&T?).  I'd like to hear comments on both of these
issues from Intel (officially if possible, rumor if not!) -- this is
as bad as predicting IBM announcements now.

> 
> Certainly, I believe that bringing out the PS/2 models 50 and 60 with
> 80286 processors was a serious mistake, wasn't it?  Couldn't they have
> put slower memory and slow 80386 processors into them, and still been
> able to differentiate the high-end model 80?

And make them that much more expensive than they are now. . . don't you
like IBM at all?

More seriously, again, the 386 (except for the P9 chip) is a 32-bit chip
and that alone makes the 386 boxes more expensive, the 386 is sole sourced
(and Intel can't or won't make enough of them) so it would limit sales if
the box really did sell.  There are lots of reasons for not using the 386
-- and lots of reasons I think the 386/286 ratio may remain smaller than
most people think.  68000s are better than 386s for programming, in performance,
and it uses more memory (all IBM pluses), but most code is for the 8088
today. Sorry.

> -- 
>      john nelson

Charles Marslett
chasm@killer.UUCP

davidsen@steinmetz.ge.com (William E. Davidsen Jr) (04/21/88)

In article <3890@killer.UUCP> chasm@killer.UUCP (Charles Marslett) writes:

| And I thought the '286 was bad til I tried to do some work with the '386.
| Seriously, the '386 is a great chip -- its a somewhat faster '286 with a
| neat feature to speed up MSDOS execution under a real OS.  Mostly, though,
| it is not much faster than an equivalent clock speed '286 in real applications.

  I'm not sure what you mean by "real applications." My experience has
been that most applications from CAD to editors use between 50-70% of
the CPU when recompiled for the 386 instructions. I have seen this for
both FORTRAN and C. For programs using 4 byte ints the speedup is 2:1
most of the time.

  If by "real application" you mean DOS applications using instructions
which will run on an 8 bit 8088, I think you're more or less right.
There are some instructions which run in fewer clocks on the 386, so it
should run a trace faster then a 286 at the same speed, but in general a
286 at the same speed will be about as fast.

  It looks like the 386 works better on slow memory than the 286,
because it does fewer fetches for opcodes, therefore getting hit less by
wait states.  If the 286 takes 2 fetches to get 4 bytes it pays for the
wait states twice (sorry for restating the obvious).  This only becomes
a factor in data when storing data larger than 2 bytes, such as 4 byte
data loads (the P9 should be somewhat slower here, the 286 doesn't do
it) and block moves or string searches. 

  Your figures for branch frequency are very close to mine, and while
there will be places where the longer opcode pipe will be useful, in
general it won't make much diference.
-- 
	bill davidsen		(wedu@ge-crd.arpa)
  {uunet | philabs | seismo}!steinmetz!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me

rwp@cup.portal.com (Roger William Preisendefer) (05/15/89)

I recently bought a 286 machine with 1M of memory and Phoenix BIOS.  My
programs are still limited to 640K.  How can I use the remaining memory?

Also, what is the difference between extended and expanded memory?

Roger Preisendefer

trgauchat@rose.waterloo.edu (Terry Gauchat) (05/16/89)

In article <18358@cup.portal.com> rwp@cup.portal.com (Roger William Preisendefer) writes:
>I recently bought a 286 machine with 1M of memory and Phoenix BIOS.  My
>programs are still limited to 640K.  How can I use the remaining memory?
>
>Roger Preisendefer

I assume you are talking about the "384K".

I use mine for a disk cache (PC Tools PC-CACHE).  It increase effective
disk access speed considerably (up to 7 times average with some programs).


You could also use it as a RAM DISK (using DOS's VDISK driver).

MicroSoft Excel comes with a HIMEM driver to automatically use the extra RAM.


And what is the real difference between extended, expanded, LIM, etc. memory:
what programs can and can't use which...

Also, particularly: What type, and how much, RAM can an AT in protected mode
use?

What's the difference between on board memory and bus (or other not on board
memory?) -- (ie: what specification, speed, max size, etc.)


Terry Gauchat
MicroCosmic Computer Services.

jca@pnet01.cts.com (John C. Archambeau) (05/16/89)

Under MesS-DOS, you have very few options with extended memory.  Here one the
ones that I know about;
 
1. Use a device driver to bump your remaining device drivers into extended
   memory.  I have this driver called HIMEM.SYS in my CONFIG.SYS, it is
   the first device driver that is loaded in, and what it does is set up
   all drivers loaded in after it to go into extended memory.
 
2. Use it as a ramdisk.

3. Find those mythical device drivers (I have yet to see one for myself)
   that converts extended memory to expanded.
 
4. Use some black magic and use the extended memory for your own programs.
   This can be done with AT BIOS int 15h, func 87h.  This is an extended
   memory block move routine.
 
As for extended vs. expanded.  Here are the differences in a brief summary.
 
   Extended memory is part of the '286 and '386 protected mode memory scheme.
   The 80286 can access up to 16 Mb of memory while in '286 protect mode.  
   Anything that's above the first 1 Mb of base memory (the uppermost 384K
   on the 8086/8 is reserved for ROM) is part of this memory scheme.
 
   Expanded memory is a standard specification for external memory beyond
   the 1 Mb of addressible memory for the 8086/8 processor.  The current
   specification is LIM EMS 4.0.  This is basically a page flipping scheme
   for external memory to an 80x86 processor in 8086 mode.  If you get an
   expanded memory card, make SURE that it supports the EMS 4.0 specification
   otherwise you will have wasted your money.  There are some EMS 3.2 cards
   out there, but they aren't really compatable with anything anymore.
   Also, DOS works VERY nicely with expanded memory.  Since the EMS memory
   appears in an window in the 640K base, DOS is very happy to work with
   it.  The page flipping is done very quickly and efficiently under EMS
   4.0
 
 JCA


UUCP: {nosc ucsd hplabs!hp-sdd}!crash!pnet01!jca
ARPA: crash!pnet01!jca@nosc.mil
INET: jca@pnet01.cts.com

marcap@concour.CS.Concordia.CA (Marc Pawlowsky) (05/16/89)

In article <18358@cup.portal.com> rwp@cup.portal.com 
(Roger William Preisendefer) writes:
>I recently bought a 286 machine with 1M of memory and Phoenix BIOS.  My
>programs are still limited to 640K.  How can I use the remaining memory?

An other question, is there a way of declaring an array in extended
memory in quick-C or turbo-C.  The quick-C manual does not even
mention extended memory.

Marc Pawlowsky

ray@philmtl.philips.ca (Raymond Dunn) (05/17/89)

In article <18358@cup.portal.com> rwp@cup.portal.com (Roger William Preisendefer) writes:
>I recently bought a 286 machine with 1M of memory and Phoenix BIOS.  My
>programs are still limited to 640K.  How can I use the remaining memory?
>
>Also, what is the difference between extended and expanded memory?

A definite candidate for "most frequently asked questions"...

Perhaps it's time to repeat my previous posting (with a few clarifications)....



Memory up to 1 Megabyte:
-----------------------

MSDOS is designed around the 8088 CPU which can address up to 1 megabyte of
memory.

In "industry standard" IBM PC architecture, this memory is organized in the
following way:

      1M +-------------+ FFFFF
         |             |          System BIOS ROM
         |             |
         |             |
         |             |
    960K +-------------+ F0000
         |             |           Option ROM and RAM
         |             |
         |             |
    816K +-------------+ CC000
         |             |           XT Hard Disk Controller BIOS ROM
    800K +-------------+ C8000
         |             |           Video BIOS ROM and option ROM and RAM
         |             |
    768K +-------------+ C0000
         |             |           Video RAM space - various video types
         |             |           have different requirements and starting
         |             |           locations.
         |             |
    640K +-------------+ A0000
         |             |
         |             |
         |             |           Base system RAM
         |             |
         |             |
    1286 +-------------+ 506
         |             |           Interrupt vectors and BIOS data area
       0 +-------------+ 0

MSDOS expects this architecture, and assumes that the RAM up to 640K is
its resource to manage.

Although MSDOS will not expect to find any RAM above 640K except video RAM,
even though there actually may be some which it could use, e.g.  unused on a
video card, on a special option card etc, it *will* however use any memory
immediately above 640K if the BIOS specifies it is available.  This is
communicated to MSDOS at boot time by BIOS setting the memory size in location
413H of the BIOS data area.

As an example of this, the Philips P3345 386SX based machine allows the system
to be configured so that 64K is allocated at 640K to give a total of 704K of
"base" system RAM.  This is *only* legal if an EGA/VGA video card is not
present, as this has video RAM at this address.

Some option cards provide RAM at other locations in the map.  Applications
programs may use that RAM in a proprietary way.  It is not normally considered
a DOS resource.

An example of this is the Philips P3105 XT system.  It is more convenient on
this machine to provide 768K of RAM using all 256K chips rather than be
involved with 64K chips to provide 640K.  This "extra" 128K of RAM can be
enabled if required at D0000.  A ramdisk driver is provided to use this
memory.


Extended and Expanded Memory:
----------------------------

Extended memory is an intrinsic part of the architecture of the Intel
processor family, expanded memory is only defined in the architecture of the
IBM-PC standard.

*Extended* memory is memory directly in the CPU memory address space, above
the 1 megabyte address.

It is "extended" because the 8088 can only access 1 meg.  Thus "extended
memory" is part of the "extended memory addressing" of the 80286 & 80386
processors.

*Expanded* memory is paged memory which can be addressed through a Page Frame
within the first 1 megabyte, and is thus accessible on all processors, even the
8088.  Expanded memory can be provided in a number of ways (see below).

The mnemonic is easy, it is in the meaning of the words:

-> -> ->        Extended is longer.        <- <- <-

-> -> ->        Expanded is fatter.        <- <- <-

When you buy an 80286, 80386 or 80386SX based machine which has more than 640K
of RAM, that extra memory must be mapped somewhere, because *normally*, in the
architecture of the PC, the area between 640K and 1M is used for video RAM,
option card ROM and RAM, and the BIOS ROM.

Some machines map the 384K from this hole on top of any *other* extended
memory above 1M.  I.e. if the machine has 1M memory, the 384K is mapped at
1M.  If the machine has 2M memory, the 384K is mapped at 2M etc.

Some machines just map the memory away out of trouble at say 16 or 24Meg.

Some machines use all or part of it to "shadow" the system BIOS, and
sometimes a proprietary Video BIOS.  Thus during system initialization, these
BIOSes are copied from ROM into the fast (16-bit or 32-bit) RAM,
write-protected, and the BIOS from then on executes from there.  This
obviously requires motherboard hardware support.

Some machines allow all or part of the extended memory to be used as
expanded memory.  This is achieved either by hardware support or software
emulation as described below.

*Some* machines allow all sorts of permutations of the above!  This is an
area where manufacturers of clones can *add value*.



Extended Memory:
---------------

As *MSDOS* assumes an 8088 and can thus only address the first 1 Megabyte of
the address space, extended memory on a 286 or 386 has limited use with DOS.

It is most commonly used as a RAM disk, because this involves only *block*
access to the memory and is a nicely self-contained application, but it
could also be used for caching, directly by an application, or to implement
some *Expanded* Memory Scheme (EMS).

An 80286 has a 24 bit address space, i.e. 16 megabytes (1 meg plus 15 meg of
extended memory).

An 80386 has a full 32 bit address space (work it out yourself!).  Most AT
architecture implementations using an 80386 use a private memory address bus
which limits the addressing to 16 or 24 or 32 Megabytes.

Extended memory is not generally used in the MSDOS environment other than by
RAM disk programs, disk caches, and expanded memory emulations, for several
reasons:

- It is not available on 8088 machines so *applications* which wish to be
compatible across the whole product line stay away from using it directly.

- It is not a standard resource, so there is no proper management of it for
co-existing software (but see MSDOS 4.0 below).

- It is very slow and a pain in the neck to access because MSDOS runs the
80286 in native mode (i.e.  as an 8088).  To access above 1 meg the 80286 must
be switched into protected mode.  This is fine, but there is no way to switch
it back to native mode (this is one of the reasons that the 80286 is regarded
as a brain-dead processor)!!  So, the trick used is to get the keyboard
controller to RESET the CPU, and the BIOS reset code recognizes this and
continues!  Thus it is really only good for some sort of *block* access to the
memory, and there is an INT15 function in the BIOS which does this for you.
All of this can be done more easily on an 80386, using its virtual 86 mode,
but there are other problems running DOS in this mode (you have to trap I/O
etc) and I wont go into that here.  There are also the usual "how does the DMA
interact with logical addressing" type problems.

The good news is that Unix and OS/2 make *full* use of extended memory, as
they run the machine in protected mode.

With release 4.0, MSDOS recognizes extended memory for the first time as
more than just a RAM disk resource.  In addition to RAMDRIVE.SYS and a disk
caching program, SMARTDRV.SYS, a device driver, HIMEM.SYS, is provided to
manage the extended memory according to XMS 2.0 specification.

XMS is an eXtended Memory Specification standard defined jointly by
Microsoft, Intel, Lotus and AST (not to be confused with LIM, see below).
This specification is available from them.  XMS 2.0 allows extended memory
to be used by co-resident software, and, for example, allows TSR's to be
positioned in extended memory.  

Very few applications are currently written to make use of this standard -
it is somewhat ironic that the provided RAM disk and disk caching routines
RAMDRIVE.SYS and SMARTDRV.SYS do *not* use the XMS management routines when
using extended memory, but *do* use LIM 4.0 when using expanded memory (see
below)!

XMS 2.0 also formally makes the first 64K of extended memory available as a
non protected mode memory resource using the overflow into A20 trick.


Expanded Memory:
---------------

There have been several standards for expanded memory.  Currently this has
settled down into the LIM 4.0 standard (_L_otus _I_ntel _M_icrosoft in
agreement).

LIM 4.0 describes the following architecture:

         PC MAIN MEMORY                LIM EXPANDED MEMORY
         --------------                -------------------

         +-------------+
         |             |
         . Extended    .
         . Memory      .
         . up to       .               /+-------------+ 32M
         . 16M on the  .             // |             |
         . '286,       .           / /  |             |
         . 4096M on    .         /  /   |  Expanded   |
         . the '386    .       /   /    |  Memory     |
         |             |     /    /     |             |
      1M +-------------+   /     /      |  Divided    |
         |             | /      /       |  into 16K   |
    960K +-------------+       /        |  logical    |
         | Page Frame  |      /         |  pages      |
         | 12*16K      |     /          |             |
         | Physical    |    /           |             |
         | Pages       |   /            |             |
    768K +-------------+\ /             .             .
         |             | /              .             .
    640K +-------------+/ \             .             .
         | Page Frame  |   \            .             .
         | 24*16K      |    \           |             |
         | Physical    |     \          |             |
         | Pages       |      \         |             |
         |             |       \        |             |
    256K +-------------+        \       |             |
         |             | \       \      |             |
         |             |   \      \     |             |
         |             |     \     \    |             |
       0 +-------------+       \    \   |             |
                                 \   \  |             |
                                   \  \ |             |
                                     \ \|             |
                                       \+-------------+  0

The expanded memory gives you up to 32M to map into up to 36 16K pages in
the positions shown above.

The page frame below 640K which allows the existing RAM to be shadowed are
usually regarded as being for the use of operating systems/environments.
The page frame above 640K, in the video RAM and "PROM" area, is for
applications.  Code can be run or data stored interchangably in any of these
frames.

30 functions are defined using int 67H, to allocate, map, swap etc these
pages.  These are provided, depending on the implementation, as a loadable
driver (usually), an extension to the motherboard BIOS, or on a PROM on a LIM
4.0 option card (not usual).

The number of actual pages available in the page frame depends on the
implementaion, and how much of the address space is already occupied by
option card ROMS (and perhaps RAM's) in the machine.

Applications which use LIM 4.0 can thus have a very large physical memory
available to them, but must access it by manually switching pages as
required (come back Z80 systems, all is forgiven!!)

LIM 4.0 can be implemented in many ways:

- as an option card with memory and page registers etc as I/O hardware to
provide the mapping etc, and an on-board BIOS PROM to provide the
functionality.

- as a pure software emulation in a .SYS or TSR driver:

  - using extended memory and virtual 86 mode on an 80386 so that the
    memory is mapped using the MMU into any of the physical LIM pages.

  - *copying* into the RAM pages existing below 640K, either from extended
    memory (if other than 8088), or from, say, disk.  This is much slower as
    pages are swapped using copying rather than just updating page registers.

- using extended memory and mapping and page register logic built into the
motherboard ASICs or logic on an 80286 or 80386 machine.  Philips has two
machines using this approach, the 80386SX based P3345 using the NEAT chipset,
and the 80286 based P2230 using the G2 chipset.

- combinations of the above etc.

LIM 4.0 management is handled by its BIOS only in so far as the application
can ask it what pages are free, how much memory is free to map etc., and to
perform the actual mapping.  The actual use of this paging is left up to the
application.  Neither LIM 4.0 nor DOS demand pages or anything remotely like
that, nor do they support an application's use of LIM in any other way.  Two
or more co-existing applications can share the LIM quite happily if they are
well behaved (i.e.  use LIM *only* through the BIOS calls).

Functionality is provided to allow the saving and restoring of the page
registers etc, so that even interrupt routines can safely be written to use
LIM memory, assuming they allocate all their requirements up front.

Whether or not LIM memory will be useful to you is *application* dependant.
Check to see if the applications you propose to use can take advantage of
it.

Release 4.0x of MSDOS *does* recognize LIM 4.0's presence, and allows buffers
and fastopen file names etc to be allocated in LIM pages, and DEBUG now
"understands" LIM.  In no way is LIM *integrated* into the operating system
though.  A driver, EMM386.SYS, is provided in DOS 4.0 to emulate LIM 4.0 using
the *extended* memory of a 386 based machine.

The RAM disk and disk caching routines RAMDRIVE.SYS and SMARTDRV.SYS can be
configured to use extended memory, *or* expanded memory under the control of
LIM 4.0.

The "Lotus/Intel/Microsoft Expanded Memory Specification Version 4.0"
(published by, you guessed it, Lotus, Intel and Microsoft), is the
definitive manual, and is available from them.

-- 
Ray Dunn.                    | UUCP: ..!uunet!philmtl!ray
Philips Electronics Ltd.     | TEL : (514) 744-8200  Ext: 2347
600 Dr Frederik Philips Blvd | FAX : (514) 744-6455
St Laurent. Quebec.  H4M 2S9 | TLX : 05-824090

vrh@mhres.mh.nl (Michael Verhey) (05/17/89)

In article <18358@cup.portal.com>, rwp@cup.portal.com (Roger William Preisendefer) writes:
> I recently bought a 286 machine with 1M of memory and Phoenix BIOS.  My
> programs are still limited to 640K.  How can I use the remaining memory?
> 
> Also, what is the difference between extended and expanded memory?

The 8086/88 processor can address 1Mb of RAM. The 80286 can address 16 Mb.
Everything above the 1Mb barrier is called extended memory. So the 80286 can
address up to 15Mb of extended memory. This memory is only accessible when
thhe processor runs in protected mode.

Expanded memory is not directly mapped by the processor, but accessed through
a special expanded memory driver.

Now about the 640k barrier: the processor runs under DOS in real mode. That
implies that the processor cannot access any extended memory above 1Mb.
The 1Mb it split up into 2 pieces: one part of 640k and one part of 384k.
The 384k is assigned to the ROM BIOS, display adapters and cartridges. So
that leaves only 640k for DOS itself.
-- 
Michael Verheij (using Netnews)		Multihouse B.V., the Netherlands
USENET: vrh@mh.nl via European backbone (mcvax).
UUCP:   ..!mcvax!mhres!vrh
"Experience comes with the amount of equipment ruined."

mju@mudos.ann-arbor.mi.us (Marc Unangst) (05/18/89)

In article <4204@crash.cts.com>, jca@pnet01.cts.com (John C. Archambeau) writes:
 >3. Find those mythical device drivers (I have yet to see one for myself)
 >   that converts extended memory to expanded.

Mythical?  Nope.  Get a program called Above Disc (sorry, no author or
publisher), which will convert either hard disk space (virtual memory!)
or extended memory into expanded memory.  I used to use it with my
hard disk, but stopped because a 75ms hard drive is really too slow
to use for virtual memory.  Other than that, though, it's fairly good.
I tried out some programs that use expanded memory (Turbo C, Telix),
and they worked just fine.

--  
Marc Unangst
UUCP smart    : mju@mudos.ann-arbor.mi.us
UUCP dumb     : ...!uunet!sharkey!mudos!mju
UUCP dumb alt.: ...!{ames,rutgers}!mailrus!clip!mudos!mju
Internet      : mju@mudos.ann-arbor.mi.us

ray@philmtl.philips.ca (Raymond Dunn) (05/19/89)

In article <3164@mhres.mh.nl> vrh@mhres.mh.nl (Michael Verhey) writes:
>The 1Mb it split up into 2 pieces: one part of 640k and one part of 384k.
>The 384k is assigned to the ROM BIOS, display adapters and cartridges. So
>that leaves only 640k for DOS itself.

In the interest of killing disinformation - sorry, but this is misleading.
See posting <498@philmtl.philips.ca> for the correct information.



-- 
Ray Dunn.                    | UUCP: ..!uunet!philmtl!ray
Philips Electronics Ltd.     | TEL : (514) 744-8200  Ext: 2347
600 Dr Frederik Philips Blvd | FAX : (514) 744-6455
St Laurent. Quebec.  H4M 2S9 | TLX : 05-824090

jca@pnet01.cts.com (John C. Archambeau) (05/19/89)

I'm not referring to using a hard drive as expanded memory, I'm referring to
using extended as expanded.  Judging from your experience, you didn't use the
driver to convert extended to expanded, just used it to have your hard drive
emulate expanded.  Faking expanded memory with a hard drive is no great trick
in itself.  But I would like to see how such a driver would perform in the
extended to expanded test.  My guess is that int 15h, func 87h would be used
since that's the only real way to get at expanded memory while in 8086 mode. 
But there's that caveat and price you pay when using extended memory.  You
have to copy it to your 640K base, do your manipulations, and copy it back. 
Cheaper than a hard drive, yes, but not better than LIM EMS 4.0
specifications.  Memory block copying can get fairly expensive, especially if
you're using expanded memory to multitask (i.e. Desqview).  Just a negative
aspect I'd point out.  The best bet is to use the extended as a cache and have
your memory card support both expanded and extended.  But of course, beggers
can never be choosers when dealing with memory prices.
 
 JCA

UUCP: {nosc ucsd hplabs!hp-sdd}!crash!pnet01!jca
ARPA: crash!pnet01!jca@nosc.mil
INET: jca@pnet01.cts.com

fboudrea@afit-ab.arpa (Fred P. Boudreaux) (05/23/89)

In article <406.2471FA57@mudos.ann-arbor.mi.us> mju@mudos.ann-arbor.mi.us writes:
>In article <4204@crash.cts.com>, jca@pnet01.cts.com (John C. Archambeau) writes:
>
>Mythical?  Nope.  Get a program called Above Disc (sorry, no author or
>publisher), which will convert either hard disk space (virtual memory!)
>or extended memory into expanded memory.  I used to use it with my
>hard disk, but stopped because a 75ms hard drive is really too slow
>to use for virtual memory.  Other than that, though, it's fairly good.
>I tried out some programs that use expanded memory (Turbo C, Telix),
>and they worked just fine.
>

I use Above Disc in my system at home to convert my 384kb EXTENDED MEMORY to
384kb Expanded memory.  I don't use my 40MB hard drive for EMS.  But I can say
that Above disc CAN BE setup to do this.  I've even tested out changing 6MB of
extended memory to expanded memory on my Z-248 at my office and it worked with
Lotus 1-2-3 and Quattro.  Both programs recognized that I had 6MB of EMS.  You
can even tell Above Disc to remove the EMS so you can use the Extended Memory
as a disk drive.

Their address is Tele-Were West, 18023 Skypart Circle #E2, Irvine, VA 92714.
Above Disc was for $69.95 but the price may have changed.


--Fred

My Statements are my own and do not reflect upon my current employer nor do
I sell for Tele-Were West, I just use their products and am satisified with
it.

stephen@ziebmef.uucp (Stephen M. Dunn) (05/23/89)

In article <13828@watdragon.waterloo.edu> trgauchat@rose.waterloo.edu (Terry Gauchat) writes:
$And what is the real difference between extended, expanded, LIM, etc. memory:
$what programs can and can't use which...

   Expanded memory (LIM) is extra memory that is bank-switched in 16K chunks
into a 64K area of the memory address space.  You can therefore access 4 pages
at a time.  This can be done, with the appropriate hardware, on a PC/XT/AT
or 386 machine.

   Extended memory is accessible only to 286 or better machines in protected
mode.  It is the memory that appears above the 1Mb barrier of the 8086/88.

   What programs can use which?  Very few programs use extended memory; the
reason is that a program has to be written specifically for a 286 or better
machine to be able to use it, and a lot of programs are written for the
lowest common denominator - the old 8088.  As for expanded memory, many
programs will use this.  You'll have to check each one and see.  

$Also, particularly: What type, and how much, RAM can an AT in protected mode
$use?

   What type?  Well, I guess you could use expanded memory if you wanted
to, but I think you're thinking of extended memory, as noted above.  How
much?  I'm not certain of this, but I believe 286 protected-mode addresses
are 24 bits wide, which would give you 16 Mb of accessible memory.

$What's the difference between on board memory and bus (or other not on board
$memory?) -- (ie: what specification, speed, max size, etc.)

   Some motherboards allow for on-board memory expansion (especially the
newer boards).  These ones will allow you to populate them with fast chips
if you like.  Off-board memory may or may not be as fast.  If it's in an
expansion slot with a full-size data bus (16 bits on a 286/386SX, 32 bits
on a 386) you can probably get it to work at whatever speed you want.  If
it's not in a full-size slot, you're obviously going to suffer some kind
of speed penalty (just like the 8088 does in comparison to the 8086).  Most
AT-clone boards these days seem to allow either 1 Mb or 4 Mb on-board, and
usually allow you to use this as either extended or expanded memory (my
Suntac board allows for 512K/640K/1M/2M/4M with memory in excess of 640K
as either type of memory).  Some AT boards allow even more memory.  As for
386 boards, they usually allow lots of memory space on-board.

-- 
-------------------------------------------------------------------------------
! Stephen M. Dunn              stephen@ziebmef.UUCP ! DISCLAIMER:  Who'd ever !
! Take off to the Great White North eh, ya hosehead ! claim such dumb ideas?  !
-------------------------------------------------------------------------------

kushmer@bnlux1.bnl.gov (christopher kushmerick) (04/06/91)

My IBM AT has a few Mb of extended ram. It is recognized by the 
virtual disk driver.

Given this, does it necessarily follow that this ram will be recognized
by an ems driver, and therefore usefull for such things as ems overlays 
in turbo pascal etcetera?

Thanks,

-- 
Chris Kushmerick                                 kciremhsuK sirhC
kushmer@bnlux1.bnl.gov    <===Try this one first
kushmerick@pofvax.sunysb.edu 

c60b-1eq@e260-1d.berkeley.edu (Noam Mendelson) (04/06/91)

In article <1991Apr5.211351.4335@bnlux1.bnl.gov> kushmer@bnlux1.bnl.gov (christopher kushmerick) writes:
>My IBM AT has a few Mb of extended ram. It is recognized by the 
>virtual disk driver.

I assume you mean VDISK.SYS with the /E option.

>Given this, does it necessarily follow that this ram will be recognized
>by an ems driver, and therefore usefull for such things as ems overlays 
>in turbo pascal etcetera?

No.  Extended memory is _not_ the same as expanded memory.  There are
programs available which emulate expanded memory using extended memory,
but they result in a considerable slowdown of access time (this is due
to the software; extended memory is not inherently slow).
You can also access extended memory directly, but this is a real PITA.
However, if you're developing your own programs you may want to consider
this option.

+==========================================================================+
| Noam Mendelson   ..!agate!ucbvax!web!c60b-1eq | "I haven't lost my mind, |
| c60b-1eq@web.Berkeley.EDU                     |  it's backed up on tape  |
| University of California at Berkeley          |  somewhere."             |