Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

User space and kernel space

From Wikipedia, the free encyclopedia
Way of using computer memory
"Kernel space" and "User space" redirect here. For the mathematical definition, seeNull space. For the user space on Wikipedia, seeWikipedia:User pages.
icon
This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "User space and kernel space" – news ·newspapers ·books ·scholar ·JSTOR
(October 2012) (Learn how and when to remove this message)

A modern computeroperating system usually usesvirtual memory to provide separate address spaces or regions of a single address space, calleduser space and kernel space.[1][a] This separation primarily providesmemory protection and hardware protection from malicious or errant software behaviour.

Kernel space is strictly reserved for running a privilegedoperating system kernel, kernel extensions, and mostdevice drivers. In contrast, user space is the memory area whereapplication software,daemons, and some drivers execute, typically with one address space per process.

Overview

[edit]

The termuser space (oruserland) refers to all code that runs outside the operating system's kernel.[2] User space usually refers to the various programs andlibraries that the operating system uses to interact with the kernel: software that performsinput/output, manipulatesfile system objects,application software, etc.

Each user spaceprocess usually runs in its ownvirtual memory space, and, unless explicitly allowed, cannot access the memory of other processes. This is the basis formemory protection in today's mainstream operating systems, and a building block forprivilege separation. A separate user mode can also be used to build efficient virtual machines – seePopek and Goldberg's virtualization requirements. With enough privileges, processes can request the kernel to map part of another process's memory space to their own, as is the case fordebuggers. Programs can also requestshared memory regions with other processes, although other techniques are also available to allowinter-process communication.

Various layers within Linux, also showing separation between theuserland andkernel space
User modeUser applicationsbash,LibreOffice,GIMP,Blender,0 A.D.,Mozilla Firefox, ...
System componentsinit daemon:
OpenRC,runit,systemd, ...
System daemons:
polkitd,smbd,sshd,udevd, ...
Windowing system:
X11,Wayland,SurfaceFlinger (Android)
Graphics:
Mesa,AMD Catalyst, ...
Other libraries:
GTK,Qt,EFL,SDL,SFML,FLTK,GNUstep, ...
C standard libraryfopen,execv,malloc,memcpy,localtime,pthread_create, ... (up to 2000subroutines)
glibc aims to be fast,musl aims to be lightweight,uClibc targets embedded systems,bionic was written forAndroid, etc. All aim to bePOSIX/SUS-compatible.
Kernel modeLinux kernelstat,splice,dup,read,open,ioctl,write,mmap,close,exit, etc. (about 380 system calls)
The Linux kernelSystem Call Interface (SCI), aims to bePOSIX/SUS-compatible[3]
Process scheduling subsystemIPC subsystemMemory management subsystemVirtual files subsystemNetworking subsystem
Other components:ALSA,DRI,evdev,klibc,LVM,device mapper,Linux Network Scheduler,Netfilter
Linux Security Modules:SELinux,TOMOYO,AppArmor,Smack
Hardware (CPU,main memory,data storage devices, etc.)

Implementation

[edit]

The most common way of implementing auser mode separate fromkernel mode involves operating systemprotection rings.Protection rings, in turn, are implemented usingCPU modes.Typically, kernel space programs run inkernel mode, also calledsupervisor mode;standard applications in user space run in user mode.

Some operating systems aresingle address space operating systems—with a single address space for all user-mode code. (The kernel-mode code may be in the same address space, or it may be in a second address space).Other operating systems have per-process address spaces, with a separate address space for each user-mode process.

See also

[edit]

Notes

[edit]
  1. ^Older operating systems, such asDOS andWindows 3.1x, do not use this architecture.

References

[edit]
  1. ^"Address space". Address space options for 32bit systems.
  2. ^"userland, n."TheJargon File.Eric S. Raymond.Archived from the original on 2017-07-18. Retrieved2016-08-14.
  3. ^"Admin Guide README".Kernel.org git repositories.

External links

[edit]
General
Variants
Kernel
Architectures
Components
Process management
Concepts
Scheduling
algorithms
Memory management,
resource protection
Storage access,
file systems
Supporting concepts
Retrieved from "https://en.wikipedia.org/w/index.php?title=User_space_and_kernel_space&oldid=1331987299"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp