"Talking about the Operation System Evolution of the Internet Age"
Beijing Catai Century Technology Co., Ltd. Chief Scientist Chen Wei
The purpose of the operating system is only one, that is to better support the application to run. To some extent, the support provided by the operating system determines the application of the application. With the arrival of the Internet, the application model has changed significantly. These changes have put forward new requirements for the operating system, and will also cause new development of the operating system. This article will briefly introduce how modern operating systems evolve and its important role in future programming practices.
Traditional operating system and window operating system
The traditional application software before the Internet is mostly static links. It is provided by a company. All functions are integrated in the same software. Once the link is, it is impossible to dynamically replace the software modules when running. At that time there were two major functions: first it provides a time-time system to the user; secondly to provide a set of functions libraries. User programs start from the main program, one-step driving software control process, and finally complete the calculation work. The operating system is always in a passive position and serves the user program. Typical examples of such systems include UNIX operating systems in DOS and console mode, as well as most embedded operating systems currently existing.
The window application based on the graphical interface uses different modes to better respond to external events such as keyboards, mouse. The application starts from the main program, one declaration menu, option, window and other user interfaces, the Callback function, and then the application software control process enters called a message pump (Message Pump) A dead cycle, equivalent to controlling the user program to control the operating system. When the user event occurs, the system is then called the user registration reaction function. That is to say, the status of the operating system is first passive. Such systems are generally called messaging-based operating systems, such as Microsoft's Windows and X-Window on UNIX.
People who write the window have known that this news pump in the window software is all, the operating system "Extract the truth" for the user program, this code should become part of the operating system. However, the benefits of this programming evolution are not enough to change the existing operating system model, so the programmer has to "copy the original article", copy this dead cycle to all window programs. In fact, copying, just writing a few lines, wastes a little memory, but there are still many ills of this message pump mechanism. Most external events start from the hardware driver, after thousands of lines of lines, the operating system has been sent to that message pump cycle, and finally because the user program is not interested in those events. The most typical is the mouse movement event, most of which are white waste CPU time. The light is wasteful, and now the hardware speed is now different. However, since the user can customize the event, the response function of the window object may have to handle unlimited number of messages, becoming a boundary, open model, so the window cannot be "object-oriented" in the true sense.
Object-oriented technology In addition to defining a data structure, it is also necessary to define a set of calculations applied to this data structure, such as the virtual function table (V-Table) of the C language, where the number of items of the function table can only be limited . Therefore, the theoretical foundation of the window object model is weak, and the strong support of the programming language is lacking. The historical limitations are increasingly significant. Typical representatives of the "object-oriented" package based on the window object model have Microsoft Foundation Classes. MFC objects will never "plug and play". The user program needs to inherit and extend the MFC object, where the more critical steps are to define messages sent to a window object via the "Message Map). In a given application domain, the user program only sends a limited number of messages to a window object, which is only a limited number of operations. However, in the MFC system, the operation of defining the number of computing is determined by the special macro definition, and it can be determined when the source program is preprocessed. In other words, the MFC object is always half-life, and must be used after the user programmer processing, so the programming model is very complex and cannot adapt to the demand for software factory. Evolution of application models in the Internet
The following is an example of an Internet era application, which includes text, chart, audio, continuous image playback and other functions, see Figure 1. Software modules of each of these features can come from different software developers, they are plug-and-play, dynamically organized in runtime, providing users with a "Sky Seamless" with a composite function application. Perhaps the reader speaks this app that looks like the Internet browser. This is just halfway. In fact, this component-based software engineering technology has already been seen before the Internet era, such as Microsoft's OLE technology can initially support Word and Excel applications in the early 1990s. set. Different, in today's Internet era, component chemical technology can be said to be everywhere. For example, Microsoft's core published Windows XP and Office XP is all using this component technology, all of which are "browser" from Windows Desktop to Word and Excel, which is:
¡ ¡ ¡ ¬¬¬¬ Program is automatically loaded as dynamic components without starting by the user one by one.
¡ ¡ ¡ ¬¬¬¬ Component Support Script Language Control, multiple components can be operated, exchange information.
¡ ¡ ¡ ¬¬¬¬ With the browser as the interactive operation interface, even if the apartment is mastered, it provides a unified standard for program development.
¡ ¡ ¡ ¬¬¬¬ Network resource management, the program is automatically downloaded, and the user is not required.
Figure 1. Example of Internet Applications: Software Module from Different Software Developers Dynamic Organization
In this new Internet application mode, "browser" actually degenerates into a visible or unacceptable "box". In terms of operating system terms, this box is used by operating system terms a executable file, or an exe file; it itself is very simple and cannot provide any application function for users. However, it provides an operational environment for other components, but supplies application functions by other components. All components are made into a dynamic link library, or a DLL file. Because this small "box" is equipped, it is the same for any app, the operating system can naturally be handled, and it is a bit in the operating system. In this operating system, start running such a small executable, usually does not have to access the external memory (such as a disk), so efficiency is high. The first component in the box generally needs to have a function called the main function (main), but the component containing the main function may not be the first loaded component. The main function in this component is in nature of the main function in the user program in the traditional operating system terminology. Readers who are familiar with Java may be associated with the operating system model here is the programming model of the Java virtual machine. Since the application is only written to the component or dynamic link library, the operating system is based on the initiative to operate from the end control program, which is different from DOS or UNIX. The operating system can perform a wide variety of controls for application components such that packaging components can adapt to different operating environment and user requirements. Components Manufacturers often have some special complex requirements for component operating environments, such as whether components support multi-threaded or information encryption, which is difficult to understand and adapt to general users; and many users have different good, such as suspected of viruses, also It is not possible to make a commercial commercial commercial. At this time, the operating system controls the initiative, dynamically generates middleware and constructing component running environments, and can solve these problems well. The operating system uses middleware technology to support and control the operating environment of the application, the key technology of the Internet Age Operating System. With regard to more detailed middleware technology, readers can see the author's "Talking about the Internet Times Programming and Intermediate Parts Technology", not described here.
Hardware device plug and play
The UNIX operating system is unified to the hardware device model, which greatly reduces the number of device driver functions, which reduces difficulty in understanding hardware devices. Unix accesss files and abstains through a specified function table, and specific functions include: Open, Close, Read, Write, IOCTL, etc. It can be said that UNIX file model is one of the first successful application examples of an object-oriented model. In the case where there is no way to obtain any information about the specific hardware, the operating system can only control hardware devices through "side-effect" to read and write files, such as: Opening a special name file, actually establishing Access to the mouse. But this method has not been completely solved. All access to the mouse is carried out in the form of file read or write, so it is inevitable. Read the 100th byte of a factory's mouse "File" is equal to reading the X coordinate of the mouse; the 100th byte of the mouse "file" in another manufacturer may be Y coordinates. The third mouse also added a roller wheel. These issues are unable to solve in the original model.
After all, in the past 30 years, people's understanding of objects, components, and middleware are already today. The Internet era requires the hardware device to be plug-and-play, and the light relying on "side effects" is impossible to distinguish the printer and the optical disk. The solution can only be added to the driver object to add non-executable description information, which is usually the metadata (Metadata), which can "tell" what characteristics and functions are there. The metadata can be in XML form, binary or both. We know that the object plus metadata is the component. The operating system can generate an intermediate according to the metadata in the component. This middleware dynamically generated in the core is a "bridge" connecting the driving component and the user program, and this "bridge" is the kernel is dynamically generated according to the metadata of the hardware device. At this time, the new operating system is still "not" Changes in a change. For example, metadata of a VCD machine shows that it can have four operations, which are represented by "delivery", "stop", "fast forward", "fast retreat". Operating systems and browsers can draw these four word groups on the screen, but do not need to know their meaning. When the end user clicks on "release", this action information passes through the "bridge" to the drive component, and the VCD machine is actually moved! This is not because the operating system "supports" a model of VCD machine, but because the operating system and the VCD machine follow the components of the hardware drive mode. Imaginary Another VCD machine supports 5 actions, operating systems and playback software (browser) do not modify the motion? Architecture is flexible by fixing
To date, the operating system architecture is roughly divided into two: Monolithic Kernel and Micro Kernel. The traditional large kernel operating system implements graphics, device drivers, file systems, etc., in the operating system kernel, run in the kernel state, the same address space. The advantage is to reduce the system overhead of inter-process communication and status switching to achieve better operating efficiency. The disadvantage is that the kernel is huge, more resources, is not easy, and once the individual drivers run error, it will cause the entire system to crash, stability, and safety. In contrast, the micronucleuclear in the kernel realizes the basic functions that must be realized by kernels, and put graphics, file systems, device drivers, communications and other functions outside the kernel, as system services to provide corresponding service functions, these The program runs in the user state. The advantage of this is that there is a refined kernel for easy cutting, transplantation. Since the system service program runs in the user address space, the error of individual drivers does not cause the entire system to crash. The disadvantage is that frequently switched frequently in the running user status and kernel state, which will cause a reduction in system efficiency.
Due to components, middleware technology, the component running environment can be used to transparent to user and component manufacturers, and ratio, if components can not be modified, running in different address spaces. In the future component system, you can view the kernel address area of the operating system as a special address space. According to the user's needs, some sources are trusted or configured on the driver of the running efficiency requirement to the kernel. Other less stable drivers are placed in a user state, and a special requirement for stability, security and real-time. In such an architecture, we don't have to distinguish between the large kernel or the microner. In fact, the so-called "kernel" can be large, fully determined according to the needs of the system itself. We call this operating system architecture as "Agile Kernel". Beijing Catai Century company first proposed the "Flexible Nuclear" structure and has been in trial to use components and middleware techniques to solve the long-term, and micro-kernels in performance, efficiency. There is no contradiction between the two, see Figure 2.
Figure 2. Flexible kernel technology
Browser becomes a unified user interface
In the network application era, the browser is more than just an interface to display the web page information. In addition to displaying graphics and text, it also needs to include other functions, such as explaining information about the network page, and completing the underlying system software to complete processing work. During this process, the work that often needs to mobilize other resources. The combination of the browser and component technology, especially the direct explanation of metadata in the component, is often referred to as "browser engine). The browser engine will become a powerful tool, which can easily implement a colorful user interface, complete the functionality that is usually available to the traditional desktop system. For example, explain the content of the web page or launch the application component, display it to the user on any platform or device; support the network standard widely used by the industry, support the general page description language, scripting language, resource description language, etc .; Language can develop cross-platform, cross-devices, user interfaces; through cross-platform components, middleware object models, to achieve scalable graphics architectures. For example, support the same user graphics software to complete the remote graphics function (similar to X-window) or high-speed graphics displayed in the same process. The same user graphics component code may not be modified, running in the hardware or desktop page, see Figure 3. Figure 3. The same binary PDA component code can run in the PDA hardware or desktop
Operating system support for XML
XML Text Description Language is a wide range of use of the Internet Age's operating system. Seeing the XML on the surface is a new type of information that is more generally broader than the web page description language HTML. It can be carefully analyzed that each tag (TAG) of XML can be defined by the user, and the label is paired, and this grammar is almost exactly the same as the LISP language in more than 40 years. It is not difficult to see that XML is actually a functional orientation of functional oriented. XML compared to binary files and general text files, XML tabularly taking into account the processing efficiency of human readability and computers. From the requirements of component technology for data formats, XML unified the description of data and remote function calls transmitted on the network, such as IBM's active SOAP (Simple Object Access Protocol). If HTML describes "how to display" information, XML describes how to "this is what" information, as for how to display another thing. XML's information in any message is described, and we call such messages as self-description messages. Due to self-description messages, different interpretations can be made according to different national languages, different operating systems, different software versions, or different security protocols.
XML has become a standard for Internet information exchange, and future operating system kernels will be the most effective support for XML. There is a large number of naming server daemons (daemon process) in the network and distributed operating systems, which are running on servers such as HTTPD, TCP / IP, FTPD, Telnetd, which are running in a user state, in a waiting state. . When the client program is accessed to a particular TCP / IP port, the corresponding server starts to deal with the (for). Such a large number of binary protocols is open to the outside, and there are some hidden dangers. They all can unify the support of the XML Remote Function call function, which can be replaced with an HTTPD server. All requests are sent to httpd in XML format, and create a corresponding server process deal with by HTTPD according to the type of request. On the surface, the operating system may not be as high as the HML, but the kernel does not have to avoid unnecessary address space switches, which greatly reduces the memory consumption of many daemon, and thus increases the security of the system, reliable Sex and running efficiency. Microsoft's Microsoft.net is the design of the operating system in accordance with this idea. We can summarize the transfer of the network era application and the development of operating system technology into Figure 4.
Figure 4. Development of the operating system technology of the Internet
The development trend of Internet technology is: desktop applications are transferred to network application, from online not only general information, but also programs, interactive applications. The new network application environment has brought new computing models: the application is combined by multi-manufacturers; cross-platform, cross-devices network application model; browser into a framework, platform, and attending a combination It is also an operation interface that provides the same user experience, intelligence interaction, unified.
As the assembly technology is getting more and more perfect, people have gradually recognized the huge potential of component technology. The conditions and techniques of factory software production have been mature. In order to meet the requirements of the new era, the concept of operating system is experiencing a major change in "海 田", the next generation of operating system comes out. These changes will bring an unprecedented development space to the computer software, and the huge business opportunities contained in it are attracting major software companies. They have proposed their own specialties, and Microsoft's .NET and Sun Java are the most Those who are conspicuous. In the early stages of this new round of breakthrough development, can China Software use this opportunity to squeeze into the runway? Let's do our best together.