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/