User space and kernel space
This article needs additional citations for verification. (October 2012) |
A modern computer operating system usually uses virtual memory to provide separate address spaces called user space and kernel space.[a] Primarily, this separation serves to provide memory protection and hardware protection from malicious or errant software behaviour.
Kernel space is strictly reserved for running a privileged
Overview
The term user space (or userland) refers to all code that runs outside the operating system's kernel.[1] User space usually refers to the various programs and libraries that the operating system uses to interact with the kernel: software that performs input/output, manipulates file system objects, application software, etc.
Each user space
User mode | User applications | bash, LibreOffice, GIMP, Blender, 0 A.D., Mozilla Firefox, ... | ||||
---|---|---|---|---|---|---|
System components | init daemon: OpenRC, runit, systemd... |
udevd ...
|
SurfaceFlinger (Android)
|
Graphics: Mesa, AMD Catalyst, ... |
Other libraries: GTK, Qt, EFL, SDL, SFML, FLTK, GNUstep, ... | |
C standard library | -compatible.
| |||||
Kernel mode | Linux kernel | stat , splice , dup , read , open , ioctl , write , mmap , close , exit , etc. (about 380 system calls)The Linux kernel System Call Interface (SCI), aims to be POSIX/SUS-compatible[2] | ||||
Process scheduling subsystem | IPC subsystem | Memory management subsystem | Virtual files subsystem | Networking subsystem | ||
Other components: Smack
| ||||||
Hardware (CPU, main memory, data storage devices, etc.) |
Implementation
The most common way of implementing a user mode separate from
Many operating systems are single address space operating systems—they have 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). Many other operating systems have a per-process address space, a separate address space for each and every user-mode process.
Another approach taken in experimental operating systems is to have a single address space for all software, and rely on a programming language's semantics to make sure that arbitrary memory cannot be accessed – applications simply cannot acquire any references to the objects that they are not allowed to access.[3][4] This approach has been implemented in JXOS, Unununium as well as Microsoft's Singularity research project.
See also
- BIOS
- CPU modes
- Early user space
- Memory protection
- OS-level virtualization
Notes
- Windows 3.1x, do not use this architecture.
References
- ^ "userland, n." The Jargon File. Eric S. Raymond. Retrieved 2016-08-14.
- ^ "Admin Guide README". Kernel.org git repositories.
- ^ "Unununium System Introduction". Archived from the original on 2001-12-15. Retrieved 2016-08-14.
- ^ "uuu/docs/system_introduction/uuu_intro.tex". UUU System Introduction Guide. 2001-06-01. Retrieved 2016-08-14.
External links
- Linux Kernel Space Definition
- Entering User Mode at the Wayback Machine (archived March 26, 2016)