Skip to content

Latest commit

 

History

History
74 lines (49 loc) · 2.45 KB

02-The-Linux-Kernel.md

File metadata and controls

74 lines (49 loc) · 2.45 KB

Linux Core Concepts

In this section, we will take a look at the core concepts of a linux operating system.

  • We will start with introduction to the linux kernel.
  • We will then learn about the kernel space and user space.

Linux Kernel

If you have worked with any operating system, you have run into the term kernel.

  • The Linux kernel is monolithic, this means that the kernel carrries out CPU scheduling, memory management and several operations by itselfs.

  • The Linux Kernel is also modular, which means it can extends its capabilities through the use of dynamically loaded kernel modules

    linux-kernel

To understand a kernel in simple terms, let us use an analogy of a College Library. Here the librarian is equal to Linux Kernel.

library

The Kernel is responsible for 4 major tasks

  1. Memory Management
  2. Process Management
  3. Device Drivers
  4. System calls and Security

Linux Kernel Versions

let us know identify the ways to identify linux kernel versions

Use uname command to get the information about the kernel (by itself it doesn't provide much information except that the system uses the Linux Kernel.

$ uname

Use the uname -r or uname comamnd and option to print the kernel version

$ uname -r
$ uname -a

kernel-versions

Kernel and User Space

One of the important functions of the linux kernel is the Memory Management . We will now see how memory is seperated within the linux kernel

Memory is divded into two areas.

  1. Kernel Space
    1. Kernel Code
    2. kernel Extensions
    3. Device Drivers
  2. User Space
    1. C
    2. Java
    3. Python
    4. Ruby e.t.c
    5. Docker Containers

memory-management

Let us know see how programs running in the User Space work

All user programs function by manipulating data that is stored in memory and on disk. User programs get access to data by making special request to the kernel called System Calls

  • Examples include, allocating memory by using variables or opening a file.

    user-space

  • For example, opening a file such as the /etc/os-release to see the operating system installed, results in a system call

    user-space1