|
lydong
元老会员
        
积分 1468
发帖 407
注册 2002-10-21 来自 广州
状态 离线
|
『楼 主』:
了解DOS内存(转载)
使用 LLM 解释/回答一下
了解DOS内存
DOS操作系统最早设计时,PC机的硬件系统只支持1M字节的寻址空间,所以DOS只能管理最多1M字节的连续内存空间。在这1M内存中,又只有640K被留给应用程序使用,它们被称为常规内存或基本内存,其它384K被称为高端内存,是留给视频显示和BIOS等使用的。在1982年,640K内存对微型计算机来说显得绰绰有余,人们甚至认为,640K的内存可以用来干任何事。现在看起来有些可笑,但在当时,情况确实如此。
现在的情况是,即使你的电脑装有几兆或几十兆内存,但如果你使用DOS操作系统,那么你也只有640K的内存可以直接使用,1M以上的内存要通过一些内存管理工具才能使用。值得庆幸的是,Windows
95已经不存在常规内存的限制了,你所有的内存,不管是8M还是128M,都可以被直接使用。
在DOS下,系统中存在以下四种内存:
常规内存(Conventional Memory);
高端内存(Upper Memory);
扩充内存(Expanded Memory);
扩展内存(Extended Memory)。
常规内存指的是0-640K的内存区。在DOS下,一般的应用程序只能使用系统的常规内存,因而都要受到640KB内存的限制。而且由于DOS本身和config.sys文件中的安装的设备驱动程序和autoexec.bat文件中执行的内存驻留程序都要占用一些常规内存,所以应用程序能使用的常规内存是不到640K的。有很多时候,我们都要想方设法地整理内存,好为一些“胃口”比较大的应用程序留出足够的常规内存,这一点想必是许多DOS时代的电脑爱好者最熟悉不过的了。
高端内存是指位于常规内存之上的384K内存。程序一般不能使用这个内存区域,但是EMM386.exe可以激活高端内存的一部分,并且它允许用户将某些设备驱动程序和用户程序用Devicehigh或LH(即loadhigh)装入高端内存。dos=high,umb也是把DOS的一部分装到高端内存里。这里的umb是高端内存块(Upper
Memory Block)的缩写。
扩充内存是一种早期的增加内存的标准,最多可扩充到32M。使用扩充内存必须在计算机中安装专门的扩充内存板,而且还要安装管理扩充内存板的管理程序。由于扩充内存是在扩展内存之前推出的,所以大多数程序都被设计成能使用扩充内存,而不能使用扩展内存。由于扩充内存使用起来比较麻烦,所以在扩展内存出现后不久就被淘汰了。
扩展内存只能用在80286或更高档次的机器上,目前几乎所有使用DOS的机器上超过1M的内存都是扩展内存。扩展内存同样不能被DOS直接使用,DOS5.0以后提供了Himem.sys这个扩展内存管理程序,我们可以通过它来管理扩展内存。emm386.exe可以把扩展内存(XMS)仿真成扩充内存(EMS),以满足一些要求使用扩充内存的程序。
最后再强调一下,不管扩充内存或扩展内存有多大,DOS的应用程序只能在常规内存下运行。有的程序可以通过DOS扩展器(比如DOS4GW.exe等程序)使CPU进入保护模式,从而直接访问扩展内存;但是要注意,进入保护模式以后,计算机就脱离了DOS状态。
转载于《学习资讯》
Understanding DOS Memory
When the DOS operating system was initially designed, the hardware system of the PC only supported a 1M-byte addressing space, so DOS could only manage a continuous memory space of up to 1M byte. Among this 1M memory, only 640K was reserved for application programs, which are called conventional memory or base memory, and the other 384K is called upper memory, which is reserved for video display, BIOS, etc. In 1982, 640K of memory was more than enough for microcomputers, and people even thought that 640K of memory could be used to do anything. Now it seems a bit funny, but at that time, that was indeed the case.
Now, even if your computer has several megabytes or tens of megabytes of memory, if you use the DOS operating system, then you only have 640K of memory that can be directly used, and memory above 1M needs to be used through some memory management tools. Fortunately, Windows 95 has no restrictions on conventional memory, and all your memory, whether 8M or 128M, can be directly used.
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 memory area from 0 to 640K. Under DOS, general application programs can only use the system's conventional memory, so they are all limited by 640KB of memory. Moreover, because DOS itself and device drivers installed in the config.sys file and memory-resident programs executed in the autoexec.bat file all occupy some conventional memory, the conventional memory that application programs can use is less than 640K. Many times, we have to try every means to organize memory to leave enough conventional memory for some application programs with a relatively large "appetite", which must be the most familiar thing to many computer enthusiasts in the DOS era.
Upper memory refers to the 384K of memory above conventional memory. Programs generally cannot use this memory area, but EMM386.exe can activate part of the upper memory, and it allows users to load certain device drivers and user programs into the upper memory using Devicehigh or LH (that is, loadhigh). dos=high,umb also loads part of DOS into the upper memory. Here, umb is the abbreviation of Upper Memory Block.
Expanded memory is an early standard for increasing memory, which can be expanded up to 32M at most. To use expanded memory, a special expanded memory board must be installed in the computer, and a management program for the expanded memory board must also be installed. Since expanded memory was introduced before extended memory, most programs are designed to be able to use expanded memory, but not extended memory. Because expanded memory is more troublesome to use, it was eliminated soon after extended memory appeared.
Extended memory can only be used on 80286 or higher-end machines. Currently, almost all memory above 1M on machines using DOS is extended memory. Extended memory also cannot be directly used by DOS. After DOS 5.0, Himem.sys, an extended memory management program, is provided, and we can manage extended memory through it. EMM386.exe can simulate extended memory (XMS) as expanded memory (EMS) to meet the requirements of some programs that use expanded memory.
Finally, let's emphasize again that no matter how large expanded memory or extended memory is, DOS application programs can only run under conventional memory. Some programs can make the CPU enter protected mode through a DOS extender (such as DOS4GW.exe and other programs), so as to directly access extended memory; but it should be noted that after entering protected mode, the computer is no longer in the DOS state.
Reprinted from "Learning Information"
|

欢迎大家观临我的个人主页:
http://dosdiy.bluepc.com.cn/
http://dosdiy.ys168.com/
EMAIL: lydong@china.com.cn lydong@yeah.net
----------------------------------------------
|
|
2002-10-22 00:00 |
|
|
Wengier
系统支持
             “新DOS时代”站长
积分 27736
发帖 10521
注册 2002-10-9
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
说法有些不确,并非“进入保护模式以后,计算机就脱离了DOS状态。”
而是进入了保护模式的DOS状态后,计算机就脱离了通常的实模式的DOS状态。
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和雨露,谢谢!)
 |
|
2002-10-22 00:00 |
|
|
lydong
元老会员
        
积分 1468
发帖 407
注册 2002-10-21 来自 广州
状态 离线
|
|
2002-10-22 00:00 |
|
|
中华dos
初级用户
 
积分 107
发帖 3
注册 2002-10-26
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
帖主能否具体解释一下dos=high,umb中high和umb的区别,我知道其实可以把他们分开写,可见两者是不同的,另外对上位内存,dos保留区这两个概念我也搞不清楚,能否解释一下。
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?
|
|
2002-10-26 00:00 |
|
|
lydong
元老会员
        
积分 1468
发帖 407
注册 2002-10-21 来自 广州
状态 离线
|
『第 5 楼』:
-
使用 LLM 解释/回答一下
dos=high,umb 的功能是将UMB的控制权交给DOS,至于 high和umb的区别我也说不清楚。
MS-DOS最初是为8086/8088 CPU设计的操作系统, 最多只能使用1MB的内存。这1MB内存最前面的640KB 即前述的传统内存,至于后面剩下的384KB,则保留给BIOS ROM、硬件接口卡(如VGA、硬盘控制卡)上的ROM 与VIDEO BUFFER 使用。
保留内存(Reserved Memory)的地址空间介于640~1024KB之间共384KB,它是保留给外部使用的地址空间。保留内存其实不应该称为内存,应该称为保留内存空间,因为在此地址空间并未安装实体的RAM。
所谓保留内存,其实只是拥有384KB的地址空间而已,并非真有384KB的RAM内存可用来存放数据。
在保留内存(640~1024间)的384KB地址空间内,除了由视频缓冲区、BIOS ROM 和其他硬件扩充卡使用之外, 仍有许多空隙, 我们可运用 386/486 CPU 的分页(Paging)的能力,将扩展内存映射过来填补这些空隙,因为这些空隙还在DOS的1MB的范围之内,以往是因为没有安插内存所以才无法使用,现在以分页技术配置好内存之后,便成为可供DOS使用的内存了。 我们称这些在640KB 以上地址的内存为“上位内存(Upper Memory)” , 上位内存可能因为外部卡的安装而被分成几个块所以又称为上位内存块(Upper Memory Blocks),简称为UMB。
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
----------------------------------------------
|
|
2002-10-26 00:00 |
|
|
禅宗
元老会员
         CEO
积分 1019
发帖 300
注册 2002-10-20 来自 广东
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
没错,dos=high,umb 的功能是将UMB的控制权交给DOS,但两者各有各的功能,High是指将DOS核心放在高端内存;而UMB则是让DOS与UMB进行关联,从而使EMM386.EXE负责管理的高端内存让一些程序使用;所以通常将它们写在一起,即可以让DOS核心放在UMB中,又能让其它程序使用UMB,当然,如果没有EMM386.EXE的话,UMB这个参数也就没有了意义了的。我是这样理解的,希望与大家探讨。
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 |
|
2002-10-29 00:00 |
|
|
laochang409
中级用户
  
积分 297
发帖 44
注册 2004-6-15
状态 离线
|
|
2004-6-23 00:00 |
|
|
Michael
钻石会员
       
积分 10046
发帖 3039
注册 2002-11-11
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
high是使dos使用hma,hma是1m以上内存的前64KB. 它并不是umb.
high is to make DOS use HMA, and HMA is the first 64KB of memory above 1MB. It is not UMB.
|

简单就是美 |
|
2004-6-23 00:00 |
|
|
qinqong
高级用户
   
积分 599
发帖 148
注册 2003-10-30
状态 离线
|
|
2004-6-24 00:00 |
|
|
Michael
钻石会员
       
积分 10046
发帖 3039
注册 2002-11-11
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
请不要只说个"好“字.谢谢
Please don't just say "Okay". Thanks
|

简单就是美 |
|
2004-6-24 00:00 |
|
|