Quote:
Originally Posted by romenyrr Is it me or is the concept of kernel and kernel modules very difficult to grasp. If somebody's nice enough, please explain to me in laymen terms what exactly the kernel is, how kernel modules work, and why do most people build the'yre own custom kernels? |
The kernel is "the core" of your OS. It's a term that's frequently used in Linux, but in fact, all the OS'es need a kernel in one or another form.
The kernel manages the resources: cpu, memory and i/o devices (that's basically everything). It's the first program that is started when you boot your OS (if you except the bootloaders and the bios firmware, which is on a previous stage).
Linux has had traditionally a monolithic kernel, which means that all the drivers and such was embedded into the same kernel, instead of being on separate modules (both things have advantages and disadvantages, that's for another discussion). Lately, the linux kernel has gained some modularity, and now with things like libusd and fuse you can even do drivers on userland (that's also for another discussion).
In simple words: the kernel is the foundation that's needed by all the rest of programs. It's the one which serves as a bridge between your machine and your software. It decides which program is going to run on a given time slice, and which will be the next one to take time (this is how you can emulate multitasking on a single cpu machine). It also decides how to assign memory to the rest of processes. The programs themselves do not know if they are taking ram or swap memory on a hard drive, or anything else. For they it's just "virtual memory". How that memory is handled, how it's assigned, and where it physically resides it's up to the kernel.
The kernel also manages i/o devices, which in fact, means any arbritrary peripheral.
Most distros comes with precompiled kernels, so, unless you need to do some tweaking for any special reason, you shouldn't need to build one.
In some other cases, for example, metadistros like Gentoo, you need to build your own one.