Upper memory area

In DOS memory management, the upper memory area (UMA) refers to memory between the addresses of 640 KB and 1024 KB (0xA0000–0xFFFFF) in an IBM PC or compatible. IBM reserved the uppermost 384 KB of the 8088 CPU's 1024 KB address space for ROM, RAM on peripherals, and memory-mapped input/output. For example, the monochrome video memory area runs from 704 to 736 KB (0xB0000–B7FFF).

The upper memory area is located between 640 KB and 1024 KB.

However, even with video RAM, the ROM BIOS and I/O ports for expansion cards, much of this 384 KB of address space was unused. As the 640 KB memory restriction became ever more of an obstacle, techniques were found to fill the empty areas with RAM. These areas were referred to as upper memory blocks (UMBs).

Usage

The next stage in the evolution of DOS was for the operating system to use upper memory blocks (UMBs) and the high memory area (HMA). This occurred with the release of DR DOS 5.0 in 1990.[1] DR DOS' built-in memory manager, EMM386.EXE, could perform most of the basic functionality of QEMM and comparable programs.

The advantage of DR DOS 5.0 over the combination of an older DOS plus QEMM was that the DR DOS kernel itself and almost all of its data structures could be loaded into high memory. This left virtually all the base memory free, allowing configurations with up to 620 KB out of 640 KB free.

Configuration was not automatic - free UMBs had to be identified by hand, manually included in the line that loaded EMM386 from CONFIG.SYS, and then drivers and so on had to be manually loaded into UMBs from CONFIG.SYS and AUTOEXEC.BAT. This configuration was not a trivial process. As it was largely automated by the installation program of QEMM, this program survived on the market; indeed, it worked well with DR DOS' own HMA and UMB support and went on to be one of the best-selling utilities for the PC.

This functionality was copied by Microsoft with the release of MS-DOS 5.0 in June 1991.[1] Eventually, even more DOS data structures were moved out of conventional memory, allowing up to 631 KB out of 640 KB to be left free. Starting from version 6.0 of MS-DOS, Microsoft even included a program called MEMMAKER which was used to automatically optimize conventional memory by moving TSR programs to the upper memory.

For a period in the early 1990s, manual optimization of the DOS memory map became a highly prized skill, allowing for the largest applications to run on even the most complex PC configurations. The technique was to first create as many UMBs as possible, including remapping allocated but unused blocks of memory, such as the monochrome display area on colour machines. Then, DOS' many subcomponents had to be loaded into these UMBs in the correct sequence to use the blocks of memory as efficiently as possible. Some TSR programs required additional memory while loading, which was freed up again once loading was complete. Fortunately, there were few dependencies amongst these modules, so it was possible to load them in almost any sequence. Exceptions were that to successfully cache CD-ROMs, most disk caches had to be loaded after any CD-ROM drivers, and that the modules of most network stacks had to be loaded in a certain sequence, essentially working progressively up through the layers of the OSI model.

A basic yet effective method used to optimize conventional memory was to load HIMEM.SYS as a device, thereafter loading EMM386.EXE as a device with the "RAM AUTO" option which allows access into the UMA by loading device drivers as devicehigh. This method effectively loads the fundamental memory managers into conventional memory, and thereafter everything else into the UMA. Conventional memory glutton programs such as MSCDEX could also be loaded into the UMA in a similar fashion, hence freeing up a large amount of conventional memory.

Windows

The increasing popularity of Windows 3.0 made the necessity of the upper memory area less relevant, as Windows applications were not directly affected by DOS' base memory limits, but DOS programs running under Windows (with Windows itself acting as a multitasking manager) were still thus constrained. With the release of Windows 95, it became less relevant still, as this version of Windows provides much of the functionality of the DOS device drivers to DOS applications running under Windows, such as CD, network and sound support; the memory map of Windows 95 DOS boxes was automatically optimised. However, not all DOS programs could execute in this environment. Specifically, programs that tried to directly switch from real mode to protected mode would not work as this was not allowed in the virtual 8086 mode it was running in. This point is now being addressed by x86 virtualization technologies such as Intel VT-x (Vanderpool) and AMD-V (Pacifica). Also, programs that tried making the switch using the Virtual Control Program Interface (VCPI) API (which was introduced to allow DOS programs that needed protected mode to enter it from the virtual 8086 mode set up by a memory manager, as described above) didn't work in Windows 95. Only the DOS Protected Mode Interface (DPMI) API for switching to protected mode was supported.

Implementation

Virtual x86 Mode

Upper memory blocks can be created by mapping extended memory into the upper memory area when running in virtual x86 mode. This is similar to how expanded memory can be emulated using extended memory so this method of providing upper memory blocks is usually provided by the expanded memory manager (for example EMM386). The application programming interface for managing the upper memory blocks is specified in the eXtended Memory Specification.

Shadow RAM

On many systems including modern ones it is possible to use memory reserved for shadowing expansion card ROM as upper memory. Many chipsets reserve up to 384 KB RAM for this purpose and since this RAM is generally unused it may be used as real mode upper memory with a custom device driver, such as UMBPCI.[2]

IBM XT

On IBM XT computers, it was possible to add more memory to the motherboard and use a custom address decoder PROM to make it appear in the upper memory area.[3] As with the 386-based upper memory described above, the extra RAM could be used to load TSR files, or as a RAM disk.

The AllCard, an add-on memory management unit for XT-class computers, allowed normal memory to be mapped into the 0xA0000-EFFFF address range, giving up to 952 KB for DOS programs. Programs such as Lotus 1-2-3, which accessed video memory directly, needed to be patched to handle this memory layout. Therefore, the 640 KB barrier was removed at the cost of software compatibility. This usage of the upper memory area is different from using upper memory blocks, which was used to free conventional memory by moving device drivers and TSRs into the upper 384 KB of the 1 MB address space, but left the amount of addressable memory (640 KB) intact.

gollark: I didn't do any horrible homoglyph hacks with THAT.
gollark: It uses the function, yes.
gollark: So, I finished that to highly dubious demand. I'd like to know how #11 and such work.
gollark: > `x = _(int(0, e), int(e, е))`You may note that this would produce slices of 0 size. However, one of the `e`s is a homoglyph; it contains `2 * e`.`return Result[0][0], x, m@set({int(e, 0), int(е, e)}), w`From this, it's fairly obvious what `strassen` *really* does - partition `m1` into 4 block matrices of half (rounded up to the nearest power of 2) size.> `E = typing(lookup[2])`I forgot what this is meant to contain. It probably isn't important.> `def exponentiate(m1, m2):`This is the actual multiplication bit.> `if m1.n == 1: return Mаtrix([[m1.bigData[0] * m2.bigData[0]]])`Recursion base case. 1-sized matrices are merely multiplied scalarly.> `aa, ab, ac, ad = strassen(m1)`> `аa, аb, аc, аd = strassen(m2)`More use of homoglyph confusion here. The matrices are quartered.> `m = m1.subtract(exponentiate(aa, аa) ** exponentiate(ab, аc), exponentiate(aa, аb) ** exponentiate(ab, аd), exponentiate(ac, аa) ** exponentiate(ad, аc), exponentiate(ac, аb) ** exponentiate(ad, аd)) @ [-0j, int.abs(m2.n * 3, m1.n)]`This does matrix multiplication in an inefficient *recursive* way; the Strassen algorithm could save one of eight multiplications here, which is more efficient (on big matrices). It also removes the zero padding.> `m = exponentiate(Mаtrix(m1), Mаtrix(m2)) @ (0j * math.sin(math.asin(math.sin(math.asin(math.sin(math.e))))), int(len(m1), len(m1)))`This multiples them and I think also removes the zero padding again, as we want it to be really very removed.> `i += 1`This was added as a counter used to ensure that it was usably performant during development.> `math.factorial = math.sinh`Unfortunately, Python's factorial function has really rather restrictive size limits.> `for row in range(m.n):`This converts back into the 2D array format.> `for performance in sorted(dir(gc)): getattr(gc, performance)()`Do random fun things to the GC.
gollark: > `globals()[Row + Row] = random.randint(*sys.version_info[:2])`Never actually got used anywhere.> `ε = sys.float_info.epsilon`Also not used. I just like epsilons.> `def __exit__(self, _, _________, _______):`This is also empty, because cleaning up the `_` global would be silly. It'll be overwritten anyway. This does serve a purpose, however, and not just in making it usable as a context manager. This actually swallows all errors, which is used in some places.> `def __pow__(self, m2):`As ever, this is not actual exponentiation. `for i, (ι, 𐌉) in enumerate(zip(self.bigData, m2.bigData)): e.bigData[i] = ι + 𐌉` is in fact just plain and simple addition of two matrices.> `def subtract(forth, 𝕒, polynomial, c, vector_space):`This just merges 4 submatrices back into one matrix.> `with out as out, out, forth:`Apart from capturing the exceptions, this doesn't really do much either. The `_` provided by the context manager is not used.> `_(0j, int(0, 𝕒.n))`Yes, it's used in this line. However, this doesn't actually have any effect whatsoever on the execution of this. So I ignore it. It was merely a distraction.> `with Mаtrix(ℤ(ℤ(4))):`It is used again to swallow exceptions. After this is just some fluff again.> `def strassen(m, x= 3.1415935258989):`This is an interesting part. Despite being called `strassen`, it does not actually implement the Strassen algorithm, which is a somewhat more efficient way to multiply matrices than the naive way used in - as far as I can tell - every entry.> `e = 2 ** (math.ceil(math.log2(m.n)) - 1)`This gets the next power of two in a fairly obvious way. It is used to pad out the matrix to the next power of 2 size.> `with m:`The context manager is used again for nicer lookups.> `Result[0] += [_(0j, int(e, e))]`Weird pythonoquirkiness again. You can append to lists in tuples with `+=`, but it throws an exception as they're sort of immutable.> `typing(lookup[4])(input())`It's entirely possible that this does things.

See also

References

  1. Dryfoos, Mike, ed. (1991-09-18) [1991-07-19]. "MS-DOS 5.0 Development Post-Mortem Report" (PDF) (mail as court document). Microsoft. p. 10. MS-PCA1179169 (MS-PCA1179159-MS-PCA1179191). MS7020988 (MS7020978-MS7021010). Depo. Ex. 1109. Comes v Microsoft Plaintiff's Exhibit 3473. CA.No.2:96CV645B Plaintiff's Exhibit 477. Archived (PDF) from the original on 2019-04-02. Retrieved 2019-07-22. […] One of the most important stimulanta for adding features was competitive pressure from DRDOS 5.0, which we first learnt of in the spring of 1990. The DRDOS feature set led us to add 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)
  2. "UMBPCI V3.89 - c't magazine's hardware-UMB-driver for DOS and Win95/98". Archived from the original on 2019-12-30. Retrieved 2020-02-07.
  3. Atkinson, Cy (2001). "What is high memory, why do I care, and how can I use it?". San Jose, CA, USA. Archived from the original on 2018-10-05. Retrieved 2020-02-07.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.