CN116775137A - Operating system starting method and device - Google Patents

Operating system starting method and device Download PDF

Info

Publication number
CN116775137A
CN116775137A CN202310596119.9A CN202310596119A CN116775137A CN 116775137 A CN116775137 A CN 116775137A CN 202310596119 A CN202310596119 A CN 202310596119A CN 116775137 A CN116775137 A CN 116775137A
Authority
CN
China
Prior art keywords
file
function
operating system
starting
kernel
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202310596119.9A
Other languages
Chinese (zh)
Inventor
范东月
王凯峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qianxin Technology Group Co Ltd
Original Assignee
Qianxin Technology Group Co Ltd
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 Qianxin Technology Group Co Ltd filed Critical Qianxin Technology Group Co Ltd
Publication of CN116775137A publication Critical patent/CN116775137A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The embodiment of the invention provides a method and a device for starting an operating system, which relate to the technical field of computers, wherein the method for starting the operating system comprises the following steps: acquiring a compiled kernel file in a disk partition; the kernel file comprises a user-level process, a first starting script and at least one target file relied by an operating system; starting the user-level process and executing a first starting script; mounting the disk partition through the first starting script; the method comprises the steps that a function file is stored in a disk partition, and the function file comprises at least one function subfile corresponding to each target function; accessing the disk partition, and releasing each function subfile in the disk partition into a memory; and starting the operating system based on each function sub-file and each target file. The invention realizes the deletion of the temporary file by restarting the operating system without manually deleting the temporary file by a user, thereby improving the deletion efficiency of the temporary file.

Description

Operating system starting method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for starting an operating system.
Background
After a period of use, the following problems are encountered in the hardware device or the virtual machine device with the open source Linux operating system installed: unnecessary temporary files are generated in the running process, and in order to reduce the occupation of equipment resources, users usually delete the temporary files.
In the related art, it is generally necessary to manually delete the temporary files by a person, but the temporary files are numerous and relatively complicated and distributed on different paths, thereby reducing the deletion efficiency of the temporary files.
Disclosure of Invention
Aiming at the problems in the prior art, the embodiment of the invention provides a method and a device for starting an operating system.
Specifically, the embodiment of the invention provides the following technical scheme:
in a first aspect, an embodiment of the present invention provides an operating system startup method, including:
acquiring a compiled kernel file in a disk partition; the kernel file comprises a user-level process, a first starting script and at least one target file relied by an operating system;
starting the user-level process and executing a first starting script;
mounting the disk partition through the first starting script; the method comprises the steps that a function file is stored in a disk partition, and the function file comprises at least one function subfile corresponding to each target function;
Accessing the disk partition, and releasing each function subfile in the disk partition into a memory;
and starting the operating system based on each function sub-file and each target file.
Further, the method further comprises:
acquiring at least one target file relied by the operating system and path information of each target file in a memory;
generating a list file based on each target file and corresponding path information;
the path information of each target file in the list file in the memory is added into the kernel configuration file;
in the compiling process, acquiring a corresponding target file based on path information of each target file in a memory in the kernel configuration file to obtain the compiled kernel file;
and packaging the kernel file and the function file to obtain the mirror image file.
Further, the method further comprises:
splitting the mirror image file to obtain the kernel file and the function file;
storing the kernel file and the function file in the disk partition, and adding the relative position of the kernel file in the disk partition in a starting configuration file of an operating system;
The obtaining the compiled kernel file in the disk partition includes:
and acquiring the kernel file in the disk partition based on the relative position of the kernel file in the starting configuration file in the disk partition.
Further, the packaging the kernel file and the function file to obtain the image file includes:
packaging the kernel file and the function file to obtain a packaged file;
and encrypting the packaged file to obtain the mirror image file.
Further, the step of packaging the kernel file and the function file to obtain a packaged file includes:
encrypting the function file to obtain an encrypted function file;
and packaging the kernel file and the encrypted functional file to obtain the packaged file.
Further, the splitting the image file to obtain the kernel file and the function file includes:
decrypting the image file to obtain a decrypted package file;
splitting the decrypted packaged file to obtain the kernel file and the encrypted functional file;
The storing the kernel file and the function file in the disk partition includes:
and storing the kernel file and the encrypted functional file in the disk partition.
Further, the function file also comprises a second starting script and a function script corresponding to at least one target function; the function subfiles comprise an executable file and at least one dynamic library file on which the executable file depends;
the starting the operating system based on each of the function subfiles and each of the target files includes:
operating each target file and executing the second starting script;
starting a function script, an executable file and a dynamic library file on which the executable file depends, which correspond to the target function realized based on the function script through the second starting script aiming at each target function realized based on the function script;
and starting an executable file corresponding to the target function which is not realized based on the function script and a dynamic library file on which the executable file depends through the second starting script aiming at each target function which is not realized based on the function script.
In a second aspect, an embodiment of the present invention further provides an operating system startup device, including:
The first acquisition unit is used for acquiring a kernel file in a disk partition; the kernel file comprises a user-level process, a first starting script and at least one target file relied by an operating system;
the execution unit is used for starting the user-level process and executing a first starting script;
the mounting unit is used for mounting the disk partition through the first starting script; the method comprises the steps that a function file is stored in a disk partition, and the function file comprises at least one function subfile corresponding to each target function;
the releasing unit is used for accessing the disk partition and releasing each function subfile in the disk partition into a memory;
and the starting unit is used for starting the operating system based on the functional subfiles and the target files.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor executes the program to implement the operating system startup method according to the first aspect.
In a fourth aspect, embodiments of the present invention also provide a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the operating system boot method according to the first aspect.
In a fifth aspect, embodiments of the present invention further provide a computer program product having stored thereon executable instructions that, when executed by a processor, cause the processor to implement the operating system boot method according to the first aspect.
According to the operating system starting method and device, the compiled kernel file is obtained in the disk partition, the user-level process in the kernel file is started, the first starting script is executed, the disk partition storing the functional file is mounted through the executed first starting script, all the functional subfiles in the disk partition are released in the memory, and then the operating system is started based on all the functional subfiles and all the target files. It can be known that the method stores the kernel files including the function files and the compiled kernel files in the disk partition, the compiled kernel files include the object files which are depended by the operating system, and the operating system acquires the kernel files and the function files required by the operating system from the disk partition when the operating system is started each time, so that the states of the operating system after each time of starting are the same. Therefore, after the operation system is started next time, the temporary files generated in the operation process after the last start are automatically cleaned, namely, the temporary files are deleted by restarting the operation system, and a user does not need to manually delete the temporary files, so that the deletion efficiency of the temporary files is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of an operating system booting method according to an embodiment of the present invention;
FIG. 2 is a second flowchart of a method for booting an operating system according to an embodiment of the present invention;
FIG. 3 is a third flowchart of a method for booting an operating system according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an operating system starting device according to an embodiment of the present invention;
fig. 5 is a schematic diagram of an entity structure of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Fig. 1 is a schematic flow chart of an operating system starting method according to an embodiment of the present invention, and an execution subject of the method may be an electronic device with the operating system installed therein, such as a terminal device, a computer, a server, or a server cluster, or may be an operating system starting device disposed in the electronic device, where the operating system starting device may be implemented by software, hardware, or a combination of both. The operating system of the method can be a Linux operating system; as shown in fig. 1, the operating system starting method includes the following steps:
step 101, acquiring a compiled kernel file in a disk partition; the kernel file includes a user-level process, a first boot script, and at least one target file on which an operating system depends.
The operating system is a group of interrelated system software programs which are used for hosting and controlling the operation, application and running of hardware and software resources of the electronic equipment and providing public services for organizing user interaction, and is also a core and a base stone of the computer system; the kernel is a core of an operating system, is a first layer of software expansion based on hardware, provides the most basic function of the operating system, is a basis for the operating system to work, and is responsible for managing processes, memory, device drivers, files and network systems of the system, and determining the performance and stability of the operating system.
The method comprises the steps that a compiled kernel file is stored in a disk partition in advance, and when an operating system is started, the compiled kernel file can be obtained from the disk partition, wherein the kernel file comprises a user-level process, a first starting script and various target files relied on by the operating system; the target file may be an executable file, a dynamic library file on which the executable file depends, an operating system dependent configuration file, etc. The user-level process may be an init process and the first initiation script may be a rcS script.
Step 102, starting a user-level process, and executing a first starting script.
Illustratively, similar to an open source Linux operating system, when an electronic device boots up, a kernel starts up a user-level process of the operating system, e.g., starts up an init process, after which a first boot script is executed, e.g., the first boot script rcS may be invoked based on path/etc/init.d/rcS and the first boot script rcS is executed.
Step 103, mounting the disk partition through the first starting script; the disk partition is stored with a function file, and the function file comprises at least one function subfile corresponding to each target function.
The function file may be developed and designed for the device in which the operating system is installed based on each target function that needs to be implemented. For example, if the operating system is installed in the firewall device, and one target function to be implemented by the firewall device is a monitoring process, a function subfile capable of implementing the monitoring process needs to be designed; other target functions are similar, and a plurality of function subfiles form a function file.
The first startup script is modified according to the requirement in advance, namely, a disk partition needing to be mounted is set in the first startup script based on the requirement, namely, a disk partition storing functional files and compiled kernel files, the space size of the disk partition, the file system type corresponding to the disk partition and mounting parameters; therefore, the disk partition may be mounted through the first boot script. In addition, the mounting parameters can be set based on requirements, and the invention is not limited herein;
and 104, accessing the disk partition, and releasing each function subfile in the disk partition into a memory.
For example, after a disk partition storing an image file is mounted, the disk partition may be accessed, a function file is obtained in the disk partition, and the function file is decompressed to obtain each function sub-file, and each function sub-file is released in the memory.
Step 105, starting the operating system based on each of the function subfiles and each of the target files.
For example, when each function subfile is released from the disk partition in the memory, the operating system is started in the memory based on each function subfile and each target file included in the kernel file, so that the operating system can be successfully started, and each designed target function can be realized.
According to the operating system starting method provided by the embodiment of the invention, the compiled kernel file is obtained in the disk partition, the user-level process in the kernel file is started, the first starting script is executed, the disk partition storing the functional file is mounted through the executed first starting script, all the functional subfiles in the disk partition are released in the memory, and the operating system is started based on all the functional subfiles and all the target files. It can be known that the method stores the kernel files including the function files and the compiled kernel files in the disk partition, the compiled kernel files include the object files which are depended by the operating system, and the operating system acquires the kernel files and the function files required by the operating system from the disk partition when the operating system is started each time, so that the states of the operating system after each time of starting are the same. Therefore, after the operation system is started next time, the temporary files generated in the operation process after the last start are automatically cleaned, namely, the temporary files are deleted by restarting the operation system, and a user does not need to manually delete the temporary files, so that the deletion efficiency of the temporary files is improved; in addition, in the running process of the operating system, if the target files and/or the functional sub-files relied on by the operating system in the kernel are deleted by the user, the target files and/or the functional sub-files can be restored after the operating system is restarted, so that the reliability of the operating system is improved, and the user is not required to restore important files by reloading the original operating system.
In an embodiment, fig. 2 is a second flowchart of the operating system booting method according to the embodiment of the present invention, as shown in fig. 2, before the step 101, the operating system booting method further includes the following steps:
and 106, acquiring at least one target file and path information in the memory of each target file which are depended on by the operating system.
The target file is a rootfs file, and the rootfs file is a base file relied by an operating system.
Illustratively, each target file rootfs relied by the operating system is sorted, the target files are usually executable files, dynamic library files relied by the executable files and configuration files required by the operating system, and path information in memory of each target file is determined, wherein the path information can be absolute path information. In addition, when searching the dynamic library on which the executable file depends, the ldd command can be used for automatically searching and adding the dynamic library file on which the executable file depends, so that the searching time of the dynamic library file is shortened, and some dynamic library files can be prevented from being missed.
Step 107, generating a list file based on each target file and the corresponding path information.
For example, when obtaining each target file and path information of each target file in the memory, in the kernel file compiling process, a list file may be generated based on each target file and path information of each target file in the memory, for example, the generated list file may be an initumfs list file, and preparation is made for packaging each target file into the kernel file.
And step 108, adding path information of each target file in the list file in the memory into the kernel configuration file.
Illustratively, path information in memory for each target file in the initumfs list file is specified in the kernel configuration file using the tailored kernel source code.
The method includes that the cut kernel source code refers to that codes irrelevant to the target functions started and realized by the operating system in the original kernel source code are cut, and the cut kernel source code is obtained so as to reduce the operation of irrelevant codes.
And 109, in the compiling process, acquiring a corresponding target file based on path information of each target file in the memory in the kernel configuration file to obtain the compiled kernel file.
In the process of compiling the kernel file, the corresponding target files are obtained based on the path information of each target file in the memory in the kernel configuration file, namely, each target file relied by the operating system in the memory is called, and after the compiling is finished, the compiled kernel file is obtained, so that the compiled kernel file contains each target file rootfs, that is, the target files relied by the operating system are packaged into the kernel file, and the compiled kernel file can be the kernel file bzImage.
And 110, packaging the kernel file and the function file to obtain the mirror image file.
For example, when the function file and the compiled kernel file bzImage are obtained, the function file and the compiled kernel file bzImage are packaged and used as image files, for example, the packaged image files can be expressed as image file system_os.tar.gz, so that the construction process of the image files of the operating system is completed.
According to the operating system starting method provided by the embodiment of the invention, each target file relied by the operating system and the function file of each target function which the operating system needs to realize are packed to be used as the mirror image file of the operating system, so that the automatic construction of the mirror image file of the operating system is realized, and preparation is made for the installation of the mirror image file and the starting of the operating system; in addition, the invention can flexibly select the target file depended by the operating system based on the requirement, thereby realizing flexible control of target file selection without taking the file depended by the operating system as the target file, and further saving the hard disk resource and the memory resource of the electronic equipment.
In an embodiment, fig. 3 is a third flowchart of the operating system booting method according to the embodiment of the present invention, as shown in fig. 3, after the step 110, the operating system booting method further includes the following steps:
And step 111, splitting the mirror image file to obtain the kernel file and the function file.
In an exemplary process of installation or upgrading, the operating system uploads the image file to obtain the image file, and then splits the image file to obtain the kernel file and the function file.
Step 112, storing the kernel file and the function file in the disk partition, and adding the relative position of the kernel file in the disk partition in a start configuration file of an operating system.
The boot configuration file of the operating system may be a GRUB file.
When the kernel file and the function file are obtained, the kernel file and the function file are stored in the designated position of the disk partition, the designated position can be preset, and the relative position of the kernel file in the disk partition and the starting parameters of the operating system are added in the starting configuration file of the operating system so as to complete the setting of starting options. In addition, the start-up parameters may be set based on the requirements, and the present invention is not limited herein.
In step 101, the compiled kernel file is obtained from the disk partition, which may be specifically implemented by the following manner:
And acquiring the kernel file in the disk partition based on the relative position of the kernel file in the starting configuration file in the disk partition.
For example, when the operating system is started, since the relative position of the kernel file in the disk partition is specified in the starting configuration file of the operating system, the hardware may load the kernel file based on the relative position of the kernel file in the disk partition, and in the process of starting the kernel file, release each target file that is dependent on the operating system and included in the kernel file to the memory.
The method can store the log file generated in the operation process of the operating system in the disk partition, so that a user can know the operation condition of the electronic equipment conveniently based on the log file; the log file may specifically be a device running state log file or a database file, etc.
Note that the electronic device performing the steps 101 to 105 and the electronic device performing the steps 106 to 112 may be the same device or may be different devices, which is not limited by the present invention.
According to the operating system starting method provided by the embodiment of the invention, the uploaded image file is split into the functional file and the kernel file, then the functional file and the kernel file are stored in the appointed position of the disk partition, and the relative position of the kernel file in the disk partition is added in the starting configuration file of the operating system, so that the installation process of the image file is realized, and preparation is made for starting the operating system; in addition, the independent packaging of the function files and the kernel files is realized, the problem that the kernel files are too large due to the fact that the function files are packaged in the kernel files is avoided, and the function files corresponding to the functions developed by the user can be managed conveniently.
In one embodiment, the above step 110 may be specifically implemented by the following ways:
packaging the kernel file and the function file to obtain a packaged file; and encrypting the packaged file to obtain the mirror image file.
For example, the function file and the kernel file are packaged to obtain a packaged file, and then the packaged file is encrypted based on a first encryption algorithm to obtain an image file. The first encryption algorithm may be an encryption algorithm such as DES or MD5, or an encryption algorithm obtained by integrating DES, RC4, and AES, which is not limited in the present invention.
According to the operating system starting method provided by the embodiment of the invention, the function file and the kernel file are packaged to obtain the packaged file, and the packaged file is encrypted, so that the image file is checked when the operating system is started later, and the problem that personnel maliciously upload the useless image file to influence the normal starting and running of the operating system is avoided.
In an embodiment, the above-mentioned packaging of the kernel file and the function file to obtain a packaged file may be implemented in the following manner:
encrypting the function file to obtain an encrypted function file; and packaging the kernel file and the encrypted functional file to obtain the packaged file.
Illustratively, when the function file is obtained, the function file is encrypted based on a second encryption algorithm to obtain an encrypted function file, for example, the encrypted function file may be expressed as secgate. And then packaging the kernel file bzImage and the encrypted functional file secgate.tar.xz to obtain a packaged file, wherein the packaged file can be expressed as a system_os.tar.gz, and the image file obtained by encrypting the packaged file system_os.tar.gz can be expressed as a system_os.sign.
It should be noted that the second encryption algorithm may be an encryption algorithm obtained by integrating DES, RC4 and AES, or may be other encryption algorithms such as DES, RC4, AES, or the like, which is not limited in the present invention.
According to the operating system starting method provided by the embodiment of the invention, the function file is encrypted so as to prevent the function file from being stolen, and the safety of the function file is improved.
In an embodiment, the above steps 111 and 112 may be specifically implemented by the following ways:
decrypting the image file to obtain a decrypted package file; splitting the decrypted packaged file to obtain the kernel file and the encrypted functional file; and storing the kernel file and the encrypted function file in the disk partition.
In the process of installation or upgrading, the operating system uploads the encrypted image file to obtain the encrypted image file, decrypts the encrypted image file based on a first decryption algorithm corresponding to the first encryption algorithm to verify whether the uploaded image file is an autonomously created image file or not, and prevents malicious uploading of useless image files; after decryption is successful, a decrypted packaging file is obtained, then the decrypted packaging file is split to obtain a kernel file and an encrypted functional file, finally the kernel file and the encrypted functional file are stored in a disk partition, the function file stored in the disk partition and independently developed is prevented from being stolen, after encryption, even if a hard disk which the disk partition belongs to is intercepted by other users, the hard disk is mounted on other equipment, the specific content of the function file cannot be stolen, and the safety of the function file is improved; of course, the kernel file in the image file may be encrypted separately, and the encrypted kernel file and the encrypted functional file may be encrypted to obtain the image file.
The operating system starting method provided by the embodiment of the invention verifies the encrypted image file, and prevents malicious uploading of useless image files; and the kernel file and the encrypted functional file are stored in the disk partition, so that the independently developed functional file stored in the disk partition is prevented from being stolen, and the safety of the functional file is improved.
In an embodiment, the function file further includes a second start script and a function script corresponding to at least one target function; the function subfiles comprise an executable file and at least one dynamic library file on which the executable file depends; the above step 104 may be specifically implemented by the following manner:
operating each target file and executing the second starting script; and starting the function script, the executable file and the dynamic library file on which the executable file depends, which correspond to the target function realized based on the function script through the second starting script aiming at each target function realized based on the function script.
And starting an executable file corresponding to the target function which is not realized based on the function script and a dynamic library file on which the executable file depends through the second starting script aiming at each target function which is not realized based on the function script.
The second start script included in the function file may be a start/sh script, and the executable file may be a binary process file; in addition, when the target function is realized, the target function is realized through an executable file corresponding to the target function and at least one dynamic library file on which the executable file depends, and some target functions may need to use a function script, some target functions do not need to use the function script, and specifically, whether the function script needs to be used or not can be determined based on a service corresponding to the target function.
In the starting process of the operating system, each target file depended by the operating system needs to be operated, and for each target function realized based on the function script, after decompression of the function file secgate.tar.xz is completed, a second starting script obtained by decompression is executed, and the function script, the executable file and the dynamic library file depended by the executable file corresponding to the target function realized based on the function script are started through the second starting script, so that each target function realized based on the function script can be normally operated after the operating system completes starting.
For each target function which is not realized based on the function script, after the decompression of the function file secgate. Tar. Xz is completed, executing a second starting script which is decompressed out, and starting an executable file corresponding to the target function which is not realized based on the function script and a dynamic library file on which the executable file depends through the second starting script, so that each target function which is not realized based on the function script can normally run after the starting of an operating system is completed.
According to the operating system starting method provided by the embodiment of the invention, after the operating system is started, each target function realized based on the function script and each target function realized not based on the function script can normally run, and the states of the operating system after each starting are the same due to the fact that the disk partition where the function file and the mirror image file of the kernel file are stored is mounted in the starting process of the operating system. Therefore, after the operation system is started next time, the temporary files generated in the operation process after the last start are automatically cleaned, and a user does not need to manually delete the temporary files, so that the deletion efficiency of the temporary files is improved; in addition, in the running process of the operating system, if the target files and/or the functional sub-files relied on by the operating system in the kernel are deleted by the user, the target files and/or the functional sub-files can be restored after the operating system is restarted, so that the reliability of the operating system is improved, and the user is not required to restore important files by reloading the original operating system.
The operating system starting device provided by the invention is described below, and the operating system starting device described below and the operating system starting method described above can be referred to correspondingly.
Fig. 4 is a schematic structural diagram of an operating system starting device according to an embodiment of the present invention, and as shown in fig. 4, the operating system starting device 400 includes a first obtaining unit 401, an executing unit 402, a mounting unit 403, a releasing unit 404, and a starting unit 405; wherein:
a first obtaining unit 401, configured to obtain a kernel file in a disk partition; the kernel file comprises a user-level process, a first starting script and at least one target file relied by an operating system;
an execution unit 402, configured to start the user-level process and execute a first start script;
a mounting unit 403, configured to mount the disk partition through the first startup script; the method comprises the steps that a function file is stored in a disk partition, and the function file comprises at least one function subfile corresponding to each target function;
a releasing unit 404, configured to access the disk partition, and release each of the functional subfiles in the disk partition in a memory;
a starting unit 405, configured to start the operating system based on each of the function subfiles and each of the target files.
The operating system starting device provided by the embodiment of the invention acquires the compiled kernel file in the disk partition, starts the user-level process in the kernel file, executes the first starting script, mounts the disk partition storing the functional file through the executed first starting script, releases each functional sub-file in the disk partition into the memory, and further starts the operating system based on each functional sub-file and each target file. It can be known that the method stores the kernel files including the function files and the compiled kernel files in the disk partition, the compiled kernel files include the object files which are depended by the operating system, and the operating system acquires the kernel files and the function files required by the operating system from the disk partition when the operating system is started each time, so that the states of the operating system after each time of starting are the same. Therefore, after the operation system is started next time, the temporary files generated in the operation process after the last start are automatically cleaned, namely, the temporary files are deleted by restarting the operation system, and a user does not need to manually delete the temporary files, so that the deletion efficiency of the temporary files is improved.
Based on any of the above embodiments, the operating system startup device 400 further includes:
The second acquisition unit is used for acquiring at least one target file which is dependent on the operating system and path information of each target file in the memory;
a generating unit, configured to generate a list file based on each of the target files and the corresponding path information;
the adding unit is used for adding the path information of each target file in the list file in the memory into the kernel configuration file;
the compiling unit is used for acquiring corresponding target files based on path information of each target file in the memory in the kernel configuration file in the compiling process to obtain the compiled kernel files;
and the packaging unit is used for packaging the kernel file and the function file to obtain the image file.
Based on any of the above embodiments, the operating system startup device 400 further includes:
the splitting unit is used for splitting the mirror image file to obtain the kernel file and the function file;
the storage unit is used for storing the kernel file and the function file in the disk partition, and adding the relative position of the kernel file in the disk partition in a starting configuration file of an operating system;
The first obtaining unit 401 is specifically configured to:
and acquiring the kernel file in the disk partition based on the relative position of the kernel file in the starting configuration file in the disk partition.
Based on any of the above embodiments, the packaging unit is specifically configured to:
packaging the kernel file and the function file to obtain a packaged file;
and encrypting the packaged file to obtain the mirror image file.
Based on any of the above embodiments, the packaging unit is specifically configured to:
encrypting the function file to obtain an encrypted function file;
and packaging the kernel file and the encrypted functional file to obtain the packaged file.
Based on any of the above embodiments, the splitting unit is specifically configured to:
decrypting the image file to obtain a decrypted package file;
splitting the decrypted packaged file to obtain the kernel file and the encrypted functional file;
the storage unit is specifically configured to:
and storing the kernel file and the encrypted functional file in the disk partition.
Based on any one of the above embodiments, the function file further includes a second start script and a function script corresponding to at least one target function; the function subfiles comprise an executable file and at least one dynamic library file on which the executable file depends; the starting unit 405 is specifically configured to:
Operating each target file and executing the second starting script;
starting a function script, an executable file and a dynamic library file on which the executable file depends, which correspond to the target function realized based on the function script through the second starting script aiming at each target function realized based on the function script;
and starting an executable file corresponding to the target function which is not realized based on the function script and a dynamic library file on which the executable file depends through the second starting script aiming at each target function which is not realized based on the function script.
Fig. 5 is a schematic physical structure of an electronic device according to an embodiment of the present invention, as shown in fig. 5, the electronic device may include: processor 510, communication interface (Communications Interface) 520, memory 530, and communication bus 540, wherein processor 510, communication interface 520, memory 530 complete communication with each other through communication bus 540. Processor 510 may invoke logic instructions in memory 530 to perform the following method: acquiring a compiled kernel file in a disk partition; the kernel file comprises a user-level process, a first starting script and at least one target file relied by an operating system;
Starting the user-level process and executing a first starting script;
mounting the disk partition through the first starting script; the method comprises the steps that a function file is stored in a disk partition, and the function file comprises at least one function subfile corresponding to each target function;
accessing the disk partition, and releasing each function subfile in the disk partition into a memory;
and starting the operating system based on each function sub-file and each target file.
Further, the logic instructions in the memory 530 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, embodiments of the present invention further provide a non-transitory computer readable storage medium having stored thereon a computer program that, when executed by a processor, is implemented to perform the operating system startup method provided in the above embodiments, for example, including: acquiring a compiled kernel file in a disk partition; the kernel file comprises a user-level process, a first starting script and at least one target file relied by an operating system;
starting the user-level process and executing a first starting script;
mounting the disk partition through the first starting script; the method comprises the steps that a function file is stored in a disk partition, and the function file comprises at least one function subfile corresponding to each target function;
accessing the disk partition, and releasing each function subfile in the disk partition into a memory;
and starting the operating system based on each function sub-file and each target file.
In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the operating system boot method provided by the methods above, the method comprising: acquiring a compiled kernel file in a disk partition; the kernel file comprises a user-level process, a first starting script and at least one target file relied by an operating system;
Starting the user-level process and executing a first starting script;
mounting the disk partition through the first starting script; the method comprises the steps that a function file is stored in a disk partition, and the function file comprises at least one function subfile corresponding to each target function;
accessing the disk partition, and releasing each function subfile in the disk partition into a memory;
and starting the operating system based on each function sub-file and each target file.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (11)

1. An operating system boot method, comprising:
acquiring a compiled kernel file in a disk partition; the kernel file comprises a user-level process, a first starting script and at least one target file relied by an operating system;
starting the user-level process and executing a first starting script;
mounting the disk partition through the first starting script; the method comprises the steps that a function file is stored in a disk partition, and the function file comprises at least one function subfile corresponding to each target function;
accessing the disk partition, and releasing each function subfile in the disk partition into a memory;
And starting the operating system based on each function sub-file and each target file.
2. The operating system boot method of claim 1, wherein the method further comprises:
acquiring at least one target file relied by the operating system and path information of each target file in a memory;
generating a list file based on each target file and corresponding path information;
the path information of each target file in the list file in the memory is added into the kernel configuration file;
in the compiling process, acquiring a corresponding target file based on path information of each target file in a memory in the kernel configuration file to obtain the compiled kernel file;
and packaging the kernel file and the function file to obtain an image file.
3. The operating system boot method of claim 2, wherein the method further comprises:
splitting the mirror image file to obtain the kernel file and the function file;
storing the kernel file and the function file in the disk partition, and adding the relative position of the kernel file in the disk partition in a starting configuration file of an operating system;
The obtaining the compiled kernel file in the disk partition includes:
and acquiring the kernel file in the disk partition based on the relative position of the kernel file in the starting configuration file in the disk partition.
4. The operating system startup method according to claim 3, wherein said packaging said kernel file and said function file to obtain said image file comprises:
packaging the kernel file and the function file to obtain a packaged file;
and encrypting the packaged file to obtain the mirror image file.
5. The operating system boot method of claim 4, wherein said packaging the kernel file and the function file to obtain a packaged file comprises:
encrypting the function file to obtain an encrypted function file;
and packaging the kernel file and the encrypted functional file to obtain the packaged file.
6. The operating system startup method according to claim 5, wherein splitting the image file to obtain the kernel file and the function file comprises:
Decrypting the image file to obtain a decrypted package file;
splitting the decrypted packaged file to obtain the kernel file and the encrypted functional file;
the storing the kernel file and the function file in the disk partition includes:
and storing the kernel file and the encrypted functional file in the disk partition.
7. The method for starting up an operating system according to any one of claims 1 to 6, wherein the function file further includes a second start-up script and a function script corresponding to at least one target function; the function subfiles comprise an executable file and at least one dynamic library file on which the executable file depends;
the starting the operating system based on each of the function subfiles and each of the target files includes:
operating each target file and executing the second starting script;
starting a function script, an executable file and a dynamic library file on which the executable file depends, which correspond to the target function realized based on the function script through the second starting script aiming at each target function realized based on the function script;
and starting an executable file corresponding to the target function which is not realized based on the function script and a dynamic library file on which the executable file depends through the second starting script aiming at each target function which is not realized based on the function script.
8. An operating system boot device, comprising:
the first acquisition unit is used for acquiring a kernel file in a disk partition; the kernel file comprises a user-level process, a first starting script and at least one target file relied by an operating system;
the execution unit is used for starting the user-level process and executing a first starting script;
the mounting unit is used for mounting the disk partition through the first starting script; the method comprises the steps that a function file is stored in a disk partition, and the function file comprises at least one function subfile corresponding to each target function;
the releasing unit is used for accessing the disk partition and releasing each function subfile in the disk partition into a memory;
and the starting unit is used for starting the operating system based on the functional subfiles and the target files.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the operating system boot method of any of claims 1 to 7 when the program is executed by the processor.
10. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the operating system boot method according to any of claims 1 to 7.
11. A computer program product having stored thereon executable instructions which, when executed by a processor, cause the processor to implement the operating system boot method of any of claims 1 to 7.
CN202310596119.9A 2023-05-16 2023-05-24 Operating system starting method and device Pending CN116775137A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2023105532992 2023-05-16
CN202310553299 2023-05-16

Publications (1)

Publication Number Publication Date
CN116775137A true CN116775137A (en) 2023-09-19

Family

ID=87995477

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310596119.9A Pending CN116775137A (en) 2023-05-16 2023-05-24 Operating system starting method and device

Country Status (1)

Country Link
CN (1) CN116775137A (en)

Similar Documents

Publication Publication Date Title
CN108628658B (en) License management method and device for container
US9244674B2 (en) Computer system supporting remotely managed IT services
EP2765508B1 (en) Installation method and installation device for application software
US9552201B2 (en) System and method for incremental software installation
JP6352535B2 (en) Programmatic event detection and message generation for requests to execute program code
US8924954B2 (en) Application software installation method and application software installation apparatus
CN109597626B (en) Component deployment method and device
US20070094348A1 (en) BITS/RDC integration and BITS enhancements
US20070038884A1 (en) System and method of remote storage of data using client software
US20110131564A1 (en) Systems and methods for generating a version identifier for a computing system based on software packages installed on the computing system
KR20170022028A (en) Method and apparatus for security checking of image for container
US20220398321A1 (en) Data management
US10924275B1 (en) Creating multiple encrypted volumes from a single source
CN110347483B (en) Method and device for migrating physical machine to virtual machine and storage medium
US20130024681A1 (en) Systems and methods for activation of applications using client-specific data
US8005851B2 (en) Streaming virtual disk for virtual applications
US20160266892A1 (en) Patching of virtual machines during data recovery
CN113382024B (en) Rotation method of credential, computing device and storage medium
KR101638689B1 (en) System and method for providing client terminal to user customized synchronization service
US20160162365A1 (en) Storing difference information in a backup system
US20180225105A1 (en) Mechanism for customizing multiple computing devices
KR102353475B1 (en) Application Providing System using Cloud Virtual File, Cloud Server and Application Providing Method, Service Server and Service Method, Mobile and Application Practicing Method
US9348849B1 (en) Backup client zero-management
CN116775137A (en) Operating system starting method and device
US20200401389A1 (en) Selectively installing applications based on manifest files

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination