CN114443582A - File system mounting method, device, equipment and medium on operating system - Google Patents

File system mounting method, device, equipment and medium on operating system Download PDF

Info

Publication number
CN114443582A
CN114443582A CN202111582776.5A CN202111582776A CN114443582A CN 114443582 A CN114443582 A CN 114443582A CN 202111582776 A CN202111582776 A CN 202111582776A CN 114443582 A CN114443582 A CN 114443582A
Authority
CN
China
Prior art keywords
file
firmware
operating system
target
compiled
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.)
Granted
Application number
CN202111582776.5A
Other languages
Chinese (zh)
Other versions
CN114443582B (en
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.)
Kedong Guangzhou Software Technology Co Ltd
Original Assignee
Kedong Guangzhou Software Technology 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 Kedong Guangzhou Software Technology Co Ltd filed Critical Kedong Guangzhou Software Technology Co Ltd
Priority to CN202111582776.5A priority Critical patent/CN114443582B/en
Publication of CN114443582A publication Critical patent/CN114443582A/en
Application granted granted Critical
Publication of CN114443582B publication Critical patent/CN114443582B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1727Details of free space management performed by the file system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • 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/4401Bootstrapping
    • G06F9/4406Loading of operating system

Abstract

The embodiment of the invention discloses a method, a device, equipment and a medium for mounting a file system on an operating system. The method for mounting the file system on the operating system comprises the following steps: acquiring a firmware file to be mounted of a system to be mounted; the system to be mounted comprises an operating system and a file system; the firmware files to be mounted comprise operating system firmware files and file system firmware files; determining a file loading address of a firmware file to be mounted, and storing the firmware file to be mounted to a target storage partition according to the file loading address; the file loading addresses corresponding to different firmware files to be mounted are different; and in response to a system restart instruction, mounting the system to be mounted through the target storage partition. The technical scheme of the embodiment of the invention can simplify the mounting process of the operating system, thereby improving the safety and reliability of the operating system.

Description

File system mounting method, device, equipment and medium on operating system
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a method, a device, equipment and a medium for mounting a file system on an operating system.
Background
The software mechanism in the operating system that is responsible for managing and storing file information is called a file management system, referred to as a file system for short. That is, various operations may be performed in a computer device running an operating system only after the operating system mounts the file system. Therefore, the file system needs to be mounted by the operating system before the operating system is started.
The method for mounting a file system on an operating system of an existing operating system includes that when a circuit board is started for the first time, after the operating system is guided to start through a BootLoader (operating system guide program), a partition for storing the file system on a storage device is formatted, operating system files and file system files (such as user programs and user data) of the operating system are stored in the partition for storing the file system together after the partition is formatted, and when the circuit board is started for the second time, the operating system files and the file system files of the operating system are obtained in the partition for storing the file system through the BootLoader, and the operating system files of the operating system are loaded, so that the file system files are mounted through the operating system.
However, in the existing method for mounting a file system on an operating system, when the file system is mounted after the operating system file of the operating system is loaded, if the storage file system partition is not formatted, the file system cannot be successfully mounted. Therefore, after the operating system file of the operating system is loaded, the partition storing the file system must be formatted first to mount the file system, and the mounting process is complicated, resulting in poor security and reliability of the operating system.
Disclosure of Invention
Embodiments of the present invention provide a method, an apparatus, a device, and a medium for mounting a file system on an operating system, which can simplify a mounting process of the operating system, thereby improving security and reliability of the operating system.
In a first aspect, an embodiment of the present invention provides a method for mounting a file system on an operating system, which is applied to an operating system boot program, and includes:
acquiring a firmware file to be mounted of a system to be mounted; the system to be mounted comprises an operating system and a file system; the firmware files to be mounted comprise operating system firmware files and file system firmware files;
determining a file loading address of the firmware file to be mounted, and storing the firmware file to be mounted to a target storage partition according to the file loading address; the file loading addresses corresponding to different firmware files to be mounted are different;
and responding to a system restart instruction, and mounting the system to be mounted through the target storage partition.
In a second aspect, an embodiment of the present invention further provides a device for mounting a file system on an operating system, configured in an operating system boot program, including:
the firmware file to be mounted acquiring module is used for acquiring a firmware file to be mounted of the system to be mounted; the system to be mounted comprises an operating system and a file system; the firmware files to be mounted comprise operating system firmware files and file system firmware files;
the firmware file storage module to be mounted is used for determining a file loading address of the firmware file to be mounted and storing the firmware file to be mounted to a target storage partition according to the file loading address; the file loading addresses corresponding to different firmware files to be mounted are different;
and the system to be mounted is mounted by the target storage partition in response to a system restart instruction.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for mounting the file system on the operating system provided by the embodiment of the invention.
In a fourth aspect, an embodiment of the present invention further provides a computer storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for mounting a file system on an operating system according to the embodiment of the present invention.
According to the embodiment of the invention, the firmware file to be mounted of the system to be mounted is obtained, the file loading address of the firmware file to be mounted is determined, and the firmware file to be mounted is stored in the target storage partition according to the file loading address, so that the system to be mounted is mounted through the target storage partition in response to the system restart instruction. According to the mounting process of the file system on the operating system, the partition for storing the file system in the equipment for operating the operating system is not required to be formatted before the system is mounted, the mounting process of the system to be mounted is simplified, the problem that the safety and the reliability of the operating system are low due to the existing mounting method of the file system on the operating system is solved, the mounting process of the operating system can be simplified, and therefore the safety and the reliability of the operating system are improved.
Drawings
FIG. 1 is a block diagram of a software architecture for a prior art method for mounting a file system on an operating system;
FIG. 2 is a diagram illustrating a partition structure of a storage device in the prior art;
FIG. 3 is a flow diagram of a prior art method for mounting a file system on an operating system;
FIG. 4 is a flowchart of a method for mounting a file system on an operating system according to an embodiment of the present invention;
FIG. 5 is a flowchart of a method for mounting a file system on an operating system according to a second embodiment of the present invention;
fig. 6 is a flowchart of a method for mounting a file system on an operating system according to a third embodiment of the present invention;
FIG. 7 is a block diagram of a firmware tool according to a third embodiment of the present invention;
FIG. 8 is a flowchart of a firmware creation tool according to a third embodiment of the present invention;
FIG. 9 is a flowchart illustrating a method for mounting a file system on an operating system according to a third embodiment of the present invention;
FIG. 10 is a schematic diagram of a partition structure of a storage device according to a third embodiment of the present invention;
FIG. 11 is a diagram illustrating a file system mount device on an operating system according to a fourth embodiment of the present invention;
fig. 12 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention.
It should be further noted that, for the convenience of description, only some but not all of the relevant aspects of the present invention are shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
In the prior art, fig. 1 is a software architecture block diagram of a file system mount method on an operating system in the prior art, and as shown in fig. 1, the software architecture block diagram of the file system mount method on the operating system in the prior art may include a BootLoader module and an operating system module (e.g., an Intewell operating system module), where the operating system module may further include a file system module and a storage device driver module. After the BootLoader is started to run, the BootLoader loads an operating system into the storage device, and starts the operating system from the partition address of the storage device where the operating system is located. After the operating system is started, the driver module of the storage device is loaded first, and then the file system initialization and the file system mount are executed. After the file system is mounted successfully, the operating system user mode program can operate the file system.
FIG. 2 is a schematic diagram of a partition structure of a storage device in the prior art, and as shown in FIG. 2, partitions of the storage device may include a BootLoader partition, an environment variable partition, and a file system partition; the BootLoader partition can be used for storing files such as BootLoader related codes; the environment variable partition can be used for storing files such as environment variable parameters and the like required by operating the operating system; the file system partition may be used to store files such as system programs and business programs for the operating system.
Fig. 3 is a flowchart of a method for mounting a file system on an operating system in the prior art, and as shown in fig. 3, a specific process of the method for mounting a file system on an operating system in the prior art includes: before a device running an operating system (such as an Intewell operating system) runs the operating system, starting the Intewell operating system from a network, and directly entering a user mode of the Intewell operating system without loading a file system; formatting the storage device according to the format of a file system to be mounted by an application program of a file system partition (namely, a file system partition) of the formatting storage device; restarting the Intewell operating system, and mounting the file system by the Intewell operating system; after the file system is mounted successfully, transmitting a system program and a service program of the Intewell operating system to a file system partition for storage through a network; and modifying the environment variable parameters of the BootLoader, and storing the environment variable parameters into the environment variable partition, so that when the Intewell operating system is restarted, the BootLoader can start the Intewell operating system in the file system partition.
Therefore, in the method for mounting the file system on the operating system in the prior art, after the operating system file of the operating system is loaded, the partition for storing the file system must be formatted first to mount the file system, and the mounting process is complicated, so that the safety and reliability of the operating system are poor.
Example one
Fig. 4 is a flowchart of a method for mounting a file system on an operating system according to an embodiment of the present invention, where this embodiment is applicable to a case where the system is mounted on the operating system without formatting a partition storing the file system in a device running the operating system, and the method may be executed by a system mounting apparatus, where the apparatus may be implemented in a software and/or hardware manner, and may generally be directly integrated in an electronic device executing the method, and the electronic device may be any device configuring a bootstrap program of the operating system, such as a terminal device or a server device, and the embodiment of the present invention does not limit the type of the electronic device executing the method for mounting the file system on the operating system. The operating system boot program may be a program for booting the operating system, for example, BootLoader, and the like, which is not limited in this embodiment of the present invention. Specifically, as shown in fig. 4, the method for mounting a file system on an operating system applied to an operating system boot program may specifically include the following steps:
s410, acquiring a firmware file to be mounted of the system to be mounted; the system to be mounted comprises an operating system and a file system; the firmware files to be mounted comprise operating system firmware files and file system firmware files.
The system to be mounted may be a system that needs to be mounted in an operating system, that is, a file system, such as a file system of an Intewell operating system; or may be a system that needs to perform mount operation in the operating system, that is, an operating system, such as an Intewell operating system; or the system may also include a system that needs to be mounted and a system that needs to perform mounting operation, that is, an operating system and a file system, such as an Intewell operating system and a file system of the Intewell operating system; the embodiments of the present invention do not limit this. The operating system may be a system composed of files related to the kernel of the operating system in the system to be mounted. The file system may be a system composed of files related to user data in the system to be mounted, for example, a system composed of files of an application program related to a user.
The firmware file to be mounted may be a firmware file recognizable by a computer and corresponding to the system to be mounted, for example, an operating system firmware file corresponding to an operating system, a file system firmware file corresponding to a file system, or a firmware file including both the operating system and the file system, which is not limited in this embodiment of the present invention. The operating system firmware file may be a firmware file that can be recognized by a computer corresponding to the operating system, and may be used to start the system to be mounted on the device. The file system firmware file can be a firmware file which can be identified by a computer corresponding to the file system, and can be used for managing and storing user files in the system to be mounted. It is understood that after the firmware file to be mounted is mounted on the device, the device may run the system to be mounted and perform various operations in the system to be mounted.
In the embodiment of the invention, the operating system boot program can acquire the firmware file to be mounted of the system to be mounted so as to determine the file loading address of the firmware file to be mounted. Specifically, the operating system boot program obtains the firmware file to be mounted of the system to be mounted, may obtain the operating system firmware file of the operating system, may also obtain the file system firmware file of the file system, or may also obtain the operating system firmware file of the operating system and the file system firmware file of the file system at the same time.
S420, determining a file loading address of the firmware file to be mounted, and storing the firmware file to be mounted to a target storage partition according to the file loading address; and different file loading addresses corresponding to the firmware files to be mounted are different.
The file loading address may be an address for obtaining a loaded file. It is understood that, when loading a file, the file may be acquired at the file loading address to load the acquired file. The target storage partition may be a partition that stores the firmware file to be mounted. It will be appreciated that different data may be stored in different partitions to enable data to be retrieved in the corresponding partition when the data is retrieved. That is, the file loading addresses corresponding to different firmware files to be mounted are different.
In the embodiment of the invention, after the operating system boot program obtains the firmware file to be mounted of the system to be mounted, the file loading address of the firmware file to be mounted can be further determined, and the firmware file to be mounted is stored in the target storage partition according to the file loading address, so that when the firmware file to be mounted is loaded, the firmware file to be mounted can be obtained in the target storage partition, and the firmware file to be mounted is loaded. For example, the operating system firmware file and the file system firmware file may be stored to different target storage partitions, for example, the operating system firmware file is stored to a target storage partition corresponding to the operating system firmware file, and the file system firmware file is stored to a target storage partition corresponding to the file system firmware file. It will be appreciated that the partition length of the target storage partition may match the storage space occupied by storing the firmware file to be mounted.
S430, responding to a system restarting instruction, and mounting the system to be mounted through the target storage partition.
The system restart instruction may be an instruction for restarting the operating system, for example, an instruction for restarting the Intewell operating system sent by a user, or an instruction for restarting the Intewell operating system sent by the system automatically, and the like.
In the embodiment of the present invention, after determining the file loading address of the firmware file to be mounted and storing the firmware file to be mounted to the target storage partition according to the file loading address, the operating system boot program may further respond to a system restart instruction to mount the system to be mounted through the target storage partition. It can be understood that the operating system boot program mounts the system to be mounted through the target storage partition, which may be that the operating system boot program obtains the firmware file to be mounted of the system to be mounted in the target storage partition, thereby implementing mounting of the system to be mounted.
According to the technical scheme of the embodiment, the firmware file to be mounted of the system to be mounted is obtained, the file loading address of the firmware file to be mounted is determined, and the firmware file to be mounted is stored to the target storage partition according to the file loading address, so that the system to be mounted is mounted through the target storage partition in response to a system restart instruction. According to the mounting process of the file system on the operating system, the partition for storing the file system in the equipment for operating the operating system is not required to be formatted before the mounting of the system, the mounting process of the system to be mounted is simplified, the problem that the safety and reliability of the operating system are low due to the existing mounting method of the file system on the operating system is solved, the mounting process of the operating system can be simplified, and therefore the safety and reliability of the operating system are improved.
Example two
Fig. 5 is a flowchart of a method for mounting a file system on an operating system according to a second embodiment of the present invention, which is a further refinement of the foregoing technical solutions, and this embodiment provides a plurality of specific selectable implementation manners for determining a file loading address of a firmware file to be mounted, storing the firmware file to be mounted to a target storage partition according to the file loading address, and mounting the system to be mounted by the target storage partition in response to a system restart instruction. The solution in this embodiment may be combined with the individual alternatives in one or more of the embodiments described above. As shown in fig. 5, the method may include the steps of:
s510, acquiring a firmware file to be mounted of the system to be mounted.
S520, acquiring firmware file pre-configuration information of the firmware file to be mounted.
The firmware file pre-configuration information may be configuration information of a preset firmware file, for example, configuration information of a file size of the preset firmware file, configuration information of a file content of the preset firmware file, and the like, which is not limited in the embodiment of the present invention.
In the embodiment of the present invention, after acquiring the firmware file to be mounted of the system to be mounted, the operating system boot program may further acquire firmware file pre-configuration information of the firmware file to be mounted, so as to determine a file loading address of the firmware file to be mounted according to the firmware file pre-configuration information.
S530, determining a file loading address of the firmware file to be mounted according to the firmware file pre-configuration information, and storing the firmware file to be mounted to a target storage partition according to the file loading address.
In the embodiment of the present invention, after acquiring the firmware file pre-configuration information of the firmware file to be mounted, the operating system boot program may further determine a file loading address of the firmware file to be mounted according to the firmware file pre-configuration information, and store the firmware file to be mounted to the target storage partition according to the file loading address. For example, if the firmware file pre-configuration information includes configuration information of a preset file size of the firmware file to be mounted, a file loading address of the firmware file to be mounted may be determined according to the file size of the firmware file to be mounted, so that an idle storage space after the file loading address can satisfy a storage space occupied by the file size of the firmware file to be mounted, and the firmware file to be mounted may be stored in the target storage partition according to the file loading address.
S540, responding to a system restarting instruction, and mounting the system to be mounted through the target storage partition.
In the embodiment of the present invention, after the operating system boot program determines the file loading address of the firmware file to be mounted according to the firmware file pre-configuration information and stores the firmware file to be mounted to the file loading address, the operating system boot program may further respond to a system restart instruction and mount the system to be mounted through the target storage partition.
Optionally, after storing the firmware file to be mounted to the target storage partition according to the file loading address, the method may further include: configuring system mounting variable parameters according to the file loading address; correspondingly, before the system to be mounted is mounted through the target storage partition, the method may further include: and positioning the firmware file to be mounted in the target storage partition according to the system mounting variable parameter.
The system mount variable parameter may be a variable parameter required by the system to perform mount operation, for example, a variable parameter required by running an operating system, or a variable parameter for implementing a memory space partition, and the like, which is not limited in the embodiment of the present invention.
Specifically, after the operating system boot program stores the firmware file to be mounted to the target storage partition according to the file loading address, the operating system boot program may further configure the system mounting variable parameter according to the file loading address, so as to locate the firmware file to be mounted in the target storage partition according to the system mounting variable parameter before the system to be mounted is mounted by the target storage partition.
Optionally, configuring a system mount variable parameter according to the file load address may include: updating the environment variable parameters of the bootstrap program of the operating system according to the file loading address; and acquiring a kernel driver code file of the system to be mounted, and updating the driver associated parameters of the kernel driver code file according to the file loading address.
The environment variable parameter may be a parameter that is required by the operating system in the operating system boot program and that can partition the target cache region. The kernel driver code file may be a code file that drives the kernel of the operating system. The drive association parameter may be a parameter related to partitioning the target cache region in the kernel drive code file.
Specifically, after the operating system boot program stores the firmware file to be mounted in the target storage partition according to the file loading address, the operating system boot program may further update an environment variable parameter of the operating system boot program according to the file loading address, acquire a kernel driver code file of the system to be mounted, and update a driver association parameter of the kernel driver code file according to the file loading address, so that before the system to be mounted is mounted in the target storage partition, the firmware file to be mounted in the target storage partition is located according to the environment variable parameter of the operating system boot program and the driver association parameter of the kernel driver code file. Specifically, the operating system boot program updates the environment variable parameter of the operating system boot program according to the file loading address, the operating system boot program may directly update the environment variable parameter, or update the environment variable parameter by updating the environment variable parameter in the file storing the environment variable parameter. It can be understood that different firmware files to be mounted stored in different target storage partitions can be located through the drive association parameters in the kernel driver code file of the system to be mounted and the environment variable parameters in the operating system boot program.
Optionally, the target storage partition may include an operating system partition and a file system partition; correspondingly, mounting the system to be mounted through the target storage partition may include: acquiring and loading an operating system firmware file stored in an operating system partition so as to start an operating system; and acquiring a file system firmware file stored in the file system partition so as to enable the operating system to mount the file system, wherein the file system firmware file can comprise a user service program file.
The operating system partition may be a partition that stores operating system firmware files, among other things. The file system partition may be a partition that stores file system firmware files. It will be appreciated that after the operating system boot program obtains and loads the operating system firmware file, the operating system may be booted based on the operating system firmware file.
Specifically, the operating system boot program may obtain an operating system firmware file of the operating system and a file system firmware file of the file system, and determine a file loading address of the operating system firmware file and a file loading address of the file system firmware file, so as to store the operating system firmware file to the file loading address of the operating system firmware file, and store the file system firmware file to the file loading address of the file system firmware file, thereby determining an operating system partition of the operating system firmware file according to the file loading address of the operating system firmware file, and determining a file system partition of the file system firmware file according to the file loading address of the file system firmware file. And then the operating system boot program can acquire and load the operating system firmware file stored in the operating system partition to start the operating system, and then acquire the file system firmware file stored in the file system partition to mount the file system by the started operating system, so that the mounting of the file system on the operating system is realized. It is understood that the file system firmware file stored in the file system partition may be a user service program file stored in the file system partition.
According to the technical scheme of the embodiment, the firmware file to be mounted of the system to be mounted is obtained through the operating system bootstrap program, the firmware file pre-configuration information of the firmware file to be mounted is obtained, the file loading address of the firmware file to be mounted is determined according to the firmware file pre-configuration information, the firmware file to be mounted is stored to the target storage partition according to the file loading address, and therefore the system to be mounted is mounted through the target storage partition in response to the system restarting instruction. According to the mounting process of the file system on the operating system, the partition for storing the file system in the equipment for operating the operating system is not required to be formatted before the mounting of the system, the mounting process of the system to be mounted is simplified, the problem that the safety and reliability of the operating system are low due to the existing mounting method of the file system on the operating system is solved, the mounting process of the operating system can be simplified, and therefore the safety and reliability of the operating system are improved.
EXAMPLE III
Fig. 6 is a flowchart of a method for mounting a file system on an operating system according to a third embodiment of the present invention, which further details the above technical solutions and shows a variety of specific optional implementation manners for acquiring a firmware associated original file by a firmware generation tool and generating a firmware file to be mounted of a system to be mounted according to the firmware associated original file by the firmware generation tool. The solution in this embodiment may be combined with the individual alternatives in one or more of the embodiments described above. As shown in fig. 6, the method may include the steps of:
s610, acquiring the firmware associated original file through a firmware generation tool.
The firmware generation tool can be used for generating a firmware file to be mounted according to the firmware associated original file. The firmware-associated original file may be associated with the system to be mounted, and may be an original file used to generate the firmware file to be mounted, for example, the original file may be associated with a kernel of the Intewell operating system to be mounted, or an original file associated with user data of the Intewell operating system to be mounted, which is not limited in the embodiment of the present invention.
In the embodiment of the invention, the firmware associated original file is acquired through the firmware generation tool, and the firmware file to be mounted is generated according to the firmware associated original file through the firmware generation tool. It should be noted that, the embodiment of the present invention does not limit the specific manner for implementing the acquisition of the firmware associated original file, as long as the acquisition of the firmware associated original file can be implemented.
Alternatively, the firmware associated original file may include an operating system firmware associated original file and a file system firmware associated original file.
The operating system firmware associated original file may be an original file associated with a kernel of the system to be mounted. The file system firmware associated raw file may be a raw file associated with user data of the system to be mounted.
Optionally, if the firmware associated original file includes a file system firmware associated original file, the corresponding acquired firmware associated original file may acquire an original file related to user data, for example, a program file such as an acquired intewell _ app (operating system user application program).
Optionally, if the firmware associated original file includes an operating system firmware associated original file, the corresponding acquiring the firmware associated original file by the firmware generation tool may include: acquiring a target source code file of an operating system; performing source code conversion on the target source code file according to the compiling parameters of the operating system to obtain a file to be compiled; compiling the file to be compiled to obtain a target compiled file of the operating system; the target compiling file is used for starting and loading an operating system; and determining the target compiling file as an operating system firmware associated original file.
The target source code file may be an original code file written by any programming language, and may be used to implement various functions of the operating system. For example, the target source code file may be an original code file written in C language, may also be an original code file written in C + + language, or may also be an original code file written in java language, and the like, which is not limited in this embodiment of the present invention. The compiling parameter may be a file parameter required for compiling the computer to run the operating system, for example, a file parameter of a real-time operating system required for compiling the computer to run the Intewell operating system, a file parameter of an operating system microkernel required for compiling the computer to run the Intewell operating system, or a file parameter of an operating system configuration required for compiling the computer to run the Intewell operating system, which is not limited in the embodiment of the present invention. The file to be compiled can be a code file which is obtained by performing source code conversion on a target source code file and needs to be compiled, and the code file which can be identified by a computer can be obtained by compiling the file to be compiled. The target compiled file may be a code file that can be recognized by the computer, and may be used to boot and load the operating system, for example, the target compiled file may be a binary code file that can be recognized by the computer. It is understood that after the target compiled file is obtained, the target compiled file may be burned into the computer device, so that the computer device can start loading the Intewell operating system according to the target compiled file.
Specifically, under the condition that the firmware associated original file comprises an operating system firmware associated original file, a target source code file of the operating system is obtained, source code conversion is performed on the target source code file according to the compiling parameters of the operating system to obtain a file to be compiled, the file to be compiled is compiled to obtain a target compiled file, and therefore the target compiled file can be determined to be the operating system firmware associated original file. For example, the obtaining of the target source code file of the operating system may be directly obtaining the target source code file of the Intewell operating system, or obtaining the target source code file of the Intewell operating system through graphical interface software. It can be understood that the graphical interface software is a compiling software for compiling a source code file of an Intewell operating system in the prior art, and can implement a series of operations such as creating, configuring and compiling a source code through the graphical interface software, and the graphical interface software includes the source code file of the Intewell operating system. Specifically, after the file to be compiled is obtained, the file to be compiled is compiled by a compiling method matched with the file to be compiled, so that a target compiled file is obtained. It can be understood that, when the target source code file is compiled by adopting different compiling methods, the target source code file needs to be subjected to source code conversion according to the different compiling methods, so as to obtain a file to be compiled which is matched with the compiling methods. Illustratively, if the target source code file is compiled by using the command line compiling method, the target source code file may be subjected to source code conversion to obtain a file to be compiled, which is matched with the command line compiling method, and the file to be compiled is compiled by using the command line compiling method to obtain the target compiled file.
Optionally, before performing source code conversion on the target source code file according to the compiling parameter of the operating system, the method may further include: acquiring a compiling reference file obtained by compiling the target source code file by an operating system; acquiring a compiled file classification of a compiled reference file; and determining the compiled file classification of the compiled reference file as the compiling parameter of the operating system.
The compiling reference file may be a file obtained by compiling a target source code file through graphical interface software in the prior art, and may be used for determining a source code file to be compiled by other compiling methods according to the compiling reference file. For example, if the microkernel file of the Intewell operating system can be obtained by compiling the target source code file through the graphical interface software in the prior art, the compiling reference file may be the microkernel file of the Intewell operating system, and further determine other compiling methods, such as a source code file that needs to be compiled by the command line compiling method, according to the microkernel file of the Intewell operating system. The compiled file classification may be a classification of different compiled reference files, for example, a classification of compiled reference files that implement different functions, a classification of compiled reference files that occupy different spaces, or a classification of compiled reference files that include different contents, and the like.
Specifically, before performing source code conversion on the target source code file according to the compiling parameters of the operating system, the method may further include obtaining a compiling reference file obtained by compiling the target source code file by the operating system to obtain a compiling file classification of the compiling reference file, so that the compiling file classification of the compiling reference file is determined as the compiling parameters of the operating system. It will be appreciated that the compiled reference file of the operating system is the file necessary to run the operating system. For example, in the prior art, a compiled reference file obtained by compiling a target source code file may run an Intewell operating system, and when other compiling methods, such as a command line compiling method, are used for compiling, it is required that the Intewell operating system is run on a computer and the compiled reference file is also compiled. By determining the compiled file classification of the compiled reference file as the compiling parameter of the operating system, the same compiled file classification of the compiled reference file can be obtained when the file to be compiled is compiled after the target source code file is subjected to source code conversion according to the compiling parameter of the operating system to obtain the file to be compiled.
Optionally, performing source code conversion on the target source code file according to the compiling parameter of the operating system to obtain a file to be compiled, which may include: generating a to-be-compiled grouped file of the to-be-compiled file according to the target source code file and the compiling parameter of the operating system; converting the source board-level configuration file according to the system type of the operating system to obtain a target board-level configuration file; and generating a file to be compiled according to the grouped file to be compiled and the target board-level configuration file.
The group file to be compiled may be a group file to be compiled obtained by grouping the target source code file, for example, the group file to be compiled may be a group file to be compiled obtained by grouping according to different functions of the target source code file, or a group file to be compiled obtained by grouping according to different directories of the target source code file, which is not limited in the embodiment of the present invention. The board-level configuration file may be a file configured for a specific device running the operating system, and for example, may be an external device file supported by the device running the Intewell operating system, a driver file required for running the device running the Intewell operating system, or a code file required for running the device running the Intewell operating system, which is not limited in this embodiment of the present invention. The source board-level configuration file may be a file related to the board-level configuration in the compiled target source code file when the target source code file is compiled by the graphical interface software. The target board-level configuration file may be a board-level configuration file obtained by converting the source board-level configuration file, and the compiling of the packet file to be compiled may be determined according to the target board-level configuration file. It will be appreciated that there may be different board level profiles for different devices running the Intewell operating system.
Specifically, the source code conversion is performed on the target source code file according to the compiling parameter of the operating system to obtain the file to be compiled, which may include that after the packet file to be compiled of the file to be compiled is generated according to the target source code file and the compiling parameter of the operating system, the source board-level configuration file is further converted according to the system type of the operating system to obtain the target board-level configuration file, so that the file to be compiled is generated according to the packet file to be compiled and the target board-level configuration file. It can be understood that the corresponding compiling reference file can be obtained by classifying and determining the compiling file of the compiling reference file as the compiling parameter of the Intewell operating system, generating the to-be-compiled grouped file of the to-be-compiled file according to the target source code file and the compiling parameter of the Intewell operating system, and then compiling the to-be-compiled grouped file.
Optionally, the packet file to be compiled may include a resource allocation file, a kernel code file, and an operating system code file; correspondingly, generating a to-be-compiled grouped file of the to-be-compiled file according to the target source code file and the compiling parameter of the operating system may include: acquiring a microkernel project file, a static library code file and a source project file of a target source code file; generating a resource allocation file according to the microkernel project file and the compiling parameter of the operating system; generating a kernel code file according to the microkernel project file, the static library code file and the compiling parameters of the operating system; generating an operating system code file according to the static library code file, the source project file and the compiling parameter of the operating system; wherein the source project files include board level support package project files and operating system application project files.
The resource allocation file may be a resource allocation file related to an operating System, and for example, the resource allocation file may be a device hardware configuration file, a real-time Virtual slot scheduling configuration file, a VSC (Virtual System architecture) configuration file, or a Virtual machine configuration file, which is not limited in this embodiment of the present invention. The kernel code file may be a code file of a microkernel related to the operating system, for example, a virtual interrupt mapping allocation file or a memory address mapping allocation interface implementation file in the Intewell operating system, which is not limited in the embodiment of the present invention. The os code file may be an os code file related to an os, for example, the os code file may be an Intewell os architecture code file, a BSP (Board Support Package) code file, a component code file, an application code file, or the like, which is not limited in this embodiment of the present invention.
The microkernel project file can be a project file related to the microkernel in a compiled target source code file when the target source code file is compiled through graphical interface software. The static library code file may be a code file related to a static library in a compiled target source code file when the target source code file is compiled by graphical interface software, and may include, for example, an SSK (Small Secure Kernel) static library code file, an Intewell operating system component static library code file, and the like. The source item file may be a file related to the source item in the compiled target source code file when the target source code file is compiled by the graphical interface software, and may include, for example, a board-level support package item file, an operating system application item file, and the like. The board-level support package project file can be a project file related to the board-level support package in a compiled target source code file when the target source code file is compiled through graphical interface software. The operating system application project file may be a project file related to the operating system application in the compiled target source code file when the target source code file is compiled by the graphical interface software.
Specifically, under the condition that the to-be-compiled grouping file comprises a resource allocation file, a kernel code file and an operating system code file, a microkernel project file, a static library code file and a source project file of a target source code file are obtained, wherein the source project file can comprise a board-level support package project file and an operating system application project file. And generating a resource allocation file according to the microkernel project file and the compiling parameter of the operating system, generating a kernel code file according to the microkernel project file, the static library code file and the compiling parameter of the operating system, and generating an operating system code file according to the static library code file, the board-level support package project file, the operating system application project file and the compiling parameter of the operating system, so that a to-be-compiled grouping file can be determined according to the resource allocation file, the kernel code file and the operating system code file.
Optionally, after performing source code conversion on the target source code file according to the compiling parameter of the operating system to obtain a file to be compiled, the method may further include: acquiring a code file to be compiled of the file to be compiled according to the file to be compiled; and generating a code control file to be compiled according to the code file to be compiled of the file to be compiled.
The code file to be compiled can be a code file which needs to be compiled in the file to be compiled. The code control file to be compiled may be a file that controls the code file to be compiled when the file to be compiled is compiled.
Specifically, after the target source code file is subjected to source code conversion according to the compiling parameters of the operating system to obtain the file to be compiled, the code file to be compiled of the file to be compiled can be further obtained according to the file to be compiled, so that the code control file to be compiled is generated according to the code file to be compiled of the file to be compiled. It can be understood that, for different devices running an operating system, the operating systems running on the devices running the operating system are also different, so that the code files to be compiled in the file to be compiled are different, that is, the code files to be compiled are different.
Optionally, compiling the file to be compiled to obtain the target compiled file, which may include: configuring compiling environment configuration information through a target command line compiling tool; the compiling environment configuration information comprises code path information and compiler path information; compiling and generating a target configuration file of a file to be compiled through a target command line compiling tool; determining an object to be compiled according to a code control file to be compiled and a target configuration file of the file to be compiled by a target command line compiling tool; the number of the objects to be compiled is matched with the compiling parameters of the operating system; and compiling the object to be compiled through a target command line compiling tool to obtain a target compiling file.
The target command line compiling tool may be a tool for compiling a file to be compiled, and a code file that can be recognized by a computer may be compiled by the target command line compiling tool. The compiling environment configuration information may be environment configuration information required for compiling the file to be compiled in the target command line compiling tool. The code path information may be path information for compiling the code in the file to be compiled. The compiler path information may be path information of a compile command used when compiling in the target command line compiling tool. The target configuration file may be a configuration file required when the file to be compiled is compiled, and for example, the target configuration file may be a driver configuration file, a kernel version configuration file, a component configuration file, or the like of an external device, which is not limited in the embodiment of the present invention. It is to be understood that the target configuration file is generated for a particular device running the Intewell operating system, and that the target configuration file will vary from device to device running the Intewell operating system. The object to be compiled may be an object to be compiled in a file to be compiled, for example, a macro file to be compiled, or a code file to be compiled, and the embodiment of the present invention does not limit this.
Specifically, compiling the file to be compiled to obtain the target compiled file may include configuring code path information and compiler path information through a target command line compiling tool, compiling and generating a target configuration file of the file to be compiled through the target command line compiling tool, determining the object to be compiled according to the code control file to be compiled and the target configuration file of the file to be compiled, and compiling the object to be compiled through the target command line compiling tool to obtain the target compiled file. Illustratively, if the compiled file classification of the compiled reference file includes vm.bin, vsc.bin, and config.bin, after determining the compiled file classification as the compiling parameters of the Intewell operating system, the compiling parameters of the Intewell operating system also include vm.bin, vsc.bin, and config.bin, where the number of objects to be compiled is 3. Specifically, the object to be compiled is determined according to the code control file to be compiled and the target configuration file of the file to be compiled, and the code control file to be compiled of the file to be compiled may determine the object to be compiled according to the target configuration file. It can be understood that if there are multiple objects to be compiled, multiple target compilation files corresponding to the objects to be compiled can be obtained.
Optionally, the compiling by the target command line compiling tool to generate the target configuration file of the file to be compiled may include: compiling a target board-level configuration file of a file to be compiled through a target command line compiling tool to obtain an initial configuration file; and compiling the initial configuration file according to the compiling requirement data of the file to be compiled by the target command line compiling tool to obtain the target configuration file.
The initial configuration file may be an initial configuration file determined according to the target board-level configuration file, for example, the initial configuration file may be a configuration file of a default configuration, and the like. The compiling requirement data may be requirement data of a configuration to be compiled when the file to be compiled is compiled, for example, requirement data of the configuration to be compiled determined according to actual requirements of a user, requirement data of the configuration to be compiled determined according to functions of an Intewell operating system, and the like, which are not limited in the embodiment of the present invention.
Specifically, the compiling by the target command line compiling tool to generate the target configuration file of the file to be compiled may include compiling the target board-level configuration file of the file to be compiled by the target command line compiling tool to obtain an initial configuration file, and compiling the initial configuration file by the target command line compiling tool according to the compiling requirement data of the file to be compiled, thereby obtaining the target configuration file. It can be understood that, for a specific device running an Intewell operating system, the initial configuration files are all the same, but when the compilation requirement data is different, the initial configuration files can be compiled according to different compilation requirement data, so that a target configuration file meeting the compilation requirement data can be obtained.
S620, generating a firmware file to be mounted of the system to be mounted according to the firmware associated original file through the firmware generation tool.
In the embodiment of the present invention, after the firmware associated original file is acquired by the firmware generation tool, the firmware file to be mounted of the system to be mounted may be further generated by the firmware generation tool according to the firmware associated original file. For example, if the firmware associated original file includes a kernel-related file in the Intewell operating system, the firmware file to be mounted generated according to the firmware associated original file may be an Intewell operating system firmware file. If the firmware associated original file comprises a file related to user data in the Intewell operating system, the firmware file to be mounted generated according to the firmware associated original file may be a file system firmware file.
Optionally, after the firmware associated original file is acquired by the firmware generation tool, the method may further include: carrying out integrity verification on the firmware associated original file through a firmware generation tool; correspondingly, generating the firmware file to be mounted of the system to be mounted according to the firmware associated original file by using the firmware generation tool may include: under the condition that the firmware associated original file is determined to pass the integrity check, acquiring an effective file and a blank file which are included in the firmware associated original file through a firmware generation tool; generating a target effective file matched with the system format of the system to be mounted according to the effective file by a firmware generation tool; generating a target blank file matched with the system format of the system to be mounted according to the blank file by a firmware generation tool; and generating a firmware file to be mounted according to the target effective file and the target blank file by a firmware generating tool.
The valid file may be a file storing valid data, for example, a file including a user application program, or a file including a target compiled file, and the like. The blank file may be a file storing blank data, for example, may be a binary file of full F, and the like, which is not limited in this embodiment of the present invention. The target active file may be an active file in a format that the operating system can mount, for example, an active file in a format that the Intewell operating system can mount. The target whitespace file may be a whitespace file in a format that the operating system can mount, such as a whitespace file in a format that the Intewell operating system can mount.
Specifically, after the firmware associated original file is acquired by the firmware generation tool, integrity check may be further performed on the firmware associated original file by the firmware generation tool to determine whether the firmware associated original file passes the integrity check. If the firmware associated original file can pass the integrity check, the valid file and the blank file included in the firmware associated original file can be acquired through a firmware generation tool. If the firmware associated original file fails the integrity check, the firmware associated original file may be retrieved again. After the effective file and the blank file included in the firmware associated original file are obtained through the firmware generation tool, a target effective file matched with the system format of the system to be mounted can be generated through the firmware generation tool according to the effective file, a target blank file matched with the system format of the system to be mounted is generated through the firmware generation tool according to the blank file, and the firmware file to be mounted is generated through the firmware generation tool according to the target effective file and the target blank file.
It will be appreciated that if the firmware associated original files include an Intewell operating system firmware associated original file and a file system firmware associated original file, then the integrity of the Intewell operating system firmware associated original file and the file system firmware associated original file need to be checked separately by a firmware generation tool. If the firmware associated original file comprises an Intewell operating system firmware associated original file and a file system firmware associated original file, the Intewell operating system firmware associated original file may comprise an Intewell operating system valid file and an Intewell operating system blank file, the file system firmware associated original file may comprise a file system valid file and a file system blank file, the Intewell operating system target valid file may be generated according to the Intewell operating system valid file through a firmware generation tool, the Intewell operating system target blank file may be generated according to the Intewell operating system blank file through the firmware generation tool, the file system target valid file may be generated according to the file system valid file through the firmware generation tool, and the file system target blank file may be generated according to the file system blank file through the firmware generation tool.
It can be further understood that the storage space occupied by the firmware-associated original file is the sum of the storage space occupied by the valid file and the storage space occupied by the blank file, and the storage space occupied by the firmware file to be mounted is the same as the storage space occupied by the firmware-associated original file. If the firmware associated original file comprises an Intewell operating system firmware associated original file and a file system firmware associated original file, the Intewell operating system firmware file can be generated according to the Intewell operating system target valid file and the Intewell operating system target blank file, and the file system firmware file can be generated according to the file system target valid file and the file system target blank file.
According to the technical scheme, the integrity of the firmware associated original file can be improved by carrying out integrity verification on the firmware associated original file, so that the effectiveness of the firmware file to be mounted is improved.
S630, sending the firmware file to be mounted to an operating system bootstrap program through the firmware generation tool, so that the operating system bootstrap program guides the system to be mounted to perform mounting processing according to the firmware file to be mounted.
In the embodiment of the present invention, after the firmware file to be mounted of the system to be mounted is generated by the firmware generation tool according to the firmware associated original file, the firmware file to be mounted may be further sent to the operating system boot program by the firmware generation tool, so that the operating system boot program may boot the system to be mounted for mounting processing according to the firmware file to be mounted.
And S640, acquiring a firmware file to be mounted of the system to be mounted.
S650, acquiring firmware file pre-configuration information of the firmware file to be mounted.
S660, determining a file loading address of the firmware file to be mounted according to the firmware file pre-configuration information, and storing the firmware file to be mounted to a target storage partition according to the file loading address.
S670, responding to a system restarting instruction, and mounting the system to be mounted through the target storage partition.
In a specific example, fig. 7 is a schematic architecture diagram of a firmware manufacturing tool according to a third embodiment of the present invention, and as shown in fig. 7, the firmware manufacturing tool may include a firmware raw file input module, a file identification checking module, a file system format conversion module, and a firmware output module. The firmware original file input module may be configured to acquire a firmware associated original file, and determine a valid file and a blank file included in the firmware associated original file. The file identification checking module can be used for carrying out integrity checking on the firmware associated original file. The file system format conversion module may be configured to convert the firmware associated original file into a to-be-mounted firmware file in an Intewell system format when the firmware associated original file passes the integrity check. The firmware output module can be used for outputting the firmware file to be mounted.
Specifically, fig. 8 is a schematic flowchart of a firmware manufacturing tool according to a third embodiment of the present invention, and as shown in fig. 8, an Intewell folder and a filesystem folder are established; putting original programs of Intewell operating system files, such as config.bin, vsc.bin and vm.bin, into Intewell folders; putting a filesystem original program, such as a business program file (program file such as intewell _ app) into a filesystem folder; using a firmware manufacturing tool to take an Intewell folder as input to manufacture and output Intewell. Bin firmware files are produced and output using the filesystem folder as input using a firmware production tool.
Fig. 9 is a schematic flowchart of a method for mounting a file system on an operating system according to a third embodiment of the present invention, where as shown in fig. 9, after a firmware file to be mounted is generated by a firmware creation tool, an operating system boot program (e.g., BootLoader) may load an intewell.bin firmware file and a filesystem.bin firmware file from a network, and write the intewell.bin firmware file and the filesystem.bin firmware file to a storage device according to a partition address of a target storage partition; changing and saving the Bootloader environment variable to perform partition processing on the storage equipment according to a target storage partition; and executing a restart instruction, directly starting the Intewell operating system after the operating system bootstrap program reads the Intewell firmware file from the storage device, and directly mounting the file system containing the user service program after the Intewell operating system is started, thereby realizing the mounting of the system.
Fig. 10 is a schematic diagram of a partition structure of a storage device according to a third embodiment of the present invention, and as shown in fig. 10, after the storage device is partitioned according to a target storage partition, the storage device may include: BootLoader partition, environment variable partition, Intewell partition, and filesystems partition. The BootLoader partition can be used for storing files such as BootLoader related codes; the environment variable partition can be used for storing files such as environment variable parameters and the like required by the operation of an Intewell operating system; the Intewell partition may be used to store Intewell. A filesystem partition may be used to store a filesystem.
According to the technical scheme, the loading process of the Intewell file system can be simplified, the use efficiency of a user on the Intewell operating system is greatly improved, and the labor cost is reduced; meanwhile, a user can conveniently place the service program in a file system partition in a customized manner, and burn and solidify the Intewell operating system in batches, so that the computer equipment using the Intewell operating system is better commercialized and more accords with the scene of large-scale production of the computer equipment; the Intewell partition of the operating system and the file system filesystem partition are separated, so that the operating system can be normally loaded and started when the file system is damaged and cannot be read and written, and the robustness of the Intewell operating system is guaranteed.
According to the technical scheme of the embodiment, the firmware associated original file is obtained through the firmware generation tool, the firmware file to be mounted of the system to be mounted is generated through the firmware generation tool according to the firmware associated original file, and the firmware file to be mounted is sent to the operating system bootstrap program through the firmware generation tool, so that the operating system bootstrap program guides the system to be mounted to perform mounting processing according to the firmware file to be mounted. After acquiring the firmware file to be mounted of the system to be mounted, the operating system boot program further acquires firmware file pre-configuration information of the firmware file to be mounted, and determines a file loading address of the firmware file to be mounted according to the firmware file pre-configuration information, so that the firmware file to be mounted is stored to the target storage partition according to the file loading address, and the system to be mounted is mounted through the target storage partition in response to a system restart instruction. According to the mounting process of the file system on the operating system, the partition for storing the file system in the equipment for operating the operating system is not required to be formatted before the mounting of the system, the mounting process of the system to be mounted is simplified, the problem that the safety and reliability of the operating system are low due to the existing mounting method of the file system on the operating system is solved, the mounting process of the operating system can be simplified, and therefore the safety and reliability of the operating system are improved.
Example four
Fig. 11 is a schematic diagram of a device for mounting a file system on an operating system according to a fourth embodiment of the present invention, as shown in fig. 11, the device is configured in an operating system boot program, and includes: a to-be-mounted firmware file obtaining module 1110, a to-be-mounted firmware file storing module 1120, and a to-be-mounted system mounting module 1130, wherein:
a to-be-mounted firmware file obtaining module 1110, configured to obtain a to-be-mounted firmware file of a to-be-mounted system; the system to be mounted comprises an operating system and a file system; the firmware files to be mounted comprise operating system firmware files and file system firmware files;
a to-be-mounted firmware file storage module 1120, configured to determine a file loading address of the to-be-mounted firmware file, and store the to-be-mounted firmware file to a target storage partition according to the file loading address; the file loading addresses corresponding to different firmware files to be mounted are different;
the system to be mounted mounting module 1130 is configured to mount, in response to a system restart instruction, the system to be mounted through the target storage partition.
According to the technical scheme of the embodiment, the firmware file to be mounted of the system to be mounted is obtained, the file loading address of the firmware file to be mounted is determined, and the firmware file to be mounted is stored to the target storage partition according to the file loading address, so that the system to be mounted is mounted through the target storage partition in response to a system restart instruction. According to the mounting process of the file system on the operating system, the partition for storing the file system in the equipment for operating the operating system is not required to be formatted before the mounting of the system, the mounting process of the system to be mounted is simplified, the problem that the safety and reliability of the operating system are low due to the existing mounting method of the file system on the operating system is solved, the mounting process of the operating system can be simplified, and therefore the safety and reliability of the operating system are improved.
Optionally, the to-be-mounted firmware file storage module 1120 may be specifically configured to: acquiring firmware file pre-configuration information of a firmware file to be mounted; and determining a file loading address of the firmware file to be mounted according to the firmware file pre-configuration information.
Optionally, the to-be-mounted firmware file storage module 1120 may be further specifically configured to: configuring system mounting variable parameters according to the file loading address; correspondingly, the system to be mounted module 1130 may be specifically configured to: and positioning the firmware file to be mounted in the target storage partition according to the system mounting variable parameter.
Optionally, the to-be-mounted firmware file storage module 1120 may be further configured to: updating the environment variable parameters of the bootstrap program of the operating system according to the file loading address; and acquiring a kernel driver code file of the system to be mounted, and updating the driver associated parameters of the kernel driver code file according to the file loading address.
Alternatively, the target storage partition may include an operating system partition and a file system partition.
Optionally, the to-be-mounted system mounting module 1130 may be specifically configured to: acquiring and loading an operating system firmware file stored in an operating system partition so as to start an operating system; acquiring a file system firmware file stored in a file system partition so that an operating system mounts the file system; wherein the file system firmware file comprises a user service program file.
Optionally, the to-be-mounted firmware file obtaining module 1110 may be specifically configured to: acquiring a firmware associated original file through a firmware generation tool; generating a firmware file to be mounted of the system to be mounted according to the firmware associated original file by a firmware generation tool; and sending the firmware file to be mounted to an operating system bootstrap program through a firmware generation tool so that the operating system bootstrap program guides the system to be mounted to carry out mounting processing according to the firmware file to be mounted.
Optionally, the to-be-mounted firmware file obtaining module 1110 may be further configured to: carrying out integrity verification on the firmware associated original file through a firmware generation tool; under the condition that the firmware associated original file is determined to pass the integrity check, acquiring an effective file and a blank file which are included in the firmware associated original file through a firmware generation tool; generating a target effective file matched with the system format of the system to be mounted according to the effective file through a firmware generation tool; generating a target blank file matched with the system format of the system to be mounted according to the blank file by a firmware generation tool; and generating a firmware file to be mounted according to the target effective file and the target blank file by a firmware generating tool.
The device for mounting the file system on the operating system can execute the method for mounting the file system on the operating system provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. For details of the technology that are not described in detail in this embodiment, reference may be made to a method for mounting a file system on an operating system according to any embodiment of the present invention.
Since the above-described mounting device for a file system on an operating system is a device capable of executing the mounting method for a file system on an operating system in the embodiment of the present invention, based on the mounting method for a file system on an operating system described in the embodiment of the present invention, a person skilled in the art can understand the specific implementation manner and various variations of the mounting device for a file system on an operating system in the embodiment of the present invention, and therefore, how the mounting device for a file system on an operating system implements the mounting method for a file system on an operating system in the embodiment of the present invention is not described in detail herein. The device used by those skilled in the art to implement the method for mounting the file system on the operating system in the embodiment of the present invention is within the scope of the present application.
EXAMPLE five
Fig. 12 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention. FIG. 12 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 12 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 12, the electronic device 12 is in the form of a general purpose computing device. The components of electronic device 12 may include, but are not limited to: one or more processors 16, a memory 28, and a bus 18 that couples various system components (including the memory 28 and the processors 16).
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
Electronic device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 28 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 30 and/or cache Memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 12, and commonly referred to as a "hard drive"). Although not shown in FIG. 12, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk-Read Only Memory (CD-ROM), a Digital Video disk (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination of which may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with electronic device 12, and/or with any devices (e.g., network card, modem, etc.) that enable electronic device 12 to communicate with one or more other computing devices. Such communication may be through an Input/Output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), Wide Area Network (WAN), and/or a public Network such as the internet) via the Network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via the bus 18. It should be appreciated that although not shown in FIG. 12, other hardware and/or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, Redundant processing units, external disk drive Arrays, (Redundant Arrays of Independent Disks, RAID) systems, tape drives, and data backup storage systems, to name a few.
The processor 16 executes various functional applications and data processing by running the program stored in the memory 28, so as to implement the file system mount method on the operating system provided by the embodiment of the present invention: acquiring a firmware file to be mounted of a system to be mounted; the system to be mounted comprises an operating system and a file system; the firmware files to be mounted comprise operating system firmware files and file system firmware files; determining a file loading address of the firmware file to be mounted, and storing the firmware file to be mounted to a target storage partition according to the file loading address; the file loading addresses corresponding to different firmware files to be mounted are different; and responding to a system restart instruction, and mounting the system to be mounted through the target storage partition.
EXAMPLE six
An embodiment of the present invention further provides a computer storage medium storing a computer program, where the computer program is used to execute a method for mounting a file system on an operating system according to any one of the above embodiments of the present invention when executed by a computer processor: acquiring a firmware file to be mounted of a system to be mounted; the system to be mounted comprises an operating system and a file system; the firmware files to be mounted comprise operating system firmware files and file system firmware files; determining a file loading address of the firmware file to be mounted, and storing the firmware file to be mounted to a target storage partition according to the file loading address; the file loading addresses corresponding to different firmware files to be mounted are different; and responding to a system restart instruction, and mounting the system to be mounted through the target storage partition.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM) or flash Memory), an optical fiber, a portable compact disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, Radio Frequency (RF), etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will appreciate that the present invention is not limited to the particular embodiments described herein, and that various obvious changes, rearrangements and substitutions will now be apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method for mounting a file system on an operating system is applied to an operating system bootstrap program and comprises the following steps:
acquiring a firmware file to be mounted of a system to be mounted; the system to be mounted comprises an operating system and a file system; the firmware files to be mounted comprise operating system firmware files and file system firmware files;
determining a file loading address of the firmware file to be mounted, and storing the firmware file to be mounted to a target storage partition according to the file loading address; the file loading addresses corresponding to different firmware files to be mounted are different;
and responding to a system restart instruction, and mounting the system to be mounted through the target storage partition.
2. The method according to claim 1, further comprising, after storing the firmware file to be mounted to a target storage partition according to the file loading address:
configuring system mounting variable parameters according to the file loading address;
before the mounting the system to be mounted through the target storage partition, further comprising:
and positioning the firmware file to be mounted in the target storage partition according to the system mounting variable parameter.
3. The method of claim 2, wherein the configuring the system mount variable parameter according to the file load address comprises:
updating the environment variable parameters of the operating system bootstrap program according to the file loading address;
and acquiring a kernel driver code file of the system to be mounted, and updating the driver associated parameters of the kernel driver code file according to the file loading address.
4. The method of claim 1, wherein the target storage partition comprises an operating system partition and a file system partition.
5. The method of claim 4, wherein the mounting the system to be mounted through the target storage partition comprises:
acquiring and loading the operating system firmware file stored in the operating system partition so as to start the operating system;
acquiring the file system firmware file stored in the file system partition so as to mount the file system by the operating system;
wherein the file system firmware file comprises a user service program file.
6. The method according to claim 1, further comprising, before the obtaining the firmware file to be mounted of the system to be mounted:
acquiring a firmware associated original file through a firmware generation tool;
generating the firmware file to be mounted of the system to be mounted according to the firmware associated original file by the firmware generation tool;
and sending the firmware file to be mounted to an operating system bootstrap program through the firmware generation tool so that the operating system bootstrap program guides the system to be mounted to carry out mounting processing according to the firmware file to be mounted.
7. The method of claim 6, further comprising, after the obtaining the firmware associated original file by the firmware generation tool:
performing integrity check on the firmware associated original file through the firmware generation tool;
the generating, by the firmware generation tool, the to-be-mounted firmware file of the to-be-mounted system according to the firmware associated original file includes:
under the condition that the firmware associated original file is determined to pass integrity verification, obtaining an effective file and a blank file included in the firmware associated original file through the firmware generation tool;
generating a target effective file matched with the system format of the system to be mounted according to the effective file by the firmware generation tool;
generating a target blank file matched with the system format of the system to be mounted according to the blank file by the firmware generation tool;
and generating the firmware file to be mounted according to the target effective file and the target blank file by the firmware generation tool.
8. A device for mounting a file system on an operating system, the device being configured to boot an operating system, the device comprising:
the firmware file to be mounted acquiring module is used for acquiring a firmware file to be mounted of a system to be mounted; the system to be mounted comprises an operating system and a file system; the firmware files to be mounted comprise operating system firmware files and file system firmware files;
the firmware file storage module to be mounted is used for determining a file loading address of the firmware file to be mounted and storing the firmware file to be mounted to a target storage partition according to the file loading address; the file loading addresses corresponding to different firmware files to be mounted are different;
and the system to be mounted is mounted by the target storage partition in response to a system restart instruction.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a method for file system mount on an operating system as recited in any of claims 1-7.
10. A computer storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements a method for file system mount on an operating system as claimed in any one of claims 1 to 7.
CN202111582776.5A 2021-12-22 2021-12-22 File system mounting method, device, equipment and medium on operating system Active CN114443582B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111582776.5A CN114443582B (en) 2021-12-22 2021-12-22 File system mounting method, device, equipment and medium on operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111582776.5A CN114443582B (en) 2021-12-22 2021-12-22 File system mounting method, device, equipment and medium on operating system

Publications (2)

Publication Number Publication Date
CN114443582A true CN114443582A (en) 2022-05-06
CN114443582B CN114443582B (en) 2022-11-29

Family

ID=81364778

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111582776.5A Active CN114443582B (en) 2021-12-22 2021-12-22 File system mounting method, device, equipment and medium on operating system

Country Status (1)

Country Link
CN (1) CN114443582B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100235615A1 (en) * 2009-03-13 2010-09-16 Sun Microsystems, Inc. Method and system for discovery of a root file system
CN102541475A (en) * 2012-03-12 2012-07-04 成都市华为赛门铁克科技有限公司 Data storage method and data storage device
CN102841796A (en) * 2011-06-24 2012-12-26 鸿富锦精密工业(深圳)有限公司 Firmware burning method
CN104572140A (en) * 2013-10-10 2015-04-29 深圳中电长城信息安全系统有限公司 Method, device and system for transplanting operating system
CN109086079A (en) * 2018-06-11 2018-12-25 青岛海信移动通信技术股份有限公司 A kind of storage equipment carry management method and device
CN109840096A (en) * 2019-01-02 2019-06-04 紫光华山信息技术有限公司 The installation method and device of operating system
CN110764694A (en) * 2019-09-20 2020-02-07 苏州浪潮智能科技有限公司 Method and system for controlling storage space
CN111666082A (en) * 2020-06-05 2020-09-15 北京元心科技有限公司 Peripheral firmware loading method based on linux operating system, control equipment and computer readable storage medium
CN113272785A (en) * 2018-12-04 2021-08-17 深圳市欢太科技有限公司 Method for mounting file system, terminal equipment and storage medium
CN113434205A (en) * 2021-04-26 2021-09-24 统信软件技术有限公司 Operating system starting method and computing device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100235615A1 (en) * 2009-03-13 2010-09-16 Sun Microsystems, Inc. Method and system for discovery of a root file system
CN102841796A (en) * 2011-06-24 2012-12-26 鸿富锦精密工业(深圳)有限公司 Firmware burning method
CN102541475A (en) * 2012-03-12 2012-07-04 成都市华为赛门铁克科技有限公司 Data storage method and data storage device
CN104572140A (en) * 2013-10-10 2015-04-29 深圳中电长城信息安全系统有限公司 Method, device and system for transplanting operating system
CN109086079A (en) * 2018-06-11 2018-12-25 青岛海信移动通信技术股份有限公司 A kind of storage equipment carry management method and device
CN113272785A (en) * 2018-12-04 2021-08-17 深圳市欢太科技有限公司 Method for mounting file system, terminal equipment and storage medium
CN109840096A (en) * 2019-01-02 2019-06-04 紫光华山信息技术有限公司 The installation method and device of operating system
CN110764694A (en) * 2019-09-20 2020-02-07 苏州浪潮智能科技有限公司 Method and system for controlling storage space
CN111666082A (en) * 2020-06-05 2020-09-15 北京元心科技有限公司 Peripheral firmware loading method based on linux operating system, control equipment and computer readable storage medium
CN113434205A (en) * 2021-04-26 2021-09-24 统信软件技术有限公司 Operating system starting method and computing device

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
AVIAD ZUCK等: "LSDM: Improving the Performance of Mobile Storage with a Log-Structured Address Remapping Device Driver", 《 2014 EIGHTH INTERNATIONAL CONFERENCE ON NEXT GENERATION MOBILE APPS, SERVICES AND TECHNOLOGIES》 *
赵利军等: "面向Linux系统的嵌入式设备陷门模板化框架", 《计算机应用于软件》 *
鲍庆国: "嵌入式设备固件分析的关键技术研究", 《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》 *

Also Published As

Publication number Publication date
CN114443582B (en) 2022-11-29

Similar Documents

Publication Publication Date Title
US10268628B2 (en) Method for extracting BIOS attributes for BIOS management and system therefor
US20120167090A1 (en) Hypervisor for starting a virtual machine
CN108509215B (en) System software replacing method and device, terminal equipment and storage medium
CN113835644B (en) Complete machine migration method, device, equipment and storage medium
US8423994B2 (en) Recipe based application conversion
US20120210114A1 (en) Log file processing system and method
CN112198820B (en) Interrupt service implementation method, device, equipment and storage medium
CN106909362A (en) The method and apparatus that the method and apparatus of BMC firmwares generation, BMC systems start
CN115390996A (en) Virtual machine migration method and device, computing equipment and storage medium
CN115291946A (en) Hongmong system transplanting method, device, electronic equipment and readable medium
CN114756290A (en) Operating system installation method, device and readable storage medium
CN113254089B (en) System boot method correction method, device, equipment and storage medium
CN114127685B (en) Electronic apparatus and control method thereof
CN107911816B (en) Starting method for multi-mode IoT device, multi-mode IoT device and storage medium
CN114443582B (en) File system mounting method, device, equipment and medium on operating system
US20150212866A1 (en) Management system for service of multiple operating environments, and methods thereof
CN116028267A (en) Dual-system secure mobile phone resetting method and device, server and storage medium
CN115469807A (en) Disk function configuration method, device, equipment and storage medium
CN112379867B (en) Embedded operating system, method and storage medium based on modular development
CN112988192A (en) Version updating method and device, electronic equipment and storage medium
CN114461216B (en) File compiling method and device, electronic equipment and storage medium
CN114253615B (en) Method and device for setting bootstrap program, electronic equipment and storage medium
US11500646B1 (en) Tracking heterogeneous operating system installation status during a manufacturing process
CN116302150B (en) Hypervisor self-starting program generation method and operating system starting method
US8555046B2 (en) Computer system and its HW abstraction method

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
GR01 Patent grant
GR01 Patent grant