Saturday, April 25, 2009

What is "Kernel memory" and "User memory".?

Memory is divided into two areas, kernel memory and user memory

  1. Kernel memory is also known as kmem, kernel space and kernel land

    1. This contains the kernel binary itself, working tables to keep track of status on the system and buffers.

    2. The kernel binary is typically 3 meg big and the working tables consume another 3 meg (only an example; may vary)

    3. Examples of working tables that the kernel keeps in kernel memory for the operation of the system are the Global Open File Table, the Process Table and the Mount Table.

    4. Traditionally once the size of kernel memory has been set on bootup (as determined by the finite set sizes of all the tables) it cannot be resized (System V). Linux has a clever way of overcoming this limitation by allowing kernel tables to grow into user memory as required!

  2. User memory is also known as umem, user space and user land.

    1. This is for the use of user programs.

Figure 1.11. Kernel memory and User Memory

Kernel memory and User Memory

Figure 1.12. Kernel Memory, table and buffer cache allocations

Kernel Memory, table and buffer cache allocations



See How kernel sits in the memory

The boot loader loads the kernel binary into memory from the hard disk, and places it at the beginning of memory.

Figure 1.10. Kernel loaded into memory

Kernel loaded into memory

Once the kernel has been read in the boot loader tells the CPU to execute it by issuing a JMP (Jump) instruction. The kernel now begins to execute


 
Things You Should Know About Linux !!!