ricepot100
驱动牛犊
驱动牛犊
  • 注册日期2007-05-18
  • 最后登录2008-10-24
  • 粉丝0
  • 关注0
  • 积分4分
  • 威望4点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:5030回复:4

[求助]32位cpu是否支持4G内存的问题

楼主#
更多 发布于:2008-10-18 06:59
看了<全面解析4GB内存无法完全识别问题>,这里我说的内存仅仅是指普通的DDR RAM, 还是很迷糊.比如32位地址线,最大可以访问4G,但是这个4G是否包括I/O地址,BIOS地址,如果包括的话那么肯定是不支持4G的了,但是x86的地址架构又是独立编码,也就是访问I/O地址又与访问RAM的指令不一样,是否可以认为对同一个数值的地址,如果用I/O指令方式访问(IN/OUT)就是访问I/O,而用RAM指令方式(普通指针方式赋值)访问就是访问RAM,那么,这样的话,又好像可以单独支持4G内存了.
我上面的猜测有什么问题了?
fyax999
禁止发言
禁止发言
  • 注册日期2017-10-22
  • 最后登录2017-11-27
  • 粉丝0
  • 关注0
  • 积分-219分
  • 威望60点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2017-10-31 16:22
用户被禁言,该主题自动屏蔽!
terrychen
驱动小牛
驱动小牛
  • 注册日期2002-04-15
  • 最后登录2014-03-13
  • 粉丝0
  • 关注0
  • 积分174分
  • 威望68点
  • 贡献值0点
  • 好评度15点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2009-03-31 13:33
现在cpu大多数支持emt64,可以切换到long mode做64位操作,北桥的4G限制早已经不是问题,remap以后,可以解决。
os可以用64 version的windows.
xtdumpling
驱动牛犊
驱动牛犊
  • 注册日期2006-08-02
  • 最后登录2009-03-01
  • 粉丝0
  • 关注0
  • 积分183分
  • 威望49点
  • 贡献值0点
  • 好评度18点
  • 原创分0分
  • 专家分0分
地板#
发布于:2009-02-20 23:00
不懂,mark
tiamo
VIP专家组
VIP专家组
  • 注册日期2002-02-26
  • 最后登录2018-01-09
  • 粉丝17
  • 关注4
  • 积分50分
  • 威望142点
  • 贡献值1点
  • 好评度40点
  • 原创分2分
  • 专家分15分
  • 原创先锋奖
  • 社区居民
地下室#
发布于:2008-10-20 00:41
1.4G不包括io地址,包括bios地址,包括memory mapped io
2.cpu的地址线早就超过32位了.
3.4G内存问题在北桥上面..
4.windows xp不支持4G内存不是因为作不到..而是微软人为限制了内存使用..微软想你花更多钱买2003而不是xp来使用4G内存.你要使用8G内存..那么再花钱买enterprise edition.

要在xp上面使用4G以上内存..只是需要patch ntoskrnl的2个地方一共8个字节的数据...
VOID MiCheckPaeLicense(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
{
    ULONG MaxPages;
    ULONG HighestPhysicalAddress;

    if(ExVerifySuite(Blade) == TRUE)
    {
        //
        // blade server?
        //    2GB physical memory
        //    highest physical address is 128GB
        //
        MaxPages                                    = 0x80000;
        HighestPhysicalAddress                            = 0x2000000;
    }
    else if(ExVerifySuite(DataCenter) == TRUE)
    {
        if(LoaderBlock->u.I386.VirtualBias == 0)
        {
            //
            // data center without /3GB
            //    128GB physical memory
            //    highest physical address is 128GB
            //
            MaxPages                                = 0x2000000;
            HighestPhysicalAddress                        = 0x2000000;
        }
        else
        {
            //
            // The system is booting /3gb, so don't use more than 16gb of
            // physical memory.  This ensures enough virtual space to map
            // the PFN database.
            //    16GB physical memory
            //    highest physical address is 16GB
            //
            MaxPages                                = 0x400000;
            HighestPhysicalAddress                        = 0x400000;
        }
    }
    else if(MmProductType != 0x00690057 && ExVerifySuite(Enterprise) == TRUE)
    {
        //
        // 0x00690057 means 'W' 'i',the first two charaters of 'WinNT' in unicode encoding
        // this value will be 'S' 'e'(ServerNT) for the Server family,the other type such as windows xp it will be 'WinNT'
        //
        if(LoaderBlock->u.I386.VirtualBias == 0)
        {
            //
            // Advanced Server is permitted a maximum of 64gb physical memory.
            // The system continues to operate in 8-byte PTE mode.
            //    64GB physical memory
            //    highest physical address is 128GB
            //
            MaxPages                                = 0x1000000;
            HighestPhysicalAddress                        = 0x2000000;
        }
        else
        {
            //
            // The system is booting /3gb, so don't use more than 16gb of
            // physical memory.  This ensures enough virtual space to map
            // the PFN database.
            //
            MaxPages                                = 0x400000;
            HighestPhysicalAddress                        = 0x400000;
        }
    }
    else if(ExVerifySuite(TerminalServer) == TRUE)
    {
        //
        // terminal server,windows 2003 standard edition and windows 2000 pro will be here
        //
        if(LoaderBlock->u.I386.VirtualBias == 0)
        {
            //
            // without /3GB
            //    4GB physical memory
            //    highest physical address is 128GB
            //
            MaxPages                                = 0x100000;
            HighestPhysicalAddress                        = 0x2000000;
        }
        else
        {
            //
            // The system is booting /3gb,
            //    4GB physical memory
            //    highest physical address is 16GB
            //
            MaxPages                                = 0x100000;
            HighestPhysicalAddress                        = 0x400000;
        }
    }
    else
    {
        //
        // the other type,such as windows xp and vista will be here[patch the numbers(0x100000)]
        //    4GB physical memory
        //    highest physical address is 4GB
        //
        MaxPages                                    = 0x100000;
        HighestPhysicalAddress                            = 0x100000;
    }

    //
    // for each memory descriptor,check its bounds
    //
    ULONG TotalPages                                    = 0;
    ULONG TotalUsablePages                                = 0;
    for(PLIST_ENTRY NextMd = LoaderBlock->MemoryDescriptorListHead.Flink; NextMd != &LoaderBlock->MemoryDescriptorListHead; NextMd = MemoryDescriptor->ListEntry.Flink)
    {
        PMEMORY_ALLOCATION_DESCRIPTOR MemoryDescriptor    = CONTAINING_RECORD(NextMd,MEMORY_ALLOCATION_DESCRIPTOR,ListEntry);
        TYPE_OF_MEMORY Type                                = MemoryDescriptor->MemoryType;

        //
        // skip those special memory type
        //
        if(Type != LoaderFirmwarePermanent && Type != LoaderBad && Type != LoaderSpecialMemory && Type != LoaderBBTMemory)
        {
            //
            // check highest physical address
            //
            if(HighestPhysicalAddress)
            {
                //
                // the whole range is beyond the highest physcial address,remove this descriptor
                //
                if(MemoryDescriptor->BasePage >= HighestPhysicalAddress)
                {
                    RemoveEntryList(&MemoryDescriptor->ListEntry);
                    continue;
                }
                else if(MemoryDescriptor->BasePage + MemoryDescriptor->PageCount > HighestPhysicalAddress)
                {
                    //
                    // truncate it
                    //
                    MemoryDescriptor->PageCount            = HighestPhysicalAddress - MemoryDescriptor->BasePage;
                }
            }

            //
            // check total size
            //
            TotalPages                                    += MemoryDescriptor->PageCount;
            if(TotalPages > MaxPages)
            {
                if(TotalPages - MemoryDescriptor->PageCount < MaxPages)
                {
                    MemoryDescriptor->PageCount            = MemoryDescriptor->PageCount - (TotalPages - MaxPages);
                }
                else
                {
                    RemoveEntryList(&MemoryDescriptor->ListEntry);
                    continue;
                }
            }

            if(MemoryDescriptor->PageCount)
                TotalUsablePages                        += MemoryDescriptor->PageCount;
        }
    }

    //
    // kernel support 64bits DMA
    //
    if(MmDynamicPfn || TotalUsablePages > 0x100000)
        Mm64BitPhysicalAddress                            = TRUE;
}


look一下....
http://thxlp.spaces.live.com/blog/cns!6317274E5BA1CBD7!490.entry
游客

返回顶部