Operating system
Операционная система
An operating system (OS) runs programs and manages the resources they share, such as CPU time, memory, storage, and network access. It lets applications use those resources without having to control the hardware directly.
Also known as: ОС, ядро, kernel
What an operating system does
A database and a web server can run on the same machine without either one deciding when it gets the CPU or which parts of memory it may access. The operating system makes those decisions and provides common ways to work with files, networks, and devices. That lets the web server open a log file without knowing how the storage device works.
The kernel is the privileged core of the OS, not the whole system. A usable installation generally includes user-space components such as system libraries, utilities, and background services. Linux is a kernel; Debian is a distribution that ships it alongside those components. A desktop interface is optional: a server can run the same kernel without one.
How applications use the OS
- Scheduling. A process holds resources such as an address space and open files. Its threads execute instructions. The kernel scheduler decides which runnable threads get CPU time and on which cores.
- Memory protection. Processes normally have separate virtual address spaces. The kernel configures how virtual addresses map to physical memory, and the processor enforces access permissions. The same address in two processes need not refer to the same physical memory.
- System calls. An application normally executes in user mode. To do something that requires the kernel, such as opening a file, it makes a system call, often through a library wrapper. The kernel checks the request and returns a result or an error.
Example: a service reads its configuration
When a service opens /etc/myapp/config.yaml, the kernel resolves the path and checks access using the process's credentials. On Linux, a successful open returns a file descriptor: an integer the process can pass to a subsequent read call. The kernel may serve the bytes from its page cache rather than fetching them from storage. If access is denied, the service cannot fix that by retrying the same call with the same credentials. The useful next step is to check which user the service runs as and whether that user can traverse the parent directories and read the file.
Why it matters in DevOps
A virtual machine normally boots a guest OS with its own kernel. A Linux container, by contrast, runs processes that share the kernel of its host environment. An Ubuntu-based image can supply Ubuntu libraries and command-line tools, but it does not supply a separate running kernel. If an application requires a particular kernel feature, changing the base image alone will not make that feature available.
What interviewers ask
You may be asked to distinguish a process from a thread, or to walk through what happens when a program reads a file. Explain what happens in the application and what requires the kernel. For a troubleshooting question like “Why does this binary work in my shell but fail as a service?”, compare the user identity, working directory, and environment first. The two processes can depend on different paths and permissions even though they run on the same OS.