Operating system (OS) study notes (a)

One. The concept of the operating system

user
application
operating system
Bare metal

The operating system is hardware not software
Operating System Definition:
  refers to the hardware and software resources to control and manage the entire computer system, and reasonable work and distribution organization and scheduling of the computer resources have been available to users and other software convenient interface and environment, he is a computer system is the most the basic system software
II. Operating system capabilities and goals
  1) as a system resource manager
functions:
  1) management processor
  2) Memory Management
  3) File Management
  4) Device Management
objectives: safety and efficiency
  2) as user interfaces and computer hardware directly
provides functionality:
  1) command Interface (allowing the user to directly use the)
    line command interface: a user says a system to do
    offline command interface: the system user to do a bunch said pile
  2) program Interface (through the program allows the user to indirectly)
    by a set of system calls composition (API = system calls)
  3) graphical user interface (GUI)   
target: user- 
  3) as the closest level hardware
functions: to expand the machine's hardware
  analog
   hardware: hammer \ wood \ nails
   operating system: excellent artisans
   make house ordinary users to directly use
III. Four basic features of the operating system
  1. concurrent (of concurrence)
  parallelism refers to two or more events occur at the same time, this is the concept of having a micro sense, i.e., physically these events occur simultaneously;
Concurrency refers to two or more events occur within the same interval of time, it is a more macro-concept. Alternating
  2. sharing (sharing)
  the so-called sharing refers to the system's memory resources available to process multiple concurrent execution of common use. Due to the different properties of the resource, so multiple processes to share resources in different ways,
can be divided into: sharing mutually exclusive: only be assigned to a
      simultaneous access: alternately
  3. Virtual (virtual)
  refers to it by a physical technique entities into a plurality of logical counterparts. Virtual implemented in the operating system, mainly through the use of time-sharing method. Obviously, if n is a virtual logical device number corresponding to a physical device, the virtual speed of the device must be a physical device speed 1 / n.
  4. Asynchronous (asynchronism)
  in a multi-channel programming environment that allows concurrent execution of multiple processes, due to the constraints of resources, generally, the implementation process is not a "one go", but run in "stop and go" approach .
Important test sites:
understanding the difference between parallel and concurrent
concurrent and mutually shared presence of
no concurrency and shared, it is not light on the virtual and asynchronous, concurrent, and therefore share two basic features of the operating system
four .OS development and classification
  stage of manual operation : a paper punch, punch 0 no
     drawback: the user exclusive whole machine
  batch stage
  1) single-batch system: introduction of off input \ output technology (complete tape)
  advantages: ease of man a certain degree machine speed contradictory, resource utilization has improved
  There is only one disadvantage of memory to run, under a program to be transferred only after the end of the program is running, CPU has a lot of time in space waiting for I / O completion. Resource utilization is still low.
  2) Multi-batch system
  operating system was born
  advantages: multi-channel programs concurrently, sharing of computer resources, greatly enhance resource utilization, CPU, and other resources remain "busy" state, the system throughput increases
  drawback: the user response time long, no interactive features (user submits their work can only wait for the computer to complete the processing center can not control their own job execution)
  time-sharing operating systems : computer time as the unit turns for each user \ service jobs, various yoghurt you can be the terminal and the interaction of hormones ah
  advantages: a user request can be a timely response to address the problem of human-computer interaction, allowing multiple users to simultaneously use a single computer, and the amount of user operation of the computer independent of each other, do not feel the presence of others
  shortcomings : You can not deal with some urgent priority task
  real-time operating system
  advantages: the ability to respond to some urgent priority task
  hard real-time: timely analysis of
  soft real-time: not timely nor dubbed the
  network operating system
  distributed operating system
  of personal Computer operating system
in four phases focus on exam before
five operating system mechanisms and architecture.
  Operational mechanism : 1) both instructions: privileged instructions: Do not allow ordinary users to use
            non-privileged instruction
       2) states two treatments:
       1 core state: privilege instruction, non-privileged instructions can be executed
       User mode 0: At this time the CPU can execute non-privileged instructions
       3) two procedures: kernel: system managers can execute in kernel mode operating
           application: nonprivileged instructions can only be executed in user mode runs
  the operating system kernel : clock management
       interrupt handling
       primitives
       of system resources management functions: process management
                     memory management
                     device management
  operating system architecture :
the kernel is the underlying software configuration of your computer, the operating system is the most basic part of the core of
        a large kernel : the operating system the main function of the kernel to run as a module in the core state
        advantages: high energy of
        disadvantages: large kernel code, chaotic structure, it is difficult to maintain
         microkernel : only the most basic function in the kernel retained
         advantages: reduced kernel function, the structural configuration of clarity, Party Maintenance
         Disadvantages: in user mode and switch between mind and frequent, low-performance                   
six interrupt exception
interrupt occurs it means that the operating system involved in
user mode to kernel mode is achieved via an interrupt and the interrupt is the only way
kernel mode to user state by executing a privileged instruction
 1. when an interrupt occurs, CPU core state immediately enters
 2. When the interrupt occurs, the currently running process pauses by the operating system kernel interrupt processing
 3. For a different signal in gradually, would be treated differently
interrupt occurs, it means that the operating system needs to intervene to carry out administration, due to the management of the operating system (such as process switching, assigned I / O devices, etc.) need to use a privileged instruction, from the CPU into the user mode kernel mode. Interrupt the CPU can switch from user mode to kernel mode, the operating system to gain control of a computer, with the interruption in order to achieve multi-channel programs concurrently.
Interrupt Category :
 internal interrupt (internal CPU and the current instruction related):
      Voluntary interruption - instruction interrupt
     forced interrupts: hardware failure
         software interrupts
 and external interrupts (external CPU regardless of the current instruction): peripheral requests
     for manual intervention

NOTE: Another classification interrupt in a
   trap, into (Trap)
   fault (Fault)
    termination (ABORT)
processing external interrupt
1) after each execution instructions, CPU checks if an external interrupt signal
2) if external interrupt signal, it is necessary to protect the interrupted process CPU environment
3) into the corresponding interrupt handler according to the interrupt signal type
4) to restore the original process environment CPU interrupts and exits, returns to the original process to continue down
seven or system call
action : the application requested by the system call operating system services. System in a variety of shared resources by the operating system, unified control, and therefore in the user program, all resource-related operations (such as memory allocation, I / O operations, file management, etc.), must be called by the operating system the way system service request, on behalf of the completion by the operating system. This ensures the stability and security of the system, to prevent users from illegal operation.
Equipment management complete device request / release / start functions
to read the file manager to complete the file / write / create / delete functions such as
process control to complete the process of creation / withdrawal / blocking / wake functions such as
system calls (classified by function)
interprocess communication
memory management
completed message passing between processes / signaling functions
to allocate memory / recovery features such as
1) What is the system call, what role?
 operating system provides an interface to the applications that use the
 application through the system call to request operating system service
 system call good processor from user mode into the core of the
2) Category :Device management,
   file management,
    process control (all operations related resources, will directly affect the operation of other processes, you will need an operating system involved in
the process through the letter needs to be achieved through a system call)
   interprocess communication
    memory management
3) system calls and library the difference between the number of culvert
 system mix is the interface to the operating system of the upper
some library number culvert is a further package system calls
the number of libraries in today's match live mostly written application is provided through high-level language
to ask grounding system with
4) behind procedure call system
1. the delivery system call arguments
2 into the instruction execution
3. execution system filled with a corresponding service application
4 returns the user program

注:以上所有内容作者结合《王道考研》归纳总结
Released five original articles · won praise 25 · views 10000 +

Guess you like

Origin blog.csdn.net/m0_46315852/article/details/104591471