Re: difference between User space and Kernel space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hari Prashanth wrote:

>     Can you say me what address space is? Not the
> address space associated with the user space. its the
> other one.

Hari,

Every user-space process has a 4 gigabyte virtual memory address space
(some CPUs allow for larger spaces).  The kernel also has a single
virtual memory address space for its own use -- it is also 4 GB in size.

All kernel code runs in the kernel virtual memory address space.  There
are times, that the kernel virtual memory address space contains pieces
of a user process's address space.  This is so that system calls can
access arguments passed using pointers.  A classic example are the
read() and write() system calls, which need to transfer data from kernel
buffers into a user process address space.

I think a common misconception held by people who are new to kernel
programming is that the kernel always deals only with physical memory
addresses.  In fact, most kernel code uses virtual addresses within the
kernel's own personal virtual memory space.
--
Francis Litterio
franl <at> world . std . com


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux