Re: Accessing Physical Memory & Other Process's Address Space
- From: Gil Hamilton <spamtrap@xxxxxxxxxx>
- Date: Thu, 7 Feb 2008 15:32:58 +0100 (CET)
Tim Roberts <spamtrap@xxxxxxxxxx> wrote in
news:hg8lq314n5p0oc2qn1vcrubv1avf6e7les@xxxxxxx:
"mybwpp@xxxxxxxxxxxxxx" <spamtrap@xxxxxxxxxx> wrote:
In 32 bit protected mode, each user process is allocated a 4GB address
space, whereby program data and code resides in lower 2GB and kernel
is mapped in the upper 2GB (in some cases it is 3GB for user and 1GB
for kernel). However the part of linear address space where kernel is
mapped, is not accessible to user process, due to the difference in
privilege levels. The question is that, do kernel mode processes also
get their address space mapped in the same manner.
In Windows and Linux, at least, there is no such thing as a "kernel
mode process". Processes simply exist. Sometimes they run in user
mode, sometimes they run in kernel mode. In user mode, part of the
address space is visible. In kernel mode, all of it is.
Somewhat tangential to the original thread, but just to clarify:
In Linux, at least, there is the notion of a "kernel-mode thread" which
is for all intents and purposes equivalent to a kernel-mode process.
These threads are basically just like other threads except that they
don't have the user-mode portions attached (i.e. the user-mode address
space consisting of code and data segments). So when the scheduler task-
switches to a kernel-mode thread, it need only switch the kernel-mode
stack -- the page tables don't need to be switched.
Other than that, these threads are analogous to ordinary threads *while*
they're running in kernel-mode. They simply have a top-level loop
somewhere -- usually an infinite loop -- that waits for something to do
(or just waits for x number of clock ticks), does something, then
repeats. Conceptually, it's as if there were a special-purpose system
call that was invoked once, then simply never completed (and hence never
returned to user-mode).
I believe Windows has an equivalent mechanism though I haven't done any
Windows kernel programming in a very long time.
GH
.
- Follow-Ups:
- Re: Accessing Physical Memory & Other Process's Address Space
- From: Tim Roberts
- Re: Accessing Physical Memory & Other Process's Address Space
- References:
- Accessing Physical Memory & Other Process's Address Space
- From: mybwpp@xxxxxxxxxxxxxx
- Re: [Clax86list] Accessing Physical Memory & Other Process's Address Space
- From: Charles Crayne
- Re: Accessing Physical Memory & Other Process's Address Space
- From: mybwpp@xxxxxxxxxxxxxx
- Re: Accessing Physical Memory & Other Process's Address Space
- From: Tim Roberts
- Accessing Physical Memory & Other Process's Address Space
- Prev by Date: Re: Can WXP handle 4 GB of Physical Memory
- Next by Date: Re: Accessing Physical Memory & Other Process's Address Space
- Previous by thread: Re: Accessing Physical Memory & Other Process's Address Space
- Next by thread: Re: Accessing Physical Memory & Other Process's Address Space
- Index(es):
Relevant Pages
|