

{"id":108994,"date":"2022-06-27T09:00:24","date_gmt":"2022-06-27T03:30:24","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=108994"},"modified":"2022-06-27T09:26:10","modified_gmt":"2022-06-27T03:56:10","slug":"what-is-linux-kernel","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/what-is-linux-kernel\/","title":{"rendered":"What is Linux Kernel?"},"content":{"rendered":"<p>In this article, you will learn what a kernel is and look into the Linux Kernel. We shall also look deeper into the kernel of Linux, by understanding its architecture, roles, and a lot of important aspects of it.<\/p>\n<h3>What is a kernel?<\/h3>\n<p>We all know that a computer needs both software and hardware to function. So to make it easier for a piece of software (for example a web browser) to interact with the physical components of the computer, it makes sense to have a layer of software that acts as an abstraction between the hardware and the software.<\/p>\n<p>For example, if the software on your computer needs to do something with the hardware, like opening the CD tray, then instead of giving the motherboard the direct signal to open the CD tray, which might be a different signal depending on what motherboard or CD tray you have. Instead, the software can just tell the kernel to that.<\/p>\n<p>In this sense, the kernel acts as the abstraction layer between the hardware and the software<\/p>\n<h3>How does a kernel work?<\/h3>\n<p>Most kernels work by responding to system calls. These are called by different parts of the operating system to get actual physical hardware to do things.<\/p>\n<p>An example of this is your C library. If you run software that was written in C on your computer, then it is up to your C library to give the appropriate kernel system calls, to make the computer run it.<\/p>\n<h3>What\u2019s the kernel&#8217;s place in the operating system?<\/h3>\n<p>The kernel is the sole heart of any operating system in the world. As discussed above, any system needs hardware and software to work, and the kernel works as the mediator between them. Let us see the 3 in slightly more depth.<\/p>\n<h4>Hardware<\/h4>\n<p>The hardware is like the hands and legs of the system, it is the physical part of the machine. These consist of the CPU, RAM, Input\/output devices such as networking, storage, graphics, mouse, keyboard, and so many more.<\/p>\n<h4>The kernel<\/h4>\n<p>The kernel is the core of the operating system, it is right in the middle acting as the mediator between the hardware and the software.<\/p>\n<h4>Software<\/h4>\n<p>The software consists of user programs, which are the running programs the kernel manages. These user programs collectively make up the userspace. The kernel also allows these processes and servers to communicate with each other. This process is called Inter-Process Communication (IPC).<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/inter-process-communication.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-109283\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/inter-process-communication.webp\" alt=\"inter process communication\" width=\"403\" height=\"502\" \/><\/a><\/p>\n<p>The above diagram shows the position and role of the kernel in the operating system. The kernel also prevents and mitigates conflicts between different processes.<\/p>\n<h3>What is the Linux Kernel?<\/h3>\n<p>Let us get to the question at hand: what exactly is a Linux kernel?<\/p>\n<p>\u201cLinux\u201d is a kernel created in 1991 by Linus Torvalds. It has been in constant development since then and is now in version 15.17.1, released on the 28th of March 2022. Linux is used in Laptops, servers, smartphones, desktops, and so many more devices.<\/p>\n<h3>Story behind Linux<\/h3>\n<p>Linus Torvalds created the Linux operating system while he was just a student at the University of Helsinki. Linus started to develop an operating system similar to UNIX because he thought to have a freely available version of UNIX. It was originally a personal project for him, which turned out to be the world\u2019s best operating system.<\/p>\n<p>While Linus was developing the operating System of his visions, he thought he would call it \u201cFreax\u201d, taking into account the \u2018free\u2019 and \u2018X\u2019 which stands for the free version of UNIX. However, when Linus submitted the files named \u2018freax\u2019 to the FTP server in order to facilitate development, Ari Lemmeke from the same university, changed the project name to Linux without consulting Linus. Later Linus consented to \u201cLinux\u201d.<\/p>\n<h3>Features of Linux Kernel<\/h3>\n<p>There are many characteristics that set Linx apart from the crowd. Some of them are:<\/p>\n<h4>1. Open source<\/h4>\n<p>This is one of the best Linux features. The source code of the kernel is freely available for anodyne under a GPL (General Public License). People have the freedom to modify the source code and later distribute the same. This is exactly how the different distros of Linux are born,<\/p>\n<h4>2. Security<\/h4>\n<p>Once you download Linux, you do not need to install an antivirus, to protect your PC from viruses and malware, because Linux asks for authorization in the form of a password before running any application or program. If this is not enough you also get iptables pre-installed, to filter traffic in networks.<\/p>\n<h4>3. Performance<\/h4>\n<p>Linux is greatly known for its performance. It is so fast and stable at the same time that over 500 of the top supercomputers run Linux. Linux is also very stable as it rarely slows down or hangs up. It can even handle multiple users and applications running at the same time.<\/p>\n<p>There are many other features that make Linux greater than all the other mainstream operating systems, you can look at those in another I have written called: Linux Tutorial.<\/p>\n<h4>4. Monolithic<\/h4>\n<p>The Linux kernel is monolithic, which means that all the hardware and driver operations are handled by the kernel itself. In other words, the entire operating system virtually works in the kernel space.<\/p>\n<h4>5. Modular<\/h4>\n<p>The Linux kernel is modular because it supports the intersection and removal at runtime of any loadable modules of the kernel. The kernel reduces its memory footprint is reduced by keeping only the necessary modules in the kernel memory.<\/p>\n<p>If you are wondering why Linux is so good, the sole reason is its open source. You see, Linux has become de-facto standard for any specialized OS that requires efficiency.<\/p>\n<p>This again boils down to the reason that Linux is open source as anyone can download the source code of the Linux kernel and compile it the way they want it. This means that any unnecessary feature can be removed which made the system more efficient.<\/p>\n<p>For example, you can run Linux on a smart toast and also a supercomputer (not to mention that the fastest supercomputer already does) because it is open source, and it can be modified to be perfect for a toaster or a supercomputer.<\/p>\n<h3>How does Linux kernel work?<\/h3>\n<p>Just as any other kernel, Linux accepts system calls to perform functions, and like some kernels, it utilizes kernel modules to activate or deactivate. These can either be disabled, enabled, or rendered toggleable at compile time.<\/p>\n<p>The Linux kernel has 4 jobs:<\/p>\n<h4>1. System calls and security<\/h4>\n<p>The kernel receives requests for service from the process.<\/p>\n<h4>2. Memory management<\/h4>\n<p>The kernel keeps track of how much memory is used to store what and where<\/p>\n<h4>3. Process management<\/h4>\n<p>The kernel determines which processes can use the central processing unit (CPU), when, and for how long.<\/p>\n<h4>4. Device drivers<\/h4>\n<p>The kernel acts as a mediator or interpreter between the hardware and the processes.<\/p>\n<h3>Architecture of Linux kernel<\/h3>\n<p>Before we see the architecture of the kernel, let us briefly revise the architecture of the Linux operating system.<\/p>\n<p>The Linux OS consists of the kernel, System libraries, system utility programs, hardware layer, and the shell. Let us look into each briefly:<\/p>\n<h4>1. Kernel<\/h4>\n<p>The kernel is the sole heart of Linux which acts as a mediator between the software and hardware.<\/p>\n<h4>2. System libraries<\/h4>\n<p>These libraries implement the operating system\u2019s functionality and don\u2019t need code access rights of the modules of the kernel.<\/p>\n<h4>3. System Utility programs<\/h4>\n<p>These programs are responsible for doing specialized level and individual activities.<\/p>\n<h4>4. Hardware layer<\/h4>\n<p>This is the layer that contains physical devices like CPU, RAM, CPU, screen, and all other peripherals.<\/p>\n<h4>5. Kernel<\/h4>\n<p>This is the interface that provides users to enter commands. It takes in commands through the user and runs the functions of the kernel.<\/p>\n<p>Now let us take a closer look at the heart of the operating systems. The kernel consists of the following core subsystems:<\/p>\n<h4>a. Process scheduler<\/h4>\n<p>This subsystem is responsible for distributing the CPU time fairly among all the processes running on the system.<\/p>\n<h4>b. Memory management unit<\/h4>\n<p>This subsystem is responsible for proper memory distribution among various processes running on the system<\/p>\n<h4>c. Virtual file system<\/h4>\n<p>The virtual file system is responsible for providing a unified interface to access store data across different filesystems and physical storage media.<\/p>\n<h4>d. Networking unit<\/h4>\n<p>This sub-system is responsible to establish communication between the server and the workstation.<\/p>\n<h4>e. Inter-processing communication unit<\/h4>\n<p>As the name suggests this subsystem is responsible for providing the operating system that allows processes to communicate with each other.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/subsystems-of-the-linux-kernel.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-109284\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/subsystems-of-the-linux-kernel.webp\" alt=\"subsystems of the linux kernel\" width=\"768\" height=\"502\" \/><\/a><\/p>\n<p>In general, we can categorize Linux kernel into 3 primary levels:<\/p>\n<h4>a. System call interface<\/h4>\n<p>This is the topmost level which undertakes basic actions like reading and writing.<\/p>\n<h4>b. Kernel code<\/h4>\n<p>This is located below the system call interface. It is common in all Linux-supported processor architectures. It is sometimes defined as an architecture-independent kernel code.<\/p>\n<h4>c. Architecture dependent code<\/h4>\n<p>This layer is under the architecture-independent kernel code. It contains a small program called the bootloader that places the operating system and device drivers into the memory.<\/p>\n<h3>Summary<\/h3>\n<p>As complex, the architecture of the Linux kernel is and the terminologies behind it are, they do absolutely no justice to the heart and soul of the world&#8217;s best operating system. Doing justice in terms of how powerful, efficient, versatile, beautiful, and mind-boggling it is!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, you will learn what a kernel is and look into the Linux Kernel. We shall also look deeper into the kernel of Linux, by understanding its architecture, roles, and a lot&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":109282,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[26852,26851,18768,26850],"class_list":["post-108994","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-architecture-of-linux-kernel","tag-features-of-linux-kernel","tag-linux-kernel","tag-what-is-linux-kernel"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What is Linux Kernel? - DataFlair<\/title>\n<meta name=\"description\" content=\"Learn what is Linux Kernel? See its features, working, architecture, kernel core subsystems, and levels of linux kernel.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/what-is-linux-kernel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is Linux Kernel? - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Learn what is Linux Kernel? See its features, working, architecture, kernel core subsystems, and levels of linux kernel.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/what-is-linux-kernel\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-06-27T03:30:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-27T03:56:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/linux-kernel.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is Linux Kernel? - DataFlair","description":"Learn what is Linux Kernel? See its features, working, architecture, kernel core subsystems, and levels of linux kernel.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/what-is-linux-kernel\/","og_locale":"en_US","og_type":"article","og_title":"What is Linux Kernel? - DataFlair","og_description":"Learn what is Linux Kernel? See its features, working, architecture, kernel core subsystems, and levels of linux kernel.","og_url":"https:\/\/data-flair.training\/blogs\/what-is-linux-kernel\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2022-06-27T03:30:24+00:00","article_modified_time":"2022-06-27T03:56:10+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/linux-kernel.webp","type":"image\/webp"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/what-is-linux-kernel\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/what-is-linux-kernel\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"What is Linux Kernel?","datePublished":"2022-06-27T03:30:24+00:00","dateModified":"2022-06-27T03:56:10+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/what-is-linux-kernel\/"},"wordCount":1543,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/what-is-linux-kernel\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/linux-kernel.webp","keywords":["architecture of linux kernel","features of linux kernel","Linux kernel","what is Linux Kernel?"],"articleSection":["Linux Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/what-is-linux-kernel\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/what-is-linux-kernel\/","url":"https:\/\/data-flair.training\/blogs\/what-is-linux-kernel\/","name":"What is Linux Kernel? - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/what-is-linux-kernel\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/what-is-linux-kernel\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/linux-kernel.webp","datePublished":"2022-06-27T03:30:24+00:00","dateModified":"2022-06-27T03:56:10+00:00","description":"Learn what is Linux Kernel? See its features, working, architecture, kernel core subsystems, and levels of linux kernel.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/what-is-linux-kernel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/what-is-linux-kernel\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/what-is-linux-kernel\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/linux-kernel.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/linux-kernel.webp","width":1200,"height":628,"caption":"linux kernel"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/what-is-linux-kernel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Linux Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/linux\/"},{"@type":"ListItem","position":3,"name":"What is Linux Kernel?"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/108994","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=108994"}],"version-history":[{"count":2,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/108994\/revisions"}],"predecessor-version":[{"id":109285,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/108994\/revisions\/109285"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/109282"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=108994"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=108994"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=108994"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}