Everything2
Near Matches
Ignore Exact
Full Text
Everything2

user space

created by guus

(idea) by guus (5.3 y) (print)   ?   (I like it!) Wed Oct 31 2001 at 14:09:39

The environment created by operating systems in which normal processes run. In user space a process can only access its own virtual memory. In order to do anything else it has to make a system call and let the kernel handle special requests.

The distinction between user space and kernel space allows several processes run in a multitasking environment without accidently crashing the system or accessing other processes' memory regions. Also, the existence of a well defined API between the kernel and user space improves portability.


(idea) by randombit (2.8 hr) (print)   ?   (I like it!) Sat Feb 12 2005 at 5:31:48

User space refers to the portion of a computer which is running user applications and tools; the user space/kernel space distinction is one of the broadest ways to differentiate the types of code running on a modern operating system.

On Intel x86 CPUs, there are 4 'rings', numbered 0 through 3. Code running in ring 0 is fully privileged; it can talk directly to hardware and so on. The rings go increasingly more isolated from the physical hardware the further 'out' you go; most operating systems put all application code into ring 3. In this ring, certain operations which can affect I/O devices or the CPU internal state are disabled. Rings 1 and 2 are rarely used. This is partially for portability reasons, as other CPUs only have a user/supervisor distinction, with no intermediate levels. But primarily because they are not that useful; the x86 ISA doesn't really support the inner rings that well, especially in combination with modern operating system constructs like virtual memory in a flat address space. Code in ring 3 could be considered user space, with a handful of exceptions.

User space does not have quite the same meaning as user mode, though this is a fairly fine semantic difference which many people will not know (or not care) about. A specific case where the difference matters is microkernels and exokernels; in these operating system designs, most of what is generally considered an operating system, such as hardware drivers, filesystems, and so on, run in user mode, but would not really be considered user space.

Generally, good design practices would suggest that, since we have already broken the code in the system into two groups, we should define a clear API between these two sides to simplify communication between them. Generally the operating system will provide a set of system calls, RPC entry points, or some other public API which allows code in user space to talk to code in kernel space. With rare exceptions, kernel space will not call out to anything living in user space; all communications are initiated by the user space code. One of these exceptions, in Unix, is that the kernel will create the primordial process init after boot; init will then proceed to startup the rest of the system. In some systems the kernel space/user space distinction is not so strong; on MS Windows, portions of IIS (Microsoft's web/FTP/etc server) actually run in ring 0! Linux had some experimental code that did the same (khttpd, and then, later on, Tux), but, to be honest, having something like that be mandatory freaks me out a little bit. Maybe I'm too much of a microkernel geek for my own good.

In summary. User space: it's where the fun stuff happens. Or something...


†: I suppose I should say, I would not consider an IDE driver running in ring 3 in a microkernel to really be user space.


printable version
chaos

kernel space futex user mode Translation Look-Aside Buffer
exokernel The HURD SPARC mutual exclusion
kernel Operating system system call BeOS
Everyday I Spend Writing Code Linux kernel nachos C++
Network user molasses vector space I/O Kit
luser privilege separation Userland System
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Drink up!
Cognate
Catharsis and the Cloth of Echoes
The Unpublished Works of Dr. Seuss
Earthquake
Grand Rapidians - Part One
Found: one slightly damaged happy meal toy
vegan
The Moon
Toaster
Hellboy
Black beans and rice
Lineage of Jesus
Call me a lady and I will growl at you
New Writeups
aneurin
You pays your money and you takes your choice(idea)
shaogo
July 20, 2008(log)
Glowing Fish
Tualatin River(place)
The Jacket
Words of Advice(idea)
John_Fox
Good Intentions Gone Wrong(person)
Heitah
Posthumous Oscar(thing)
ignis_glaciesque
University of South Florida(place)
ignis_glaciesque
Flogstaskriket(idea)
liveforever
Caesar's last breath(idea)
dagnyswaggart
she wants to believe(personal)
antigravpussy
he doesn't know, but her eyes widen too far(thing)
dagnyswaggart
Wild tides guard her secrets(poetry)
Lord Brawl
Caesar's last breath(poetry)
locke baron
Forgotten things in space(fiction)
sitaraika
Colours(idea)
This page courtesy of The Everything Development Company