TONT 42903 Windows 95在安装了1GB以上内存的机器上无法启动

请注意:本页内容发布于 2313 天前,内容可能已经过时,请注意甄别。

当世界年龄还小的时候。

原文链接:https://blogs.msdn.microsoft.com/oldnewthing/20030814-00/?p=42903

Short version

长话短说版

Windows 95 will fail to boot if you have more than around 480MB of memory. (This was considered an insane amount of memory back then. Remember, Windows 95’s target machine was a 4MB 386SX and a powerful machine had 16MB. So according to Moore’s law, that gave us seven years before we had to do something about it. One of my friends got 96MB of memory on his machine to test that we didn’t tank under “insanely huge memory configurations” and we all drooled.)

Windows 95在安装了约480MB以上的内存时将无法启动。(在那个年代,这个内存容量是难以想象的。请记住,Windows 95开发时的目标配置是拥有4MB内存的386SX,比较强力的机器一般有16MB的内存。依据摩尔定律,我们大约需要再过7年才需要对这种设计进行修正。我有一个朋友当时有台机器配置了96MB内存用来跑测试,这个配置甚至不在我们能预想到的『土豪级内存配置』列表下面,可以想象我们当时是如何的羡慕)。

Windows 98 bumped the limit to 1GB because there existed a vendor (who shall remain nameless) who was insane enough to want to sell machines with 1GB of RAM and preinstall Windows 98 instead of the much more suitable Windows NT.

Windows 98将最大内存限制提升到了1GB,因为当时有家供应商(名称保密)足够牛×要销售预装Windows 98的1GB内存配置的机器,而这个配置本应更适合安装Windows NT。

Long version

娓娓道来版

One of the first things that happens in the Windows 95 boot process once you have transitioned into 32-bit mode is to initialize the 32-bit memory manager. But now you have a chicken-and-egg problem: The memory manager needs to allocate some memory in order to keep track of the memory it is managing. (Keeping track of which pages are paged in and which are paged out, that sort of thing.) But it can’t allocate memory until the memory manager is initialized. Eek!

在Windows 95的引导过程中,有几件事情发生在转入32位模式的最初阶段,其中一间就是初始化32位内存管理器。然而,这里有一个『先有蛋还是先有鸡』的问题:内存管理器需要给自己分配一些内存用以跟踪其正在管理的内存(诸如跟踪哪些内存页page in了,哪些page out了这样的事情),然而当内存管理器还没有初始化时无法分配内存,我的天。

The solution is to initialize the memory manager twice.

解决方法是,对内存管理器进行2次初始化。

The first time the memory manager is initialized, it gets all its memory from a fixed block of memory preallocated in the init-data segment. It sets up this fixed block as the memory manager heap. So now there is a heap available to satisfy memory allocations.

第一次初始化时,内存管理器所能用到的内存区段来自在init-data段中的一块固定部分。内存管理器将这一块固定的内存作为(最初的)内存管理堆(heap),现在它就有可以用来进行内存管理的一个堆了。

Next, the memory manager starts looking for the real memory in the system, and when it finds some, it allocates memory (from the initial fixed block) to keep track of the real memory.

接下来,内存管理器会扫描系统中实际配置的内存数量,每找到一些后,就会在刚才的固定内存区块里分配一些内存,来对实际配置的内存进行跟踪。

After the memory manager has found all the real memory in the system, it’s time to initialize the memory manager a second time: It carves out a chunk of that real memory to use as the “real heap” and copies the information from the heap that it has been using so far (the fixed-sized heap) to the “real heap”.

当内存管理器搜索完所有真实内存后,就可以进行第二次初始化了:内存管理器会从实际的内存中挖出一块内存来用作『真实(内存管理)堆』,并将直至刚才为止一直在使用的、固定内存块中里分配的堆里的数据复制过来。

Once everything has been copied and all the pointers fixed up, the global memory manager heap pointers are changed to point at the new (“real”) heap and the original heap is abandoned.

等到一切都复制好、所有的指针都修正了之后,全局内存管理器的堆指针就指向了这个新的(真实)堆,之前的那个就扔掉不要了。

The memory consumed by the original heap is reclaimed when the init-data segment is discarded (which happens at the end of system initialization).

而之前第一次使用的堆所占用的内存,在init-data段被抛弃后就被回收了(发生在系统初始化的最后阶段)。

The total RAM limitation occurs because the size of the fixed block in the init-data segment needs to be large enough to satisfy all the memory allocations performed during the memory scan. If you have too much memory, an allocation during the memory scan fails and the system halts.

系统安装的总内存量上限即由此而生,因为(在第一次初始化中)init-data段里(用来追踪实际安装的内存)的固定内存块需要足够大,才能在对实际内存扫描时满足对内存分配情况记录的需求。如果内存容量过大,那么这个扫描过程就会失败,系统也会停机。

The size of the init-data segment was chosen to balance two factors. The larger you make it, the more memory you can have in the system before hitting an allocation failure during the memory scan. But you can’t make it too large or machines with small amounts of memory won’t even be able to load VMM into memory.

Init-data段的大小是权衡两种因素后得出的。这个段的尺寸越大,在发生内存扫描(因内存过大而导致分配表不够用)失败前能扫描到的内存就越大,但又不能太大,否则当主机安装的内存小的时候,剩下的内存就不够把虚拟机管理器(译注:VMM,Vitrual Machine Manager,Windows 95的关键组件之一,驱动程序文件名VMM32.VXD,负责进行内存管理、事件管理、中断管理、对其它虚拟设备驱动(VxD)进行加载和初始化,创建新的虚拟机以及进行线程调度,可以说是Windows 9x的地基)加载进来了。

Comments

  1. 4MB是最低要求而不是标配,查了一下,相应的CPU最低要求是386DX。微软的建议最低配置是80486+最少8MB内存。

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

 剩余字数 ( Characters available )

Your comment will be available after auditing.
您的评论将在通过审核后显示。

Please DO NOT add any links in your comment, otherwise it would be identified as SPAM automatically and never be audited.
请不要在评论中插入任何链接,否则将被自动归类为垃圾评论,且永远不会被提交给博主进行复审。

*