Python full stack development S5 1th day job

Source: Internet
Author: User

The function of programming language and its relationship with operating system and hardware

The role of programming language: Used to define the form of computer programs, programmers use it to write programs, and then control their instructions to the computer, so that the computer to complete the task of human arrangement.

The role of programming language and the relationship with the operating system and hardware: The program is developed in programming languages, and the program must be run on the operating system, that is, the operating system is the running environment of the program. The program does not directly control the computer hardware, it must be issued by the program to the operating system request, through the operating system to control hardware.

Application-"Operating system-" hardware

Application: Refers to a computer program that completes one or more specific tasks, runs in user mode, interacts with the user, and has a visual user interface. Applications are often divided into two parts: the graphical user interface (GUI) and the engine (Engien).

Operating system: A program to manage computer hardware and software resources, but also the core and cornerstone of a computer system. The operating system is tasked with basic tasks such as managing and configuring memory, prioritizing system resource supply and demand, controlling input and output devices, operating networks, and managing file systems. Operating system is to manage all the hardware resources of computer system including software resources and data resources, control program operation, improve human-machine interface, and support other application software, so as to maximize the function of all resources of computer system and provide users with convenient, effective and friendly service interface. The operating system is a large management control program, which roughly includes 5 management functions: Process and processor management, job management, storage management, device management, file management. There are DOS, OS/2, UNIX, Xenix, LINUX, Windows, NetWare and so on, which are common on microcomputer.

Hardware: Computer hardware abbreviation, refers to the computer system by electronic, mechanical and optoelectronic components, such as the composition of a variety of physical devices collectively. These physical devices constitute an organic whole to provide the material basis for the computer software operation according to the requirements of the system structure. In short, the function of the hardware is to enter and store the program and data, as well as the execution program to make the data available in the form. From the appearance, the microcomputer is composed of the host box and the external equipment. The main host box includes CPU, memory, motherboard, hard disk drive, optical drive, various expansion cards, cable, power, etc. external devices include mouse, keyboard, etc.

The operating system is located between the hardware and the program, is a bridge between the two. The program can issue commands through the operating system, and the operating system interprets commands, drives hardware devices, and implements control over them.

cpu-"Memory-" disk

CPU: central processing unit, is an ultra-large-scale integrated circuit, is a computer computing core and control core. It consists of two components, the alu,arithmetic and Logic unit, and the Controller (Cu,control unit). In addition, there are several registers and buffer memory and the bus to realize the data, control and state of the connection between them. It is combined with internal memory and input/output devices as three core components of an electronic computer. Its function is mainly to explain the computer instruction and processing the data in the computer software.

Memory: is one of the important parts of the computer, it is a bridge to communicate with the CPU. All programs in the computer are running in memory. Memory is also known as internal memory, which is used to temporarily store the data in the CPU, as well as with external memory such as the hard disk. As long as the computer is running, the CPU will transfer the data needed for operation into memory and the CPU will transmit the result when the operation is complete. Memory is made up of memory chip, circuit board, Gold finger and so on. It includes random memory (RAM), read-only memory (ROM), and caching (cache). The data is only temporarily saved, and the power loss data is lost.

Hard disk: One of the main carriers for storing permanent data, including solid-state drives (SSD disks, new hard drives), mechanical hard drives (HDD legacy HDD), Hybrid drives (HHD a new hard drive based on traditional mechanical hard drives). SSDs are stored using flash particles, HDDs are stored with magnetic discs, and hybrid drives (Hhd:hybrid hard disk) are a hard disk that integrates magnetic hard disks and flash memory. Most hard drives are fixed hard disks that are permanently sealed and pinned to the hard drive.

There is no direct data transfer between the hard disk and the CPU, and their transmission medium is memory. The CPU reads the data the fastest, the memory is second, the hard disk is slowest.

CPU and register, kernel State and user state and how to switch

CPU and register: Registers are part of the CPU hardware. Registers are high-speed storage parts with limited storage capacity that can be used to hold instructions, data, and addresses. Since the time it takes to access the memory to get instructions or data is much longer than the CPU executes the instructions, there are registers inside all CPUs that hold the key variables and temporary data, which typically provides instructions in the CPU's instruction set. Used to transfer a word (which can be interpreted as data) from memory into a register and to store a word from the register in memory. Other CPU instruction sets can combine operating data from registers, memory, or both to produce a result, such as adding two words and putting the result in registers or memory.

Register Classification: In addition to storing variables and temporary results of the general register; Most computers also have a special register of programmers Courseware, one of which is the program counter, which holds the memory address of the next instruction to be fetched, and the program calculator is updated to execute the later instructions after the instruction is taken out. Another register is the stack pointer, which 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 stored in the register are saved; Finally, a very important register is the program status Word register (WORD,PSW), which contains the bar code bit ( Set by the comparison instruction), CPU priority, mode (user state or Kernel state), and various other control bits.

Kernel state and User Configuration and how to switch: All user programs are running in the user state, but sometimes the program needs to do some kernel state things (such as reading from the hard disk, or getting input from the keyboard). The only thing that can do these things is the operating system, so at this point the program requires the operating system to perform these operations in the name of the program first. This requires a mechanism: the user-state program switches to the kernel state, but does not control the instructions executed in the kernel state, which is called the system call, the implementation in the CPU is called trap instruction (trap instruction). Their work flow is as follows:

1. The user-state program places some data values in registers, or uses parameters to create a stack frame, which indicates that the service required by the operating system needs to be provided;

2. The user state program executes the trap instruction;

3.CPU switch to the kernel state, and jump to the instructions located in the memory at the specified location, these instructions are part of the operating system, they have memory protection, can not be accessed by the user-state program;

4. These instructions are called traps or system call processors (handler). They will read the data parameters of the program into memory and execute the service requested by the program;

5. When the system call is complete, the operating system resets the CPU to the user state and returns the result of the system call.

In addition, the following two conditions can also cause the switch between the kernel state and the user state.

1. Exception: When the CPU executes the program running in the user state, some pre-unknown exception occurs, this will trigger the current running process switch to handle the exception of the kernel-related programs, also went to the kernel state, such as page faults.

2. Peripheral device Interruption: When the peripheral device completes the user requested operation, the CPU will be issued a corresponding interrupt signal, then the CPU suspends execution of the next instruction to be executed to execute the handler corresponding to the interrupt signal, if the previously executed instruction is a user-state program, Then the process of this conversion will naturally occur from the user state to the kernel state switch. For example, the disk read and write operation is completed, the system will switch to the hard disk read and write interrupt handler to perform subsequent operations.

Memory series, L1 cache, L2 cache, memory (RAM), EEPROM and Flash, CMOS and BIOS battery

L1 Cache: A first-level cache, CPU-level cache. Its capacity is unlikely to be too large. The capacity of the general L1 cache is usually 32-256kb. Cached data can only be saved temporarily.

L2 cache: Level Two cache, is the second layer of CPU cache, divided into two internal and external chips. The internal chip level two cache runs at the same rate as the main frequency, while the external level two cache is only half the frequency. L2 cache capacity also affects CPU performance, the principle is that the larger the better, the average desktop CPU L2 cache is generally 128KB to 2MB or higher, laptops, servers and workstations with the CPU L2 cache up to 1MB-3MB. The same data as the L1 cache can only be saved temporarily.

Memory: internal memory, which is used for temporary storage of operational data in the CPU, as well as data exchanged with external memory such as the hard disk. As long as the computer is running, the CPU will transfer the data needed for operation into memory and the CPU will transmit the result when the operation is complete. Memory is made up of memory chip, circuit board, Gold finger and so on. It includes random memory (RAM), read-only memory (ROM), and caching (cache). The data is only temporarily saved, and the power loss data is lost. Capacity 512MB to more than 8GB.

EEPROM and Flash Memory: EEPROM (live erasable Programmable read-only memory) is a user-readable, read-only memory that can be erased and reprogrammed (rewritten) by the action above the normal voltage. In an EEPROM, the computer can be programmed frequently and repeatedly when it is used. EEPROM is a special form of flash memory, and its application is usually the voltage in the PC to erase and re-program. Flash memory is a long-life non-volatile (in the case of a power outage can still hold the stored data information) of the storage, data deletion is not in a single byte units but in fixed chunks, the chunk size is generally 256KB to 20MB. Flash memory is a variant of the electronic erasable read-only memory (EEPROM), unlike the EEPROM, which can be deleted and rewritten at byte level rather than the entire chip, while most of the flash memory chips require block erasure. The flash memory is often used to store settings information, such as the BIOS (Basic program), PDA (personal digital assistant), digital camera, and so on, due to the fact that the data is still saved.

Read speed: L1 cache >>l2 Cache >> memory (RAM) >>eeprom and Flash.

CMOS: A complementary metal oxide semiconductor, usually a chip that holds basic startup information (such as date, time, startup settings, etc.) of a computer. CMOS is a read-write parallel or serial flash chip on the motherboard that is used to save the BIOS hardware configuration and user settings for certain parameters.

BIOS Battery: The motherboard battery is used to record the time of the computer system, that is, to maintain the accuracy of the clock, when the power is not enough, time will go back to the factory date, as well as record the start of the hardware information to use, that is, to maintain the CMOS BIOS information.

Disk structure, average seek time, average delay time, virtual memory and MMU

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 specific circle.

Average delay time: After the picker reaches the correct track, it must wait for the rotation to be under the sector where the data is located, which becomes the delay time.

Tape

Tape: The computer belt, as a digital information storage with a large capacity, low price, slow reading speed advantages. The main mass is used for the computer's external memory device. Now used only on professional equipment (such as computer tape storage, lathe control machine) because of its large capacity, in the earthquake and flood fire, the characteristics of strong mobility, often used for backup (common in large database systems).

Device drivers and controllers

Device driver: Used to communicate the function of the hardware itself to the operating system, and to complete the translation between the hardware device electronic signal and the high-level programming language of the operating system and software. The driver provides a hardware-to-operating system interface and coordinates the relationship between the two. Device drivers are a small piece of code that is added to the operating system, which contains information about the hardware device. With this information, the computer operating system can communicate with the device and operate on it. A driver is a configuration file that is written by the hardware vendor according to the operating system, and it can be said that there is no driver and the hardware in the computer does not work.

Controller: Refers to a predetermined order to change the main circuit or control circuit wiring and change the resistance in the circuit to control the machine start, speed, braking and reverse the main device. It is composed of program counter, instruction register, instruction decoder, timing generator and operation Controller, which is the "decision-making organ" of issuing the command, which is to complete the operation of coordinating and directing the whole computer system.

Bus with South Bridge and North Bridge

Bus: A public communication trunk that transmits information between various functional parts of a computer, which is a transmission harness composed of wires, and according to the kind of information transmitted by the computer, the bus of the computer can be divided into data bus, address bus and control bus, which are used for transmitting, data address and control signal respectively. Bus is an internal structure, it is CPU, memory, input, output equipment to transmit information of the common channel, the host of the various components through the bus connection, external devices through the corresponding interface circuit and then connected to the bus, thus forming a computer hardware system. In the computer system, the common path that transmits information between the parts is called the bus, and the microcomputer is connected with the function parts by the bus structure.

South Bridge: The development direction of the chip is mainly to integrate more functions, such as network card, RAID, IEEE1394, even Wi-Fi network and so on. is an important part of the motherboard chipset, generally located on the motherboard from the CPU socket farther down, the front of the PCI, that is, by the front of the host box, this layout is to take into account that it is connected to the I/O bus more, far from the processor to facilitate wiring, and more easily realize the long wiring principle such as signal line. Compared to North Bridge chip, the data processing capacity of South Bridge chip is not big. The South Bridge chip is responsible for communication between the I/O bus, such as PCI bus, USB, LAN, ATA, SATA, audio controller, keyboard controller, real-time clock controller, advanced power management, etc.

North Bridge: North Bridge Chip is the motherboard on the latest chip from the CPU, this is mainly considering the North Bridge chip and processor communication is the most closely, in order to improve communication performance and shorten the transmission distance. The North Bridge chip is the most important part of the motherboard chipset, also known as the main bridges. In general, the name of the chipset is named after the North Bridge chip name, North Bridge chip is responsible for the connection with the CPU and control memory, AGP, PCI data inside the North Bridge transmission, to provide the type and frequency of the CPU, the system's front-end bus frequency, memory type (SDRAM, DDR, Rdram and Ddrii, etc.) and support for maximum capacity, Isa/pci/agp/pcie slots, ECC error correction, integrated chipset-based North Bridge chip also integrates the display core.

Operating system start-up process

1. Computer power-On

2.BIOS starts running, detects hardware: CPU, memory, hard disk, etc.

3.BIOS read the parameters in the CMOS memory and select the boot device

4. Read the contents of the first sector from the boot device (MBR master boot record 512 bytes, first 446 is boot information, 64 is partition information, last two is flag bit)

5. Read into the bootloader boot loader module According to the partition information, start the operating system

Application Start-up process

Click on the application path, find the application storage location through the operating system hard disk, the hard disk transfer program data from memory to the central processing unit, the CPU logarithm

Python full stack development S5 1th day job

Related Article

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.