WO2016101519A1 - Method and device for realizing restart of operating system - Google Patents

Method and device for realizing restart of operating system Download PDF

Info

Publication number
WO2016101519A1
WO2016101519A1 PCT/CN2015/079406 CN2015079406W WO2016101519A1 WO 2016101519 A1 WO2016101519 A1 WO 2016101519A1 CN 2015079406 W CN2015079406 W CN 2015079406W WO 2016101519 A1 WO2016101519 A1 WO 2016101519A1
Authority
WO
WIPO (PCT)
Prior art keywords
operating system
file
kernel
module
restart
Prior art date
Application number
PCT/CN2015/079406
Other languages
French (fr)
Chinese (zh)
Inventor
陈彬
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016101519A1 publication Critical patent/WO2016101519A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating

Definitions

  • the embodiments of the present invention relate to operating system technologies, and in particular, to a method and apparatus for implementing an operating system restart.
  • the restart process of the operating system is divided into two phases: the boot phase and the kernel phase.
  • the booting phase devices such as a memory controller, a storage device, and a bus bridge, which are related to booting an operating system, are mainly detected by a firmware such as a boot chip, and then the kernel of the operating system is loaded and enters the kernel stage.
  • the kernel phase the kernel sets up the required data structures, detects all devices on the operating system, loads the drivers needed by the device and initializes the device, and finally performs user-level initialization.
  • restart time of the operating system For computing devices used in critical applications, longer reboot times reduce availability, affecting the user experience of computing devices, and sometimes even significant economic losses. At present, reducing the restart time of the operating system has received more and more attention.
  • One way to reduce the restart time of the operating system is to shorten the operating system restart time by quickly recovering important data stored in the operating system by the operating system during the kernel phase.
  • Another method is to shorten the operating system restart time by skipping the detection device and directly loading the kernel during the boot phase.
  • the above method for reducing the restart time of the operating system shortens the restart time of the operating system in different ways.
  • the complexity of the operating system such as the complexity of the types of devices managed by the operating system, causes the operating system to restart.
  • it is still long or even unacceptable. Therefore, the market needs to further reduce the restart time of the operating system.
  • An embodiment of the present invention provides a method for implementing an operating system restart, including:
  • the method further includes: reading the device parameter description file from the operating system file.
  • the method further includes: initializing a loading environment required to load the kernel.
  • the loading environment required to initialize the loading kernel includes at least: prohibiting the operating system from responding to the interrupt; and clearing the cache and the fast table of the computing device.
  • the loading the kernel includes: loading the kernel with at least the first starting position and the second starting position as parameters.
  • the embodiment of the invention further discloses an apparatus for implementing an operating system restart, which comprises at least an analysis unit and a preparation unit, wherein
  • the parsing unit is configured to read the kernel image file and the root file system file from the preset operating system file, and read the device parameter description file from the current operating system;
  • the preparation unit includes a shutdown module, a restart module, a save module, and a load module, wherein
  • Load the module set to load the kernel from a fixed location.
  • the parsing module is further configured to: when the device parameter description file fails to be read from the current operating system, read the device parameter description file from the operating system file.
  • the external interface includes at least a network interface.
  • the management device is a watchdog chip.
  • the preparation unit further includes an initialization module, configured to initialize a loading environment required to load the kernel.
  • the initialization module is specifically configured to: prohibit the operating system from responding to the interrupt; and clear the cache and the fast table of the computing device.
  • the loading module is specifically configured to: load the kernel by using at least the first starting position and the second starting position as parameters.
  • the technical solution provided by the embodiment of the present invention reads a kernel image file and a root file system file from a preset operating system file, and reads a device parameter description file from a current operating system;
  • the external interface of the computing device and the management device for resetting the computing device; restart the current operating system, save the kernel image file in a preset fixed location in the memory, and save the root file system file and the device parameter description file in the
  • the first starting position and the second starting position of the applied memory are loaded, and the kernel is loaded from the fixed position.
  • the process of the firmware detecting device in the booting phase is omitted; on the other hand, the reading efficiency is improved by simultaneously reading the required files from the operating system file and the current operating system; Moreover, by loading the kernel from a fixed location in memory, the efficiency of loading the kernel is improved. It can be seen that the embodiment of the present invention improves the restarting efficiency of the operating system from various aspects, and greatly reduces the restart time of the operating system, thereby better satisfying the market demand.
  • FIG. 1 is a flowchart of a method for implementing an operating system restart according to an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of a device for implementing an operating system restart according to an embodiment of the present invention.
  • FIG. 1 is a flowchart of a method for implementing an operating system restart according to the present invention. As shown in FIG. 1 , the method includes:
  • Step 101 Read the kernel image file and the root file system file from the preset operating system file, and read the device parameter description file from the current operating system.
  • the operating system file can be a software package of the Linux operating system; the kernel image file, such as a Linux kernel image file, is used to boot the kernel; the root file system file, such as the root file system of the Linux operating system, is used to boot The root file system is loaded in the kernel; the device parameter description file, such as the device parameter description file of the Linux operating system, is used to initialize the device in the boot kernel.
  • the kernel image file such as a Linux kernel image file
  • the root file system file such as the root file system of the Linux operating system
  • the root file system is loaded in the kernel
  • the device parameter description file such as the device parameter description file of the Linux operating system
  • the operating system saves the device parameter description file in the memory. Therefore, the specific implementation of reading the device parameter description file from the current operating system includes: obtaining the starting position of the memory saving device parameter description file, according to the obtained starting position. Read the device parameter description file.
  • step 101 further includes: reading the device parameter description file from the operating system file.
  • the current operating system does not save the device parameter description file to the memory.
  • the device parameter description file can also be read from the operating system file. Thereby further improving the stability of the method of the invention.
  • Step 102 Shut down an external interface of the computing device where the operating system is located, and a management device for resetting the computing device.
  • the external interface includes at least a network interface, and may also include an external interface such as a Bluetooth interface.
  • the network interface is closed to avoid the information received from the network interface during the restart, such as the network packet interference restart process, thereby improving the stability of the embodiment of the present invention.
  • the management device is a watchdog chip. In this way, the watchdog chip reset computing device is avoided, thereby preventing the firmware from being activated and detecting the device.
  • Step 103 Restart the current operating system, save the kernel image file in a preset fixed position in the memory, and save the root file system file and the device parameter description file in the first starting position and the second starting position of the requested memory. And load the kernel from a fixed location.
  • the memory in this step refers specifically to the kernel state fixed memory, that is, the memory space dedicated to storing the information specified by the kernel.
  • the loaded kernel controls the computing device, so that the restart process enters the kernel phase.
  • the method further includes: initializing a loading environment required to load the kernel.
  • the loading environment required to initialize the loading kernel includes at least: prohibiting the operating system from responding to the interrupt; and clearing the cache and the fast table of the computing device.
  • the cache is a cache in a central processing unit (CPU) in the computing device;
  • the fast table is a cache in a memory management unit (MMU) in the computing device.
  • MMU memory management unit
  • the loading of the kernel in step 103 includes: loading the kernel with at least a first starting position and a second starting position as parameters.
  • the parameters of the loading kernel also include the kernel's command line parameters such as the default print level of the kernel log.
  • FIG. 2 is a schematic structural diagram of a device for implementing an operating system restart according to an embodiment of the present invention, which includes at least an analysis unit and a preparation unit, where
  • the parsing unit is configured to read the kernel image file and the root file system file from the preset operating system file, and read the device parameter description file from the current operating system;
  • the preparation unit includes a shutdown module, a restart module, a save module, and a load module, wherein
  • the module is turned off, set to shut down the external interface of the computing device where the operating system is located, and the management device used to reset the computing device.
  • the external interface includes at least a network interface; the management device is a watchdog chip.
  • the save module is set to save the kernel image file in a preset fixed position in the memory, and save the root file system file and the device parameter description file in the first start position and the second start position of the requested memory.
  • Load the module set to load the kernel from a fixed location.
  • the loaded kernel controls the computing device, so that the restart process enters the kernel phase.
  • parsing module is further configured to: when the device parameter description file fails to be read from the current operating system, read the device parameter description file from the operating system file.
  • the preparation unit also includes an initialization module that is set to initialize the loading environment required to enter the kernel phase. specifically,
  • the initialization module is specifically configured to: disable the operating system from responding to the interrupt; and, to clear the cache and the fast table of the computing device.
  • the loading module is specifically configured to load the kernel by using at least a first starting position and a second starting position as parameters.
  • the method and device for implementing an operating system restart are implemented by using a software implementation, reading a kernel image file and a root file system file from a preset operating system file, and reading from a current operating system.
  • Device parameter description file close the external interface of the computing device where the operating system is located, and the management device for resetting the computing device; restart the current operating system, save the kernel image file in a preset fixed location in the memory, and copy the root file system file
  • the device parameter description file is saved in the first start position and the second start position of the requested memory, and the kernel is loaded from the fixed position.

Abstract

A method and device for realizing restart of an operating system, which are implemented based on software. The method comprises: reading a kernel image file and a root file system file from a pre-set operating system file, and reading a device parameter description file from the current operating system (101); shutting down an external interface of a computing device where the operating system is located, as well as a management device for resetting the computing device (102); and restarting the current operating system, saving the kernel image file in a pre-set fixed position of a memory, saving the root file system file and the device parameter description file in a first start position and a second start position of an applied memory, and loading a kernel from the fixed position (103).

Description

一种实现操作系统重启的方法和装置Method and device for realizing operating system restart 技术领域Technical field
本发明实施例涉及操作系统技术,尤指一种实现操作系统重启的方法和装置。The embodiments of the present invention relate to operating system technologies, and in particular, to a method and apparatus for implementing an operating system restart.
背景技术Background technique
众所周知,具有复杂功能的计算设备如服务器的操作系统如Linux操作系统的重启时间通常为分钟级,如5分钟或者更长的时间。通常,操作系统的重启过程分两个阶段:引导阶段和内核阶段。其中,在引导阶段,主要由固件如引导芯片检测与启动操作系统相关的设备(Device)如内存控制器、存储设备和总线桥等,然后加载操作系统的内核并进入内核阶段。在内核阶段,内核设置需要的数据结构,检测操作系统上的全部设备,装载设备需要的驱动程序并初始化设备,最后进行用户级初始化。It is well known that computing devices with complex functions, such as server operating systems such as the Linux operating system, typically have a reboot time of five minutes, such as five minutes or longer. Usually, the restart process of the operating system is divided into two phases: the boot phase and the kernel phase. Among them, in the booting phase, devices such as a memory controller, a storage device, and a bus bridge, which are related to booting an operating system, are mainly detected by a firmware such as a boot chip, and then the kernel of the operating system is loaded and enters the kernel stage. In the kernel phase, the kernel sets up the required data structures, detects all devices on the operating system, loads the drivers needed by the device and initializes the device, and finally performs user-level initialization.
对于应用于重要场合的计算设备,其较长的重启时间降低了可用性,从而影响了计算设备的用户体验,有时甚至带来重大经济损失。目前,减少操作系统的重启时间得到了越来越多的关注。一种减少操作系统的重启时间的方法是,在内核阶段,通过快速恢复操作系统保存在内存中的重要数据,缩短操作系统重启时间。另一种方法是,在引导阶段,通过跳过检测设备而直接加载内核,缩短操作系统重启时间。For computing devices used in critical applications, longer reboot times reduce availability, affecting the user experience of computing devices, and sometimes even significant economic losses. At present, reducing the restart time of the operating system has received more and more attention. One way to reduce the restart time of the operating system is to shorten the operating system restart time by quickly recovering important data stored in the operating system by the operating system during the kernel phase. Another method is to shorten the operating system restart time by skipping the detection device and directly loading the kernel during the boot phase.
上述减少操作系统的重启时间的方法,均通过不同的方式缩短了操作系统的重启时间,然而,操作系统的功能的复杂化如操作系统管理的设备种类的复杂化,使得操作系统的重启时间,对于某些领域如金融领域而言,仍然较长甚至无法接受。因此市场需要进一步减少操作系统的重启时间。The above method for reducing the restart time of the operating system shortens the restart time of the operating system in different ways. However, the complexity of the operating system, such as the complexity of the types of devices managed by the operating system, causes the operating system to restart. For some areas, such as the financial sector, it is still long or even unacceptable. Therefore, the market needs to further reduce the restart time of the operating system.
发明内容Summary of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。(The following is a brief summary of subject matter that is described in greater detail herein.This summary is not intended to be limiting as to the scope of the claims.) The following is an overview of the topics detailed in this document. This Summary is not intended to limit the scope of the claims. (The following is a brief summary of subject matter that is described in greater detail herein. This summary is not intended to be limiting as to the scope of the claims.)
本发明实施例提供一种实现操作系统重启的方法,包括:An embodiment of the present invention provides a method for implementing an operating system restart, including:
从预先设置的操作系统文件中读取内核镜像文件和根文件系统文件,以及从当前操作系统中读取设备参数描述文件;Read the kernel image file and the root file system file from the preset operating system file, and read the device parameter description file from the current operating system;
关闭操作系统所在的计算设备的外部接口、以及用于复位计算设备的管理器件;Shutting down an external interface of the computing device where the operating system is located, and a management device for resetting the computing device;
重启当前操作系统,将内核镜像文件保存在内存的预先设置的固定位置上,将根文件系统文件和设备参数描述文件保存在申请到的内存的第一起始位置和第二起始位置上,并从固定位置上加载内核。Restart the current operating system, save the kernel image file in a preset fixed position in the memory, and save the root file system file and the device parameter description file in the first starting position and the second starting position of the applied memory, and Load the kernel from a fixed location.
如果从当前操作系统中读取所述设备参数描述文件失败,该方法还包括:从所述操作系统文件中读取所述设备参数描述文件。If the device parameter description file fails to be read from the current operating system, the method further includes: reading the device parameter description file from the operating system file.
可选地,所述重启当前操作系统之后,所述将内核镜像文件保存在内存的预先设置的固定位置上之前,该方法还包括:初始化加载内核所需的加载环境。Optionally, after the restarting the current operating system, before saving the kernel image file in a preset fixed position of the memory, the method further includes: initializing a loading environment required to load the kernel.
其中,所述初始化加载内核所需的加载环境至少包括:禁止所述操作系统响应中断;以及,清空所述计算设备的缓存和快表。The loading environment required to initialize the loading kernel includes at least: prohibiting the operating system from responding to the interrupt; and clearing the cache and the fast table of the computing device.
所述加载内核包括:至少以所述第一起始位置和第二起始位置为参数进行加载内核。The loading the kernel includes: loading the kernel with at least the first starting position and the second starting position as parameters.
本发明实施例还公开了一种实现操作系统重启的装置,至少包括解析单元和准备单元,其中,The embodiment of the invention further discloses an apparatus for implementing an operating system restart, which comprises at least an analysis unit and a preparation unit, wherein
解析单元,设置为从预先设置的操作系统文件中读取内核镜像文件和根文件系统文件,以及从当前操作系统中读取设备参数描述文件;The parsing unit is configured to read the kernel image file and the root file system file from the preset operating system file, and read the device parameter description file from the current operating system;
准备单元包括关闭模块、重启模块、保存模块和加载模块,其中,The preparation unit includes a shutdown module, a restart module, a save module, and a load module, wherein
关闭模块,设置为关闭操作系统所在的计算设备的外部接口、以及用于复位计算设备的管理器件;Turning off the module, setting the external interface of the computing device where the operating system is located, and the management device for resetting the computing device;
重启模块,设置为重启当前操作系统;Restart the module and set it to restart the current operating system.
保存模块,设置为重启当前操作系统,将内核镜像文件保存在内存的预先设置的固定位置上,并将根文件系统文件和设备参数描述文件保存在申请 到的内存的第一起始位置和第二起始位置上;Save the module, set to restart the current operating system, save the kernel image file in a preset fixed location in the memory, and save the root file system file and device parameter description file in the application. The first starting position and the second starting position of the memory;
加载模块,设置为从固定位置上加载内核。Load the module, set to load the kernel from a fixed location.
所述解析模块还设置为:当从当前操作系统中读取所述设备参数描述文件失败时,从所述操作系统文件中读取所述设备参数描述文件。The parsing module is further configured to: when the device parameter description file fails to be read from the current operating system, read the device parameter description file from the operating system file.
所述外部接口至少包括网络接口。The external interface includes at least a network interface.
所述管理器件为看门狗芯片。The management device is a watchdog chip.
可选地,所述准备单元还包括初始化模块,用于初始化加载内核所需的加载环境。Optionally, the preparation unit further includes an initialization module, configured to initialize a loading environment required to load the kernel.
所述初始化模块具体设置为:禁止所述操作系统响应中断;以及,清空所述计算设备的缓存和快表。The initialization module is specifically configured to: prohibit the operating system from responding to the interrupt; and clear the cache and the fast table of the computing device.
所述加载模块具体设置为:至少以所述第一起始位置和第二起始位置为参数进行加载内核。The loading module is specifically configured to: load the kernel by using at least the first starting position and the second starting position as parameters.
与现有技术相比,本发明实施例提供的技术方案从预先设置的操作系统文件中读取内核镜像文件和根文件系统文件,以及从当前操作系统中读取设备参数描述文件;关闭操作系统所在的计算设备的外部接口、以及用于复位计算设备的管理器件;重启当前操作系统,将内核镜像文件保存在内存的预先设置的固定位置上,将根文件系统文件和设备参数描述文件保存在申请到的内存的第一起始位置和第二起始位置上,并从固定位置上加载内核。从本发明实施例来看,一方面,省去了引导阶段中固件检测设备的过程;另一方面,通过同时从操作系统文件和当前操作系统中读取所需文件,提高了读取效率;而且,通过从内存的固定位置上加载内核,提高了加载内核的效率。可见,本发明实施例通过从多方面提高操作系统的重启效率,较大地减少了操作系统的重启时间,从而较好地满足了市场的需求。Compared with the prior art, the technical solution provided by the embodiment of the present invention reads a kernel image file and a root file system file from a preset operating system file, and reads a device parameter description file from a current operating system; The external interface of the computing device and the management device for resetting the computing device; restart the current operating system, save the kernel image file in a preset fixed location in the memory, and save the root file system file and the device parameter description file in the The first starting position and the second starting position of the applied memory are loaded, and the kernel is loaded from the fixed position. From the embodiment of the present invention, on the one hand, the process of the firmware detecting device in the booting phase is omitted; on the other hand, the reading efficiency is improved by simultaneously reading the required files from the operating system file and the current operating system; Moreover, by loading the kernel from a fixed location in memory, the efficiency of loading the kernel is improved. It can be seen that the embodiment of the present invention improves the restarting efficiency of the operating system from various aspects, and greatly reduces the restart time of the operating system, thereby better satisfying the market demand.
本发明的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过在说明书、权利要求书以及附图中所特别指出的结构来实现和获得。Other features and advantages of the invention will be set forth in the description which follows, The objectives and other advantages of the invention may be realized and obtained by means of the structure particularly pointed in the appended claims.
在阅读并理解了附图和详细描述后,可以明白其他方面。(Other aspects will be appreciated upon reading and understanding the attached figures and  detailed description.)Other aspects will be apparent upon reading and understanding the drawings and detailed description. (Other aspects will be appreciated upon reading and understanding the attached figures and Detailed description.)
附图概述BRIEF abstract
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The drawings described herein are intended to provide a further understanding of the invention, and are intended to be a part of the invention. In the drawing:
图1为本发明实施例实现操作系统重启的方法的流程图;FIG. 1 is a flowchart of a method for implementing an operating system restart according to an embodiment of the present invention;
图2为本发明实施例实现操作系统重启的装置的组成结构示意图。FIG. 2 is a schematic structural diagram of a device for implementing an operating system restart according to an embodiment of the present invention.
本发明的较佳实施方式Preferred embodiment of the invention
为使本发明实施例的目的、技术方案和优点更加清楚明白,下文中将结合附图对本发明的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。The embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the features in the embodiments and the embodiments in the present application may be arbitrarily combined with each other.
在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行。并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。The steps illustrated in the flowchart of the figures may be executed in a computer system such as a set of computer executable instructions. Also, although logical sequences are shown in the flowcharts, in some cases the steps shown or described may be performed in a different order than the ones described herein.
图1为本发明实现操作系统重启的方法的流程图,如图1所示,包括:FIG. 1 is a flowchart of a method for implementing an operating system restart according to the present invention. As shown in FIG. 1 , the method includes:
步骤101:从预先设置的操作系统文件中读取内核镜像文件和根文件系统文件,以及从当前操作系统中读取设备参数描述文件。Step 101: Read the kernel image file and the root file system file from the preset operating system file, and read the device parameter description file from the current operating system.
以Linux操作系统为例,操作系统文件可以为Linux操作系统的软件包;内核镜像文件如Linux内核镜像文件,用于启动内核;根文件系统文件如Linux操作系统的根文件系统,用于在启动内核中加载根文件系统;设备参数描述文件如Linux操作系统的设备参数描述文件用于在启动内核中初始化设备。Take the Linux operating system as an example. The operating system file can be a software package of the Linux operating system; the kernel image file, such as a Linux kernel image file, is used to boot the kernel; the root file system file, such as the root file system of the Linux operating system, is used to boot The root file system is loaded in the kernel; the device parameter description file, such as the device parameter description file of the Linux operating system, is used to initialize the device in the boot kernel.
步骤101中的从操作系统文件中读取内核镜像文件和根文件系统文件的具体实现,属于本领域技术人员的惯用技术手段,不用于限定本发明的保护范围,此处不再赘述。The specific implementation of reading the kernel image file and the root file system file from the operating system file in step 101 is a common technical means for those skilled in the art, and is not intended to limit the scope of protection of the present invention, and details are not described herein again.
通常,操作系统将设备参数描述文件保存在内存中,因此,从当前操作系统中读取设备参数描述文件的具体实现包括:获取内存保存设备参数描述文件的起始位置,根据获得的起始位置读取设备参数描述文件。 Generally, the operating system saves the device parameter description file in the memory. Therefore, the specific implementation of reading the device parameter description file from the current operating system includes: obtaining the starting position of the memory saving device parameter description file, according to the obtained starting position. Read the device parameter description file.
其中,如何获取内存保存设备参数描述文件的起始位置、以及根据起始位置读取设备参数描述文件的具体实现,属于本领域技术人员的惯用技术手段,不用于限定本发明的保护范围,此处不再赘述。The specific implementation of how to obtain the starting position of the memory saving device parameter description file and the reading of the device parameter description file according to the starting position is a common technical means by those skilled in the art, and is not used to limit the protection scope of the present invention. I won't go into details here.
进一步地,further,
如果从当前操作系统中读取设备参数描述文件失败,步骤101还包括:从操作系统文件中读取设备参数描述文件。这样,以当前操作系统没有保存设备参数描述文件到内存中为例来看,如果从当前操作系统中读取设备参数描述文件失败,此时,还可以从操作系统文件中读取设备参数描述文件,从而进一步提高了本发明方法的稳定性。If the device parameter description file fails to be read from the current operating system, step 101 further includes: reading the device parameter description file from the operating system file. In this way, the current operating system does not save the device parameter description file to the memory. For example, if the device parameter description file fails to be read from the current operating system, the device parameter description file can also be read from the operating system file. Thereby further improving the stability of the method of the invention.
步骤102:关闭操作系统所在的计算设备的外部接口、以及用于复位计算设备的管理器件。Step 102: Shut down an external interface of the computing device where the operating system is located, and a management device for resetting the computing device.
其中,如何关闭外部接口和管理器件的具体实现,属于本领域技术人员的惯用技术手段,不用于限定本发明的保护范围,此处不再赘述。The specific implementation of how to close the external interface and the management device is a common technical means for those skilled in the art, and is not intended to limit the scope of protection of the present invention, and details are not described herein.
步骤102中,外部接口至少包括网络接口,还可以包括蓝牙接口等外部接口。以网络接口为例来看,关闭网络接口避免了重启过程中从网络接口上接收到的信息如网络报文干扰重启过程,从而提高了本发明实施例的稳定性。In step 102, the external interface includes at least a network interface, and may also include an external interface such as a Bluetooth interface. Taking the network interface as an example, the network interface is closed to avoid the information received from the network interface during the restart, such as the network packet interference restart process, thereby improving the stability of the embodiment of the present invention.
在本发明的一个实施例中,管理器件为看门狗芯片。这样,避免了看门狗芯片复位计算设备,从而避免了启动固件而使其检测设备。In one embodiment of the invention, the management device is a watchdog chip. In this way, the watchdog chip reset computing device is avoided, thereby preventing the firmware from being activated and detecting the device.
步骤103:重启当前操作系统,将内核镜像文件保存在内存的预先设置的固定位置,将根文件系统文件和设备参数描述文件保存在申请到的内存的第一起始位置和第二起始位置,并从固定位置上加载内核。Step 103: Restart the current operating system, save the kernel image file in a preset fixed position in the memory, and save the root file system file and the device parameter description file in the first starting position and the second starting position of the requested memory. And load the kernel from a fixed location.
其中,重启操作系统的具体实现,属于本领域技术人员的惯用技术手段,不用于限定本发明的保护范围,此处不再赘述。The specific implementation of restarting the operating system belongs to the technical means of the person skilled in the art, and is not used to limit the scope of protection of the present invention, and details are not described herein again.
以操作系统为Linux操作系统为例,本步骤中的内存具体指的是内核态固定内存,即专门用于存储内核规定的信息的内存空间。Taking the operating system as the Linux operating system as an example, the memory in this step refers specifically to the kernel state fixed memory, that is, the memory space dedicated to storing the information specified by the kernel.
其中,如何申请内存的起始位置、以及从固定位置上加载内核的具体实现,属于本领域技术人员的惯用技术手段,不用于限定本发明的保护范围,此处不再赘述。 The specific implementation of how to apply for the starting position of the memory and the loading of the kernel from the fixed location is a common technical means for those skilled in the art, and is not intended to limit the scope of protection of the present invention, and details are not described herein.
需要说明的是,本发明实施例之后,加载的内核对计算设备进行控制,使得重启过程进入内核阶段。It should be noted that, after the embodiment of the present invention, the loaded kernel controls the computing device, so that the restart process enters the kernel phase.
步骤103中的重启当前操作系统之后,步骤103中的将内核镜像文件保存在内存的预先设置的固定位置上之前,该方法还包括:初始化加载内核所需的加载环境。After the current operating system is restarted in step 103, before the kernel image file is saved in a preset fixed position in the memory in step 103, the method further includes: initializing a loading environment required to load the kernel.
其中,初始化加载内核所需的加载环境至少包括:禁止操作系统响应中断;以及,清空计算设备的缓存和快表。这里,缓存为计算设备中的中央处理器(CPU)中的缓存;快表为计算设备中的内存管理单元(MMU)中的缓存。这样,避免了重启之前的内核产生的数据影响重启之后的内核对计算设备进行控制,从而保证了本发明实施例的稳定性。其中,如何禁止操作系统响应中断、以及清空计算设备的缓存和快表的具体实现,属于本领域技术人员的惯用技术手段,不用于限定本发明的保护范围,此处不再赘述。The loading environment required to initialize the loading kernel includes at least: prohibiting the operating system from responding to the interrupt; and clearing the cache and the fast table of the computing device. Here, the cache is a cache in a central processing unit (CPU) in the computing device; the fast table is a cache in a memory management unit (MMU) in the computing device. In this way, the data generated by the kernel before the restart is prevented from affecting the kernel after the restart, and the computing device is controlled, thereby ensuring the stability of the embodiment of the present invention. The specific technical implementation of the present invention is not limited to the scope of the present invention.
步骤103中的加载内核包括:至少以第一起始位置和第二起始位置为参数进行加载内核。其中,加载内核的参数还包括内核的命令行参数如内核日志的默认打印级别等。The loading of the kernel in step 103 includes: loading the kernel with at least a first starting position and a second starting position as parameters. Among them, the parameters of the loading kernel also include the kernel's command line parameters such as the default print level of the kernel log.
图2为本发明实施例实现操作系统重启的装置的组成结构示意图,至少包括解析单元和准备单元,其中,2 is a schematic structural diagram of a device for implementing an operating system restart according to an embodiment of the present invention, which includes at least an analysis unit and a preparation unit, where
解析单元,设置为从预先设置的操作系统文件中读取内核镜像文件和根文件系统文件,以及从当前操作系统中读取设备参数描述文件;The parsing unit is configured to read the kernel image file and the root file system file from the preset operating system file, and read the device parameter description file from the current operating system;
准备单元包括关闭模块、重启模块、保存模块和加载模块,其中,The preparation unit includes a shutdown module, a restart module, a save module, and a load module, wherein
关闭模块,设置为关闭操作系统所在的计算设备的外部接口、以及用于复位计算设备的管理器件。这里,外部接口至少包括网络接口;管理器件为看门狗芯片。The module is turned off, set to shut down the external interface of the computing device where the operating system is located, and the management device used to reset the computing device. Here, the external interface includes at least a network interface; the management device is a watchdog chip.
重启模块,设置为重启当前操作系统。Restart the module and set it to restart the current operating system.
保存模块,设置为将内核镜像文件保存在内存的预先设置的固定位置,并将根文件系统文件和设备参数描述文件保存在申请到的内存的第一起始位置和第二起始位置。The save module is set to save the kernel image file in a preset fixed position in the memory, and save the root file system file and the device parameter description file in the first start position and the second start position of the requested memory.
加载模块,设置为从固定位置上加载内核。 Load the module, set to load the kernel from a fixed location.
本发明实施例提供的装置运行之后,加载的内核对计算设备进行控制,使得重启过程进入内核阶段。After the device provided by the embodiment of the present invention runs, the loaded kernel controls the computing device, so that the restart process enters the kernel phase.
进一步地,解析模块还设置为:当从当前操作系统中读取设备参数描述文件失败时,从操作系统文件中读取设备参数描述文件。Further, the parsing module is further configured to: when the device parameter description file fails to be read from the current operating system, read the device parameter description file from the operating system file.
准备单元还包括初始化模块,设置为初始化进入内核阶段所需的加载环境。具体地,The preparation unit also includes an initialization module that is set to initialize the loading environment required to enter the kernel phase. specifically,
初始化模块具体设置为:禁止操作系统响应中断;以及,清空计算设备的缓存和快表。The initialization module is specifically configured to: disable the operating system from responding to the interrupt; and, to clear the cache and the fast table of the computing device.
加载模块具体设置为:至少以第一起始位置和第二起始位置为参数进行加载内核。The loading module is specifically configured to load the kernel by using at least a first starting position and a second starting position as parameters.
工业实用性Industrial applicability
本发明实施例提出的实现操作系统重启的方法和装置,本发明实施例基于软件实现,从预先设置的操作系统文件中读取内核镜像文件和根文件系统文件,以及从当前操作系统中读取设备参数描述文件;关闭操作系统所在的计算设备的外部接口、以及用于复位计算设备的管理器件;重启当前操作系统,将内核镜像文件保存在内存的预先设置的固定位置,将根文件系统文件和设备参数描述文件保存在申请到的内存的第一起始位置和第二起始位置,并从固定位置上加载内核。通过本发明实施例提供的技术方案,减少了操作系统的重启时间,从而较好地满足了市场需求。 The method and device for implementing an operating system restart according to an embodiment of the present invention are implemented by using a software implementation, reading a kernel image file and a root file system file from a preset operating system file, and reading from a current operating system. Device parameter description file; close the external interface of the computing device where the operating system is located, and the management device for resetting the computing device; restart the current operating system, save the kernel image file in a preset fixed location in the memory, and copy the root file system file And the device parameter description file is saved in the first start position and the second start position of the requested memory, and the kernel is loaded from the fixed position. The technical solution provided by the embodiment of the invention reduces the restart time of the operating system, thereby better satisfying the market demand.

Claims (12)

  1. 一种实现操作系统重启的方法,其包括:A method for implementing an operating system restart, which includes:
    从预先设置的操作系统文件中读取内核镜像文件和根文件系统文件,以及从当前操作系统中读取设备参数描述文件;Read the kernel image file and the root file system file from the preset operating system file, and read the device parameter description file from the current operating system;
    关闭操作系统所在的计算设备的外部接口、以及用于复位计算设备的管理器件;Shutting down an external interface of the computing device where the operating system is located, and a management device for resetting the computing device;
    重启当前操作系统,将内核镜像文件保存在内存的预先设置的固定位置,将根文件系统文件和设备参数描述文件保存在申请到的内存的第一起始位置和第二起始位置,并从固定位置上加载内核。Restart the current operating system, save the kernel image file in a preset fixed position in the memory, save the root file system file and the device parameter description file in the first starting position and the second starting position of the requested memory, and fix it from the fixed Load the kernel in the location.
  2. 根据权利要求1所述的方法,其中,如果所述读取所述设备参数描述文件失败,该方法还包括:从所述操作系统文件中读取所述设备参数描述文件。The method of claim 1, wherein if the reading of the device parameter description file fails, the method further comprises: reading the device parameter description file from the operating system file.
  3. 根据权利要求1或2所述的方法,其中,所述重启当前操作系统之后,所述将内核镜像文件保存在内存的预先设置的固定位置之前,该方法还包括:初始化所述加载内核所需的加载环境。The method according to claim 1 or 2, wherein after the restarting the current operating system, before saving the kernel image file in a preset fixed position of the memory, the method further comprises: initializing the loading of the kernel The loading environment.
  4. 根据权利要求3所述的方法,其中,所述初始化加载内核所需的加载环境至少包括:禁止所述操作系统响应中断;以及,清空所述计算设备的缓存和快表。The method of claim 3, wherein said initializing a load environment required to load the kernel comprises at least: disabling said operating system from responding to an interrupt; and emptying said computing device's cache and fast table.
  5. 根据权利要求1或2所述的方法,其中,所述加载内核包括:至少以所述第一起始位置和第二起始位置为参数进行加载内核。The method according to claim 1 or 2, wherein the loading of the kernel comprises: loading the kernel with at least the first starting position and the second starting position as parameters.
  6. 一种实现操作系统重启的装置,其至少包括解析单元和准备单元,其中,An apparatus for implementing an operating system restart, which includes at least a parsing unit and a preparing unit, wherein
    解析单元,设置为从预先设置的操作系统文件中读取内核镜像文件和根文件系统文件,以及从当前操作系统中读取设备参数描述文件;The parsing unit is configured to read the kernel image file and the root file system file from the preset operating system file, and read the device parameter description file from the current operating system;
    准备单元包括关闭模块、重启模块、保存模块和加载模块,其中,The preparation unit includes a shutdown module, a restart module, a save module, and a load module, wherein
    关闭模块,设置为关闭操作系统所在的计算设备的外部接口、以及用于复位计算设备的管理器件; Turning off the module, setting the external interface of the computing device where the operating system is located, and the management device for resetting the computing device;
    重启模块,设置为重启当前操作系统;Restart the module and set it to restart the current operating system.
    保存模块,设置为重启当前操作系统,将内核镜像文件保存在内存的预先设置的固定位置,并将根文件系统文件和设备参数描述文件保存在申请到的内存的第一起始位置和第二起始位置;Save the module, set to restart the current operating system, save the kernel image file in a preset fixed position in the memory, and save the root file system file and the device parameter description file in the first starting position of the requested memory and the second Starting position
    加载模块,设置为从固定位置上加载内核。Load the module, set to load the kernel from a fixed location.
  7. 根据权利要求6所述的装置,其中,所述解析模块还设置为:当从当前操作系统中读取所述设备参数描述文件失败时,从所述操作系统文件中读取所述设备参数描述文件。The apparatus according to claim 6, wherein the parsing module is further configured to: read the device parameter description from the operating system file when the device parameter description file fails to be read from a current operating system file.
  8. 根据权利要求6或7所述的装置,其中,所述外部接口至少包括网络接口。The apparatus of claim 6 or 7, wherein the external interface comprises at least a network interface.
  9. 根据权利要求6或7所述的装置,其中,所述管理器件为看门狗芯片。The apparatus according to claim 6 or 7, wherein said management device is a watchdog chip.
  10. 根据权利要求6或7所述的装置,其中,所述准备单元还包括初始化模块,设置为初始化加载内核所需的加载环境。The apparatus according to claim 6 or 7, wherein said preparation unit further comprises an initialization module arranged to initialize a loading environment required to load the kernel.
  11. 根据权利要求10所述的装置,其中,所述初始化模块具体设置为:禁止所述操作系统响应中断;以及,清空所述计算设备的缓存和快表。The apparatus of claim 10, wherein the initialization module is specifically configured to: disable the operating system from responding to an interrupt; and clear the cache and fast table of the computing device.
  12. 根据权利要求6或7所述的装置,其中,所述加载模块具体设置为:至少以所述第一起始位置和第二起始位置为参数进行加载内核。 The apparatus according to claim 6 or 7, wherein the loading module is specifically configured to load the kernel at least with the first starting position and the second starting position as parameters.
PCT/CN2015/079406 2014-12-26 2015-05-20 Method and device for realizing restart of operating system WO2016101519A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410829411.1 2014-12-26
CN201410829411.1A CN105786547A (en) 2014-12-26 2014-12-26 Operation system restarting method and apparatus

Publications (1)

Publication Number Publication Date
WO2016101519A1 true WO2016101519A1 (en) 2016-06-30

Family

ID=56149093

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/079406 WO2016101519A1 (en) 2014-12-26 2015-05-20 Method and device for realizing restart of operating system

Country Status (2)

Country Link
CN (1) CN105786547A (en)
WO (1) WO2016101519A1 (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107656757A (en) * 2016-07-25 2018-02-02 南京中兴新软件有限责任公司 operating system switching method and device
CN107276789B (en) * 2017-05-19 2020-12-01 太仓鸿羽智能科技有限公司 Log uploading method and device and computer readable storage medium
CN107291501B (en) * 2017-06-23 2020-04-24 联想(北京)有限公司 System quick starting method and electronic equipment
CN109343956A (en) * 2018-09-20 2019-02-15 阿里巴巴集团控股有限公司 A kind of operating system configuration method and device
CN112416886A (en) * 2019-08-21 2021-02-26 普天信息技术有限公司 Linux system starting method and device
CN111090546B (en) * 2019-12-13 2023-01-10 苏州浪潮智能科技有限公司 Method, device and equipment for restarting operating system and readable storage medium
WO2021247849A1 (en) * 2020-06-05 2021-12-09 Arris Enterprises Llc Selective reset system for a remote physical device
CN111796882A (en) * 2020-07-21 2020-10-20 北京联想软件有限公司 Electronic equipment system processing method and device and electronic equipment
CN114579195B (en) * 2022-03-11 2023-08-18 浪潮商用机器有限公司 Operating system restarting method, system and related components

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1818869A (en) * 2006-03-15 2006-08-16 浙江大学 Mirror starting optimization of built-in operation system
CN102012823A (en) * 2009-09-04 2011-04-13 中兴通讯股份有限公司 Method and device for quickly restarting computer
CN102622280A (en) * 2011-01-06 2012-08-01 苏州科达科技有限公司 Control method and control device used for software version upgrade and based on dual file system
CN103955389A (en) * 2014-05-06 2014-07-30 中国科学院微电子研究所 System startup method based on PCM (Phase Change Random Access Memory)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6173417B1 (en) * 1998-04-30 2001-01-09 Intel Corporation Initializing and restarting operating systems
JP2005222366A (en) * 2004-02-06 2005-08-18 Nippon Telegr & Teleph Corp <Ntt> Automatic recovery method, program, program recording medium, processor
CN1945531A (en) * 2006-11-16 2007-04-11 刘金刚 Design method of inter-operation system
CN101556547B (en) * 2009-05-25 2012-01-25 芯通科技(成都)有限公司 Safe method and system used for remotely upgrading embedded Linux kernel
CN103761124B (en) * 2014-01-06 2017-03-01 武汉烽火富华电气有限责任公司 Embedded Linux system for protection supervisory equipment starts method
CN103885847A (en) * 2014-02-08 2014-06-25 京信通信系统(中国)有限公司 Dog feeding method and device based on embedded system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1818869A (en) * 2006-03-15 2006-08-16 浙江大学 Mirror starting optimization of built-in operation system
CN102012823A (en) * 2009-09-04 2011-04-13 中兴通讯股份有限公司 Method and device for quickly restarting computer
CN102622280A (en) * 2011-01-06 2012-08-01 苏州科达科技有限公司 Control method and control device used for software version upgrade and based on dual file system
CN103955389A (en) * 2014-05-06 2014-07-30 中国科学院微电子研究所 System startup method based on PCM (Phase Change Random Access Memory)

Also Published As

Publication number Publication date
CN105786547A (en) 2016-07-20

Similar Documents

Publication Publication Date Title
WO2016101519A1 (en) Method and device for realizing restart of operating system
US9760461B2 (en) Electronic device and firmware recovery program that ensure recovery of firmware
US11157265B2 (en) Firmware update
US9703346B2 (en) Firmware interface with backup non-volatile memory storage
US9658863B2 (en) Information processing apparatus and control method therefor
KR101618535B1 (en) Secure data protection with improved read-only memory locking during system pre-boot
US20120311240A1 (en) Information processing apparatus, information processing method, and storage medium
US20150095632A1 (en) Computer booting system and method for computer system
KR101673299B1 (en) Operating system recovery method and apparatus, and terminal device
US20140149644A1 (en) Electronic apparatus, method of updating firmware, and computer-readable recording medium
US9411605B2 (en) Device-less and system agnostic unified extensible firmware interface (UEFI) driver
US8838952B2 (en) Information processing apparatus with secure boot capability capable of verification of configuration change
US20150149751A1 (en) Cpu-based measured boot
US11704198B2 (en) Method and apparatus for providing recovery from a computing device boot up error
US9448888B2 (en) Preventing a rollback attack in a computing system that includes a primary memory bank and a backup memory bank
WO2012149774A1 (en) Method and apparatus for activating processor
TWI546661B (en) Resuming a system using state information
CN112667442B (en) Control method, device and equipment based on nonvolatile memory device starting system
US8572742B1 (en) Detecting and repairing master boot record infections
US10983818B2 (en) Method and system for preventing execution of a dirty virtual machine on an undesirable host server in a virtualization cluster environment
KR100994723B1 (en) selective suspend resume method of reducing initial driving time in system, and computer readable medium thereof
US9342392B2 (en) Image forming apparatus, image forming apparatus control method, and recording medium
US20140372806A1 (en) Virtual machine system and information storing processing method
US20220121437A1 (en) Information processing apparatus using swap file, control method therefor, and storage medium
US10061630B2 (en) Image forming apparatus that ensures operation while HDD is inoperative, and recording medium therefor

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15871595

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15871595

Country of ref document: EP

Kind code of ref document: A1