The kernel is the operating system’s central component. It serves as a link between the user’s application and the hardware (CPU). The kernel is a large piece of executable code that is responsible for processing 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 background process that does not communicate with any controlling terminal. Typically, daemons are initiated at boot time, operate as root or a specific user (for example, Apache or Postfix), and manage system-level duties. Although the name of a daemon is frequently prefixed with d (as in crond and sshd), this is not essential 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.