Linux Tutorial Series

Linux Tutorial Series – 159 – Review

Here is the video version, if you prefer it:

Let’s review what we learned.

Here is how your computer boots up:

  1. A boot loader is ran by machine’s BIOS or boot firmware
  2. The boot loader finds the kernel image on disk, loads it into memory, and starts it
  3. The kernel initializes the hardware devices and its drivers
  4. The kernel mounts the root filesystem
  5. The kernel starts a program called init; init has PID equal to 1
  6. init starts all of the other necessary system processes
  7. At some point at or near the end of this entire process, you get the option to log in to your system

Here is how the user space starts up:

  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

When shutting down your computer, the following goes on:

  1. init asks every process to shut down
  2. If some processes (or a process) don’t respond, init initiates a kill with a TERM signal
  3. If some processes (or a process) don’t respond still, init initiates a kill with a KILL signal
  4. The system makes preparations for a shutdown
  5. The system unmounts all of the other filesystems other than root
  6. The system remounts the root filesystem in read-only mode (meaning you can’t write, only read)
  7. The system writes out all of the data left over in the buffers to the filesystem (this happens during the remounting process)
  8. The kernel reboots or stops the system

Other things to mention:

  • Boot loaders job is to load the kernel into memory and start it with a set of parameters
  • demsg command is used to display kernel messages, or you can look at /var/log/kern.log
  • init is the process which starts all system services
  • shutdown command is used to shut down or restart your system

Talk soon!

NewsletterUpdates on interesting things I am doing

Subscribe to my newsletter to keep abreast of the interesting things I'm doing. I will send you the newsletter only when there is something interesting. This means 0% spam, 100% interesting content.

Leave a Reply

Your email address will not be published. Required fields are marked *