lkml.org 
[lkml]   [1999]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Address spaces on a i386 - Getting Confused
   From: Paul Sargent <Paul.Sargent@3dlabs.com>
Date: Tue, 30 Mar 1999 11:35:39 +0100

Now by my reckoning this would give a 1:1 virtual to physical memory
mapping, so why bother with virtual addresses.

Because user space is at 0x0 --> 0xc0000000

All of the kernel and the current user process mapped by the tlb on
the x86 cpu using the page tables setup by the memory management layer
of ther kernel (mostly, arch/i386/mm/init.c, mm/*.c,
include/asm-i386/{pgtable,page}.h)

The kernel mappings are present for each user address space, but the
mappings below 0xc0000000 are unique for each user.

So when the copy is done from user space to kernel space for your
read() example, the TLB maps the user's virtual address to the
physical page the kernel gave to it and the copy data comes from
there, likewise for the kernel destination addresses even though it's
just a straight 1:1 mapping.

Trying to write some kernel video card drivers are we? :-)

Later,
David S. Miller
davem@redhat.com


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

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.059 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site