The question stated below might not be technically correct(misconception) so it would be appreciable if misconception is also addressed.
Which ring level do the different *nix run levels operate in?
Ring tag not available.
The question stated below might not be technically correct(misconception) so it would be appreciable if misconception is also addressed.
Which ring level do the different *nix run levels operate in?
Ring tag not available.
Unix runlevels are orthogonal (in the sense "unrelated", "independent of" - see comments) to protection rings.
Runlevels are basically a run time configurations/states of the operating system as a whole, they describe what services are available ("to the user") - like SSH access, MTA, file server, GUI.
Rings are a hardware aided concept which allows finer grained control over the hardware (as mentioned in the wikipedia page you link to). For example code running in higher Ring may not be able to execute some CPU instructions.
Linux on the x86 architecture usually uses Ring0 for kernel (including device drivers) and Ring3 for userspace applications (regerdless of whether they are run by root or another ordinary or privileged user).
Hence you can't really say that a runlevel is running in some specific Ring - there are always1 userspace applications (at least PID 1 - the init
) running in Ring3 and the kernel (Ring0).
1As always, the "always" really means "almost always", since you can run "normal" programs in Ring0, but you are unlikely to see that in real life (unless you work on HPC).
The two concepts are completely unrelated. The system run level refers to the set of services that are running on the system, such as whether or not the gui desktop environment is running. Ring levels are a hardware protection mechanism on intel x86 processors that separate code into different privelege levels. Linux only uses rings 0 and 3 for kernel and user mode code respectively. Thus, all user mode processes, running when the system is in any run level execute in ring 3, until they make a call into kernel code, which transitions the cpu to ring 0.
From your own link:
In a monolithic kernel, the operating system runs in supervisor mode and the applications run in user mode. Other types of operating systems, like those with an exokernel or microkernel, do not necessarily share this behavior.
Some examples from the PC world:
Linux and Windows are two operating systems that use supervisor/user-mode. To perform specialized functions, user-mode code must perform a system call into supervisor mode or even to the kernel space where trusted code of the operating system will perform the needed task and return it back to user space.
So your answer would be 2. The supervisor (0) and the user (1).