Categories
Linux Tutorial Series

Linux Tutorial Series – 155 – User space startup

Here is the video version, if you prefer it:

Let’s talk about how the user space starts up. To remind ourselves, there is the user space, which “regular” users can access and there is the kernel (system) space, which “regular” users can’t access. If they try to, the operating system doesn’t allow them to.

Here is roughly how the user space starts up: (Ward, 2014)⁠

  1. init
  2. Essential low-level services which enable managing hardware devices and system logging
  3. Network configuration
  4. Mid and high-level services (such as cron (used for scheduling tasks) and printing)
  5. Login prompts, GUIs, and other high-level applications

To remind ourselves, init is the process with the PID of 1, with which it all begins. I hope you now see why this holds – because init has the PID of 1 and it is the first step here. It is also speculated that init is how the universe was made, albeit scientist are not yet sure.

Hope you learned something useful!

References

Ward, B. (2014). How Linux Works: What Every Superuser Should Know (2nd ed.). No Starch Press. Pages 111-112

Categories
Linux Tutorial Series

Linux Tutorial Series – 6 – User space and system space – what is the difference?

Here is the video version, if you prefer it:

User space is the space that “normal” processes use. System space (aka kernel space) is the space that only the operating system can use.

See, every program has to be stored in random access memory (RAM). That means that the operating system also has to be stored in RAM. (Ward, 2014)⁠ So the operating system uses the RAM, user programs (your normal every day programs such as Mozilla Firefox) use the RAM, everyone uses the RAM! Now, the thing about the operating system is, because of security reasons and because of potential issues, it limits the user processes to a part of RAM called user space and the operating system resides in a different part of the RAM. If any process (process being another word for a program you have started on your computer) tries to access any part of the memory which is not its own, it can’t. The operating system makes sure of it. The figure below should help clarify things.

Figure 1 – System and user space (my own illustration)

Hope you learned something useful!

References

Ward, B. (2014). How Linux Works: What Every Superuser Should Know (2nd ed.). No Starch Press. Pages 8-9