Modularized Kernel:
Of general use, it is suitable for all types of machines and we can say that it is easily portable with different Linux(small code modules are inserted and removed from the running kernel.
Just as there are computers that are advanced in terms of hardware, there are computers that are less advanced.
Due to the hardware being current or not, the modularized kernel was created.
obs: If the modularized kernel did not exist, we would have to insert in the kernel all the characteristics of all the different types of
computers. This way it would make the binary kernel slow and cumbersome at the time of its tasks and make it complicated
maintenance due to programs that depend directly on the kernel.
* Below are some of the occurrences when using modularized kernel:
Uses a lot of physical space in memory;
load only modules with few bytes;
the kernel can access a module before it has initialized;
a module can be removed, even with the module still in use; and
generates unnecessary codes that provide easy access to the network and the machine's own data.
"Semi-Monolithic" kernel,(The kernel we use, vmlinuz + kernel-modules):
The Linux kernel has incorporated some features of a modular kernel, which makes it currently a kind of "semi-monolithic" kernel. The entire kernel, including the drivers device and other components still form a single code block (gigantic, more 30 MB compressed) but now they can be compiled separately in the form of modules.
These modules can be loaded and unloaded at any time, as would be possible in a modular kernel, but without the loss of performance or increase in complexity that would exist when use a truly modular kernel.
Pure Monolithic kernel (to be used only on the machine where it was compiled):
Kernel configuration improves system performance. Configuring the kernel means compiling only the necessary code.
For better performance and security, we can compile the pure monolithic kernel, generating a single file (vmlinuz) that contains only the modules needed by our PC, inside the compiled code.
* Below are some examples of the importance of compiling the Monolithic Puro kernel:
1- Kernel speed (little code execution);
2- It gives us more available memory (virtual memory will not use kernel memory);
3- Makes the system more stable;
4- The kernel becomes faster than using modules (compilation around 15 minutes); and
5- Lowers the "attack profile" to our system.
Exemplifying:
A build of kernel 6.0.8 for my PC, using FatDog64 and initrd Overlayfs, yielded a final result with a
single file (vmlinuz "with everything inside"), at the size of 9653K, 9,29% of a current (5.19.17) general purpose kernel, from
FatDog64 which contains: vmlinuz 7785K and kernel-modules + firmware 96Mb.
1- To obtain this result, each user has to make his own compilation and the size of vmlinuz varies according to the hardware;
2- The .config obtained still needs some corrections made manually;
3- I only got excellent results, with everything working, on FatDog64 (other distros, I had problems with the sound); and
4- I still haven't tested compiling in AUFS mode.
Why all this explanation? Mainly to value FatDog64, this "fertile ground" where I've been testing so many cool things and where "everything works out" facilitating learning...