c - Virtual Memory allocation without Physical Memory allocation -


i'm working on linux kernel project , need find way allocate virtual memory without allocating physical memory. example if use :

char* buffer = my_virtual_mem_malloc(sizeof(char) * 512); 

my_virtual_mem_malloc new syscall implemented kernel module. data written on buffer stocked on file or on other server using socket (not on physical memory). complete job, need request virtual memory , access vm_area_struct structure redefine vm_ops struct.

do have ideas ?

thx

this not architecturally possible. can create vm areas have writeback routine copies data somewhere, @ level, must allocate physical pages written to.

if you're okay that, can write fuse driver, mount somewhere, , mmap file it. if you're not, you'll have write(), because redirecting writes without allocating physical page at all not supported x86, @ least.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -