lkml.org 
[lkml]   [2001]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
On Tue, 10 Jul 2001, Timur Tabi wrote:

> Chris Wedgwood wrote:
>
> >How does FreeBSD do this? What about other OSs? Do they map out most
> >of userland on syscall entry and map it in as required for their
> >equivalents to copy_to/from_user? (Taking the performance hit in doing
> >so?)
> >
>
> I don't know about *BSD, but in Windows NT/2000, even drivers run in
> virtual space. The OS is not monolithic, so address spaces are general
^^^^^^^^^^^^^
> not "shared" as they are in Linux.
^^^^^^^

Everything in the kernel is virtual. There are some 1:1 mappings in
low-address space, but there is a PTE for everything addressed anywhere.
It has to be this way or paging would not work. Linux is also not
as you say "monolithic". We have installable device drivers, you know.
They are logically within the kernel's virtual address space, but
may be anywhere in physical memory. Also, although the kernel is
uncompressed into memory slightly above 1 megabyte upon startup,
it could exist anywhere in physical memory. It's just easier to
make the 1:1 mappings exist where the kernel was started in 32-bit
linear mode, before paging was enabled.

The kernel has the capability (by design) of addressing anything it
wants. So, if this is what you mean by "shared", I guess you imply
that Windows can't address anything it wants? Of course it can.

In Unix and Unix variants, it is by design, provided that the
kernel exist within every process address space. Early Nixes
like Ultrix, simply called the kernel entry point. Since it
was protected, this trapped to the real kernel and the page-fault
handler actually performed the work on behalf of the caller.

Unlike some OS (like VMS), a context-switch does not occur
when the kernel provides services for the calling task.
Therefore, it was most reasonable to have the kernel exist within
each tasks address space. With modern processors, it doesn't make
very much difference, you could have user space start at virtual
address 0 and extend to virtual address 0xffffffff. However, this would
not be Unix. It would also force the kernel to use additional
CPU cycles when addressing a tasks virtual address space,
i.e., when data are copied to/from user to kernel space.
>
> --
> Timur Tabi
> Interactive Silicon
>

Cheers,
Dick Johnson

Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips).

I was going to compile a list of innovations that could be
attributed to Microsoft. Once I realized that Ctrl-Alt-Del
was handled in the BIOS, I found that there aren't any.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:56    [from the cache]
©2003-2011 Jasper Spaans