Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If my understanding is not wrong, every process has a Kernel Address space associated with it (which is typically 1GB). As far as local variables are concerned, they are assigned on the kernel stack and so their virtual address is according to the address of the kernel stack.

However, if there are global variables in the kernel code, what will be the virtual address of these variables? When and who will assign this address? If it is the compiler, how does the compiler know that some part of code is kernel code?

Sorry for asking such a naive question, but I'm really confused here.

share|improve this question
see stackoverflow.com/questions/13013491/… – msw Aug 21 '13 at 23:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.