1. Basic features

  • concurrent
    • Concurrency refers to the macroscopic ability to run multiple programs simultaneously in a period of time. Parallelism requires hardware support, such as multi-pipeline, multi-core processor or distributed computing system.
    • Parallelism is the ability to run multiple instructions at the same time. The operating system enables programs to run concurrently by introducing processes and threads.
  • Shared
    • Sharing means that resources in a system can be shared by multiple concurrent threads.
    • There are two types of sharing: mutually exclusive sharing and simultaneous sharing.
    • Mutually exclusive shared resources are called critical resources, such as printers. Only one process is allowed to access them at a time. You need to use the synchronization mechanism to achieve mutually exclusive access.
  • virtual
    • Virtualization refers to the transformation of one physical entity into multiple logical entities.
    • There are two main virtual technologies: time division multiplexing and space division multiplexing.
    • Multiple threads can execute concurrently on the same processor using time division multiplexing, where each process takes turns occupying the processor, executing only a small time slice at a time and switching quickly.
    • Virtual memory uses a space reuse technique, which abstracts physical memory into an address space that each process has its own. The pages in the address space are mapped to physical memory. All pages in the address space do not need to be in physical memory. When a page that is not in physical memory is used, the page replacement algorithm is performed to swap the page into memory.
  • asynchronous
    • Asynchrony is when a process does not complete all at once, but rather moves forward in a stop-and-go manner at an unknown speed.

2. Basic functions

  • Process management
    • Process control, process synchronization, process communication, deadlock handling, processor scheduling, etc.
  • Memory management
    • Memory allocation, address mapping, memory protection and sharing, virtual memory, etc.
  • File management
    • File storage space management, directory management, file read and write management and protection.
  • Equipment management
    • Complete user I/O requests to facilitate the use of various devices and improve device utilization.
    • It mainly includes buffer management, device allocation, device processing, and virtual devices.

3. System call

If a process needs to use kernel-mode functionality in user mode, it makes a system call to the kernel and the operating system does the workCopy the code

  • Linux system calls mainly include the following

4. Macro and microkernels

  • Macro kernel
    • A macro kernel puts operating system functionality into the kernel as a tightly integrated whole.
    • Because the modules share information, they have high performance.
  • The microkernel
    • Due to the increasing complexity of operating systems, some operating system functions are removed from the kernel to reduce the complexity of the kernel. The removed part is divided into several services according to the principle of layering, independent of each other.
    • Under the microkernel architecture, the operating system is divided into small, well-defined modules, with only the microkernel running in kernel mode and the rest in user mode.
    • There is a performance penalty due to the frequent switching between user and core state.

5. Interrupt classification

  • External interrupt
    • Caused by an event other than an instruction executed by the CPU, such as an IO completion interrupt, indicating that the device input/output processing has completed and that the processor is able to send the next input/output request. In addition, there are clock interrupts, console interrupts, etc.
  • abnormal
    • Caused by the CPU’s internal time to execute instructions, such as illegal opcodes, address out of bounds, arithmetic removal, etc.
  • In a
    • Use system calls in user programs