Python Full Stack road Day1 (complement)

Source: Internet
Author: User
Tags time and date

September 18, 2017 0:20:28

Summary
I. Introduction to COMPUTER HARDWARE
Two. Computer startup process
Homework
Summary today

Summary

reference: Eastern Vietnamese Move Blog

    1. Due to poor early notes collation, so start to organize notes and daily upload to blog.
I. Introduction to COMPUTER HARDWARE
  • Concept: A bus connects CPUs, memory, and I/O devices and communicates with other devices. CPU is responsible for operation, memory is used to store temporary variables, hard disk is used to store data

    1. Processor CPU (Register + Controller)
        • execute until the end of the program.
      1. Universal Registers : Used to save variables and temporary results
      2. Program Counter : It holds the memory address of the next instruction that will be taken out. After the instruction is removed, the program calculator is updated to perform the later instructions
      3. stack pointer Register : it points to the top of the current stack in memory. The stack contains a frame in each of the processes that have entered but have not yet exited. In the stack frame of a procedure, the relevant input parameters, local variables, and temporary variables that are not saved in the register are saved. (Knowledge Supplement: 1. Stacks: Like placing folded clothes into a box, one piece into the box, followed by the LIFO principle, like taking the first piece of clothing out, must start from the last one, until the first one is taken out. 2. Queue: Just like line swipe out of the door, follow the first-out principle, a queue, must be the first line of people swipe to go first
      4. Program Status Word Register (PSW): This register contains the bar code bit (set by the comparison instruction), CPU priority, mode (user state or Kernel state), and various other control bits. The user usually reads the entire PSW, but writes only a few of the fields
      5. kernel State and user state :
        • The program status Word register has a bits control in both modes (0, 1)
        1. Kernel state: When the CPU is running in the kernel state, the CPU can execute all the instructions in the instruction set, it is clear that all of the instructions contain all the functions of using the hardware, (the operating system runs in the kernel state, so that the entire hardware can be accessed)
        2. User status: The user program runs in the user state, only can execute a subset of the entire instruction set of the CPU, which does not contain the part of the operation hardware function, therefore, in general, in the user state about I/O and memory protection (the operating system occupies the memory is protected, can not be occupied by other programs), of course, In the user state, it is forbidden to set the mode in the PSW to the kernel state.
        3. Kernel State and User state switching: Software operating under the user's condition cannot operate the hardware, but our software, such as Storm Audio, must have the need to operate the hardware, such as reading a movie file from disk, it must go through the process of switching from user state to kernel state, for this reason, the user program must use System Call), the system calls into the kernel and invokes the operating system, the trap instruction switches the user state to the kernel State, and enables the operating system for service
        • The first-level cache L1 in the CPU is the register. Second-level cache L2 for communication between multicore CPUs, access speed wall access memory faster
    2. Memory

      • The register is the L1 cache and the cache is L2
      1. Cache Hit: Cache hardware checks if the cache line required is in the cache and, if it is, the cache hit
      2. Memory RAM: All data disappears after power loss, volatile storage
      3. ROM: Read-only memory is programmed in the factory and can no longer be modified
      4. Flash: Like a solid-state drive, not as fragile as a mechanical hard drive, but too many erase times will damage
      5. CMOS storage: Built-in a small battery, mainly used to record time and date parameters, but also save some other parameters, into the record which is the system disk and so on
    3. Disk

      1. Sector: Mechanical hard disk, a small segment of a circle in a disc
      2. Average seek time: manipulator arm from a cylinder randomly moved to the adjacent cylinder time to find the time, found the track is to recruit the data in the circle, but do not know the specific location of the data this circle
      3. Average delay time: After the picker has reached the correct track, it must wait to rotate to the sector where the data is located, which becomes a delay time
      4. Virtual memory: Used to run a program larger than physical memory, from a mechanical hard disk to split a piece to temporarily run memory temporarily do not need but will run instructions, in Linux to become swap, the core of this mechanism is to quickly map the memory address, by a component in the CPU is responsible for the memory management Unit (MMU)
    4. Tape
      • High capacity, inexpensive but low speed, typically used for backup (common in large database systems)
    5. Bus
      1. North Bridge PCI: Connect high-speed equipment
      2. South Bridge ISA: Connecting slow devices
Two. Computer startup process
    • Operating system startup process
      1. Computer power-On
      2. BIOS starts to run, detects hardware: CPU, memory, hard disk, etc.
      3. The BIOS reads the parameters in the CMOS memory and selects the boot device
      4. Reads the contents of the first sector from the boot device (MBR master boot record 512 bytes, first 446 for boot information, 64 for partition information, and last two for flag bit)
      5. Read into the bootloader boot loader module According to the partition information, start the operating system
      6. The operating system then asks the BIOS for configuration information. For each device, the system checks to see if the device driver is present and, if not, asks the user to install the device driver.
    • Application initiation Process
      Pending additions
Homework
    • Not currently
Summary today
    • The concepts related to ' processor ', ' memory ' and ' disk ' are mainly
      1. How CPU, memory, and hard disk work
      2. CPU and register
      3. Kernel state in user mode and conversion mechanism
      4. L1,L2 cache, RAM, Flash, CMOS
      5. Disk structure, seek and delay time
      6. Virtual Memory and MMU
    • Operating system startup process and application start-up process should be clarified
    • Today is mainly to collate hardware related concepts, but also to further strengthen the memory during the day, after all, the Haifeng teacher said the foundation is not good, should go home to farm, tomorrow refueling.

Python full stack path Day1 (complement)

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.