[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Could kernel copy memory between processes directly?
wojtek@ifirma.pl writes:
> I
> don't think I could implement doors myself but NetBSD said (will say?) at
> Usenix 2002 it was their "future direction".
Yes, they said it, but considering that it takes ages for NetBSD to go from
saying something to actually implemeting it, I wouldn't count on it in the
nearest future.
> >copyin and copyout only work on the currently running process.
>
> Okay, this is the answer to my initial question. So, as a simplification,
> the kernel sees only itself and current process, like in Linux, correct?
This depends on the MMU. All architectures have some notion of the current
userland address space and all architectures have ways to quickly access
that address space (for copyin and copyout).
On some archs (sparc, i386 (not sure about alpha)) this means that the kernel
space and user space are mapped into the same page table in the MMU. Some
other archs have one supervisor address space and one user address space
and have special purpose instructions for doing memory reads in the
user address space from the kernel. I suspect that some architectures
could actually have instructions to access at least two different user
address spaces from the kernel at the same time (or at least without too
much horror), but that wouldn't be portable.
It is not possible to have multiple processes running in the same address
space and keep the semantics where one process is not allowed to fiddle with
the other, unless we do some really weird tricks with the page tables, but
I'm not going to get into how ugly and unportable this could get.
//art