mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bryan Donlan <bdonlan@gmail.com>
To: sidc7 <siddhartha.chhabra@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Kernel vs user memory
Date: Sat, 17 Jan 2009 00:26:53 -0500	[thread overview]
Message-ID: <3e8340490901162126u109da9cbu7292fddf6d832723@mail.gmail.com> (raw)
In-Reply-To: <21512985.post@talk.nabble.com>

On Fri, Jan 16, 2009 at 11:21 PM, sidc7 <siddhartha.chhabra@gmail.com> wrote:
>
> I am not an expert, just started doing some kernel programming and code
> reading, so as far as I understand, memory can be either mapped to user
> space or kernel space, if its neither in user and kernel, as you said, the
> division is not easy, where will the memory be mapped to, is there any other
> special region ?

For each memory space (usually one per process), the kernel sets up a
page table. The lower PAGE_OFFSET bytes are mapped differently for
each such space, but above the address PAGE_OFFSET, every process has
the same mappings - this is what one usually thinks of when one hears
'kernel memory'. The kernel then puts its data structures in this
upper area, so that the addresses of these structures remains the same
in all processes. Of course, these pages are only accessible in kernel
mode - attempting to access them at all from a user process will get
you a segmentation fault.

Note also that while on 64-bit platforms the kernel memory map
generally includes all of physical RAM, on 32-bit platforms such as
the x86, there's typically only about 700mb of physical RAM mapped in
this area by default; the remainder of RAM (if any) can only be used
for page/buffer cache and process memory.

  reply	other threads:[~2009-01-17  5:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-17  2:56 sidc7
2009-01-17  4:16 ` Bryan Donlan
2009-01-17  4:21   ` sidc7
2009-01-17  5:26     ` Bryan Donlan [this message]
     [not found]       ` <49f90a801003181710v5e08ccc8jdd26ec899e75bdb9@mail.gmail.com>
2010-03-19  0:28         ` Bryan Donlan
     [not found]           ` <49f90a801003181747m5078d9c2y3cc8421203a7b1e6@mail.gmail.com>
2010-03-19  1:06             ` Bryan Donlan
2010-03-19  1:29               ` Siddhartha Chhabra
2009-01-17  6:26 ` H. Peter Anvin
2009-01-17  6:34   ` sidc7
2009-01-17  6:38     ` H. Peter Anvin
2009-01-17  6:42       ` sidc7
2009-01-17  7:27         ` H. Peter Anvin
2009-01-19 20:03           ` sidc7

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3e8340490901162126u109da9cbu7292fddf6d832723@mail.gmail.com \
    --to=bdonlan@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=siddhartha.chhabra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®