Here is a patch, relative to p13g, that gives the kernel the capability to malloc more than 4k. The memory is allocated in pages, so this is not meant to replace kmalloc, rather be used when you really need it. The functions are klmalloc() and klfree(), called with the same parameters as kmalloc() and kfree(). This code is seriously untested! I am not sure yet whether it fails gracefully when no free pages are available, although I think it should. It works by grabbing the next free entry in the swapper page directory above physical memory, in the kernel space ( > 0xC0000000), and allocating a page table. This means that the max space that can be allocated by the kernel thru this call is 4Mbytes. I am not sure how fragmented this page table will get. This may or may not be a problem. When klmalloc() is called it searches (inelegantly) for enough consecutive page table entries to map the required memory, then it gets free pages for each of these entries. I think I have sorted the only race. That is being interrupted between finding the table entries and setting them. I am open to comments, flames, etc... Hopefully this is a reasonable way to approach this problem. Let me know what you think. Charles Hawkins +--------------------------------+ +-----------------------------------+ + Cambridge University + + Telephone : (44) 223 332765 + + Engineering Department + + Fax : (44) 223 332662 + + Trumpington Street + + E-mail : ceh@eng.cam.ac.uk + + Cambridge CB2 1PZ + + + +--------------------------------+ +-----------------------------------+