Initializing buddy allocator
Posted: Tue Nov 29, 2005 1:13 am
Hi all,
After reading Intel docs, memory mgmt tutorials, Linux memory management books, I got an overall idea of memory management and various algorithms used to allocate and free page frames. I prefer to implement buddy allocator in my kernel to allocate page frames in different regions (DMA and NORMAL). I didn't find any tutorial that explains how to initialize the buddy system allocater based on the physical memory available in the system. There will be two variables to hold the buddy data structure in my kernl, one for DMA page frames (<16 MB) and another for NORMAL regions (>16 MB).
Could anyone explain me how to initialize the buddy allocator? i.e., how to add the page frames into the different page frame regions (1, 2, 4, 8, 16, etc), initially?
After reading Intel docs, memory mgmt tutorials, Linux memory management books, I got an overall idea of memory management and various algorithms used to allocate and free page frames. I prefer to implement buddy allocator in my kernel to allocate page frames in different regions (DMA and NORMAL). I didn't find any tutorial that explains how to initialize the buddy system allocater based on the physical memory available in the system. There will be two variables to hold the buddy data structure in my kernl, one for DMA page frames (<16 MB) and another for NORMAL regions (>16 MB).
Could anyone explain me how to initialize the buddy allocator? i.e., how to add the page frames into the different page frame regions (1, 2, 4, 8, 16, etc), initially?