I'm sure there are people who want to know or need to know about LINUX in LPIC exams and in actual work. However, when I look it up, some people may say, "I tried to look up commands and words, but in the end it's complicated and I don't understand?" (I became). This is an article for those who want to know how LINUX works easily!
In order to know how LINUX works, it is effective to deepen your understanding of the startup process of LINUX. The reason is that the system involved in the boot process is the system that runs LINUX, and running LINUX is all about LINUX. For example, by turning the car key to know how the car works and knowing how the engine is started, you can deepen your understanding of how the car works. By knowing about the LINUX engine, you will know what LINUX can do!
First, let's talk about the position of LINUX among many OSs. LINUX is a type of OS called UNIX-based OS. The version of LINUX is branched in the form called a distributor, but this LINUX kernel (the source of the OS) was widely released as open source, and the OS was developed by various people. .. As a result, various branches have been created, such as Debian, Ubuntu, and fashion. (This system Roughly divided, it is divided into a free version and a paid version, CentOS is famous for no charge, and Red Hat is famous for paid version)
The following table shows the flow of the Linux startup process from turning on the power button to being able to enter commands.
1.Power on 2.Firmware boot 3.Firmware loads the bootloader 4.Bootloader kernel and filesystem image(initramfs)Read 5.Bootloader runs kernel 6.Kernel is a file system image(initramfs)Run 7.Kernel init(Or systemd)Launch and mount the root file system 8.Kernel init(Or systemd)Run
When you turn on the power, the firmware engraved on the terminal will start up. Well-known firmware has BIOS (Boot Input / Output System) and UEFI (Unified Extendable Farmware Interface), and the type of boot loader handled by each firmware changes.
The firmware first loads the bootloader stored at the top of the hard disk and begins preparing to launch LINUX. At this time, if it is BIOS, an image file is generated and expanded, and if it is UEFI, the stored EFI file is read and started. What is started at this time is called GRUB2 (GRand Unified Bootloader). (It is attached with 2 because it is the second generation)
The bootloader loads the LINUX kernel (vmlinuz) and filesystem image (initramfs). vmlinuz is a strange name, but it seems that the initial name is VM of Virtual Machine, and the end is z is a compressed file, so x of linux is changed to z. After running the kernel and deploying the filesystem image from the bootloader, we assume that the root filesystem is ready for use. The kernel launches the user process.
After all the preparations, the kernel finally calls its own process (inti or systemd). At this time, start Linux in the boot mode that matches the runlevel or Target. After booting, control is returned to the user again and Linux can be operated.
Firmware: A system that boots Linux from the hardware side Bootloader: The one that wakes up Linux Kernel: Linux seed initramfs: Top of file system, top of file system User process: Init or systemd, user operation itself Runlevel: GUI, CGI or emergency mode is divided by level
Boot loader and kernel settings related to Linux booting are located in specific locations.
Body file In case of BIOS (Basic input / output system), boot.img and core.img (* not image file)
For details, refer to this site, but roughly speaking, systemd is an upward compatible system that has grown init. It's more convenient and more responsible! In terms of specific functions, processes that were managed separately in the init era will now be managed on a unit-by-unit basis. By managing this process on a unit-by-unit basis, each service can be operated stably. (Easy to start and stop)
I wrote it with reference to the following books. If you want to see it in detail with Plus Alpha, you can pick it up and use it like a dictionary ☺
-[Linux Textbook LPIC Level 1 Speed Master Problem Collection Version 5.0 Compatible](https://www.amazon.co.jp/gp/product/B07TVTKW2C/ref=as_li_tl?ie=UTF8&camp=247&creative=1211&creativeASIN=B07TVTKW2C&linkCode=as2&tag = vk4268370f-22 & linkId = 8965e118505185053b84e77611a602dc)