{"id":189,"date":"2024-05-19T13:35:43","date_gmt":"2024-05-19T13:35:43","guid":{"rendered":"https:\/\/www.rajeshkumar.xyz\/blog\/?p=189"},"modified":"2024-05-19T13:35:43","modified_gmt":"2024-05-19T13:35:43","slug":"how-linux-works-kernel-internal-explained","status":"publish","type":"post","link":"https:\/\/www.rajeshkumar.xyz\/blog\/how-linux-works-kernel-internal-explained\/","title":{"rendered":"How Linux Works? Kernel Internal Explained!"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"674\" height=\"1024\" src=\"https:\/\/www.rajeshkumar.xyz\/blog\/wp-content\/uploads\/2024\/05\/1713689337349-674x1024.jpg\" alt=\"\" class=\"wp-image-190\" srcset=\"https:\/\/www.rajeshkumar.xyz\/blog\/wp-content\/uploads\/2024\/05\/1713689337349-674x1024.jpg 674w, https:\/\/www.rajeshkumar.xyz\/blog\/wp-content\/uploads\/2024\/05\/1713689337349-198x300.jpg 198w, https:\/\/www.rajeshkumar.xyz\/blog\/wp-content\/uploads\/2024\/05\/1713689337349-768x1167.jpg 768w, https:\/\/www.rajeshkumar.xyz\/blog\/wp-content\/uploads\/2024\/05\/1713689337349-1011x1536.jpg 1011w, https:\/\/www.rajeshkumar.xyz\/blog\/wp-content\/uploads\/2024\/05\/1713689337349.jpg 1106w\" sizes=\"auto, (max-width: 674px) 100vw, 674px\" \/><\/figure>\n\n\n\n<p>&#8220;Linux&#8221; refers to the Linux kernel, the core of many operating systems (known as distributions, or &#8220;distros&#8221;) that manage a computer&#8217;s hardware and resources, like CPU, memory, and storage devices. Distros include Ubuntu, Fedora, and Debian, among others. Here\u2019s a basic overview of how Linux works:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. <strong>Kernel<\/strong><\/h3>\n\n\n\n<p>The kernel is the heart of the system. It manages the system resources and facilitates communication between hardware and software components. The key functions of the kernel include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Process Management<\/strong>: It handles the creation, execution, and termination of processes.<\/li>\n\n\n\n<li><strong>Memory Management<\/strong>: It manages memory access for programs and optimizes RAM usage.<\/li>\n\n\n\n<li><strong>Device Drivers<\/strong>: These are part of the kernel and interact directly with the hardware.<\/li>\n\n\n\n<li><strong>System Calls and Security<\/strong>: The kernel provides system calls that programs use to perform advanced operations and manages security by controlling access to data and hardware.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">2. <strong>Shell<\/strong><\/h3>\n\n\n\n<p>The shell is a program that interprets user commands and script files, and executes them. Bash (Bourne Again SHell) is a commonly used shell in Linux. Users interact with the shell through a command-line interface (CLI) or scripts.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. <strong>Filesystem Hierarchy<\/strong><\/h3>\n\n\n\n<p>Linux has a hierarchical filesystem, with everything starting from the root directory, denoted by <code>\/<\/code>. This includes:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\/bin and \/sbin<\/strong>: Essential user and system binaries (programs)<\/li>\n\n\n\n<li><strong>\/etc<\/strong>: Configuration files<\/li>\n\n\n\n<li><strong>\/dev<\/strong>: Device files<\/li>\n\n\n\n<li><strong>\/proc<\/strong>: Dynamic directory that provides information about running processes and kernel parameters<\/li>\n\n\n\n<li><strong>\/var<\/strong>: Variable data like logs and databases<\/li>\n\n\n\n<li><strong>\/home<\/strong>: Personal directories for users<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">4. <strong>User and Group Management<\/strong><\/h3>\n\n\n\n<p>Linux is a multi-user system, meaning multiple users can have accounts and store data on the same machine. Each user can belong to one or more groups, which define permissions and roles.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. <strong>Networking<\/strong><\/h3>\n\n\n\n<p>Linux supports various networking protocols and provides tools for networking configuration. It can serve as a server or client in network models.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">6. <strong>Package Management<\/strong><\/h3>\n\n\n\n<p>Most Linux distributions come with a package manager, a tool for installing, updating, and removing software. Examples include <code>apt<\/code> for Debian-based distributions, <code>yum<\/code> for RHEL-based, and <code>pacman<\/code> for Arch Linux.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">7. <strong>Graphical User Interface (GUI)<\/strong><\/h3>\n\n\n\n<p>While many Linux servers operate in a text-only mode, desktop distributions typically include a graphical desktop environment, such as GNOME, KDE, or Xfce, which makes using Linux similar to other operating systems like Windows or macOS.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">8. <strong>System Services<\/strong><\/h3>\n\n\n\n<p>Linux uses init systems (like systemd, SysV init, or Upstart) to bootstrap the user space and to manage system processes after booting. These are responsible for starting and stopping services, including the network, system logging, and the graphical session.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">9. <strong>Boot Process<\/strong><\/h3>\n\n\n\n<p>The Linux boot process involves several stages:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>BIOS\/UEFI<\/strong>: Basic system checks and loading of the bootloader.<\/li>\n\n\n\n<li><strong>Bootloader (GRUB, LILO)<\/strong>: Manages the loading of the Linux kernel.<\/li>\n\n\n\n<li><strong>Kernel<\/strong>: Initializes the devices and their drivers.<\/li>\n\n\n\n<li><strong>Init<\/strong>: SystemV init or systemd initializes the system processes.<\/li>\n\n\n\n<li><strong>Runlevel\/Target<\/strong>: Defines what services and programs should run.<\/li>\n<\/ul>\n\n\n\n<p>Understanding how Linux works involves learning about its architecture and components. While Linux can be complex, its transparency and flexibility have made it popular for both personal and professional use.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;Linux&#8221; refers to the Linux kernel, the core of many operating systems (known as distributions, or &#8220;distros&#8221;) that manage a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-189","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/posts\/189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/comments?post=189"}],"version-history":[{"count":1,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/posts\/189\/revisions"}],"predecessor-version":[{"id":191,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/posts\/189\/revisions\/191"}],"wp:attachment":[{"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/media?parent=189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/categories?post=189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/tags?post=189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}