4 ms·
It feels kind of embarrassing to admit that despite years of tweaking this stuff to get games to run as a kid, I never actually bothered to find out what the d
by jsnell 10y ago
It feels kind of embarrassing to admit that despite years of tweaking this stuff to get games to run as a kid, I never actually bothered to find out what the difference between EMS and XMS was. Or even know the basics of how they both worked. "It's just extra memory, right?".
It's bizarre that the computer magazines I read (and obsessively reread) would not have run an article like this.
- zerocrates 10y ago> It's bizarre that the computer magazines I read (and obsessively reread) would not have run an article like this. The "Megamemory Explained" graphic used in this post comes from the Jan. 14, 1986 issue of PC Magazine, part of an article called "Enlarging the Dimensions of Memory." It doesn't cover XMS as the 386 was so new as to be effectively nonexistent at the time, but otherwise seems to be a pretty thorough explanation.
- polpo 10y agoAnd here's another article from 1993 in PC Magazine which goes into detail, and with a bit more accuracy than the original article for this HN discussion (for example, it explains how XMS works on the 286): https://books.google.com/books?id=gCfzPMoPJWgC&pg=PA302&lpg=PA302&dq=xms+loadall&source=bl&ots=rmlgK_Hia9&sig=skK-3_tKMmhbFteI4FgBgnYTUhc&hl=en&sa=X&ved=0ahUKEwjbgMq26aTTAhVdImMKHSnTACUQ6AEIMDAC#v=onepage&q=xms%20loadall&f=false https://books.google.com/books?id=gCfzPMoPJWgC&pg=PA302&lpg=...
- flomo 10y agoWow, that is the exact article where I learned this stuff from. (Funny how your memory gets jogged like that.) I was an Apple guy and a late comer to the PC world, and PC Magazine was pretty much a must-read back in the day. Lots of good technical content.
- joakleaf 10y agoAs I recall: you could only access XMS memory by copying. So you had to _copy_ a memory block from above the 1MB barrier to the lower 1MB addressable space to read, and copy back up again to write. EMS was pageable. You could had up to four 16 KB pages below 1MB that were fully accessible, but you had to select which address above 1MB each of those four pages had to point to. So in short, XMS was inefficient, because you had to copy, and EMS was more efficient because you simply decided which part of the extended memory you wanted to map to lower memory. I think, EMS was emulated in real mode on the 80386 chip by using its virtual 8086 mode. This was not possible on the 80286, so the 80286 could only use XMS in real mode. I briefly developed using both EMS and XMS, and as I recall, XMS was somehow less painful to get up and running and generally work with, but the performance conscience part of me obviously favored EMS's paging mechanism. Fortunately, 32-bit memory came along quickly both in the form of Windows and DOS protected mode.
- cameldrv 10y agoEMS was originally for the 286. It wasn't emulated by the CPU like you could on the 386. You bought an add-in board that contained the extra memory and handled memory requests on the bus for the bank switched area and accepted commands to change what areas the banked switched areas pointed to. When the 386 came out, it was common to have more than 1MB on the motherboard, but the motherboard (typically?) didn't natively emulate the EMS bank switching scheme, probably because at about that time, everyone figured that people were going to stop using DOS and switch to OS/2, and be running 32 bit code that could natively address higher than 1MB. When that didn't happen right away, Quarterdeck came out with QEMM/386, which used the Virtual 8086 features of the 386 to emulate EMS in software. Microsoft then shipped a not quite as good clone of QEMM as EMM386 with DOS 5.0.
- 0x0 10y agoOn the other hand, I seem to recall EMS in virtual86 mode being critized because the virtual86 mode caused a lot of very slow traps for that emulation. Not sure if true, but if the emulation was inefficient then I could see XMS being faster even if it means copying memory around.
- Sharlin 10y agoYeah, exactly what I was thinking! I don't recall ever seeing (or searching for) an explanation on how EMS and XMS really worked until today.
- digi_owl 10y agoYou are far from alone.