From the course: Advanced Linux: The Linux Kernel
What is the Linux kernel? - Linux Tutorial
From the course: Advanced Linux: The Linux Kernel
What is the Linux kernel?
- [Instructor] What is this Linux Kernel thing? Well, let's talk about it. The Kernel is a program, compiled program. The Kernel program has a name. That file has a name. The name is something like vmlinuz-<kernel version>. That program needs to be loaded into memory and run, and that operation is done by a boot loader. With Linux, we often have a boot loader called GRUB. So GRUB reads the kernel, file from disc, puts it in memory, and transfers control to it. The Kernel program, like other programs, actually has some command line parameters that you can set, and GRUB is responsible for passing those parameters to the Kernel. The Linux Kernel also has an API. It provides a programming interface. The functions that we can call from user space into the Kernel, we call system calls, but the Linux Kernel also provides virtual file systems, proc and sys, and the lesser known debugfs, for example. And through those virtual file systems, we can interact directly with the Kernel, getting information from the Kernel and changing things in the Kernel. And our system has device files. We interact with device drivers by doing operations on those device files. Those operations are standard system calls like read and write and open. The Kernel is a gatekeeper. The Kernel enforces privileges. In Linux, we call those privileges capabilities, and the Linux Kernel source code, it refers to the capabilities of a process to see if it's allowed to perform some sort of privilege operation. Linux Kernel also implements a number of security policies, the underlying mechanisms used by SE Linux and App Armor, for example. And finally, the Kernel provides controlled access to hardware and other resources. It wouldn't be safe to allow processes to willy-nilly access the disc at will, for example, no. The Kernel has to provide controlled access to make sure that things are done in an orderly and safe manner. The Kernel is modular. The Kernel itself, that vmlinuz file is relatively small. The Kernel image is sufficient to boot to user space to begin running the first process. Once we have that process and the ones that started, we can load additional functionality into the Kernel through the loadable Kernel module mechanism. The loadable module mechanism means we can just load the drivers that we need. We don't need to load drivers for hardware that's not present. We can also load additional sorts of functionality that's not drivers, but, say, for security or other things. We'll be looking at all of those in some detail.