linux在内存中启动,Linux 内存分配之--启动时内存分配

Linux内存子系统提供现代操作系统所拥有的内存管理功能。在嵌入式linux的开发过程中分配大块(>= 1M Bytes)的连续内存分配将成为很困难的问题,因为在系统运行过程当中由于频繁的内存分配释放导致很多内存碎片(外碎片),很难分配连续的内存块。系统启动时候的内存分配将很好地解决这个问题,虽然并不推荐使用该方法,因为启动时内存分配绕过了Linux内核的所有内存管理策略。

Boot time allocator uses a bitmap to indicate  available memory start from

0 to max_low_pfn which comes from e820 memory map.

Only the code compiled into kernel binary image can use boot time allocator, the module can't use boot time allocator for boot time allocator

mechanisms are removed after system booting.

Relationship between boot time allocator and buddy system:

buddy system algorithm get page frame information(e.g. how many page frame the system has) from boot time allocator after kernel subsystems who get memory through boot time allocator allocating memory, destructor

of boot time allocator informs buddy system with how many free pages

the system still has. So boot time allocator allocates pages before buddy system start to work, buddy system manages the memory page frames

not allocated by boot time allocator.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值