Breaking
May 17, 2025

Remembering More Memory: XMS and a Real Hack Al Williams | usagoldmines.com

Last time we talked about how the original PC has a limit of 640 kB for your programs and 1 MB in total. But of course those restrictions chafed. People demanded more memory, and there were workarounds to provide it.

However, the workarounds were made to primarily work with the old 8088 CPU. Expanded memory (EMS) swapped pages of memory into page frames that lived above the 640 kB line (but below 1 MB). The system would work with newer CPUs, but those newer CPUs could already address more memory. That led to new standards, workarounds, and even a classic hack.

XMS

If you had an 80286 or above, you might be better off using extended memory (XMS). This took advantage of the fact that the CPU could address more memory. You didn’t need a special board to load 4MB of RAM into an 80286-based PC. You just couldn’t get to with MSDOS. In particular, the memory above 1 MB was — in theory — inaccessible to real-mode programs like MSDOS.

Well, that’s not strictly true in two cases. One, you’ll see in a minute. The other case is because of the overlapping memory segments on an 8088, or in real mode on later processors. Address FFFF:000F was the top of the 1 MB range.

PCs with more than 20 bits of address space ran into problems since some programs “knew” that memory access above that would wrap around. That is FFFF:0010, on an 8088, is the same as 0000:0000. They would block A20, the 21st address bit, by default. However, you could turn that block off in software, although exactly how that worked varied by the type of motherboard — yet another complication.

XMS allowed MSDOS programs to allocate and free blocks of memory that were above the 1 MB line and map them into that special area above FFFF:0010, the so-called high memory area (HMA).

The 640 kB user area, 384 kB system area, and almost 64 kB of HMA in a PC (80286 or above)

Because of its transient nature, XMS wasn’t very useful for code, but it was a way to store data. If you weren’t using it, you could load some TSRs into the HMA to prevent taking memory from MSDOS.

Protected Mode Hacks

There is another way to access memory above the 1 MB line: protected mode. In protected mode, you still have a segment and an offset, but the segment is just an index into a table that tells you where the segment is and how big it is. The offset is just an offset into the segment. So by setting up the segment table, you can access any memory you like. You can even set up a segment that starts at zero and is as big as all the memory you can have.

A protected mode segment table entry

You can use segments like that in a lot of different ways, but many modern operating systems do set them up very simply. All segments start at address 0 and then go up to the top of user memory. Modern processors, 80386s and up, have a page table mechanism that lets you do many things that segments were meant to do in a more efficient way.

However, MS-DOS can’t deal with any of that directly. There were many schemes that would switch to protected mode to deal with upper memory using EMS or XMS and then switch back to real mode.

Unfortunately, switching back to real mode was expensive because, typically, you had to set a bit in non-volatile memory and reboot the computer! On boot, the BIOS would notice that you weren’t really rebooting and put you back where you were in real mode. Quite a kludge!

There was a better way to run MSDOS in protected mode called Virtual86 mode. However, that was complex to manage and required many instructions to run in an emulated mode, which wasn’t great for performance. It did, however, avoid the real mode switch penalty as you tried to access other memory.

Unreal Mode

In true hacker fashion, several of us figured out something that later became known as Unreal Mode. In the CPU documentation, they caution you that before switching to real mode, you need to set all the segment tables to reflect what a segment in real mode looks like. Obviously, you have to think, “What if I don’t?”

Well, if you don’t, then your segments can be as big as you like. Turns out, apparently, some people knew about this even though it was undocumented and perhaps under a non-disclosure agreement. [Michal Necasek] has a great history about the people who independently discovered it, or at least, the ones who talked about it publicly.

The method was doomed, though, because of Windows. Windows ran in protected mode and did its own messing with the segment registers. If you wanted to play with that, you needed a different scheme, but that’s another story.

Modern Times

These days, we don’t even use video cards with a paltry 1 MB or even 100 MB of memory! Your PC can adroitly handle tremendous amounts of memory. I’m writing this on a machine with 64 GB of physical memory. Even my smallest laptop has 8 GB and at least one of the bigger ones has more.

Then there’s virtual memory, and if you have solid state disk drives, that’s probably faster than the old PC’s memory, even though today it is considered slow.

Modern memory systems almost don’t resemble these old systems even though we abstract them to pretend they do. Your processor really runs out of cache memory. The memory system probably manages several levels of cache. It fills the cache from the actual RAM and fills that from the paging device. Each program can have a totally different view of physical memory with its own idea of what physical memory is at any given address. It is a lot to keep track of.

Times change. EMS, XMS, and Unreal mode seemed perfectly normal in their day. It makes you wonder what things we take for granted today will be considered backward and antiquated in the coming decades.

 

This articles is written by : Nermeen Nabil Khear Abdelmalak

All rights reserved to : USAGOLDMIES . www.usagoldmines.com

You can Enjoy surfing our website categories and read more content in many fields you may like .

Why USAGoldMines ?

USAGoldMines is a comprehensive website offering the latest in financial, crypto, and technical news. With specialized sections for each category, it provides readers with up-to-date market insights, investment trends, and technological advancements, making it a valuable resource for investors and enthusiasts in the fast-paced financial world.

Recent:

Hack Aims for Polaroid, Hits Game Boy Camera Sweet Spot Tyler August | usagoldmines.com

Moon Phase Flip Clock is Fantastic Navarre Bartz | usagoldmines.com

FBI Issues New Scam Warning, Says Fraudsters Have Been Impersonating ‘Senior US Officials’ in Text a...

Billion-Dollar Bank Warns 7,537 Customers After Data Breach Triggers Unauthorized Account Access Mar...

New Bismuth Transistor Runs 40% Faster and Uses 10% Less Power John Elliot V | usagoldmines.com

Bankrupt Crypto Exchange FTX To Shell Out $5,400,000,000 to Creditors at the End of the Month Conor ...

A Portable M4 Mac mini Navarre Bartz | usagoldmines.com

The Screamer Is Just Like The Clapper But Even More Annoying Lewin Day | usagoldmines.com

Hackaday Podcast Episode 321: Learn You Some 3DP, Let the Wookie Win, or Design a Thinkpad Motherboa...

ChatGPT & Me. ChatGPT Is Me! Jenny List | usagoldmines.com

Compliant Mechanism Shrinks Instead of Stretching Ian Bos | usagoldmines.com

Google Issues Cybersecurity Alert to US Retailers, Says Hackers Who Paralyzed UK Counterparts Now Ta...

This Week in Security: Lingering Spectre, Deep Fakes, and CoreAudio Jonathan Bennett | usagoldmines....

Home-casting Thermoelectric Alloys Aaron Beckendorf | usagoldmines.com

Wireless Doorbell Extension Features Home-Wound Coil John Elliot V | usagoldmines.com

Not a Sewing Machine: A Multimedia Briefcase Al Williams | usagoldmines.com

Coinbase Reveals Cyber Attack Involving Employee Bribery, Warns Incident May Cost $400,000,000 Danie...

$40,000 Abruptly Drained From Citibank Account in Massive Transaction – Bank Claims Customer Trigger...

Voyager 1’s Primary Thrusters Revived Before DSN Command Pause Maya Posch | usagoldmines.com

Welcome Your New AI (LEGO) Overlord Al Williams | usagoldmines.com

Falling Down The Land Camera Rabbit Hole Jenny List | usagoldmines.com

FPV Drone Takes Off From a Rocketing Start Ian Bos | usagoldmines.com

Mylar Space Blankets As RF Reflectors Jenny List | usagoldmines.com

LACED: Peeling Back PCB Layers With Chemical Etching and a Laser Maya Posch | usagoldmines.com

Automatic Transmission For Manual Transportation Bryan Cockfield | usagoldmines.com

Crypto Exchange CEO’s Daughter and Grandson Narrowly Escape Kidnap Attempt by Armed Gang in France: ...

Smart Terrarium Run By ESP32 Lewin Day | usagoldmines.com

Fancy Adding a Transputer Or Two To Your Atari ST? Dave Rowntree | usagoldmines.com

Inside Starlink’s User Terminal Al Williams | usagoldmines.com

LED Layer Makes Plywood Glow Tyler August | usagoldmines.com

Your Own Core Rope Memory Al Williams | usagoldmines.com

2025 Pet Hacks Contest: Automatic Treat Dispenser Makes Kitty Work For It Tyler August | usagoldmine...

RTEMS Statement Deepens libogc License Controversy Tom Nardi | usagoldmines.com

RADUGA: The Retro Computer from Behind the Curtain Al Williams | usagoldmines.com

Version Control to the Max Al Williams | usagoldmines.com

A Brain Transplant for a Philips Smart Lamp Tyler August | usagoldmines.com

Turning a Chromebox Into a Proper Power-Efficient PC Maya Posch | usagoldmines.com

You Wouldn’t Download a Helmet? Fenix Guthrie | usagoldmines.com

What’s an LCR Databridge? Al Williams | usagoldmines.com

A Web Based Controller For Your Garage Door Lewin Day | usagoldmines.com

Thermal Monocular Brings the Heat at 10X Al Williams | usagoldmines.com

A Toolchanging Delta 3D printer Aaron Beckendorf | usagoldmines.com

Fake CAPTCHA Scam Targets Millions of University Students With Unknown Malware: Report Daily Hodl St...

Remembering Memory: EMS, and TSRs Al Williams | usagoldmines.com

The World’s Longest Range LED Flashlight John Elliot V | usagoldmines.com

Trackside Observations Of A Rail Power Enthusiast Jenny List | usagoldmines.com

Studying QR Code Degradation Jenny List | usagoldmines.com

Simulating High-Side Bootstrap Circuits With LTSpice Dave Rowntree | usagoldmines.com

The ZX Spectrum Logic Analyzer Al Williams | usagoldmines.com

A Single-Pixel Camera Without Moving Parts Using Compressed Sensing Maya Posch | usagoldmines.com

Hackers Attempting To Extort School Employees via Email After Millions of Students’ Personal Data Le...

Work, Eat, Sleep, Repeat: Become a Human Tamagotchi Heidi Ulrich | usagoldmines.com

Investor Kidnapped, Driven to Remote Desert and Robbed of $4,000,000 in Cryptocurrency by Teenagers:...

Unwinding an Unusual Slide Rule Al Williams | usagoldmines.com

Semiconductor Simulator Lets Your Play IC Designer Al Williams | usagoldmines.com

161,359 Americans Warned Data Breach May Have Exposed Names, Social Security Numbers, Financial Reco...

Keebin’ with Kristina: the One With the MingKwai Typewriter Kristina Panos | usagoldmines.com

Print PLA in PLA with A Giant Molecular Model Kit Tyler August | usagoldmines.com

Radio Apocalypse: Meteor Burst Communications Dan Maloney | usagoldmines.com

What’s in a Washer? Al Williams | usagoldmines.com

Rebooting An 1973 Art Installation Running On A Nova Dave Rowntree | usagoldmines.com

Simulating Cable TV Al Williams | usagoldmines.com

Reading the color of money Matt Varian | usagoldmines.com

Hackers Infiltrate Grocery Giant, Steal ‘Huge Amounts’ of Customer and Employee Data in Extortion Sc...

Man Allegedly Drains $3,000,000 From Bank Using Fraudulent Identities, Friends, Family and an Inside...

Hackaday Links: May 11, 2025 Dan Maloney | usagoldmines.com

Open Source ELINT Accidentally from NASA Al Williams | usagoldmines.com

Learn 15 Print-in-Place Mechanisms in 15 Minutes Dave Rowntree | usagoldmines.com

Exploring the RP2350’s UART-Bootloader Tyler August | usagoldmines.com

Eight Arrested in Multi-State Bank Fraud Conspiracy That Caused Over $1,500,000 in Losses: DOJ Daily...

Tearing Down a Forgotten Video Game Al Williams | usagoldmines.com

Boxie – a Gameboy-Esque Audio Player Matt Varian | usagoldmines.com

Another Old ThinkPad Gets A New Motherboard Jenny List | usagoldmines.com

An LLM for the Raspberry Pi Al Williams | usagoldmines.com

Restoring A Sinclair C5 For The Road Jenny List | usagoldmines.com

25,000,000 Customers’ Personal Information At Risk As Telecom Giant Discovers Malware for Mass SIM S...

Move over, Lithopane: 3D Printed 3D Photos with Gaussian Splats Tyler August | usagoldmines.com

Best Practices for FDM Printing Al Williams | usagoldmines.com

$2,950,000 Enters Fraudulent Accounts at JPMorgan Chase, Wells Fargo, Bank of America and BBVA in Mi...

“Man and Machine” vs “Man vs Machine” Elliot Williams | usagoldmines.com

PoE-powered GPIB Adapter with Ethernet and USB-C Support Maya Posch | usagoldmines.com

Web Dashboard and OTA Updates for the ESP32 John Elliot V | usagoldmines.com

413,032 Americans Affected As Major Data Breach Leaks Customer Names, Social Security Numbers, Finan...

The Apple II MouseCard IRQ is Synced to Vertical Blanking After All Maya Posch | usagoldmines.com

The Nuclear War You Didn’t Notice Al Williams | usagoldmines.com

Criminal Groups Allegedly Target Bank of America, Capital One and Wells Fargo Customers, Steal $155,...

Antique Mill Satisfies Food Cravings Tyler August | usagoldmines.com

Inside a Selective Voltmeter Al Williams | usagoldmines.com

A Single Chip Computer For The 8051 Generation Jenny List | usagoldmines.com

Supercon 2024: An Immersive Motion Rehabilitation Device Lewin Day | usagoldmines.com

Oscilloscope Digital Storage, 1990s Style Al Williams | usagoldmines.com

Hackaday Podcast Episode 320: A Lot of Cool 3D Printing, DIY Penicillin, and an Optical Twofer Krist...

This Week in Security: Encrypted Messaging, NSO’s Judgement, and AI CVE DDoS Jonathan Bennett | usag...

Triggering Lightning and Safely Guiding It Using a Drone Maya Posch | usagoldmines.com

Bank Data Breach Blamed on Insider As Social Security Numbers, Account Information and Addresses of ...

Scan Your Caliper for Physical Part Copies Al Williams | usagoldmines.com

Hacky Shack? The TRS-80 Model I Story Maya Posch | usagoldmines.com

Understanding Linear Regression Al Williams | usagoldmines.com

DIY Driving Simulator Pedals Matthew Carlson | usagoldmines.com

Edison Phonograph Plays the Cylinders Al Williams | usagoldmines.com