---------------------------------------- > Date: Thu, 3 Jan 2008 12:50:05 +0530 > From: [EMAIL PROTECTED] > To: [email protected] > Subject: Linux kernel module > > Hi, > > > > I have written a memory manager library (C code) which allocates memory > from heap using OS call and manages the memory for the application that > uses this library. > > Now I want to make this a kernel module such that multiple applications > can use it for memory management. > > > > Should the memory manager be made as a loadable kernel module for > multiple applications to use it? > > > > As I understand, the virtual address seen by each of the application is > different for the same physical memory. (Is this understanding right??). > How do I give the correct virtual address to the application that calls > this memory manager for memory allocation? > > The OS itself is responsible for mapping memory. The address space you specify to the brk call is a virtual address.
I'm not sure if what you're trying to do is really valid here. It sounds to me like you're writing a library at the malloc level- a malloc replacement. If so, you don't want this as a kernel module- you want to have it at the application level. If the new call has the same signature as malloc, you want to replace glibc with a version with your function. If it doesn't, your app needs to call it instead of malloc. If you're trying to write code that changes how the kernel finds empty physical pages- that isn't a module's job, thats a deep part of the kernel you'd have to yank. Or am I completely missing something? Gabe _________________________________________________________________ The best games are on Xbox 360. Click here for a special offer on an Xbox 360 Console. http://www.xbox.com/en-US/hardware/wheretobuy/ -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-newbie
