What is kernel linux wiki

Linux Kernel

A kernel is the lowest level of easily replaceable software that interfaces with the hardware in your computer.

Details [ ]

The kernel is responsible for interfacing all of your applications that are running in “user mode” down to the physical hardware, and allowing processes, known as servers, to get information from each other using Interprocess Communication (IPC).

In other words kernel’s job is to talk to hardware and software, and to manage the system’s resources as best as possible. It talks to the hardware via the drivers that are included in the kernel (or additionally installed later on in the form of a kernel module). This way, when an application wants to do something (like change the volume setting of the speakers), it can just submit that request to the kernel, and the kernel can use the driver it has for the speakers to actually change the volume.

There are three different types of kernels, microkernel, monolithic kernel and hybrid kernel. Linux uses a monolithic kernel. Since this is a Linux wiki we will only concern ourselves with the monolithic kernel.

Monolithic Kernel [ ]

Monolithic kernels encompass not only the CPU, memory, and IPC, they also include things like device drivers, file system management, and system server calls. Monolithic kernels tend to be better at accessing hardware and multitasking because if a program needs to get information from memory or another process running it has a more direct line to access it and doesn’t have to wait in a queue to get things done. This however can cause problems because the more things that run in supervisor mode, the more things that can bring down your system if one doesn’t behave properly.

  • More direct access to hardware for programs
  • Easier for processes to communicate between eachother
  • If your device is supported, it should work with no additional installations
  • Processes react faster because there isn’t a queue for processor time
  • Large install footprint
  • Large memory footprint
  • Less secure because everything runs in supervisor mode

Источник

What is the Linux kernel?

The Linux® kernel is the main component of a Linux operating system (OS) and is the core interface between a computer’s hardware and its processes. It communicates between the 2, managing resources as efficiently as possible.

Читайте также:  Change other user password in linux

The kernel is so named because—like a seed inside a hard shell—it exists within the OS and controls all the major functions of the hardware, whether it’s a phone, laptop, server, or any other kind of computer.

What the kernel does

  1. Memory management: Keep track of how much memory is used to store what, and where
  2. Process management: Determine which processes can use the central processing unit (CPU), when, and for how long
  3. Device drivers: Act as mediator/interpreter between the hardware and processes
  4. System calls and security: Receive requests for service from the processes

The kernel, if implemented properly, is invisible to the user, working in its own little world known as kernel space, where it allocates memory and keeps track of where everything is stored. What the user sees—like web browsers and files—are known as the user space. These applications interact with the kernel through a system call interface (SCI).

Think about it like this: The kernel is a busy personal assistant for a powerful executive (the hardware). It’s the assistant’s job to relay messages and requests (processes) from employees and the public (users) to the executive, to remember what is stored where (memory), and to determine who has access to the executive at any given time and for how long.

Where the kernel fits within the OS

To put the kernel in context, you can think of a Linux machine as having 3 layers:

  1. The hardware: The physical machine—the bottom or base of the system, made up of memory (RAM) and the processor or central processing unit (CPU), as well as input/output (I/O) devices such as storage, networking, and graphics. The CPU performs computations and reads from, and writes to, memory.
  2. The Linux kernel: The core of the OS. (See? It’s right in the middle.) It’s software residing in memory that tells the CPU what to do.
  3. User processes: These are the running programs that the kernel manages. User processes are what collectively make up user space. User processes are also known as just processes. The kernel also allows these processes and servers to communicate with each other (known as inter-process communication, or IPC).

Code executed by the system runs on CPUs in 1 of 2 modes: kernel mode or user mode. Code running in the kernel mode has unrestricted access to the hardware, while user mode restricts access to the CPU and memory to the SCI. A similar separation exists for memory (kernel space and user space). These 2 small details form the base for some complicated operations like privilege separation for security, building containers, and virtual machines.

Читайте также:  Alt linux microsoft office

This also means that if a process fails in user mode, the damage is limited and can be recovered by the kernel. However, because of its access to memory and the processor, a kernel process crash can crash the entire system. Since there are safeguards in place and permissions required to cross boundaries, user process crashes usually can’t cause too many problems.
Also, because the Linux kernel can continue to work during live patching, there’s no downtime while patches are applied for security fixes.

Источник

What Is Linux Kernel?

So Linux is now 25 years old. Linus Torvalds, a 21-year-old computer science student at the University of Helsinki in Finland at the time, built the Linux kernel in 1991. On August 25, 1991, Torvalds wrote the following to comp.os.minix, a Usenet newsgroup.

I’m doing a (free) operating system (just a hobby, won’t be big and professional like gnu) for 386 (486) AT clones. This has been brewing since April, and is starting to get ready. I’d like any feedback on things people like/dislike in minix, as my OS resembles it somewhat (same physical layout of the file-system (due to practical reasons) among other things).

Linus Torvalds

Linus then released the kernel under the GPL licence, which meant that it was open source and available to the general public to examine the code, tweak it to suit their needs, and distribute it under the same GPL licence. The Linux kernel 1.0.0, containing 176,250 lines of code, was published on March 14, 1994. The Linux kernel version 3.10, released in June 2013, comprises 15,803,499 lines of code, whereas version 4.1, released in June 2015, has expanded to over 19.5 million lines of code provided by about 14,000 programmers.

So What Does Linux Kernel Do?

Every operating system, in some form or another, makes use of a kernel. A computer without a kernel is technically conceivable, but it is impractical. It is nearly difficult to have a functioning operating system without the kernel. In general, the kernel is a piece of software that acts as a barrier between the hardware and the main applications that run on a computer.

It is the first component to load when the operating system boots up. It is loaded into memory and remains there for the duration of the computer’s session. So let’s have a look at some of the Linux kernel’s features.

1. Communication and Resource Management

The Linux kernel enables communication between hardware and software via drivers included in the kernel or added via kernel modules. It is also in charge of managing the system’s resources, including as memory management, process and task management, and disc management. As a result, the kernel ensures that a programme has enough memory. It also ensures that the processor runs and completes duties efficiently.

Читайте также:  Linux xrandr разрешение экрана

2. The Linux Kernel Is Monolithic

The Linux kernel is monolithic, as opposed to a microkernel, which strives to have the smallest install and memory footprint feasible by handling only what it needs to, such as the CPU, memory, and IPC (Inter Process Communication). Device drivers, system server calls, and the file management system are also part of the Linux kernel. Because there is a direct route to any information required from memory or any running process, the Linux kernel is much better at accessing hardware and multitasking.

The kernel’s monolithic structure also means that it has a very big footprint, however one significant method the developers have avoided this issue is through the usage of kernel modules. Kernel modules can be loaded and unloaded at runtime, allowing features to be added and withdrawn at any moment.

3. Portability

The Linux kernel was not originally intended to be portable, although it has since been ported to a variety of systems. It is the operating system (kernel) of choice for nearly all of the top 500 fastest supercomputers. It is the brains behind Google Android, the most popular operating system ever. The Linux kernel also powers other mobile operating systems such as Firefox OS, HP webOS, and Samsung’s Tizen.

4. Patching

Live kernel patching was introduced with the release of the Linux kernel version 4.0 in April 2015. Updates to the kernel can be applied or even replaced without the need to restart your computer. This enables for system updates with no downtime, which is extremely useful in server systems.

Conclusion

The kernel and the BIOS should not be confused. The BIOS is a self-contained programme that is stored in a chip on a computer’s main circuit board. During the boot process, it performs activities such as initialising the hardware and loading the kernel into memory.

The kernel, unlike the BIOS, can be readily replaced or upgraded by replacing or upgrading the operating system or, in the case of Linux, by introducing a newer kernel or modifying an existing kernel. Windows and macOS, like Linux, have their own kernels that are all distinct. The Linux kernel is the main common component among the different Linux distributions available, whether broad or specialised.

Источник

Оцените статью
Adblock
detector