uclinux2.6(bf561)中的bootmem分析(1):猜测
来源:互联网 发布:好的日记软件 编辑:程序博客网 时间:2024/05/16 18:07
在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.
*/
- uclinux2.6(bf561)中的bootmem分析(1):猜测
- uclinux2.6(bf561)中的bootmem分析(3):init_bootmem_node
- uclinux2.6(bf561)中的bootmem分析(4):alloc_bootmem_pages
- uclinux2.6(bf561)中的bootmem分析(2):调用前的参数分析
- uClinux2.6(bf561)中的CPLB
- uClinux2.6(bf561)的NorFlash驱动实现分析(1): 基本参数
- uclinux2.6(bf561)内核中的current_thread_info
- uclinux2.6(bf561)内核中的paging_init
- uClinux2.6(bf561)的NorFlash驱动实现分析(6): do_map_probe
- uClinux2.6(bf561)的NorFlash驱动实现分析(7): cfi_probe
- uClinux2.6(bf561)的NorFlash驱动实现分析(8): check_cmd_set
- uClinux2.6(bf561)的NorFlash驱动实现分析(2): chips和maps
- uClinux2.6(bf561)的NorFlash驱动实现分析(3) : chip_driver注册
- uClinux2.6(bf561)的NorFlash驱动实现分析(4) : maps定义
- uClinux2.6(bf561)的NorFlash驱动实现分析(5) : 驱动加载
- uClinux2.6(bf561)的NorFlash驱动实现分析(9): 驱动的使用
- uClinux2.6中的双链表
- 再读uclinux-2008r1(bf561)内核中的bootmem
- WEB2.0中AJAX应用的详细探讨
- 一步一步教你使用.net进行Socket通信
- 笔记本显示屏
- jboss-4.2.2.GA中配置数据源详细步骤
- ASP.NET利用输出流生成下载文件(doc、xml..)
- uclinux2.6(bf561)中的bootmem分析(1):猜测
- Server Application Error(http 500 错误,IIS不能解析ASP)
- 数学练习二:互联网数字游戏
- 逐步教你使用.net进行Socket通信进阶篇
- 提高链表随机访问效率的一种方案
- 见到武学高人
- sigh
- Embarcadero Technologies®公司将收购Borland® 软件公司的CodeGear™业务
- 串口通信,C#,C++,短信发送模块实现