100% found this document useful (2 votes)
386 views10 pages

Boot Management & Process Management

OS

Uploaded by

Aqsa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
386 views10 pages

Boot Management & Process Management

OS

Uploaded by

Aqsa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Boot Management & Process Management

When we click the power button of our system, several processes are
executing in the background. It's very important to understand the
booting process to learn the working of an operating system. It's a must
to understand how the Linux kernel boots to resolve the booting error. It
is a very curious topic to know, so let's begin with the basics.
o The boot microcode or BIOS of the machine hundreds and executes
a boot loader.
o The boot loader catches the kernel image over the disk and ships it
into memory to begin the computer.
o The kernel boots the devices and drivers.
o The kernel mounts the common filesystem.
o The kernel begins a program called init with a zero method ID.
o Init configures the system processes remainder in motion.
o Init begins a method allowing us to log in for some purpose,
typically at the close or top to the head of the boot order.

Start-up Message

Classic UNIX operating system manufacturers many diagnostic messages


on boot that tell us about the boot method. Initially, the messages recover
from the kernel and processes that init begins. Although, these messages
are not consistent or pretty, and they are not even informative terribly in
some cases. Hardware enhancements additionally have led to the kernel
to begin a lot quicker as compared to before messages flash by
accordingly quickly; it might be tough to see what is happening. Almost
all current Linux distributions do the best for covering boot medical
specialty with different filter and splash screen varieties to distract us,
whereas the system begins as a result.
Kernel Boot and Initialization Options

o CPU examination
o Device bus discovery
o Memory examination
o Devices discovery
o Root filesystem mount
o Auxiliary kernel system start-up
o Userspace begin
The CPU examination and memory examination are not so exceptional.
Although, when the kernel provokes devices, the dependencies question
comes. For instance, the disk device drivers may depend on the SCSI
system and bus support. We would not need to be worried about the
dependencies in general, except that a few essential parts are loadable
kernel modules rather than a part of almost all kernels.

Kernel Parameters

The Linux Kernel receives a set of text-based kernel parameters having a


few further system details when it starts. The parameters describe several
alternative types of behaviors, such as a diagnostic result of the kernel
concern to device driver-specific and manufacturer selections. The Ro
parameter guides the kernel for mounting the common filesystem in the
read-only mode under the user area starts. This general read-only mode
guarantees that fsck can inspect the basis filesystem safely before trying
to do anything serious. The boot-up technique remounts the basis
filesystem in the read-write mode during the check.

Tasks of Boot Loade


o Choose from multiple kernels.
o Shift between groups of kernel parameters.
o Supports booting distinct OSes.

Significantly, bootloaders became more advanced since the Linux kernel


origin, with options such as menu systems and command-line history.
Although, a common want has been perpetually flexibility in parameter
choice and kernel image. One brilliant development is that a few wants
have diminished.

For instance, as an outcome of we can perform recovery boot or associate


emergency from a USB device, we seldom require to be worried about
getting into kernel parameters manually or going into the single-user
mode. Modern bootloaders supply more power than ever, which may
notably be handy if we are creating custom kernels or want to tweak
parameters.
Overview of Boot Loader
o GRUB: It is a normal near-universal under Linux systems, along with
UEFI and BIOS/MBR versions.
o SYSLINUX: SYSLINUX may be managed to execute from several
alternative filesystem styles.
o LILO: It is one of the main Linux bootloaders. ELILO can be a UEFI
version.
o LOADLIN: It boots the kernel through DOS.
o System-boot: It is a straightforward boot manager of UEFI.
o coreboot: It is a good replacement for the system BIOS which will
demonstrate the kernel.
o EFI Linux: It is a UEFI boot loader specified to work as a model and
prefers different boot loaders of UEFI.
o Linux Kernel EFISTUB: It is a kernel plug-in used to directly load
the kernel from related UEFI/EDI System Partition.

GRUB Work and Introduction

GRUB is an acronym for Grand Unified Boot Loader. One of the most
vital capabilities of GRUB is filesystem navigation that lets straightforward
configuration choice and kernel image.
o The GRUB code hundreds.
o The BIOS hundreds and runs it upon searching the boot code. Often,
it is wherever GRUB starts.
o The code initializes. Currently, GRUB will access filesystems and disks
at now.
o GRUB recognizes its boot partition and several configurations there.
o GRUB provides the user the opportunity to differentiate the
configuration.
o GRUB runs the configuration after a user action or timeout.
o In the course of configuration execution, GRUB may load further
code in the boot partition. Also, several modules are preloaded.
o To run and load the kernel, GRUB runs boot commands.

Linux Boot Process Steps in Detail


An OS is low-level software that handles resources, gives basic services to
other software, and controls peripherals. We will explain each boot
process in detail:

o BIOS
BIOS is an acronym for Basic Input/Output System. In other words,
the BIOS can load and run the MBR (Master Boot Record) boot
loader. When we first turn on our system, the BIOS first implements
a few integrity checks of the SSD or HDD.
After that, the BIOS finds, loads, and runs the boot loader function,
which can be detected in the MBR. Sometimes, the MBR is on a CD-
ROM or USB stick, like with a live Linux installation. Then, the boot
loader function is loaded into memory, and BIOS provides system
control to it once it is detected.
o MBR
MBR is an acronym for Master Boot Record and is liable to load and
run the GRUB boot loader. MBR is placed in the first bootable disk
sector, which is generally /dev/sda, relying on our hardware. Also,
the MBR includes details of GRUB, or LILO is an older system.
o GRUB
GRUB is sometimes known as GNU GRUB, which stands for GNU
GRand Unified Bootloader. It is the classic bootloader for almost
all the latest Linux systems. The splash screen of GRUB is often the
initial thing we see when we boot our system. It contains a general
menu where we can choose some portions.
We can use our keyboard to choose the one we wish our system to
initiate with if we have multiple installed kernel images. The latest
kernel image is chosen by default. The splash screen will delay for
some seconds for us to choose options. It will load the kernel image
(default) if we don't. In several systems, we can see the GRUB
configuration file at /etc/grub/conf or /boot/grub/grub.conf.
o Kernel
Often, the kernel is called the code of an operating system. It
contained full control on everything in our system. In this boot
process stage, the kernel mounts the base file system that was
chosen that is set up in the file, i.e., grub.conf. Then, it runs the
/sbin/init function, which is always the initial function to be run. We
can confirm it with its PID (process id), which should be always 1.
Then, the kernel creates a temporary base file system with the help
of initrd (Initial RAM Disk) until the actual file system is mounted.
o Init
At this stage, our system runs runlevel programs. It would find an
init file, generally detected at /etc/inittab, to determine the run level
of Linux. Modern Linux systems utilize systemd to select a run level
rather. Then, systemd will start running runlevel programs.
There are six run labels in the Linux operating system:
o 0- halt
o 1- single-user mode
o 2- multiuser, without NFS
o 3- Full multiuser mode
o 4- unused
o 5- X11
o 6- reboot

We can check the configuration default run level of our system by running
the following command:
1. $ grep initdefault /etc/inittab
o Runlevel programs
We can see distinct services getting started depending on which
distribution of Linux we have installed. They are called runlevel
programs and are run from distinct directories depending on our
run level. All six runlevels mentioned above contain its directories:
o Run level 0- /etc/rc0.d/
o Run level 1- /etc/rc1.d/
o Run level 2- /etc/rc2.d/
o Run level 3- /etc/rc3.d/
o Run level 4- /etc/rc4.d/
o Run level 5- /etc/rc5.d/
o Run level 6- /etc/rc6.d/

Important: The exact location of the directories differentiates from one


distribution to another.

If we look in distinct run level directories, we will find programs that begin
with either a "K" or "S" for kill and startup, respectively. These start up
programs are run at the time of the system startup and kill several
programs at the time of shutdown.

What is Process Management in Linux?


Overview

Process management in Linux is an essential skill for Linux administrators and


developers.

It involves controlling and monitoring the processes running on a Linux system,


including managing process resources, scheduling processes to run on the CPU,
and terminating processes when necessary. Understanding the different types of
processes, their states, and the available commands for process management,
such as ps, top, kill, nice, and renice, are important for managing processes
effectively.

Introduction to Process

A process is an instance of a program currently running on a computer system.


In Linux, processes are managed by the operating system's kernel, which
allocates system resources and schedules processes to run on the CPU.
Understanding and managing processes is a critical skill for Linux
administrators and developers.

Types of Processes

In Linux, processes can be categorized into two types:

Foreground Processes

Foreground processes are the kinds of processes that require input from the user
and are characterized by their interactivity. For instance, a foreground process
would be like you are running an Office application on the Linux system.

Background Processes

On the other hand, background processes are non-interactive operations carried


out in the background and do not call for any participation from the user.
Antivirus software is an example of a Background Process.

Additionally, processes can be system processes or user processes. System


processes are initiated by the kernel, while users initiate User processes.

Process States in Linux

In Linux, a process can be in one of five states:

• Running:
The process is currently executing on the CPU.
• Sleeping:
The process is waiting for a resource to become available.
• Stopped:
The process has been terminated by a user
• Zombie:
The process has completed execution but has not yet been cleaned by
the system.
• Orphan:
The parent process of the current process has been terminated.

What is Process Management in Linux?

Process management is the task of controlling and monitoring the processes that
are running on a Linux system. It involves managing process resources,
scheduling processes to run on the CPU, and terminating processes when
required.
Commands for Process Management in Linux

Linux provides several commands for managing processes, which include:


Commands Description
ps Displays information about the processes running currently.
Provides real-time information about system processes and their
top
resource usage.
kill Terminates a process by sending a signal to it.
nice Adjusts the priority of a process.
renice Changes the priority of a running process.
ps PID Shows the state of an exact process.
pidof Shows the Process ID of a process.
Df Shows Disk Management of your system.
free Shows the status of your RAM.
Bg For sending a running process to the background.
Fg For running a stopped process in the foreground.

Practically Managing the Processes

We have explained some common commands below which are required to


manage processes. Let’s check them out:

Identifying and Terminating Processes in Linux.

Identification of processes and termination of processes can be done by using


the below-mentioned commands in Linux.

The ps command is used to find the process ID (PID) of the process you want to
manage. As instance, if it’s required to kill a process you need to know
the process ID (PID) of that exact process.

The kill command in Linux is used to terminate processes by their process IDs
(PIDs).

The killall command in Linux is used to terminate processes by their names. It


sends a signal to all processes with a specified name, effectively killing them.

Managing Priority of Processes in Linux


Managing the priority of a running process is done using “nice” and “renice”
commands in Linux.

The nice command in Linux is used to modify the priority of a process. It


assigns a lower priority to a process to reduce its resource usage.

The renice command is used to modify the priority of an already running


process. It can increase or decrease the priority of a process, depending on the
specified value.

MAnalyzing Resource Usage in Linux.

The top command in Linux is used to display real-time information about


processes running on a system, including CPU and memory usage. It provides
an interactive interface that allows users to monitor and manage processes.

Conclusion

• Processes are instances of programs that are currently running on a


Linux system.
• Processes can be categorized into foreground, background, and system
and user processes.
• Processes can be in one of five states: running, sleeping, stopped,
zombie, or orphan.
• Process management involves controlling and monitoring the processes
running on a Linux system.
• Linux provides several commands for managing processes, including ps,
top, kill, nice, and renice.
• Practically managing processes involves using these commands to
identify and terminate processes, adjust process priorities, and monitor
system resource usage.

You might also like