High memory area

Source: Wikipedia, the free encyclopedia.

The high memory area is highlighted.

In

AT
or compatible computer.

In

address lines, wrapped around at the 20th bit, so that address FFFF:0010 was equivalent to 0000:0000.[1]

To allow running existing DOS programs which relied on this feature to access

circuitry on the motherboard to simulate the wrapping around. This circuit was a simple logic gate which could disconnect the microprocessor's 21st addressing line, A20, from the rest of the motherboard. This gate could be controlled, initially through the keyboard controller, to allow running programs which wanted to access the entire RAM.[1]

So-called

A20 handlers could control the addressing mode dynamically,[1] thereby allowing programs to load themselves into the 1024–1088 KB region and run in real mode.[1]

Code suitable to be executed in the HMA must either be coded to be

offset relocatable (with all addresses being fixed up during load).[2][1]

Before code (or data) in the HMA can be addressed by the CPU, the corresponding driver must ensure that the HMA is mapped in. This requires that any such requests are tunneled through a

A20 gate.[2][1] If the driver does not exhibit any public data structures and only uses interrupts or calls already controlled by the underlying operating system, it might be possible to register the driver with the system in a way so that the system will take care of A20 itself thereby eliminating the need for a separate stub.[1][nb 1]

The first user of the HMA among

8.0 (2000), parts of the HMA are also used as a scratchpad to hold a growing data structure recording various properties of the loaded real-mode drivers.[7][14][15]

See also

Notes

  1. A20 handler
    will provide the functionality of the stub.

References

  1. ^
    dynamic dead code elimination
    in the author's FreeKEYB driver.)
  2. ^ a b c Ingenoso, Tony (1998-12-20). "Chapter 13 - The A20 gate and the HMA". Making Code Work Better - How to minimize the size of 80x86 code and sometimes make it faster (e-book). Archived from the original on 2019-11-18. Retrieved 2019-11-18.
  3. ^
    UMB support, task swapping, and Undelete. […] Considerable amounts of the team's management attention was diverted to new features such as file transfer software, undelete and network installation […] Eventually this situation reached a crisis point at the end of July 1990, and, led by BradS
    , the team's management spent an arduous series of meetings nailing down a schedule and process for closing the project down […] (1+32 pages)
  4. DR DOS 6.0 (Technical information document). Revision A. Novell. TID800074 (replaces FYI-M-1303). Archived
    from the original on 2021-12-15. Retrieved 2021-12-15.
  5. ^
    ISBN 978-0-201-63287-3. (xviii+856+vi pages, 3.5"-floppy [1]) Errata: [2][3]
  6. RBIL. 2000. Archived
    from the original on 2020-02-18. Retrieved 2020-02-18.
  7. ^
    MS-DOS 7.0+, since this issue introduced a new and for the most part undocumented RMD data structure usually located in the HMA. The kernel collects and records configuration and Real Mode Driver data during boot (type of driver, interrupts hooked by driver, CONFIG.SYS
    line of invocation, etc.) and stores this information in an […] complicated […] and […] growing data structure. Presumably this info is meant to be used by the Windows core to get a better picture of the loaded Real Mode drivers instead of treating DOS as a monolithic block, or even […] attempt to unhook or unload some of them, however, it is only used to a very limited extent (for example you can see some of the info reflected in the log files created on Windows 9x startup, and some parts of the Windows configuration manager also make use of it), leaving room for speculation much beyond the technical side - in particular because nothing of the interesting stuff is documented… […]
  8. OpenDOS 7.01, including the description of many undocumented features and internals. It is part of the author's yet larger MPDOSTIP.ZIP collection maintained up to 2001 and distributed on many sites at the time. The provided link points to a HTML-converted older version of the file.) [4]
  9. ^ Paul, Matthias R. (2001-04-09). "II.4. Undokumentierte Eigenschaften externer Kommandos". NWDOS-TIPs — Tips & Tricks rund um Novell DOS 7, mit Blick auf undokumentierte Details, Bugs und Workarounds. MPDOSTIP (in German) (3 ed.).
  10. ^
    ISBN 0-201-60835-9. (xxvi+738+iv pages, 3.5"-floppy [5][6]) Errata: [7][8][9]
  11. XMS memory. Some earlier issues of MS-DOS/PC DOS DISPLAY.SYS
    seem to have had a facility to store them in the HMA […]
  12. from the original on 2020-02-18. Retrieved 2020-02-18.
  13. ^
    SHARE.EXE
    […] Move code to HMA if available and added /NOHMA option force loading low. […]
  14. ^ Sweger, Kristofer (2007) [2002-07-15]. "ANSIPLUS and Windows". Archived from the original on 2021-11-28. Retrieved 2021-11-28. […] ANSIPLUS's code cannot be loaded to the HMA under MS-DOS 7 (Windows 9x only) because there apparently is not enough unused HMA memory available. […]
  15. ^ Paul, Matthias R. (2002-08-13). "Suche freien Speicherbereich unterhalb von 1 MB, der nicht von OS überschrieben wird" (in German). Newsgroupde.comp.lang.assembler.x86. Archived from the original on 2017-09-04. Retrieved 2017-09-03.
  16. ^ Paul, Matthias R. (1997-10-02) [1997-09-29]. "Caldera OpenDOS 7.01/7.02 Update Alpha 3 IBMBIO.COM - README.TXT and BOOT.TXT - A short description of how OpenDOS is booted". Archived from the original on 2003-10-04. Retrieved 2009-03-29. [10]

Further reading

  • Necasek, Michal (2011-09-13). "Who needs the address wraparound, anyway?". OS/2 Museum. Archived from the original on 2020-02-19. Retrieved 2020-02-19. […]
    DOS
    =HIGH. In that case, DOS makes sure that linear address 1000C0h contains the appropriate far call. […]
  • Kozierok, Charles M. (2001-04-17) [1997]. "High Memory Area (HMA)". The PC Guide. 2.2.0. Archived from the original on 2006-10-16. Retrieved 2006-10-15.
  • Paul, Matthias R. (2002-04-11). "Re: [fd-dev] ANNOUNCE: CuteMouse 2.0 alpha 1". freedos-dev. Archived from the original on 2020-02-21. Retrieved 2020-02-21. […] in case of such
    Interrupt Sharing Protocol
    ), which consumes much more memory if you hook many interrupts. […] We came to the result that this would most probably not be save in practise because you never know if other drivers normalize or denormalize pointers, for what reasons ever. […]