Linux Core Concepts Flashcards
Linux Memory is divided into two space, what are those two spaces?
Kernel Space and User space
What is Kernel Space in Linux Memory?
Kernel space is the portion of memory in
which the Kernel executes and provides its
services. A process running in the Kernel
space has unrestricted access to the hardware. As
such, it is strictly reserved for running the
Kernel code, Kernel extensions, and most
device drivers.
What is user space in Linux Memory?
All user programs function by manipulating
data, but where does this data live? Most
commonly, it is stored in memory and on
disk.
User programs get access to data by making
special requests to the Kernel called system
calls. Examples include allocating memory by
using variables or opening a file.
What is dmesg?
Dmesg is a tool used to display messages
from an area of the kernel called the ring
buffer. When a Linux operating system boots
up, there are numerous messages generated
by the kernel that appear on the display
screen.
what is the lspci command?
The Ispci command stands for list PCI. This
command is used to display information
about all PCI devices that are configured in
the system.
Examples of PCI devices are ethernet cards,
raid controllers, video cards, and wireless
adapters that directly attach to PCI slots in
the motherboard of the computer.
what is the lsblk command?
The Isblk command lists information about block devices. Here
sda is the physical disk.
The sda1 to sda5 are partitions created for
this disk.
what is the meaning of major and minor number in the output of lsblk?
In the lsblk command output, you can also see
that there are major and minor numbers
associated with each device. The major
number which is on the left-hand side of the
colon identifies the type of device driver associated
with the device. In this case, the number 8
refers to a block sdisk device.
The minor number is used to differentiate
amongst devices that are similar and share
the same major number. Here the numbers O
to 5, help identify the different partitions for
the disk sda.
Give some examples of Major numbers for some very common device types?
Command to display information about the CPU architecture?
lscpu
commands to check linux memory?
lsmem –summary
free -m (where m is show in MB, use -k for KB)
Popular example of a bootloader?
GRUB2 - Grand Unified Boot Loader - version 2
Can you list the Linux Boot sequence?
Step 1: BIOS POST
Step 2: Boot Loader (GRUB2)
Step 3: Kernel Initialization
Step 4: INIT process (systemd)
what does BIOS POST stand for?
Power on self test - POST is a test to ensure that the hardware components attached to the host are functioning correctly
What is the next step after POST in linux boot sequence?
Boot Loader - GRUB2
- The next stage after POST is the boot loader. After
a successful POST test, the BIOS loads and
executes the boot code from the boot device,
which is located in the first sector of the hard disk. - In Linux, this is located in the /Boot File System.
The boot loader provides the user with the boot
screen often with multiple options to boot into such as
Microsoft Windows OS or an Ubuntu 18.04 OS, in
an example of a dual boot system. - Once the selection is made at the boot screen, the
boot loader loads the kernel into memory, supplies
it with some perimeters, and hands over the
control to the kernel. - A popular example of the boot loader is the
GRUB2, which stands for Grand Unified
Bootloader version 2, and it is now the primary
boot loader for most current Linux distributions.
what is the next step after boot loader in Linux boot sequence?
Kernel Initialization
- After the selected kernel is loaded into the
memory, it is usually decompressed. This is done
as the kernels are generally in a compressed state
to conserve space. - The kernel is then loaded into the memory and
starts executing. During this space, the kernel
carries out tasks such as initializing hardware and
memory management tasks among other things. - Once it is completely operational, the kernel looks
for an init process to run, which sets up the user
space and the processes needed for the user
environment.
What is the next step after Kernel Initialization in linux boot sequence?
INIT Process (systemd)
Once the kernel is is completely operational after the kernel initialization step, the kernel looks
for an init process to run, which sets up the user
space and the processes needed for the user
environment.
In most of the linux distros, the INIT function then calls which daemon
INIT function calls the systemd daemon
what does the systemd daemon do?
Systemd is responsible for
- mounting file systems,
- starting and managing system services.
Systemd is the universal standard
these days but not too long ago another
initialization process called System V init was
used.