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-08-12 16:31
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » Repost: Understanding DOS Memory View 2,747 Replies 6
Original Poster Posted 2002-11-16 00:00 ·  中国 广东 佛山 禅城区 电信
元老会员
★★★★
Credits 5,170
Posts 1,637
Joined 2002-10-16 00:00
23-year member
UID 8
Gender Male
From 广东佛山
Status Offline
Understanding DOS Memory  

  When the DOS operating system was first designed, the PC hardware system supported only a 1MB addressing space, so DOS could manage only up to 1MB of contiguous memory. Of this 1MB of memory, only 640K was reserved for application programs; this was called conventional memory or base memory. The other 384K was called upper memory and was reserved for video display, BIOS, and so on. In 1982, 640K of memory seemed more than enough for microcomputers, and people even thought that 640K of memory could be used to do anything. It seems 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 have only 640K of memory that you can use directly. Memory above 1MB can be used only through some memory management tools. Fortunately, Windows 95 no longer has the conventional memory limitation. All your memory, whether 8MB or 128MB, can be used directly.

  Under DOS, there are the following four types of memory 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 generally use only the system's conventional memory, and therefore are all subject to the 640KB memory limit. Also, since DOS itself, the device drivers installed in config.sys, and the memory-resident programs executed in autoexec.bat all occupy some conventional memory, the conventional memory available to applications is less than 640K. Very often, we have to rack our brains to arrange memory properly so as to leave enough conventional memory for some applications with a bigger "appetite." This is surely something many computer enthusiasts from the DOS era are thoroughly 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 the user to load certain device drivers and user programs into upper memory with Devicehigh or LH (that is, loadhigh). dos=high,umb also loads part of DOS into upper memory. The umb here is the abbreviation of Upper Memory Block.

  Expanded memory was an early standard for increasing memory, and it could be expanded up to 32MB. To use expanded memory, a special expanded memory board had to be installed in the computer, and a manager for the expanded memory board also had to be installed. Since expanded memory appeared before extended memory, most programs were designed to use expanded memory, but not extended memory. Because expanded memory was rather troublesome to use, it was phased out soon after extended memory appeared.

  Extended memory can only be used on 80286 or higher-grade machines. At present, on almost all DOS machines, memory above 1MB is extended memory. Extended memory likewise cannot be used directly by DOS. After DOS 5.0, DOS provided Himem.sys, this extended memory manager, 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 once again that no matter how much expanded memory or extended memory there is, DOS applications 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, thus directly accessing extended memory; but note that after entering protected mode, the computer leaves the DOS state.
我的网志
http://hzmys.blog.163.com/
我的网盘
firststep.qjwm.com
fsmys.ys168.com
ssmys.ys168.com
www.brsbox.com/fsmys
www.brsbox.com/ssmys
www.brsbox.com/ccdos
Floor 2 Posted 2002-11-16 00:00 ·  美国 肯塔基州 费耶特县 列克星敦 Charter_Communications
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
This article was posted by a forum member on this forum before. At the time I pointed out that there was a major error in it, namely that the last sentence was completely wrong, and it should be changed to: "the computer leaves the usual real-mode DOS state and enters the protected-mode DOS state."
Wengier - 新DOS时代

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

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

Floor 3 Posted 2002-11-17 00:00 ·  中国 湖北 随州 电信
元老会员
★★★
Credits 1,987
Posts 632
Joined 2002-10-27 00:00
23-year member
UID 73
Gender Male
Status Offline
This is the introduction to DOS memory from Hongen's "Getting Started with DOS." Everyone can go to the thread "Friends who need a DOS beginner's tutorial, please come in" in DOS Usage Experience & Excellent Articles to download it.
http://dos.e-stone.cn/dosbbs
uploadImages/200311161145850422.swf
Floor 4 Posted 2009-03-12 01:38 ·  中国 河南 商丘 电信
新手上路
Credits 13
Posts 7
Joined 2009-01-11 00:46
17-year member
UID 136350
Gender Male
Status Offline
Already read it
Floor 5 Posted 2009-03-14 10:22 ·  中国 四川 德阳 电信
中级用户
★★
Credits 274
Posts 192
Joined 2009-01-07 21:09
17-year member
UID 136069
Gender Male
Status Offline
Thanks for sharing
Floor 6 Posted 2009-03-15 01:33 ·  中国 河南 新乡 联通
初级用户
Credits 25
Posts 16
Joined 2007-10-27 16:01
18-year member
UID 100933
Gender Male
From 河南新乡
Status Offline
Thanks bump
Floor 7 Posted 2009-04-09 22:43 ·  中国 重庆 巴南区 电信
初级用户
Credits 20
Posts 11
Joined 2009-01-01 12:28
17-year member
UID 135501
Gender Male
Status Offline
Let me take a look
Forum Jump: