This is not architecturally possible. You can create vm areas that have a writeback routine that copies data somewhere, but at some level, you must allocate physical pages to be written to If you're okay with that, you can simply write a FUSE driver mount it somewhere, and mmap a file from it. If you're not, then you'll have to just write() because redirecting writes without allocating a physical page at all is not supported by the x86, at the very least.
This is not architecturally possible. You can create vm areas that have a writeback routine that copies data somewhere, but at some level, you must allocate physical pages to be written to. If you're okay with that, you can simply write a FUSE driver, mount it somewhere, and mmap a file from it.
If you're not, then you'll have to just write(), because redirecting writes without allocating a physical page at all is not supported by the x86, at the very least.
Well.. you could leave the page as unmapped, then in the page fault handler inspect the faulting instruction and emulate it. But that'd be awfully slow, and require a full instruction decoder. – caf Jul 1 at 4:13 so it could be possible by handling Page fault exception to cancel it when it appear for virtual address used by my modified malloc?
– Corvus Jul 1 at 12:31 @Corvus, caf's idea is theoretically possible but a terrible idea. It will slow accesses by a factor of a thousand, at least. – bdonlan Jul 1 at 21:10.
I'm working on a Linux kernel project and I need to find a way to allocate Virtual Memory without allocating Physical Memory. My_virtual_mem_malloc is a new SYSCALL implemented by my kernel module. All data written on this buffer is stocked on file or on other server by using socket (not on Physical Memory).
So to complete this job, I need to request Virtual Memory and get access to the vm_area_struct structure to redefine vm_ops struct. Do you have any ideas about this?
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.