网站公告列表

  没有公告

加入收藏
设为首页
联系本站
您现在的位置: AnalogCN安诺电子 >> 文章 >> 技术交流 >> 文章正文
  uclinux2.6(bf561)中的bootmem分析(1):猜测           ★★★ 【字体:
uclinux2.6(bf561)中的bootmem分析(1):猜测
作者:快乐虾    文章来源:http://blog.csdn.net/lights_joy    点击数:    更新时间:2008-5-13    
在setup_arch(arch/blackfin/kernel/setup.c)函数中,与bootmem相关的代码有:
     int bootmap_size;
 
     /* setup memory defaults from the user config */
     physical_mem_end = 0;
     _ramend = CONFIG_MEM_SIZE * 1024 * 1024;
 
     if (physical_mem_end == 0)
         physical_mem_end = _ramend;
 
     /* by now the stack is part of the init task */
     memory_end = _ramend - DMA_UNCACHED_REGION;
 
     _ramstart = (unsigned long)__bss_stop;
     _rambase = (unsigned long)_stext;
#ifdef CONFIG_MPU
     /* Round up to multiple of 4MB. */
     memory_start = (_ramstart + 0x3fffff) & ~0x3fffff;
#else
     memory_start = PAGE_ALIGN(_ramstart);
#endif
 
     /*
      * give all the memory to the bootmap allocator, tell it to put the
      * boot mem_map at the start of memory
      */
     bootmap_size = init_bootmem_node(NODE_DATA(0), memory_start >> PAGE_SHIFT, /* map goes here */
                        PAGE_OFFSET >> PAGE_SHIFT,
                        memory_end >> PAGE_SHIFT);
     /*
      * free the usable memory, we have to make sure we do not free
      * the bootmem bitmap so we then reserve it after freeing it :-)
      */
     free_bootmem(memory_start, memory_end - memory_start);
 
     reserve_bootmem(memory_start, bootmap_size);
此时,内存管理的初始化函数paging_init尚未调用,因此猜测bootmem的作用似乎是在内核启动完成前提供一种简单的内存管理策略。看看mm/bootmem.c的注释:
/*
 * linux/mm/bootmem.c
 *
 * Copyright (C) 1999 Ingo Molnar
 * Discontiguous memory support, Kanoj Sarcar, SGI, Nov 1999
 *
 * simple boot-time physical memory area allocator and
 * free memory collector. It's used to deal with reserved
 * system memory and memory holes as well.
 */
文章录入:admin    责任编辑:admin 
  • 上一篇文章:

  • 下一篇文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关文章
    ucos-ii在嵌入式智能视觉监控
    14bit 40 MSamples/s ADC应用
    打造windows下的嵌入式开发工
    DSP和FPGA在汽车电子中的广泛
    [连载]ADSP-TSl01S系列之一 
    ADI ADIS1625x低功耗陀螺仪方
    基于DSP的实时图像跟踪系统的
    wxWidgets和MFC动态类型信息
    用dll方式编译wxWidgets-2.8
    Blackfin时钟控制
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    版权所有:AnalogCN安诺电子 湘ICP备06016315号