Alloc/Free API Calls

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
DarylD

Alloc/Free API Calls

Post by DarylD »

What is the best way for kernel modules to allocate/free memory. I thought of two possibilties:

1. Have an ISR to do it, maybe latch the allocator and freer-upper (cool word) onto different interrupts. Only worry with this is speed. Context switching won't be an issue for kernel modules but maybe user code will be affected.

2. When loading executables bind them to the alloc/free functions directly. This will be fast but does kind of make things a lot more monolithic.

Any other suggestions?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Alloc/Free API Calls

Post by Pype.Clicker »

Clicker has a generic 'kalloc' service that module links to at load-time. This service is just a kind of "rendez-vous point" where memory providers can register and offer allocation with some property bits (for instance KMEM_DRIVER offers DMA-aware memory ...) for a given memory range.
Post Reply