Operating System Principles Chapter 2 Operating System Structure

Operating System Principles for Undergraduate Students Learning Record
Learning Record Family Bucket

2.1 Operating system services and interfaces

2.1.1 Operating System Services

Provide an environment for programs and users to execute programs in the form of services

Basic service:

User interface, program execution, I/O operations, file system operations, communication, error detection

Value-added services:

Resource allocation, statistics, protection and security

The service form of the operating system:

  • system call
  • user interface
  • system program

2.1.2 System calls

Programming interface for operating system services - program-oriented

High-level language writing (C or C++)

program through the application program interface ( API)access

Three commonly used APIs:

  • windowsWin32 API

  • POSIXsystems (including nearly all versions of UNIX, Linux, and Mac OS X)POSIX API

  • Java Virtual Machine (JVM) JavaAPI

2.1.3 User interface

Graphical interface (GUI)

The first graphical interface - Xerox Alto

touch screen GUI

Future Human-Machine Interface: Voice Control, Human Perception Control

2.1.4 System program

Used to manage and maintain the operating system

Use operating system services for users

Function:

  • File management, such as displaying file information in a folder, modifying attributes and deleting operations
  • Status information, view background processes, view the memory used by the computer, etc.
  • file processing, editing files
  • Programming language support, writing programs on the computer, such as writing C language codes in the command line interface
  • Program loading and execution, executing code on the computer
  • communication, remote connection desktop

2.2 Operating system structure

2.2.1 Simple structure

The functions are all mixed in one level, which is more complicated and chaotic, without structure

Unstructured: small, simple, limited functionality

Problem: confusing, difficult to maintain and update, not suitable for large-scale system development

example:

MS-DOS, no module division

Early Unix systems

2.2.2 Hierarchy

  • The operating system is divided into several layers
  • Build high layers on low layers
  • The bottom layer (0 layer) is hardware
  • The highest layer (N layer) is the user layer
  • Each layer can only use lower-level functions and services

Advantages: Simplified system design and implementation, easy to debug and upgrade maintenance

Disadvantages: difficult layer definition, poor efficiency

For example: iOSoperating system, Dutch Electrologica X8(32 K memory) simple batch processing system

But for iOSthe system , it can be called across layers, or it can be called from the lower layer to the higher layer

2.2.3 Microkernel

Kernel miniaturization:

Move as many functions out of the kernel as possible to user space, and the server can adopt this structure

benefit:

  • Easy to extend the microkernel

  • Easy to port the operating system to the new architecture system

  • more stable

  • safer

shortcoming:

  • Increased overhead for user-space and kernel-space communication

  • Solution: Propose a message passing mechanism

When the kernel gets control of the CPU

Example: Mach, the first CMUoperating

QNX- Microkernel-based real-time operating system

Windows NT, 2000, 2003 and subsequent versions, etc.

2.2.4 Module structure

Most operating systems today adopt a modular structure: Solarismodules and Linux

  • use an object-oriented approach
  • Each core component is separated
  • Each session with other modules is called an interface
  • Each module is loaded into the kernel when needed

Advantages: more flexible in operation and use

2.2.5 Hybrid structure

Mixed structure is not a structure, it means mix and match

such as complex Mac OS X

2.3 Virtual Machine

2.3.1 Virtual Machine Definition

virtual machine:

A complete computer system that is realized by software simulation, has complete hardware system functions, and runs in a completely isolated environment

  • Physical computer resource sharing to create virtual machines
  • Each virtual machine is isolated from other virtual machines
  • Virtual machines are difficult to implement due to the need for exact replicas of physical machines
  • In the 1960s, virtual machines were used in mainframe IBM VMoperating systems

Commonly used virtual machine software:JWM VMare Virtual box

There are multiple virtual machines on a physical computer, and different virtual machines are isolated from each other

The resources of each virtual machine on a physical computer can be dynamically allocated

2.3.2 Java virtual machine

Java language interpreter

  • A hypothetical computer that can run Java code
  • As long as the interpreter is ported to a specific operating system according to JVMthe specification , any compiled Java code can be run
  • Features: platform independent

Function: Enable code to run across platforms

2.3.3 Workstation virtual machine

Workstation virtual machine: virtual machine on the operating system

  • Host OS (Host OS): The OS installed on the hardware
  • Guest operating system (Guest OS) The operating system installed on the operating system
  • The workstation virtual machine is installed on the host operating system, and the guest operating system can be installed in the workstation virtual machine

benefit:

  • Use multiple operating systems on one computer at the same time
  • One host operating system, several guest operating systems

2.3.4 Server virtual machine

Multi-user, multi-operating system

Virtual machines installed on bare metal

Bare metal: only the hardware is installed, and the software part is not installed: including the operating system, various drivers and application software

Server virtualization:

Abstract server physical resources into logical resources, and turn one server into several or even hundreds of isolated virtual servers

Common patterns:

  • One virtual multiple: One server is virtualized into multiple server virtual machines
  • Multiple virtual one: Multiple independent physical servers are virtualized into one server virtual machine

advantage:

  • good security
  • Resource Sharing
  • good scalability
  • easy to isolate
  • High cost performance

2.3.5 Connection method

Software form: install a remote login software in the computer, such as remote desktop

Hardware mode: users do not need a PC, but only need a terminal device the size of a mobile phone, such as a virtual machine terminal

unit work

  1. Compare the advantages and disadvantages CLIof .

    GUI (Graphical User Interface)

    Advantages: Displayed in the form of graphics, intuitive operation, convenient for users to operate and use

    Disadvantages: Need to spend other resources to meet the user's "needs", so it is inefficient for computer system operation

    CLI (Command Line Interface)

    Advantages: save the resources of the computer system, and the efficiency of the computer system is high

    Disadvantages: It is troublesome for ordinary users to use, and the operation is not intuitive

  2. ‌What is a system program? What is an application? Please state your criteria for distinction. In addition, please list 10 WINDOWS system programs.

    System program:

    Programs that directly provide semi-finished products for applications (provide virtual environments for applications to execute) and coordinate multiple applications to run in parallel, running at the bottom of the computer

    application:

    An application program is a computer program developed to run on an operating system in order to complete one or several specific tasks

    Criteria for Differentiation: Service Objectives Provided

    Example Windows system program:

    mstask.exe Windows scheduled task

    regsvc.exe remote registry service

    msgsrv32.exe Windows Messenger Service

    mprexe.exe Windows routing program

    mmtask.tsk multimedia support program

    lsass.exe local security authority service

    kernel32.dll Windows shell

    services.exe Windows Service Controller

    spool32.exe Windows printing task control program

    taskmon.exe Windows Task Optimizer

  3. What are the structures of the operating system? Please give 1-2 examples for each structure.

    Simple structure: MS-DOS, early Unix systems

    Hierarchy: iOSOS, Netherlands Electrologica X8(32K RAM)

    Microkernel: Windows2000, CMUMach

    Module structure: Solaris

    Hybrid Architecture: Mac OS X

  4. What is a virtual machine? What are the benefits of introducing a virtual machine?

    definition:

    A complete computer system that is realized by software simulation, has complete hardware system functions, and runs in a completely isolated environment

    benefit:

    1. Installing a virtual machine can demonstrate the environment, and various demonstration environments can be installed, which is convenient for various examples.

    2. The virtual machine can ensure the fast operation of the host, reduce unnecessary garbage installation programs, occasionally used programs, or test programs run on the virtual machine.

    3. It can help to experience different versions of operating systems, such as Linux, Mac, etc.

    4. It can reduce the occupied space, reduce the cost of purchasing software and hardware equipment, save energy and lower maintenance costs.

    5. The virtual machine can improve the security of the system.

  5. What are the main advantages of adopting a microkernel approach to system design? How do client programs and system services interact in a microkernel? What are the disadvantages of the microkernel approach?

    advantage:

    Easy to extend the microkernel

    Easy to port the operating system to the new architecture system

    More stable (less code runs in core state)

    safer

    shortcoming:

    Increased overhead for user-space and kernel-space communication

    interaction:

    ‏Context switching is required to make system calls to complete tasks

Guess you like

Origin blog.csdn.net/weixin_45788387/article/details/122291667