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.