User Space and Kernel Space

Kernel space and user space are memory region which differs in the privilege of their components.

Kernel Space:

  • It is a part of memory where the code of the kernel is located and executed under.
  • The components used in kernel space are referred to as kernel space components.
  • Processes running under this space have full access to the kernel and do not require any system calls to avail of service provided by the kernel.
  • They can access any machine instruction of the underlying architecture
  • They can access h/w controllers and register as per to rules.
  • Example: getpid, socket, read, write, open, process management subsystem, memory management subsystem are system space or kernel space components.

User Space:

  • It is a set of locations where normal user’s processes run that is space other than kernel space.
  • This area is often referred to as userland and components are referred to as user space components, the code that runs outside the operating system’s kernel.
  • Userland usually refers to the various programs and libraries that the operating system uses to interact with the kernel.
  • Processes running under this pace do not have the full privilege and do not have access to kernel space.
  • They can access a small part of the kernel by using system calls.
  • They cannot access all the machine instructions and can access h/w controllers and register with the help of system calls.
  • Examples: Any C program or top, ps, ls, malloc, fopen are common user space program which evokes system calls to get the job done.

Diag-1: User space and Kernel Space

untitled image

Related Post:



Categories: Operating system (OS)

4 replies

Trackbacks

  1. Index of Operating System - Tech Access
  2. Types of Threads - Tech Access
  3. User Level Threads - Tech Access
  4. Characteristics of a Thread - Tech Access

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: