kernel questions

Guy Harris guy at auspex.UUCP
Thu Feb 16 19:39:32 AEST 1989


>>1) If a user process can be 'nailed' into memory, is there still a
>>need to copyin(k) data from user virtual address space into kernel
>>address space? If no, could the kernel then access the user data
>>in the user virtual address space with minimum overhead?
>
>A) no, and b) yes, and in fact this is what `raw I/O' does.

Well, sort of.  When doing "raw I/O" the kernel generally doesn't even
touch the data; it lets the I/O subsystem do so (which is why the
details are machine-dependent, as indicated).

If kernel code wants to access the data directly, that's *also*
machine-dependent; some systems provide separate address spaces for
kernel-mode and user-mode code (e.g.  a Sun-2), which means that
user-mode virtual address N and kernel-mode virtual address N refer to
different physical addresses, and there may not *be* a kernel-mode
virtual address that refers to the same physical address as user-mode
virtual address N. 

In addition, of course, the kernel may or may not want to access the
data directly; for instance, it may have write permission on some
location that the user does *not* have write permission on, and if it's
doing stuff on behalf of the user, it may not want to modify a location
for the user process if it can't modify it itself.



More information about the Comp.unix.wizards mailing list