Hi, I wrote a small kernel module that defines and exports bfree() and bmalloc() functions. The idea is to use this kernel module as a replacement for big physcial area kernel patch. For example, zoran kernel driver relies on the big physical area API for v4l (used for video-in-a-window) to work. While the driver will compile and load with a non-patched kernel, v4l will not work reliably without big physical area support since the chip needs about 2megs of contiguous memory to display in a window. This means one really has to use a patched kernel. This module removes this requirement and allows v4l to work reliably with a non-patched kernel. The idea is to load the module from initrd or right after boot. I have used __get_free_pages() and mem_map_reserve() to pre-allocate the memory. I have left the user-mode code that I used to debug allocation and garbage collection. Compiled into a user-space program, the code will allocate/free random chunks from a pre-allocated space and print out the used list. Comments? Questions: 1) On a 256 MB machine, I was able to pre-allocate 512 pages using __get_free_pages(...,get_order(size)). It is enough for one card, but not for more. Any ideas on how to pre-allocate more? 2) __get_free_pages(...,get_order(size)) can be used to pre-allocate 2^n contiguous pages (2,4,16,...512, ...., 1024). Can I use something else from a kernel module to request a number that is not 2^n (say 750)? -- ---------------------------------------- Constantine Gavrilov Linux Leader Optibase Ltd 7 Shenkar St, Herzliya 46120, Israel Phone: (972-9)-970-9140 Fax: (972-9)-958-6099 ----------------------------------------