中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-09 14:34
47,812 topics / 349,914 posts / today 0 new / 48,268 members
DOS学习入门 & 精彩文章 (教学室) » Understanding DOS Memory (Reprinted)
Printable Version  3,236 / 9
Floor1 Lydong Posted 2002-10-22 00:00
元老会员 Posts 407 Credits 1,468 From 广州
Understanding DOS Memory
 
When the DOS operating system was first designed, the PC hardware system only supported a 1 MB addressing space, so DOS could manage at most 1 MB of continuous memory space. Within this 1 MB of memory, only 640K was reserved for application programs; it was called conventional memory or base memory. The other 384K was called upper memory, reserved for video display, BIOS, and so on. In 1982, 640K of memory seemed more than enough for microcomputers; people even believed that 640K of memory could be used to do anything. It looks a bit laughable now, but at the time, that really was the situation.


  The situation now is that even if your computer has several megabytes or several dozen megabytes of memory installed, if you use the DOS operating system, then you still only have 640K of memory that can be used directly. Memory above 1 MB can only be used through some memory management tools. Fortunately, Windows
95 no longer has the conventional memory limitation; all of your memory, whether 8M or 128M, can be used directly.

  Under DOS, the following four kinds of memory exist in the system:
  Conventional Memory;
  Upper Memory;
  Expanded Memory;
  Extended Memory.

  Conventional memory refers to the 0–640K memory area. Under DOS, ordinary application programs can only use the system’s conventional memory, and therefore are all subject to the 640KB memory limit. Also, because DOS itself, the device drivers installed in the config.sys file, and the memory-resident programs executed in the autoexec.bat file all occupy some conventional memory, the conventional memory available to application programs is less than 640K. Very often, we have to think of every possible way to tidy up memory so as to leave enough conventional memory for some applications with relatively big “appetites”; this is surely something many computer enthusiasts from the DOS era are all too familiar with.


  Upper memory refers to the 384K of memory located above conventional memory. Programs generally cannot use this memory area, but EMM386.exe can activate part of upper memory, and it allows users to load certain device drivers and user programs into upper memory with Devicehigh or LH (i.e. loadhigh). dos=high,umb also loads part of DOS into upper memory. Here umb is the abbreviation of Upper
Memory Block.

  Expanded memory is an early standard for increasing memory, and can be expanded up to 32M. To use expanded memory, a special expanded memory board must be installed in the computer, and a management program for managing the expanded memory board must also be installed. Since expanded memory was introduced before extended memory, most programs were designed to be able to use expanded memory, but not extended memory. Because expanded memory was relatively troublesome to use, it was eliminated not long after extended memory appeared.


  Extended memory can only be used on 80286 or higher-grade machines. At present, on almost all machines using DOS, memory above 1 MB is extended memory. Extended memory likewise cannot be used directly by DOS. After DOS 5.0, Himem.sys, an extended memory management program, was provided, and we can use it to manage extended memory. emm386.exe can emulate extended memory (XMS) as expanded memory (EMS), to satisfy some programs that require expanded memory.


  Finally, let me emphasize again: no matter how large expanded memory or extended memory is, DOS application programs can only run in conventional memory. Some programs can use a DOS extender (such as DOS4GW.exe and similar programs) to put the CPU into protected mode, thereby directly accessing extended memory; but note that after entering protected mode, the computer has left the DOS state.

Reposted from Learning Information

Floor2 Wengier Posted 2002-10-22 00:00
系统支持 Posts 10,521 Credits 27,736
The statement is somewhat inaccurate. It is not that "after entering protected mode, the computer is out of the DOS state." Instead, after entering the DOS state of protected mode, the computer is out of the usual DOS state of real mode.
Floor3 Lydong Posted 2002-10-22 00:00
元老会员 Posts 407 Credits 1,468 From 广州
Completely agree with the moderator's comment
Floor4 中华dos Posted 2002-10-26 00:00
初级用户 Posts 3 Credits 107
Can the poster specifically explain the differences between high and umb in dos=high,umb? I know that actually they can be written separately, which shows that the two are different. Also, I don't understand the concepts of upper memory and DOS reserved area. Can you explain them?
Floor5 Lydong Posted 2002-10-26 00:00
元老会员 Posts 407 Credits 1,468 From 广州
The function of dos=high,umb is to hand over the control of UMB to DOS. As for the difference between high and umb, I can't explain it clearly.

MS-DOS was originally an operating system designed for 8086/8088 CPUs and can use at most 1MB of memory. The first 640KB of this 1MB memory is the aforementioned conventional memory. As for the remaining 384KB behind, it is reserved for BIOS ROM, ROM on hardware interface cards (such as VGA, hard disk control cards) and VIDEO BUFFER.

The address space of Reserved Memory (Reserved Memory) is between 640~1024KB, totaling 384KB, which is an address space reserved for external use. Reserved memory should not actually be called memory, but should be called reserved memory space, because no physical RAM is installed in this address space.

The so-called reserved memory actually only has an address space of 384KB, not really 384KB of RAM memory available for storing data.

In the 384KB address space of reserved memory (between 640~1024), in addition to being used by video buffers, BIOS ROM and other hardware expansion cards, there are still many gaps. We can use the paging (Paging) ability of 386/486 CPUs to map extended memory over to fill these gaps. Because these gaps are still within the 1MB range of DOS, they couldn't be used before because there was no installed memory. After configuring memory with paging technology, they then become memory available for DOS to use. We call this memory above 640KB address "Upper Memory (Upper Memory)". Upper memory may be divided into several blocks due to the installation of external cards, so it is also called Upper Memory Blocks, abbreviated as UMB.
Floor6 禅宗 Posted 2002-10-29 00:00
元老会员 Posts 300 Credits 1,019 From 广东
Yes, the function of dos=high,umb is to hand over the control of UMB to DOS, but the two have their own functions. High means placing the DOS kernel in the upper memory; while UMB is to associate DOS with UMB, so that the upper memory managed by EMM386.EXE can be used by some programs. So usually they are written together, which can not only place the DOS kernel in UMB, but also let other programs use UMB. Of course, if there is no EMM386.EXE, the parameter UMB will be meaningless. This is my understanding, and I hope to discuss it with you.
Floor7 laochang409 Posted 2004-06-23 00:00
中级用户 Posts 44 Credits 297
Floor8 Michael Posted 2004-06-23 00:00
钻石会员 Posts 3,041 Credits 10,056
high is to make DOS use HMA, and HMA is the first 64KB of memory above 1MB. It is not UMB.
Floor9 qinqong Posted 2004-06-24 00:00
高级用户 Posts 148 Credits 599
Good
Floor10 Michael Posted 2004-06-24 00:00
钻石会员 Posts 3,041 Credits 10,056
Please don't just say "Okay". Thanks
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023