[Experiment 5] How does the Linux operating system work?

Source: Internet
Author: User

  • [Experiment 5] How does the Linux operating system work? Cracking the mysteries of the Operating System
    • Operating system work basis: storage program computer, stack (function call stack) mechanism and interrupt mechanism
    • On the basis of operating system work, please briefly describe how the Operating System (kernel) works, macro overview combined with the microscopic analysis of key points (CS: EIP, EBP/ESP, etc.)
    • Complete a summary text of about 500 words (must be written by yourself), and attach study notes. In addition, please develop the habit of respecting intellectual property rights to reference or refer to other people's documents to indicate the source URL
    • Submit the lab report as a blog URL. Submit the address. Submit the lab 5 portal.
    • Please submit the lab course before this Thursday. The latest submission date is, January 1, June 30.
  • Additional Experiment: write your own OS Kernel (process management and process scheduling)
    • Experimental environment see: https://github.com/mengning/mykernel

  • Stack (function call stack) Mechanism
    • Take calling function f (x, y, z); As An Example
      • First: z-in-stack, y-in-stack, and x-in-Stack
    • Second: next address
    • In the new process, ebp is added to the stack. Therefore, in the new process, 0x8% ebp is the first parameter, 0xc % ebp is the second parameter, and 0 x 10% ebp is the z parameter.
    • Last: leave and ret;

      Ret is equivalent to pop eip, and the returned status is now

  • Interruption Mechanism
    • In general, interruption means "interruption", letting go of what you are doing, and turning to other things.
    • The "interrupt mechanism" is the policies that interrupt me and tell me to do other things.
    • In linux, after the CPU executes a command, the logical address of the next command is stored in the registers cs and eip. Before executing a new command, the control unit checks whether there is any interruption or exception during the execution of the previous command. If yes, the control unit will drop the command and enter the following process:
  • Operating System (kernel) Working Principle
    • In a broad sense, kernel is a software that provides a layer between hardware and applications running on computers. Strictly speaking, from the perspective of computer science, Linux's Kernel refers to the code written by Linus Torvalds in the early 1990s S.
    • Kernel functions: process scheduling, file system, storage management, module management, and Performance Tuning
    • Its work is also inseparable from the CS: EIP, EBP/ESP registers. What the kernel does is to re-Modify and restore these values.
  • Personal Summary
    • The LInux OS system analysis course gives me a deeper understanding of the underlying operating system. Operating systems that have previously been studied in undergraduate courses are generic learning operating systems and various functions provided by their kernels, such as various management systems. At that time, the operating system was a "big manager" in my eyes. If I had a deep understanding of the operating system, we became half a manager.
    • From Lab 1 to Lab 5, this question has always been around us: "How do we work? ".
      • From a hardware macro perspective:
      • From the software perspective:
      • In general, "How do I work? "
      • User-layer init sets the running level based on the inittab File
  •  

    • Additional lab
      • (To be completed)

     

    Reference link:

    • Http://zh.wikipedia.org/wiki/%E5%AD%98%E5%82%A8%E7%A8%8B%E5%BA%8F%E8% AE %A1%E7% AE %97%E6%9C%BA
    • Http://www.kerneltravel.net/journal/viii/01.htm
    • Http://soft.zdnet.com.cn/software_zone/2009/0327/1359774.shtml
    • Http://www.weiguolv.com/info/2005-1/200511642611.htm
    • Http://www.xuexila.com/diannao/rumen/3543.html
    • Http://soft.chinabyte.com/ OS /325/12254325.shtml

    Link to this article:

    • Http://www.cnblogs.com/kaimin/p/how-does-linux-operating-system-work.html

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.