Shell Script

1 Linux command Line

트리스탄1234 2022. 8. 10. 10:32
728x90
반응형
1. Kernel's main function
In this article, we will learn about the basic background knowledge before starting the Shell Script. Let's take a look at the most basic of them, the function and structure of the kernel. The main functions of the kernel are system memory management, SW program management, hardware management, file system management, and communication between Sw and HW.
1)system memory management
System memory consists of physical memory, virtual memory, and swap memory. As shown in the figure below, the Linux system uses the virtual memory called SWAP to create a virtual memory space using the hard disk space. Data not currently used in the physical memory is swapped out to the swap space to move the data to increase the use efficiency of the physical memory space. move to increase the efficiency of use of physical memory capacity.
 

Memory location information is grouped in blocks called pages, and the kernel provides a function to track, move, and manage movement information between physical and virtual memory in a table unit for these pages. ​ Current virtual memory status information can be viewed using cat /proc/meminfo as shown in the figure below.

Basically, one process has one page file, and when another process is accessing a page, other processes cannot access the page. ​ The icps -m command is a command that can inquire the status of this shared memory. Each field will be explained in detail later in another chapter.

2. Software program management function

The Linux kernel first calls the init process when booting the system. After that, in order to run the processes of other programs, the /etc/inittabs (location is slightly different depending on the type of Linux) file is called and the Run-Level value is checked. run their processes.

Run-Level has a value of 0 to 6, but only the three most used will be described.

- Run Level 1 : Single User mode (only the most basic processes run) Console mode, used for emergency recovery

- Run Level 3 : Standard mode, console environment

- Run Level 5: Graphic mode, GUI environment

The Linux kernel provides the ps command to check the status of individual processes. Detailed management of process deletion and execution will be posted later.

반응형

 

 

3. Hardware Management

The kernel recognizes the hardware through the device file. Device files are created for each hardware, and there are three types of device files as follows.

· Character File: Device file to process data of one character at a time

 

· Block File: Device file for processing block unit data at once

· Network File: A device file for sending and receiving packets through the network.

The Linux kernel creates a node file for device-to-device communication and assigns a unique ID to each node to perform device-to-device communication. ID consists of Major Number and Minor Numberer.

The 5th column value is the Major Node ID value, and all sda (disk) devices use 8, and the 6th column value, the Minor Node id value, is used to distinguish between devices in sda to identify a specific sda.

4. File system management

The Linux kernel supports various file systems as shown in the table below to write and write data of various file systems.

Linux system provides GNU utility and shell functions for system operation in addition to the kernel for hardware management, and the types of shell are as follows.

 
728x90
반응형

'Shell Script' 카테고리의 다른 글

6. Basic Shell Script writing  (3) 2022.08.11
5 Linux File Permission  (2) 2022.08.11
4 Environment variables  (1) 2022.08.11
3 Bash Shell Command  (8) 2022.08.10
2.Bash Shell Basic Command  (6) 2022.08.10