Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A random thought from the same era popped in my head a few days ago:

> What was the difference between extended memory and expanded memory?

10yo me never did figure out why Kings Quest would play with one and not the other.



Extended memory was memory above 1MB that real mode DOS couldn't access directly but could through a driver that put processors capable of protected mode (the 286--sort of--and later) into protected mode temporarily.

Expanded memory bank switched the additional memory into an area of high memory below 1MB.

Basically, with DOS, a program had to be designed and the system configured for one or the other.


> that put processors capable of protected mode (the 286--sort of--and later) into protected mode temporarily.

Or, on the 386 and later, permanently, running DOS as a vm86 task instead. EMM386 and similar did that. It was very transparent, so you usually wouldn't notice, and even for programs that would like to drive protected mode themselves, there was an interface called DPMI (earlier VCPI) with which they could wrestle protected mode away from the memory manager (being the exception to "permanent").

DOS4/GW, which most probably know from DOOM and other games, used that interface.

For software that did not use DPMI/VCPI, you usually got a message like "CPU already in protected mode" and had to disable your memory manager (usually by rebooting).


DOS4/GW and Desqview were the two main extended memory systems IIRC. Manuals in storage, sorry I can't look up here.


Great question and a puzzler for me at first. From my perspective only expanded memory mattered (bank-switched block in memory space < 1MB) because all the apps I was using at first didn't support extended memory, which requires some switching to protected mode and the effort to add that to real mode programs was high.

It's extra confusing because initially expanded memory was done with add-on cards and later extended memory drivers (on 286 and up) could emulate expanded.


I don't really recall extended memory ever being used much on PCs running a real mode operating system like DOS. I definitely had an expanded memory add-on board at one point though.

There were a lot of essentially kludges in the latter days of DOS that weren't really made unnecessary until Windows 3.0 (or other OSs with a protected mode) and the 80386 and later processors.


> I don't really recall extended memory ever being used much on PCs running a real mode operating system like DOS.

Extended Memory/XMS was pretty much a DOS thing, though. Anything using protected mode would not need it, and be able to just access the memory directly.

> that weren't really made unnecessary until Windows 3.0 (or other OSs with a protected mode)

Windows 3.0 was "sort of" a protected mode OS. The actual Windows part ran as a 16bit task, similar to DOS in EMM386. That changed, again "sort of", with Windows 3.1. There was a thing called "Win32s" to run 32bit Windows applications, but most of Windows was still a single 16bit task.

Windows NT was the real deal, though, shedding off its real mode roots with essentially a reimplementation. It only became part of the "mainstream" Windows versions with Windows XP (Windows 2000 was based on NT already, but still marketed alongside the "legacy" Windows 95/98/ME).


I have a VERY vague memory that you could copy win32s from 3.1 into 3.0 to help running 32bit apps there. There might have been some fiddling with some sys.ini involved. But I might just be dreaming awake or something...


I can imagine that you're right! Would not be too surprising if Win32s was self-contained enough, and the differences between 3.0 and 3.1 small enough (although there were larger ones at least in some other aspects), that this could be done reasonably. (Though most apps were still likely to be 16 bit apps at that time, so not making any use of Win32s.)


The original 8086 processor could directly address up to 1 megabyte of memory. The PC memory map allocated 640 KB of that for RAM.

The first kind of further memory expansion was classic bank-switching. Within that 1 megabyte address space, you insert a window, say 32 kilobytes, which can be set to some 32 KB section of the extra memory. Same way more than 64 KB was added to systems like the Apple II, which could only address 64 KB. It's a pain to program for this kind of arrangement.

Later, when running in protected mode, the Intel 286 would be able to directly address up to 16 megabytes of RAM, and the Intel 386 up to 4 gigabytes. Memory managers running in protected mode that could access this memory directly were created, which would handle memory for DOS applications.

Those two approaches for > 1 MB are XMS and EMS. Though I can't remember which is which!


There’s an excellent post on this at https://www.filfre.net/2017/04/the-640-k-barrier/


Brings back memories. I remember my parents being astonished when little me fixed our old IBM PC/XT, which was not booting from the hard disk using a low level format „hack“ I found in a copy of PC magazine [0]. The trick was to boot from floppy first and trigger a BIOS interrupt to do the low level format.

[0] https://youtu.be/PW787WRG8h4


Extended memory (XMS) is RAM that is addressed above the first megabyte of the address space.

Expanded memory (EMS) is bank switched RAM that stays inside the 640K barrier.


> that stays inside the 640K barrier

Yes, but to be super pedantic, it stayed within the 1MB barrier[1] that real mode could "officially" address. It was perfectly okay to have your EMS window above the A000h segment in memory, i.e. above 640k, if no device was using it.

[1] Plus some change known as the "high memory area" (HMA), an artifact of how linear addresses are calculated from segment and offset.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: