[Tfug] Locking from user-land

John Gruenenfelder johng at as.arizona.edu
Sun Jan 11 23:08:46 MST 2009

On Sun, Jan 11, 2009 at 07:32:03PM -0700, Tom Rini wrote:
>On Sun, Jan 11, 2009 at 01:53:17PM -0800, Bexley Hall wrote:
>> Hi,
>> Is there any way I can *effectively* wire down (even for
>> a short -- but *guaranteed* -- period of time) a small
>> amount of physical memory from user-land?
>Sure, and I think this all even works on x86.  mem=(real minus what you
>want), the top "what you want" is yours to do with as you please.
>That's the kernel command line mem=.  Otherwise, I believe no.  And keep

Are you sure it's that simple?  Certainly, memory the OS doesn't know about is
free for any use you can imagine, but how to actually access it, especially
from userspace?  It seems the MMU might complain.  And even if it didn't,
you'd still need root priviledges to actually access it.

>in mind that atomic operations, outside of kernel space, might not be
>possible depending on the architecture.

Yes, I think for Bexley's purpose some sort of kernel interaction is pretty
much mandatory if he wants memory/time access with guaranteed
characteristics.  I suppose you could write a small and simple kernel module
to do exactly this for the purpose of kernel->userspace transfers.  But Bexley
mentioned doing this from userspace alone... probably not.

Perhaps one of the realtime kernel extensions?  I don't know what sort of
guarantees they give with regards to memory transfers in a specified time

--John Gruenenfelder    Systems Manager, MKS Imaging Technology, LLC.
Try Weasel Reader for PalmOS  --  http://weaselreader.org
"This is the most fun I've had without being drenched in the blood
of my enemies!"
        --Sam of Sam & Max

More information about the tfug mailing list