How do applications communicate with kernel




















The kernel is the core of the OS and is the first to load when the computer boots up. It is responsible for providing an interface for all applications, controlling the hardware and allowing processes to get information from each other. A kernel is bigger than a process. It creates and manages processes. A kernel is the base of an operating System to make it possible to work with processes. The Kernel is part of the operating system — And the most crucial.

Kernel is the heart and core of an Operating System that manages operations of computer and hardware. It comes under the category of free and open source software. The Linux kernel mainly acts as a resource manager acting as an abstract layer for the applications.

The applications have a connection with the kernel which in turn interacts with the hardware and services the applications. Linux is a multitasking system allowing multiple processes to execute concurrently.

Linux is just the kernel. Unix is a complete package of Operating system. Skip to content Android Windows Linux Apple. Applications running on the system communicate with the kernel via system calls see Figure 1.

An application typically calls functions in a libraryfor example, the C library that in turn rely on the system call interface to instruct the kernel to carry out tasks on their behalf. Some library calls provide many features not found in the system call, and thus, calling into the kernel is just one step in an otherwise large function. For example, consider the familiar printf function. It provides formatting and buffering of the data and only eventually calls write to write the data to the console.

Conversely, some library calls have a one-to-one relationship with the kernel. For example, the open library function does nothing except call the open system call. Still other C library functions, such as strcpy , should you hope make no use of the kernel at all. When an application executes a system call, it is said that the kernel is executing on behalf of the application.

Furthermore, the application is said to be executing a system call in kernel-space, and the kernel is running in process context. This relationshipthat applications call into the kernel via the system call interfaceis the fundamental manner in which applications get work done. Figure 1. Relationship between applications, the kernel, and hardware. The kernel also manages the system's hardware.

Nearly all architectures, including all systems that Linux supports, provide the concept of interrupts. When hardware wants to communicate with the system, it issues an interrupt that asynchronously interrupts the kernel. Interrupts are identified by a number. The kernel uses the number to execute a specific interrupt handler to process and respond to the interrupt. For example, as you type, the keyboard controller issues an interrupt to let the system know that there is new data in the keyboard buffer.

The kernel notes the interrupt number being issued and executes the correct interrupt handler. The interrupt handler processes the keyboard data and lets the keyboard controller know it is ready for more data.

To provide synchronization, the kernel can usually disable interruptseither all interrupts or just one specific interrupt number. In many operating systems, including Linux, the interrupt handlers do not run in a process context. Instead, they run in a special interrupt context that is not associated with any process.



0コメント

  • 1000 / 1000