A Survey of Contemporary Operating Systems

Part 1, a brief overview

This article will summarize several typical operating systems such as Linux, Windows, Android, iOS, and Harmony from the perspective of kernel architecture, module composition, operating principle, functions and interfaces, and application scenarios.

1 concept

Please explain what is the kernel architecture, module composition, operating principle, functions and interfaces, and application scenarios of the operating system?

  1. Kernel architecture: The kernel architecture of the operating system is usually divided into two types, one is the monolithic kernel architecture, which integrates all operating system modules into one kernel; the other is the microkernel architecture, which integrates the basic functional modules of the operating system Only the necessary core modules are reserved to run in the kernel space, and the rest of the modules are run in the user space, thus improving the reliability and security of the system.

  2. Module composition: The module composition of the operating system usually includes process management, memory management, file system, network management, drivers, etc. Among them, the process management module is responsible for managing the creation, scheduling and termination of system processes; the memory management module is responsible for managing the memory allocation and recovery of the system; the file system module is responsible for managing the reading, writing and storage of files; the network management module is responsible for managing network connections and data Transmission, etc.; the driver module is responsible for managing the drivers for various hardware devices.

  3. Operation principle: refers to the operation mode of each module of the operating system and the joint operation mode of each module

  4. Functions and interfaces: The operating system provides a series of interfaces for applications to access and use various functions of the operating system, including process management, file management, memory management, and network management. These interfaces usually include system calls and library functions for use by different applications.

  5. Application scenarios: The application scenarios of the operating system are very extensive, from desktop operating systems to mobile device operating systems, to embedded device operating systems, involving various fields of computers, including personal computers, servers, mobile devices, embedded systems, etc.

2 Linux

2.1 Kernel Architecture

The Linux kernel architecture is a monolithic kernel architecture, also known as a single-core or single-core design.

The design idea of ​​the monolithic kernel architecture is to integrate all operating system functions into the kernel, and implement various system functions through the interfaces provided by the kernel. This design method can guarantee the performance and stability of the system, because all functions run in the same kernel space, and there is no need for complex communication and interaction between different processes.

The Linux kernel contains a large number of subsystems and modules that provide various functions, such as process management, memory management, file system, network protocol stack, and so on. These subsystems and modules are independent of each other, but are related to each other through the interface provided by the kernel to form a complete operating system.

The advantage of the monolithic kernel architecture is that it can provide efficient system calls and communication mechanisms, and it can also make full use of hardware resources. The disadvantage is that since all functions run in the same kernel space, the size and complexity of the kernel are relatively large, which is prone to security vulnerabilities and stability problems.

2.2 Module Composition and Operating Principle

The running process between the various modules of the Linux operating system is interrelated and interactive. The following is the operation process of each module:

  1. Process management module: The Linux process management module is responsible for managing all running processes, including process creation, destruction, scheduling and communication. This module uses data structures such as process tables, task queues, and schedulers, and implements process management through system calls and signal mechanisms.

  2. Memory management module: The Linux memory management module is responsible for managing the allocation and release of system memory, as well as the sharing and protection of memory between processes. This module includes physical memory management, virtual memory management, and memory mapping management. Linux uses virtual memory technology to implement memory management, and allocates an independent virtual address space for each process, which enables memory isolation and protection between different processes.

  3. File system module: The Linux file system module is responsible for managing the creation, deletion, modification, and access of files and directories. The Linux file system adopts the virtual file system (VFS) mechanism, which allows the system to support many different file system types, such as ext3, NTFS, FAT, etc.

  4. Network module: The Linux network module is responsible for managing issues such as network connections, data transmission, and security. It includes the TCP/IP protocol stack, network device drivers, sockets, etc. The Linux network module adopts a layered architecture and divides the network protocol stack into application layer, transport layer, network layer and data link layer.

  5. Device driver module: The Linux device driver module is responsible for managing the communication between hardware devices and drivers. Linux supports a variety of device driver models, such as character device drivers, block device drivers, and network device drivers. The device driver module communicates with hardware devices through interrupt processing and DMA control.
    insert image description here

The running process between these modules is interrelated and interacts, for example, the process can access the file system and network modules through system calls. The memory management module can manage the memory allocation and release of the process. In addition, device driver modules can also communicate between processes and hardware devices. All these modules are provided by the kernel and coordinated and managed by the scheduler.

2.3 Operating principle

In the Linux operating system, various modules communicate and work together by calling system calls, interrupts, and event-driven methods. The following is a brief description of the running process between several important modules in Linux:

  1. Process management module and memory management module: The process management module is responsible for creating, canceling and scheduling processes, while the memory management module is responsible for allocating and recycling the memory space of the process. The communication between the two modules is implemented through system calls. For example, the fork() system call needs to be called when the process is created, and the malloc() or brk() system call needs to be called when the memory is allocated.

  2. File system module and process management module: the file system module is responsible for managing files and directories, while the process management module is responsible for managing processes and threads. In Linux, the file system is treated as a special kind of file and can be accessed by all processes. When a process needs to read or write a file, it issues a system call to the file system module, which then reads the data from or writes the data to disk.

  3. Network module and process management module: the network module is responsible for managing network interfaces and data transmission, while the process management module is responsible for managing processes and threads. In Linux, a process can send a request to the network module through the socket interface, and then the network module will forward the request to the corresponding network device, thereby realizing network communication.

In Linux, the communication mode between various modules is very flexible, and can be realized in various ways such as system call, interrupt, and event drive. This modular design makes Linux more flexible to adapt to different hardware and application scenarios, and also facilitates system maintenance and development.

2.4 Function and interface

The Linux system provides three interfaces:

  1. Graphical interface operation interface, Linux systems generally provide graphical interface interfaces such as KDE and Gnome, the purpose is to facilitate ordinary users to operate computers.
  2. Console interface, that is, terminal interface, Linux systems generally provide terminal interfaces such as bash shell, cshell, etc. The purpose is to facilitate the system administrator to operate the computer. In fact, the powerful functions of Linux are mainly reflected in the terminal interface.
  3. API interface: the application interface, which is the application program interface. From a programming point of view, the Linux system is a large program call library, which provides a large number of API functions to facilitate programmers to develop applications.

2.5 Application scenarios

The Linux operating system is widely used in various scenarios. The following are some typical application scenarios:

  1. Servers and data centers: Linux is very popular as a server operating system, especially in large-scale data centers and cloud computing environments, such as Google, Amazon, Facebook, etc.

  2. Embedded systems: Linux is also widely used in embedded systems, such as smartphones, tablet computers, routers, TVs, set-top boxes, and car entertainment systems.

  3. Mobile devices: The Linux kernel is used in mobile operating systems such as Android, Sailfish OS, etc.

  4. Supercomputers: Linux is also a very popular operating system in the field of supercomputers. For example, most of the top supercomputers run Linux.

  5. Desktop systems: Although Linux has a relatively small market share in the desktop space, there are still a large number of users and developers using Linux as a desktop operating system.

In conclusion, the Linux operating system is widely used in various scenarios, and its high degree of customizability, flexibility, security and stability make it the operating system of choice for many enterprises and organizations.

3. Windows

3.1 Kernel Architecture

The kernel architecture of Windows is a hybrid kernel architecture.

The hybrid kernel architecture combines the characteristics of microkernel and monolithic kernel in design. Different from the monolithic kernel, the hybrid kernel provides part of the kernel functions in the form of dynamic link library (DLL), these functions include system services in user mode and kernel mode, such as file system, network protocol stack, graphics subsystem, etc. . A microkernel, on the other hand, runs system services as separate processes.

The advantage of the hybrid kernel architecture is that by moving certain functions to DLLs in user mode, the size of the kernel can be reduced, and the stability and security of the kernel can be improved. At the same time, it also inherits the advantages of the single core, such as fast system calls and communication mechanisms, simple code structure, etc.

However, hybrid core architectures also have some disadvantages. Since some kernel functions run in user mode, they will be subject to more restrictions, such as performance, access rights, security, etc. In addition, the loading and unloading of the DLL library will also increase the system overhead, making the response speed of the system slow down.

3.2 Module Composition

  1. Process management module: Windows uses processes and threads to manage applications and system services. A process is an independent execution environment, and each process has its own memory space and system resources. A thread is an execution unit in a process that can share the memory and system resources of the process with other threads.
  2. Memory Management Module: Windows uses virtual memory to manage system memory. Virtual memory is a simulated memory space on the hard disk that allows applications to use more memory than actual physical memory. Windows also provides functions such as memory protection, memory sharing, and memory paging.
  3. Device driver module: Windows uses device drivers to manage hardware devices, including mice, keyboards, printers, network cards, sound cards, etc. Drivers act as an intermediate layer between the operating system and the hardware device, enabling the operating system to communicate with the hardware device.
  4. Network protocol stack module: Windows provides a variety of network management functions, including TCP/IP protocol, network sharing, remote desktop, VPN and firewall, etc. These features make Windows a powerful network operating system.
  5. File System Module: Windows uses the NTFS file system to manage files and folders on the disk. NTFS supports file and folder security, compression, encryption and backup. Additionally, Windows supports other file systems such as FAT32 and exFAT.

3.3 Operating principle

The interaction between the various modules of the Windows operating system is complex. Some examples are given:

  1. Interaction between Windows kernel and drivers. When a device is plugged into the computer, the Windows kernel interacts with the device driver to determine the type and state of the device. Once the device type is determined, the kernel loads the appropriate driver and passes control to it. The driver then communicates with the device so that the operating system can use the device.

  2. Interaction between Windows kernel and user space processes. When a program runs on Windows, it runs in user space, but it needs to interact with the kernel in order to be able to use system resources such as files, networks, and devices. To enable this interaction, Windows provides a number of APIs and system calls that allow applications to communicate with the kernel.

  3. Interaction between different modules in the Windows kernel. For example, Windows' file system drivers and network drivers must interact with the kernel's I/O manager to be able to access file and network resources. Similarly, Windows' security subsystem must interact with the kernel's security manager in order to be able to protect the system from malware and attacks.

  4. Interaction between the Windows kernel and system services. Windows provides many system services, such as Windows Update, Windows Defender, and Windows Firewall, etc. These services need to interact with the kernel in order to be able to access system resources and perform operations. For example, the Windows Update service needs to interact with the kernel's network drivers and security subsystems to be able to download and install updates.

These are just some simple examples of the interaction between the Windows kernel and other modules, in reality the interaction between these modules is very complex and sometimes involves more modules.

3.4 Function and interface

1. Base Services

Provides an access interface to the basic resources available on the Windows system. Such as: file system (file system), external device (device), process (process), thread (thread), access to the registry (Windows registry) and error handling mechanism (error handling). These functional interfaces are located in kernel.exe, krnl286.exe or krnl386.exe system documentation under 16-bit Windows; and in kernel32.dll and advapi32.dll under 32-bit Windows.

2. Graphics Device Interface (GDI)

The functions provided are: output graphics content to monitors, printers and other external output devices. It's in gdi.exe under 16-bit Windows; and gdi32.dll under 32-bit Windows.

3. Graphical User Interface (GUI)

Provides functionality to create and manage screens and most basic controls such as buttons and scroll bars. Receive mouse and keyboard input, and other GUI-related functions. These calling interfaces are located in: user.exe under 16-bit Windows, and user32.dll under 32-bit Windows. After the Windows XP version, the calling interface of basic controls and common dialog controls (Common Control Library) is placed in comctl32.dll.

4. Common Dialog Box Library (Common Dialog Box Library)

Provides standard dialog boxes for applications, such as open/save document dialogs, color dialogs, font dialogs, and more. This link library is located in: commdlg.dll under 16-bit Windows, and comdlg32.dll under 32-bit Windows. It is categorized under User Interface API.

5. Common Control Library (Common Control Library)

Provides an interface for applications to access some advanced controls provided by the operating system. For example: status bar (status bar), progress bar (progress bars), toolbar (toolbar) and label (tab). This link library is located in: commctrl.dll under 16-bit Windows, and comctl32.dll under 32-bit Windows. . It is categorized under User Interface API.

6. Windows Shell (Windows Shell)

As an integral part of the Windows API, it not only allows applications to access the functions provided by the Windows shell, but also improves and enhances them. It's in shell.dll on 16-bit Windows, and shell32.dll on 32-bit Windows (and shlwapi.dll on Windows 95). It is categorized under User Interface API.

7. Network Services

Provides an interface for accessing various network functions provided by the operating system. It includes NetBIOS, Winsock, NetDDE and RPC etc.

3.5 Application scenarios

The Windows operating system is a widely used operating system, and its application scenarios are very extensive. The following are the main application scenarios of the Windows operating system:

  1. PCs and Laptops: Windows is one of the most popular operating systems on desktops and laptops. Its user-friendly interface, wide hardware compatibility, and robust software ecosystem make it the operating system of choice for many individual users.

  2. Enterprise Server: Windows Server is a popular enterprise server operating system that can be used to run enterprise applications, manage networks, and provide other important functions. It can manage large numbers of users, data and applications and provide a secure and reliable solution.

  3. Gaming platform: Windows is one of the go-to platforms for game developers and gamers. Many games are developed for the Windows platform, so using the Windows operating system ensures the best gaming performance and experience.

  4. Mobile Devices: The Windows operating system is also used in some mobile devices such as tablets and cell phones. Although the market share is not as good as Android and iOS, Windows mobile devices still have its user base, especially in some professional applications.

  5. Internet of Things: Windows IoT is an operating system developed specifically for IoT devices. It can help developers quickly build and deploy IoT devices, thereby promoting the popularization and development of IoT technology.

The application scenarios of the Windows operating system are very wide. Whether it is an individual user, an enterprise user or a developer, they can find a solution that suits them in the Windows operating system.

4 Android

4.1 Kernel Architecture

Android's kernel architecture is a monolithic kernel architecture. Under this architecture, all kernel functions are integrated in a single kernel, unlike the microkernel architecture or hybrid kernel architecture that divides kernel functions into multiple different modules.

In Android, the kernel provides many basic functions, such as process management, memory management, file system, network protocol stack, drivers, etc. At the same time, Android also has some specialized modules, such as HAL (Hardware Abstraction Layer) modules, runtime libraries, Android Framework, etc., which are other services and functions provided on top of the kernel. These modules communicate with the kernel through standard Linux system calls and IPC mechanisms.

Android's single kernel architecture makes the maintenance, development and testing of kernel code easier and more efficient, and also reduces the overhead of kernel communication. However, since all kernel functions are integrated in one kernel, the kernel code becomes very large and complex, and it is easy to introduce some security holes. Therefore, in Android, developers need to take some additional security measures to ensure the security and stability of the system.

4.1.1 Comparison of Android and Linux kernel architectures

Android is an operating system based on the Linux kernel, but it has made some modifications and optimizations on the basis of the Linux kernel to meet the special needs of mobile devices. Among them, the most notable difference is that the Android kernel has added some new drivers, such as SurfaceFlinger and Binder drivers, to support Android's unique graphics and communication mechanisms. In addition, Android introduces a user space process - Zygote, which is used to preload application processes, thereby reducing application startup time. In addition, Android also provides many unique functions and services, such as Dalvik virtual machine, application framework and various system applications, etc., which are all built on the basis of the Linux kernel.

The Linux kernel is a general-purpose operating system kernel designed to support multiple hardware platforms and application scenarios. It provides rich functions and services, such as process management, memory management, file system, network protocol stack and drivers, etc. Unlike Android, the Linux kernel does not provide application frameworks and application programming interfaces, which are provided by system libraries and applications in user space. In addition, the development and maintenance of the Linux kernel is an open community activity, which uses a stable development model and version control mechanism to ensure the stability and compatibility of the kernel.

In general, both Android and Linux adopt a single-core architecture, but there are differences in their implementation methods and mechanisms, which also determine their performance in terms of functions and services, application development and maintenance, compatibility and stability, etc. difference.

4.2 Module Composition

The module composition of the Android operating system includes the following main modules:

  1. Linux kernel: The Android operating system is built based on the Linux kernel, which provides basic functions such as underlying hardware drivers, memory management, process management, and security mechanisms.
  2. System runtime library: including Dalvik virtual machine and ART virtual machine, C/C++ runtime library, etc., to support the running of applications.
  3. System Services: Provides a series of system services, such as Activity Manager, Window Manager, Package Manager, Notification Manager, Location Manager, etc., to support the development and operation of applications.
  4. Application framework: including various API interfaces and development tools, such as Android SDK, Android Studio, etc., to facilitate the development and debugging of applications.
  5. Application program: includes various application programs and system applications, such as browser, SMS, phone, contacts, camera, gallery, etc., to meet various needs of users.
  6. Hardware Abstraction Layer (HAL): Used to provide drivers and interfaces for various hardware devices, such as cameras, Wi-Fi, Bluetooth, sensors, etc., to facilitate integration and development by hardware manufacturers.
  7. Kernel driver: used to support the underlying operations of hardware devices, such as device drivers, file system drivers, network drivers, etc.

The module composition of the Android operating system is relatively complex, and there is a close connection and cooperation between different modules, which together constitute a complete operating system. These modules cooperate with each other to provide users with a safe, stable and efficient mobile device operating system.

4.3 Operating principle

When an Android device starts up, it first runs a bootloader and then loads the kernel. After the kernel starts, it initializes the hardware and loads some key modules, such as process management, memory management, and device drivers. These modules exist in Android as kernel modules to be loaded and unloaded when needed.

After the kernel boots, Android starts a daemon process called "Init". The daemon reads the /init.rc file, which contains a series of commands to start and configure the system. After the Init process starts, it will start and initialize other system services and processes according to the instructions in the /init.rc file, such as the Zygote process (used to start the application process), SurfaceFlinger (used to manage the display system) and System Server ( for managing system services), etc.

Android applications run in the form of processes. When the user starts the application, the system starts a new process and runs the application's code in it. Android applications run in their own processes and communicate through the Binder IPC mechanism.

The Android interface is composed of the application's Activity, which can contain multiple view controls, such as TextView, Button, and ImageView. These view controls are managed and rendered by Android's view system, which is responsible for drawing the application's user interface to the screen.

Android also provides a series of core libraries, such as Android Runtime (ART), Java core library, Surface Manager and Media Framework, etc. These libraries provide various functions such as application runtime environment, graphics display, media playback and communication, etc.

4.4 Function and interface

Android is a powerful mobile operating system that provides a wide range of functions and interfaces to support various types of applications. The following are the main functions and interfaces of Android:

  1. Application Framework: Android provides a set of APIs that developers can use to create Android applications. These APIs include various components, such as Activity, Service, BroadcastReceiver, ContentProvider, etc., and various application functions, such as user interface, multimedia, network communication, data storage, etc.

  2. System Components: Android includes many system components such as Phone, SMS, Contacts, Calendar, Camera, etc. These components can be used by other applications, or as system applications.

  3. Multitasking: Android allows multiple applications to run simultaneously, and users can easily switch between applications.

  4. Multi-touch: Android supports multi-touch, allowing users to use their fingers to perform various gestures on the screen.

  5. Notifications: Android provides a notification system that allows applications to display messages to the user while they are running in the background.

  6. Resource management: Android uses resources to manage elements such as text, images, and layouts in an application. These resources are easily accessible within the application and automatically adapt to different device screen sizes.

  7. Security: Android provides a variety of security features, such as application sandbox, rights management, encrypted data storage, etc., to ensure the security of user data and devices.

  8. Virtual machine: Android applications run on the Dalvik virtual machine, which enables Android to run on different hardware devices, and has good compatibility and portability.

The interface of Android includes Java API, C/C++ API and Android NDK. Java API is used to develop applications and system components, while C/C++ API and Android NDK are used to develop low-level system components and drivers.

4.5 Application scenarios

The Android operating system is widely used in embedded systems such as mobile devices and smart home devices. In the field of mobile devices, Android is widely used in smart phones, tablet computers, smart watches, smart TVs and other devices. Due to Android's open source code, high degree of customization, rich application ecosystem and other advantages, many mobile phone manufacturers and other manufacturers have adopted Android as the operating system of their devices.

In addition to the field of mobile devices, Android is also widely used in smart homes, smart wearables and other devices. For example, smart home devices such as smart speakers, smart home controllers, and smart door locks often use Android as their operating system.

In general, Android is highly customizable, open source code, good application ecosystem and rich functions and interfaces, these characteristics make it an ideal choice for various embedded systems, and thus has been widely used in many fields. widely used.

5 iOS

5.1 Kernel Architecture

The iOS kernel is a hybrid microkernel and monolithic kernel design, which means it combines features of both types of kernel architectures. The microkernel architecture is a minimalist design that keeps the kernel as small as possible by providing only the essential services needed for process management and inter-process communication. The monolithic kernel architecture provides more comprehensive services in the kernel itself, such as file systems and device drivers.

The iOS kernel is based on the XNU operating system kernel developed by Apple. XNU is an open source kernel that combines the Mach microkernel, BSD kernel subsystem, and I/O Kit driver framework. The Mach microkernel provides basic abstractions for process management, memory management, and interprocess communication. The BSD subsystem provides POSIX-compliant interfaces for managing files, sockets, and other system resources. The I/O Kit framework provides a layer of abstraction for device drivers and other hardware-related functions.

Overall, the iOS kernel architecture is designed to provide a high level of security and performance while minimizing the risk of system crashes or other issues that could affect the user experience. By combining elements of microkernel and monolithic kernel architectures, the iOS kernel provides a balance between efficiency and flexibility, while still maintaining a high level of security and stability.

5.1.1 Comparing Windows and iOS

Although both iOS and Windows use a hybrid kernel architecture, there are differences in their implementations and mechanisms.

In iOS, the hybrid kernel architecture is called the XNU kernel, which consists of two parts: the Mach microkernel and the BSD macrokernel. The Mach microkernel provides the most basic kernel functions, such as thread and process management, memory management, and IPC, while the BSD macrokernel provides higher-level services, such as network protocol stack, file system, and security certification. The Mach microkernel and the BSD macrokernel communicate through the interface generated by MIG (Mach Interface Generator). This design makes iOS have better security and stability, and can also meet the needs of various applications.

In Windows, the hybrid kernel architecture is called the Windows NT kernel, which consists of two parts: the microkernel and the server process. The microkernel provides the most basic kernel functions, such as process management, memory management, thread management, and object management, while the server process provides higher-level services, such as file system, network protocol stack, and security services. The microkernel and the server process communicate through mechanisms such as RPC (Remote Procedure Call) and shared memory. This design makes Windows have better scalability and maintainability, but also can provide a better user experience.

Generally speaking, both iOS and Windows adopt a hybrid kernel architecture, but there are differences in their implementation methods and mechanisms, which also determine their differences in security, stability, scalability, and user experience.

5.2 Module Composition

  1. The Mach microkernel is at the heart of the iOS kernel architecture. It is responsible for managing processes and memory, and provides a mechanism for inter-process communication. The Mach microkernel is a minimalist design, providing only the basic services needed for process management and communication. This makes it more secure and easier to maintain than monolithic kernel architectures.
  2. The BSD subsystem is a set of kernel services that provide a POSIX-compliant interface to user-level software. This includes the file system, network, and other system services. The BSD subsystem is a monolithic design, integrated into the kernel. This makes it more efficient than a microkernel design, since the overhead of interprocess communication is not required.
  3. The I/O Kit driver framework is responsible for managing device drivers and other hardware-related functions. It provides a layer of abstraction between the kernel and the hardware, making it easier to add new hardware devices to the system. The I/O Kit driver framework is a monolithic design that is integrated into the kernel.
  4. The Security module is responsible for handling the security of the system, including tasks such as authentication, authorization, and encryption
  5. Network protocol stack module: This module includes various network protocols and services, including TCP/IP, UDP, HTTP, SSL/TLS, DNS, etc. It handles network communication and data transmission, providing the infrastructure for network connectivity
  6. The File System module is responsible for managing the iOS file system, including tasks such as access permissions, file operations, and storage management

5.3 Operating principle

The following are a few examples of operations between several modules of the iOS operating system:

  1. Mach microkernel and BSD subsystem: The Mach microkernel is mainly responsible for memory management and process management, while the BSD subsystem is responsible for file systems, network protocols, and user permissions. The two modules work together to realize the basic functions of iOS, such as loading of applications, reading and writing of files, and network communication.

  2. I/O Kit and Core Audio: I/O Kit is the foundation of iOS device drivers and is responsible for managing hardware device access and communication. Core Audio provides audio-related services and interfaces, such as audio playback, recording, and processing. These two modules work together to allow the iOS device to interact with external devices for audio data, such as earphones, speakers, and microphones.

  3. Core Data and UIKit: Core Data is a persistence framework for iOS that manages data storage and retrieval in applications. UIKit is the UI framework of iOS, which is used to create and manage the user interface of the application. These two modules work together to allow applications to access and manipulate persistent data in an easy way, and present the data to users.

  4. Core Animation and Core Graphics: Core Animation provides animation effects in iOS applications, such as gradients, scaling, and rotation. Core Graphics provides graphics processing functions in iOS applications, such as drawing, rendering and transformation. These two modules work together to allow applications to display various graphics and animation effects on the user interface.

5.4 Function and interface

Main functions :

  1. Processor Management: Manage CPU resources to ensure the normal operation of applications and systems.
  2. Storage management: Manage the device's storage space, including file systems and storage (such as hard drives or solid-state drives).
  3. Network management: Provides network connections such as Wi-Fi, cellular networks, and Bluetooth, allowing applications to communicate over the network.
  4. User Interface: Provides user interface elements, including icons, menus, dialog boxes, and notifications, to allow users to interact with the device.
  5. Application Management: Manage the lifecycle of applications, including start, pause, stop, and destroy.
  6. Security: Provides a variety of security features, including data encryption, application sandbox, Touch ID, Face ID, etc.
  7. Multimedia function: support audio, video, image and other multimedia functions, including taking pictures, video recording, music playback and video playback, etc.

Interface for developers to use

  1. UIKit: Provides user interface elements such as buttons, labels, text boxes, etc. for iOS applications.
  2. Foundation framework: Provides basic functions such as data management, string processing, date and time management.
  3. Core Data: Used to create and manage data models in applications, supporting relational databases.
  4. Core Animation: Provides animation support to make applications attractive and dynamic.
  5. Core Location: Provide location services and support the positioning function of the application.
  6. AVFoundation framework: Provides audio and video processing functions, enabling developers to implement multimedia functions in applications.
  7. MapKit: Provides map and location service support, developers can use maps and location information to build applications.
  8. HealthKit: Provides health data collection and management functions, which can be used to build health and fitness applications.

These interfaces enable developers to build various types of applications by taking advantage of the capabilities of the iOS operating system.

5.5 Application scenarios

  1. Smartphone: The iOS operating system is the operating system of the iPhone, which has the characteristics of smoothness, stability, and ease of use, and supports rich applications.
  2. Tablet computer: iPad is a tablet computer developed based on the iOS operating system. It supports applications and functions similar to those of the iPhone. It also has a larger screen and more powerful processing capabilities to meet users' needs for mobility and productivity.
  3. Mobile applications: The iOS operating system supports a variety of mobile applications, including social, entertainment, office and other types, and users can download and install them through the App Store.
  4. Smart wearable devices: The iOS operating system is also applied to smart wearable devices such as Apple Watch, providing users with convenient operating experience and life assistant functions.

6 Harmony

kernel architecture

The kernel architecture of Harmony OS is a microkernel architecture. In this architecture, the operating system kernel only provides the most basic services, such as process management, memory management, and thread scheduling, and other functions run in the user space in the form of plug-ins. The advantage of this architecture is that it is more flexible, easier to maintain and update, and it can also improve the reliability and security of the system.

Harmony is an operating system independently developed by Huawei. Its kernel architecture can be divided into three parts: microkernel, driver framework, and application framework.

  1. microkernel

Harmony's microkernel is a very small kernel that contains only the most basic operating system functions, such as thread management, memory management, inter-process communication, device drivers, and security. The design purpose of the microkernel is to reduce the core system services as much as possible, making the system more lightweight, reliable and secure.

  1. driver framework

The driver framework is an important part of Harmony, which is responsible for managing the drivers of system hardware devices. The driver framework includes various hardware abstraction layers (HAL) and hardware driver interface (HDI), which separate hardware devices from operating systems, thus simplifying the development and maintenance of device drivers.

  1. application framework

The application framework is the top-level framework in Harmony, which provides various applications and services, such as GUI, multimedia, network communication, security and privacy, etc. The application framework makes application development easier and more efficient, and provides various APIs and SDKs to support developers in creating their own applications and services.

In short, Harmony's kernel architecture is based on the design idea of ​​microkernel, and provides various services and functions through the driver framework and application framework. Harmony's kernel is designed to improve system performance, reliability, and security, and to support the development and deployment of a wide variety of devices and applications.

Module composition

  1. Kernel module: Responsible for managing the core functions of the computer, including system calls, process scheduling, interrupt handling and other functions.
  2. Driver module: responsible for managing the hardware devices of the computer, including device initialization, control, data transmission and other functions.
  3. Distributed collaboration capability module: realizes the distributed collaboration capability of Harmony OS, including functions such as distributed scheduling and distributed communication.
  4. Security module: responsible for managing the security of Harmony OS, including functions such as user authentication, data encryption, and access control.
  5. Graphical user interface module: responsible for managing the graphical user interface of Harmony OS, including window management, event processing, drawing and other functions.
  6. Application framework module: Provide framework and tools for application development, including graphical user interface library, multimedia library, network library, etc.
  7. System service module: Provide system-level services, including file system, time service, timer service, etc.
  8. Artificial intelligence module: Provide artificial intelligence functions, including speech recognition, face recognition, natural language processing, etc.

The module composition of Harmony OS focuses on distributed collaboration capabilities and security

Operating principle

The various modules of HarmonyOS interact and communicate through the microkernel, the core of which is the distributed soft bus technology. Here are a few examples to illustrate the workflow between the various modules:

  1. Software Bus and Distributed Capabilities
    HarmonyOS' Distributed Software Bus technology (Distributed Software Bus, DSB) enables applications to interact and communicate between multiple devices and multiple services. The implementation of DSB is based on microkernel technology, which provides a general and pluggable communication mechanism for different services through the microkernel. For example, when an application needs to use the Wi-Fi function, it can call the Wi-Fi service through the DSB, regardless of whether the service is running locally or on the remote device.

  2. Driver module The
    driver module of HarmonyOS is a kernel module, which is mainly responsible for managing and controlling the operation of hardware devices. For example, when the user touches the screen on the device, the driver module will detect the operation and convert it into a corresponding signal, and then pass the signal to other modules for further processing.

  3. Graphics display module
    The graphics display module of HarmonyOS is responsible for managing and displaying the graphical interface, which includes a window manager, a drawing engine, and a graphics device interface. For example, when the user opens an application program on the device, the graphic display module will display the corresponding interface according to the requirements of the application program, including menus, buttons, text, etc.

  4. Security module
    The security module of HarmonyOS includes identity authentication, encryption and access control, etc. Its main function is to protect the privacy and security of devices and users. For example, when a user logs in to the device, the security module will verify the user's identity and grant corresponding permissions, and at the same time encrypt and protect the user's data.

These are just some of the workflows between the various modules of HarmonyOS

Function and interface

  1. Application Programming Interface (API): The Application Programming Interface is one of the most commonly used interfaces of HarmonyOS and is used to provide operating system functionality to application developers. These APIs include UI, network, file system, multimedia, etc., which can help developers develop feature-rich applications.

  2. Service API: Service API is an IPC (Inter-Process Communication)-based interface provided by HarmonyOS, which allows different applications to share data and functions. For example, applications can call system-level functions, such as Wi-Fi modules, sensors, etc., through service interfaces.

  3. System Service API: System Service API is an interface provided by HarmonyOS, which allows applications to access underlying hardware, system services and system resources, such as communication services, location services, system settings, etc.

  4. Application Framework API: Application Framework API is a high-level interface provided by HarmonyOS, which allows developers to easily create applications. These interfaces include application management, event management, resource management, interface management, and more.

  5. Device Driver API: The Device Driver API is an interface provided by HarmonyOS that allows applications to access hardware devices. These interfaces include kernel driver interfaces, user space driver interfaces, and so on.

Application Scenario

  1. Smart home field: Through the distributed architecture of HarmonyOS, smart home devices can be connected to realize the overall control and management of smart home.
  2. Automotive field: HarmonyOS can implement a series of intelligent functions in cars, including autonomous driving, Internet of Vehicles, and in-vehicle entertainment.
  3. Mobile device field: HarmonyOS can be applied to mobile devices such as smartphones, tablets, and smart watches to provide a smoother and more efficient user experience.
  4. Industrial control field: HarmonyOS can be applied to industrial control equipment to realize remote control and management of equipment.

ROS

ROS is the abbreviation of Robot Operating System, commonly known as "Robot Operating System". But it is not a real operating system, but an open source meta-operating system for robots, which provides many functions similar to traditional operating systems: hardware abstraction, underlying device control, common function implementation, inter-process Messaging, package management, and more. And provide related tools and libraries for obtaining, compiling, editing code, and running programs among multiple computers to complete distributed computing.

Robot Operating System Challenges:

  1. Multi-domain heterogeneous resource management. Each type of robot has a large amount of special software, which leads to the robot intelligence meeting the specified needs, and can only perform fixed tasks in a specific environment, making it difficult to establish interconnection between robots.
  2. Autonomous behavioral control of complex robots. Affected by the "perception-plan-action" control loop, the robot's behavior is uncertain when facing complex environments and changing tasks, and the robot's behavior is complex and changeable.
  3. swarm intelligence. To a certain extent, a single intelligence has the perception ability, autonomy ability and primary human-computer mutual understanding ability of a relatively simple environment, but it needs to realize one-to-many, many-to-many human-machine mutual collaboration etc.

micROS

Core idea

Control abstraction and data abstraction are the core contents of operating system basic research.

Role-Based Control Abstraction

Using the actor-based idea, research the correlation between individual machine intelligence and group machine intelligence structure, focusing on role setting and interaction rules, learning-based formation mechanism of role capabilities, role intelligence generation and evolution mechanism, and distribution The division of labor and cooperation of each role in the structural model. Based on the theories of multi-agent system (MAS) and computer supported cooperative work (CSCW), we propose a swarm intelligent robot operating system based on the role model Control abstraction. A role is an abstraction of a behavior of a robot or a group of robots facing a specific task. The comparison between it and the core concept of a process in a traditional computer operating system is shown below.
insert image description here

Data Abstraction Based on Semantic Situation Graph

The semantic context graph is proposed as the data abstraction of the robot operating system to realize functions such as machine-machine collaboration and human-machine collaboration, data fusion, asynchronous update, multi-view sharing, and event triggering. A conceptual comparison between a semantic context graph and a file in a traditional computer operating system is shown below.
insert image description here

Module Composition and Interface

micROS is designed and developed according to the node-level architecture of the swarm intelligence operating system. The core module includes the resource management layer and the support structure layer for group behavior manipulation. Among them, the resource management layer is divided into four sub-modules: physical domain (physics domain) resource management, information domain (information domain) resource management, cognitive domain (cognition domain) resource management, and combat domain/social domain (social domain) resource management ; The group behavior control support framework layer is divided into four sub-modules: group observation support framework observe, group judgment support framework orient, group decision support framework decide, and group action support framework act. Each sub-module of the swarm intelligence operating system software prototype is developed based on the design of "software bus + plug-in". For example, the act sub-module of the swarm action support framework includes the swarm action software bus act_softbus and the swarm action function plug-in library plugins. micROS provides typical functional plug-in examples in the plug-in library, and supports third-party plug-in extensions of the software according to the plug-in interface specification. Currently, typical plug-ins provided by micROS include a variety of unmanned system sensor driver plug-ins, typical controller plug-ins, navigation and positioning data processing plug-ins, visible light data processing plug-ins, path planning plug-ins, group action adaptive plug-ins, group dynamic control plug-ins, local motion plugins etc.

Some problems faced by the operating system and future development trends (to solve these problems)

The future development trend of the operating system may include the following aspects:

  1. Security: With the development of the Internet, network security has become an extremely important issue. The future of operating systems will focus more on security, especially in areas related to cloud computing, Internet of Things, artificial intelligence, and more.

  2. Cross-platform: With the development of computer hardware and software, more and more attention has been paid to the cross-platform characteristics of the operating system. Future operating systems will pay more attention to seamless integration and interoperability on different platforms.

  3. Artificial intelligence: Artificial intelligence will gradually become a new direction for operating system development. The future operating system will learn from artificial intelligence technology to make the operating system more intelligent, adaptive and automatic.

  4. Virtualization: virtualization technology will continue to be the focus of operating system development. The future operating system will pay more attention to the development of virtualization technology, improve the scalability and flexibility of the system, and support the needs of various application scenarios.

  5. Openness: Open source code has become the development trend of many current operating systems. The future operating system will pay more attention to openness and community co-construction, strengthen cooperation with the open source community, and jointly promote the development and innovation of the operating system.

In addition to the above parts, combined with the design concept and development goals of HarmonyOS, and the future development trend of the Internet of Everything, the following explanation is given: the
operating system has experienced more than 60 years of development, and has gone through multiple generations, from the earliest multi-tasking operating system, such as MULTICS and UNIX, to multi-processor operating systems suitable for personal computers, such as Linux and Windows, and to mobile operating systems that have been widely popular for more than ten years, such as iOS and Android, the core technology has been very mature, and the software complexity has reached scaled to hundreds of millions of lines of code. Every major development of the operating system must be closely related to the development of computer hardware. With the advent of the Internet of Things era, the operating system is bound to usher in new developments. In the future, more and more connections and computing will be done on more other devices (including edge devices) in more scenarios. The concept extension of the device managed by the operating system is expanded. The previous operating system usually manages a single device, but the future operating system needs to manage the distributed multi-terminals in the connected state in a unified manner.

Combined with the article "Chen Haibo: Thoughts on Operating System Architecture and Evolution for 2030",
the operating system will be in the future

  1. Human-computer interaction: more convenient human-computer interaction (language, gesture, etc.)
  2. Task scheduling: With the emergence of 5G, in network communication, the end system should adopt an effective way to organize and guarantee the end-to-end delay.
  3. Computing resources: In the future, the diversification of computing methods will require the operating system to be able to reasonably coordinate different computing
  4. OS component library: It is difficult to adapt to all scenarios using an operating system. Try to build a dedicated OS component library and solve this problem by assembling different scenarios
  5. OS resource management: The current operating system uses a simple approximation algorithm for overall planning tasks. As the complexity of the system increases, the resource overall planning effect of this algorithm will gradually become poor. Therefore, future overall planning resources will tend to be more precise overall planning and allocation
  6. Compatibility with downward architecture: In order to achieve cross-system and cross-computing power, the operating system needs to be able to perceive the underlying architecture, and be able to reasonably perform concurrent and collaborative design based on the chip architecture.
  7. New computing architecture: The computing architecture of the current DSA architecture has major disadvantages, such as difficult maintenance, overlapping functions, low operational reusability, and low efficiency. To solve this problem, it is necessary to develop new computing architectures
  8. new storage architecture
  9. Digital trust system: The digital trust system will start more from the perspective of application.
  10. From hierarchical decoupling to vertical integration: solving the problem of "thick layers" caused by the traditional addition of abstraction layers

The several aspects mentioned above are further developed.

Guess you like

Origin blog.csdn.net/qq_41624557/article/details/130546314