alexgolec
alexgolec

Reputation: 28282

What exactly is meant by 'map memory into userspace'?

When memory (suppose some kernel memory buffer) is mapped into userspace, what is it that happens? Is it that the entries in the page tables of the user process's struct mm are modified so that they point to the same pages as those in the kernel's virtual address space?

Does it mean that the process's entries are mapped to corresponding kernel virtual addresses?

How is this memory mapping implemented?

Upvotes: 2

Views: 671

Answers (2)

pflz
pflz

Reputation: 1941

Is it that the entries in the page tables of the user process's struct mm are modified so that they point to the same pages as those in the kernel's virtual address space?

Yes they are. In fact, all the physical memory is already mapped into kernel address space. So that implies that whatever physical memory is given to the process as virtual memory, that memory is already mapped by the kernel. I recommend you read the Gorman book on memory management.

Upvotes: 0

dave
dave

Reputation: 12806

There is a good explanation of this here

Upvotes: 1

Related Questions