Thread (6 messages) 6 messages, 4 authors, 2012-04-18

how to use the memory allocated in kernel?

From: Dave Hylands <hidden>
Date: 2012-04-18 17:47:18

Hi,

2012/4/18 ??? [off-list ref]:
Hi Dave,

Thanks for reply. My English is not very good, and so I want to ask about a
term:map. Does map mean that create a relationship between the virtual space
and physical memory?
In this case yes. The MMU translates virtual addresses to physical
addresses. So when dealing with linux you have a virtual memory space,
and a totally separate physical memory space. The MMU translates (or
maps) virtual addresses to physical addresses.

alloc_vm_space allocates some address space from virtual memory, but
doesn't set up any mapping to physical memory. So the complete process
of allocating memory goes something like this:

1 - Allocate some virtual address space
2 - Allocate some physical pages
3 - Setup the MMU to map your virtual address space to the physical pages.

alloc_vm_pages just does step 1. vmalloc and kmalloc do steps 1, 2, and 3

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help