The kernel is the Central part of the operating system. It acts as an interface between the user (application) and hardware (CPU). The kernel is the big chunk of executable code in charge of handling all requests.
Kernel role has been split mainly into –
- Process management: The kernel is in charge of creating and destroying processes and handling their connection to the outside world (input and output) and provides Communication among different processes (through signals, pipes, or IPC primitives). Scheduler which controls how process share CPU also part of Process management.
- Memory Management: Kernel manages the computer memory a critical resource. kernel builds up a virtual addressing space for any and all processes on top of the limited available resources and it performs simple malloc/free pair too much more complex functionalities.
- Filesystems: Unix is heavily based on the filesystem concept; almost everything in Unix can be treated as a file. The kernel builds a structured filesystem on top of unstructured hardware, and the resulting file abstraction is heavily used throughout the whole system.
- Networking: Networking is managed by the kernel because most network operations are not specific to a process: incoming packets are asynchronous events.The packets must be collected, identified, and dispatched before a process takes care of them.
- Device Control: As for every peripheral present on a system there must be device driver embedded in the kernel to perform the device-specific functionality from the hard drive to the keyboard.
Daemons: A daemon is a process that runs in the background, not connecting to any controlling terminal. Daemons are normally started at boot time, are run as root or some other special user (such as Apache or postfix), and handle system-level tasks. As a convention, the name of a daemon often ends in d (as in crond and sshd), but this is not required, or even universal.
A daemon has two general requirements:
- It must run as a child of init.
- It must not be connected to a terminal.