China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-17 05:32
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » Understanding DOS Memory (Reprinted) View 3,031 Replies 9
Original Poster Posted 2002-10-22 00:00 ·  中国 广东 广州 增城区 电信
元老会员
★★★
Credits 1,468
Posts 407
Joined 2002-10-21 00:00
23-year member
UID 34
Gender Male
From 广州
Status Offline
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

欢迎大家观临我的个人主页:

http://dosdiy.bluepc.com.cn/
http://dosdiy.ys168.com/


EMAIL: lydong@china.com.cn lydong@yeah.net
----------------------------------------------
Floor 2 Posted 2002-10-22 00:00 ·  美国 肯塔基州 费耶特县 列克星敦 Charter_Communications
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
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.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 3 Posted 2002-10-22 00:00 ·  中国 广东 广州 增城区 电信
元老会员
★★★
Credits 1,468
Posts 407
Joined 2002-10-21 00:00
23-year member
UID 34
Gender Male
From 广州
Status Offline
Completely agree with the moderator's comment
欢迎大家观临我的个人主页:

http://dosdiy.bluepc.com.cn/
http://dosdiy.ys168.com/


EMAIL: lydong@china.com.cn lydong@yeah.net
----------------------------------------------
Floor 4 Posted 2002-10-26 00:00 ·  加拿大 安大略省 多伦多
初级用户
Credits 107
Posts 3
Joined 2002-10-26 00:00
23-year member
UID 64
Gender Male
Status Offline
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?
Floor 5 Posted 2002-10-26 00:00 ·  中国 广东 广州 增城区 电信
元老会员
★★★
Credits 1,468
Posts 407
Joined 2002-10-21 00:00
23-year member
UID 34
Gender Male
From 广州
Status Offline
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.
欢迎大家观临我的个人主页:

http://dosdiy.bluepc.com.cn/
http://dosdiy.ys168.com/


EMAIL: lydong@china.com.cn lydong@yeah.net
----------------------------------------------
Floor 6 Posted 2002-10-29 00:00 ·  中国 广东 东莞 电信
元老会员
★★★
CEO
Credits 1,019
Posts 300
Joined 2002-10-20 00:00
23-year member
UID 33
Gender Male
From 广东
Status Offline
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.
禅宗——大道至简,知易行难!
网站: http://www.dgzens.com

QQ: 11951692 微信: dgzens
E-MAIL: warmrose@21cn.com
Floor 7 Posted 2004-06-23 00:00 ·  中国 天津 电信
中级用户
Credits 297
Posts 44
Joined 2004-06-15 00:00
22-year member
UID 26749
Gender Male
Status Offline
Floor 8 Posted 2004-06-23 00:00 ·  中国 山东 日照 东港区 联通
钻石会员
★★★★★
Credits 10,046
Posts 3,039
Joined 2002-11-11 00:00
23-year member
UID 223
Gender Male
Status Offline
high is to make DOS use HMA, and HMA is the first 64KB of memory above 1MB. It is not UMB.
简单就是美
Floor 9 Posted 2004-06-24 00:00 ·  中国 河南 郑州 联通
高级用户
★★
Credits 599
Posts 148
Joined 2003-10-30 00:00
22-year member
UID 12192
Gender Male
Status Offline
Good
Floor 10 Posted 2004-06-24 00:00 ·  中国 山东 日照 联通
钻石会员
★★★★★
Credits 10,046
Posts 3,039
Joined 2002-11-11 00:00
23-year member
UID 223
Gender Male
Status Offline
Please don't just say "Okay". Thanks
简单就是美
Forum Jump: