What is a Kernel?
The kernel is what all operating systems use to access the system’s hardware, while daemons are software that runs in the background of the computer for various purposes.
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.
System daemons are software programs that work alongside the kernel to provide various services. They are typically started at the same time as the computer boots up, and they continue running in the background unless they need to be accessed by another program. On the other hand, the kernel is an integral part of any operating system that manages access to system hardware devices and ensures that programs can interact with each other.
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.
Daemons do things like check the mail for you and keep the mail from being deleted; they also keep the system’s time correct and make sure the system’s memory works, keep the system’s processes running, and so on.
The term daemon is also used to refer to a very independent program of other programs. It can run when any other program is not running.
A daemon has two general requirements:
- It must run as a child of init.
- It must not be connected to a terminal.