{Original version: 23 Jan 2020}
{Latest update: 1 Feb 2020}

Introduction

  • All UNIX kernels derived from either SVR4 or 4.4BSD.
  • All UNIX kernels tend to agree on certain standards: POSIX and CAE, at the very least.
  • UNIX kernels also share fundamental design ideas and features.Comparison of Linux kernel against main UNIX kernels:
    • Monolithic kernel: most UNIX flavors are monolithic, like Linux.
    • Kernel modules: most modern kernels can dynamically load and unload portions of the kernel code via modules.
    • Kernel threading: some UNIX kernels (e.g., Solaris are organized as a set of kernel threads with their own execution context that can be scheduled separately.
    • Multithreaded application support: implemented in the form of lightweight processes (LWP) in the case of Linux.
    • Preemptive kernel: starting with version 2.6 of the kernel, the Linux kernel can interleave execution flows while in privilege mode, just like Solaris and other UNIX kernels.
    • Multiprocessor support: starting with kernel 2.6, Linux supports Symmetric MultiProcessing (SMP) for different memory models, including Non-Uniform Memory Access (NUMA).
    • Filesystem: Linux supports many different filesystems.
    • STREAMS: as of version 2.6, the Linux kernel does not have any equivalent to the STREAM I/O subsystem supported in SVR4.
    Linux tries to separate hardware-dependent and hardware-independent sections of its own source code by creating subdirectories for the different architectures under arch and include.
  • Up to version 2.5 of the kernel, the second number in the kernel version denoted whether it was a stable version (an even number) or a development version (an odd number). Starting with kernel 2.6, this is no longer the case.

Basic Operating System Concepts

  • Objectives of the operating system:
    • Direct interaction with the hardware components.
    • Provide an execution environment to the applications.
  • Hardware supports different execution modes for the CPU:
    • Non-privileged mode for user programs (called user mode in UNIX).
    • Privileged mode for the kernel (called kernel mode in UNIX).
  • UNIX kernels provide a multiuser environment, which includes the following features:
    • An authentication mechanism to identify the users.
    • A protection mechanism to prevent buggy software from blocking other users.
    • A protection mechanism against malicious programs that could interfere with the activity of other users.
    • An accounting mechanism to limit the amount of resources assigned to each user.
  • In a multiuser system, each user has a private space on the machine.
  • All users are identified by a unique User ID (UID) and Group ID (GID).
  • UNIX systems have a special user called root or superuser with special privileges.
  • All operating systems use the process as a fundamental abstraction. A process executes a single sequence of instructions in an address space in memory.
  • Modern operating systems allow processes with multiple execution flows (i.e., multiple sequences of instructions executed in the same address space).
  • Systems that allow concurrent active processes are said to support multiprocessing.
  • The scheduler selects the processes that will run on the CPUs.
  • Some OSes allow only nonpreemptable processes, which means that the scheduler is invoked only when a process relinquishes the CPU. However, processes on a multiuser system must be preemptable, meaning that the kernel tracks how long they run on the CPU, and periodically activates the scheduler.
  • UNIX kernels adopt a process/kernel model where each process has the illusion that it is the only process on the systm and it has exclusive access to the services from the OS. When the process makes a system call, the hardware changes the privilege mode from user mode to kernel mode, and the process starts the execution of a kernel procedure with a very limited purpose.

Memory Addressing