Python Full stack _day2

Source: Internet
Author: User

1. Why do I need an operating system

Computer hardware system is very complex, if there is no operating system, programmers need to consider these hardware details when developing application software, which will greatly increase the development difficulty and affect the development efficiency, multiple software concurrently run the hardware resource preemption, conflict problems, in addition, different computer hardware has a big difference, If the program runs directly on the hardware there will be a compatibility problem, may be on a computer on the normal running software on the B computer running on the crazy. The existence of the operating system solves these problems, he runs on the hardware, encapsulates the hardware into a unified platform, and manages the hardware in an orderly manner, providing a better and simpler operating environment for the application software.

2. Location of the operating system

The operating system is located between the computer hardware and the application software, consists of the operating system kernel and the system call two parts, the operating system kernel runs in the kernel state management computer hardware, the system call runs in the user state provides the operation hardware interface to the application.

3. Functions of the operating system

1. Shielding annoying hardware operation details, so that the development of the application can be more simple and efficient operation of the hardware, to prevent the programmer from excessive brain drop hair.

2. Sometimes multiple applications need to use the same hardware situation, if there is no unified scheduling management, there will be conflicts, the operating system will be unified management of hardware requests to achieve orderly

4. Development of the operating system first generation (1940~1955): Vacuum tubes and punch cards

Background of the first generation of computers:

Before the first generation, humans were trying to replace manpower with machinery, and the first generation of computers was a sign that computers had entered the electronic age from the mechanical age, and since the Babbage failed until the Second World War, the construction of digital computers had barely progressed, and the Second World War had stimulated the explosive progress of computer research.

Professor John Atanasoff of Lowa State University and his student Clifford Berry built a digital computer that was considered the first to work. The machine uses 300 vacuum tubes. Around the same time, Konrad Zuse built a Z3 computer in Dublin Relay, a team from the Bletchley Park in England built Colossus,howard Aiken at Harvard University in 1944 to build Mark 1, William of the University of Pennsylvania Mauchley and his students J.presper Eckert built the ENIAC. These machines are binary, some use vacuum tubes, some are programmable, but are very primitive, it takes a few seconds to complete the simplest operation.

During this time, engineers in the same group designed, built, programmed, operated and maintained the same machine, all programmed in purely machine language, or worse, to control the basic functions of the machine through the wiring of thousands of cable street plug-in boards. There is no programming language (no assembly), and the operating system has never heard of it. The process of using the machine is more primitive, see the following ' work process '

Characteristics:
No concept of operating system
All programming is written in purely machine language.

Working process:
Programmer on the wall when the table appointment for a period of time, and then the programmer took his plug-in version to the computer room, will own the plug-in Board street computers, within a few hours he exclusive access to the entire computer resources, the back of a group of people have to wait (more than 20,000 vacuum tubes will often be burned out of the situation appears).

Then there was a punch card that could write the program on the card and read it into the machine without the plug-in board.

Advantages:

The programmer in the time period of application to enjoy the entire resources, the immediate debugging of their own programs, if there are bugs can be processed immediately,

Disadvantages:

This is a waste to the computer provider (you buy a computer 4000 dollars, that year you use 365 than only 1 days, it must be cost-saving, the use of the most)
You have a computer you rent out, you rent 2 hours at a time, so even if the user has completed the work in the first hour, the remaining 1 hours of your computer is free, and one day you can only rent to 12 people, equivalent to waste 12 hours.

Note: Only one program is in memory at the same time and is executed by CPU calls, say 10 program execution, is serial

Second generation computer (1955~1965): Transistors and batch processing systems

Generation background of the second generation of computers:

Because the computer was very expensive at the time, it is natural to think of ways to reduce the wastage of the machine. The usual method is the batch processing system.

Characteristics:
Designers, production personnel, operators, program personnel and maintenance personnel directly have a clear division of labor, the computer is locked in a dedicated air-conditioned room, operated by professional operators, this is the ' mainframe '.

With the concept of operating system, is the earliest operating system: is the human and computer system, people need to participate.

Programming languages: Fortran or assembly language, written on paper, then punched into a card, then the card cassette into the input room, to the operator, and then drink coffee waiting for the output interface

Working process: Illustrations

The problem with the first generation of computers is:
Too many human-computer interaction (human-Computer Interaction process: input-"calculation-" output)
A person's interaction: input-"calculation-" output

10 Human Interactions:
Input-"calculation-" output
Input-"calculation-" output
Input-"calculation-" output
Input-"calculation-" output
Input-"calculation-" output

How the second generation solves the first generation problem:
1. Save a bunch of people's input into a big wave of input,
2. Then the sequential calculation (this is problematic, but the second generation is not resolved)
3. Save a bunch of people's output into a large wave of output

The predecessor of the modern operating system:

After gathering about one hours of bulk work, the cards were read into the tape and then the tapes were sent to the machine room and mounted on tape. The tapes are then sent to the machine room and mounted on the tape drive. The operator then loads a special program that reads the first job (job, one or a set of programs) from the tape and runs, its output is written to the second tape, and it is not printed. After each job finishes, the operating system automatically reads the next job from the tape and runs. When a whole batch of jobs is finished, the operator goes to the input and output tapes, says the input tape to the next batch of jobs, and takes the output tape to a 1041 machine for offline (not with the main computer), a system that requires ginseng to operate the machine is the predecessor of the modern operating system.

Advantages: Batch processing, saving the machine
Disadvantages:
1. The entire process requires people to participate in the control, the tape to move (between the two villains)

2. The process of calculation is still a sequential calculation-"serial

3. The programmer originally enjoyed a period of time of the computer, now must be unified planning to a batch of jobs, waiting for the results and re-commissioning of the process will require the equivalent batch of other programs to work (which greatly affected the development efficiency of the program, unable to debug the program in time)

Third generation computer (1965~1980): IC Chip and multi-channel program design

Generation background of the third generation computer:

In the early 1960s, most computer manufacturers had two completely incompatible production lines.

One is word-oriented: large scientific computers, such as IBM 7094, are mainly used for scientific calculations and engineering calculations.

The other is character-oriented: commercial computers, such as IBM 1401, are primarily used by banks and insurers for tape archiving and printing services

Developing and maintaining a completely different product is expensive, while different users have different uses for the computer.

IBM tried to meet scientific and commercial computing by introducing SYSTEM/360 series, 360 series low-end machine and 1401 equivalent, high-grade machine than 7094 more powerful, different performance to sell different prices

360 is the first to adopt a (small-scale) chip (integrated circuit) of the mainstream model, and the second generation of transistors using the computer compared to the cost-effective has been greatly improved. The descendants of these computers are still used in the large computer center, which is now the predecessor of the server, which processes no fewer than thousands of requests per second.

How to troubleshoot second-generation computer problems 1:
The card is taken to the machine room to quickly read the job from the card into the disk, so any time when a job ends, the operating system can read a job from the tape, loaded into the empty memory area to run, this technology is called
Simultaneous external device online operation: spooling, which is used for output simultaneously. When this technology is used, it is not necessary to IBM1401 the machine, and do not have to move the tape to move away (the middle two villain no longer needed)

How to troubleshoot second-generation computer problems 2:

The operating system of the third-generation computer has widely applied the key technology of the second generation computer's operating system: multi-Channel technology
Multi-channel technology (see section Seventh):

Multi-channel technology in multi-Dow is a number of programs, multi-channel technology is to solve multiple programs to compete or share the same resource (such as the CPU) of the orderly scheduling problem, the solution is multiplexing, multiplexing is divided into time multiplexing and space reuse.

Spatial multiplexing : divides the memory into parts, each of which is put into a program, so that there is a multi-channel program in memory at the same time.

time Reuse : When a program waits for I/O, another program can use the CPU, and if the memory can hold enough jobs at the same time, the CPU utilization can be close to 100%, similar to the overall approach that we learned in elementary school mathematics.

The most important problem in space multiplexing is that the direct memory of the program must be segmented, which is implemented at the hardware level and implemented by operating system control. If the memory is not split, then one program can access the memory of the other program.

The first loss is security, such as your QQ program can access the operating system's memory, which means that your QQ can get all the operating system permissions.

Second, the loss of stability, a program crashes when it is possible to recycle other people's memory, for example, the memory of the operating system is recycled, the operating system crashes.

The third-generation computer's operating system is still batch-processing

Many programmers miss their first-generation computers and can debug their own programs on the fly. To meet the programmer's quick response, a time-sharing OS appeared

How to troubleshoot second-generation computer problems 3:

Time-sharing operating system:
Multiple online terminals + multi-channel technology

20 clients loaded into memory at the same time, 17 thinking, 3 running, the CPU is in a multi-channel way to handle the memory of the 3 programs, because the customer submitted is generally short instructions and very little time-consuming, the index computer can provide many users with fast interactive services, All the users think they have the computer resources alone

Ctts: MIT has developed a successful, CTSS-compatible time-sharing system on a modified 7094 machine, and the third-generation computer has widely adopted the necessary protection hardware (the memory between the programs is isolated from each other), and the time-sharing system has become popular

MIT, Bell Labs and GE decided to develop a multics that could support hundreds of terminals at the same time (the designers focused on building a machine to meet the needs of all the users in the Boston area), and it was clear that Ctts was going to die.

Later, a computer scientist Ken Thompson, who attended the development of Multics, developed a simple, single-user version of Multics, which was later a UNIX system . Based on a number of other UNIX versions, the IEEE proposes a UNIX standard, POSIX (Portable Operating System interface Portable Operating system Interface), to enable the program to run on any version of UNIX.

Later, in 1987, a small clone of Unix, Minix, was introduced for use in teaching. Finnish student Linus Torvalds wrote Linux based on it

Fourth generation computer (1980~ to date): PC

Slightly

5. Multi-Channel technology

Processing requests from multiple (multiple-way) shared (shared-as-reuse) resources originating from several programs, called Multiplexing, are implemented in two ways:

1. Reuse of Time

When a resource is reused in time, different programs or users take turns using it, and the first program gets the resource used at the end, in the turn to the second ... The third one ...

For example, when multiple programs need to be running on the CPU at the same time, the operating system rotates these tasks at a very short interval, or when a program does not need the CPU temporarily (for example, it is waiting for the hard disk to read), the next task is performed first, because the switching time between tasks is very short, giving the impression that these tasks are running

2. Reuse in Space

Each customer acquires a small subset of resources in a large resource, reducing the time it takes to queue up for resources.

For example, multiple running programs go into memory at the same time, and the hardware layer provides a protection mechanism to ensure that the respective memory is split and controlled by the operating system, which is much more efficient than one program exclusive memory and one queue into memory.

Other resources for space reuse also have disks, and in many systems, one disk saves files for many users at the same time. Allocating disk space and documenting who is using which disk block is a typical task for operating system resource management.

  

Python Full stack _day2

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.