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
Paul Sargent writes:
> Hi David,
>
> Let's just say I'm learning about the linux kernel with a device I
> understand.

;-)

> OK, so user process address space lies below 0xC0000000 and there is
> a different mapping per process. Kernel mappings are above
> 0xC0000000 and are constant. So when a syscall is run, we're still
> in the user process context, therefore the userspace mappings still
> exist for that process. (How am I doing?)

Yep.

> This means that the copy-from-user() and copy-to-user() can just be
> simple copies.

Yep.

> But I'm still confused by the virt-to-phys macro. I would have
> thought if I want to find the physical address of a user space
> buffer I would have to go through the page table to fins out where
> is physical page is, not just mask off some bits.

The virt-to-phys macro is to convert kernel virtual addresses (those
returned by get_free_page() and kmalloc()) to physical
addresses. Stuff returned by vmalloc() can't be converted to physical
addresses this way: you have to walk the page tables.

Similarly, for user addresses you have to walk the page tables.

Regards,

Richard....

-
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.515 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site