A Brief History of computers (Operating System)

Source: Internet
Author: User

Introduction

There is no software written by humans. It is so important that its appearance has profoundly affected the entire process.ProgramIt can be said that the history of an operating system represents the development track of the program world to a great extent.

Essentially, an operating system is no different from other software. It is logic + data, and then it is so important that people separate it from other software.

The operating system is called system software, and other operating system-based software is called application software.

However, this division often brings confusion and fear to beginners, so that they do not dare and are unwilling to treat ordinary software with a normal mind. This is very bad.

Before the official start

Whether you believe it or not, all software functions can be implemented by hardware, just like building blocks. hardware is like a simple triangle, a circular block. software uses those triangles, the circle is like a house, a car, and a simulated world.

Software is actually a process of building blocks. If one day you want a house and someone provides you with a building block (hardware ), then the assembly process (software) will no longer need it.

The significance of software is that our technology is limited and hardware cannot provide a complete building block. We can only use software to assemble scattered building blocks.

 An operating system is a software, and an application is also a software.

The relationship between them is similar to that between languages and compilers in advanced languages.

Reference: http://blog.csdn.net/only_lonely/archive/2010/03/16/5386552.aspx

Application Software: Buddy, let me talk to the hard disk for help. I want XXX files->Abstract semantics unrelated to machines

The operating system said to the application software: Okay, please wait.->Abstract semantics unrelated to machines

The operating system said to the hardware: the hard disk number is 9527, turning your disk in three and a half turns ......->Specific semantics related to machines

When the hardware operation is complete

The operating system said to the application: "You want to file here, please take it"->Abstract semantics unrelated to machines

The fact is so simple

Note:

The core of an operating system is to abstract hardware details and serve higher-level software. This is the essence of the system.

The so-called process, thread, memory management, system and application software layering are just a concept and behavior method created by the operating system to better complete the task.

In order to make you better understand and understand the core of the operating system, please ignore and ignore those complicated concepts. Okay, now we have an operating system, which is pure, operating systems without a trace of impurities, no processes, no threads, no damn memory management, no damn R3 and R0, all they have is a thing called interruption, okay ~ All the delays have ended. Let's get started.

1. The operating system is dead!

In the eyes of many people, the operating system is dynamic and energetic. It is everywhere, always running, always ready to provide services for you.

In fact, this is an incorrect understanding. To understand this error, you need to start with the CPU usage method.

Not long ago, on each of our computersThere is only one CPU, and each CPU can only do one thing at a time.

You can imagine what the operating system will do when the CPU is processing your application?

The answer is simple., Operating systemCodeNot running, it just lie quietly there, like a corpse

Note: the operating system is not a ubiquitous manager as many people think. It only runs as needed.

Does the operating system only run when needed?

What is needed?

When an application or hardware calls it, there is a hardware-supported way to "interrupt" and efficiently implement the application (hardware) to call the Operating System (hardware) service.

What is interruption? Baidu, you will know that if you treat it as a function call, I don't mind very much

Http://baike.baidu.com/view/121718.htm

Okay, now we have a dead operating system. When you call it, it serves you. When you never call it (this is possible ), it will never be executed. This is the simplest operating system (which has been eliminated now, but actually exists in history), with no threads, no processes, and no damn memory management, you see, everything can be as simple as you want.

See the following simple code.

While (true)

{

// Do something bad

}

In our only "pure" operating system, such application code will be a disaster and your machine will be paralyzed,

Undoubtedly, this is not good ~

In addition, the development of the operating system can be considered as simply to better solve the troubles caused by the above Code.

Yes, that's right!

 While (true)

{

// Do something bad

}

This is a magic piece of code. The evolution of the operating system is to slow down and reduce the cup brought by the above Code ~

Second, let the body move.

As mentioned above, the operating system is like a corpse. You don't want to interrupt it, but it will never change.

So how can we make bodies (Operating Systems) Move like normal people?

It's very simple. Just keep using interruptions to stimulate it,

Thanks to the omnipotent computer, there is a kind of interruption in the world called time interruption.

What is time interruption?

It is to trigger an interrupt at a fixed time, interrupt the execution sequence of the CPU, and execute the code of the operating system.

Well, now it's okay ~ The body has been moved.

But what is the purpose of a moving corpse?

Let's take a look at the Magic Code.

While (true)

{

// Do something bad

}

When your computer is stuck in the above Code, the operating system has the opportunity to break the CPU ownership through time interruption, so that it has the opportunity to terminate the wrong program, or schedule another program to run.

Schedule another program to run

I hope readers will not ignore this sentence,ArrangementIt's a verb. It's something a person can do, not something a corpse can do. Through time interruption, a corpse-like operating system, we can do something that a person can do, what is this in medicine? What are the dead?

This is one aspect of the problem, and the other aspect is"Another program is running.", Um ~ Interesting,

Make a vicious assumption that if your computer cannot read novels while listening to music, you cannot listen to music when typing, and you cannot browse webpages when hanging up on QQ, would you like to drop your computer and buy another one? (If I were, I would have that impulse) the CPU could only run one program at a time. It was with time interruptions and fast switching that made our computer look like this, it seems that multiple programs can be run simultaneously

Next, we will introduce a memory concept.

Don't be afraid. Here we will talk about a basic concept of memory.

Memory is a place where program code and data are stored, allowing the CPU to access and operate

Well, back to the previous topic, the interruption of time creates the illusion of multitasking, which can make the computer seem to be able to run multiple programs at the same time.

There is only one problem. Where are the multiple running programs stored?

They are stored together with the operating system (the operating system is also a software) inSameMemory

Let's take a look at the sad code.

While (true)

{

//Do something bad

}

The while (true) problem is solved through time interruption, but what about do something bad?

You know,All programs, including the operating system, are stored in the memory.

If do something bad happens to give the content in the memory where the operating system code is locatedDamageDrop

What will happen when the next time the interruption falls?

2012 ......

Three breads, ~ Cheese, too.

If there is something in this world that allows every application to run independently without interference,

If there is something in this world that makes it impossible to destroy the memory of other applications even if the application is poorly designed and messy.

Yes, it's not an illusion. It's something that actually exists. It's a collection of technologies. In general, we call itVirtual MemoryTechnology.

Well, there is bread and cheese. For a moment, the world has become better, isn't it?

For details about the implementation of the virtual memory technology, please write another 5000 words.

If you are interested, you can use Baidu or Google

It is worth mentioning that the ing from virtual memory addresses to real memory addresses is provided by hardware ~

Abstract hardware and provide better interfaces for applications. This is the responsibility of the operating system, but now it is done by hardware. This proves again that,There is no clear boundary between hardware and software.

For entertainment purposes, let's take a look at the Magic Code.

While (true)

{

// Do something bad

}

You can add code that you think is tricky enough in do something bad, and test whether it can kill your operating system.

Four-point statement

This article is not a rigorous paper, but a rough description of the development history of the operating system from one aspect. This article does not involve many concepts,, as long as you grasp the core of the Operating System-"abstract hardware to provide more convenient interfaces for Applications", from here on, do not be afraid, everything will be very simple

5. A small example in Windows

When you press the key on the keyboard, the keyboard (hardware) triggers an interrupt, the operating system runs, retrieves which key is pressed, and then sends the key information to the message loop of the currently activated window, then, when the program runs (Time is interrupted), the message is retrieved from the message loop, identified, and processed ......

 

Only_lonely original, you are welcome to reprint, please be sure to indicate the source

if you are casual, I will be grateful and willing to accept it.

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.