File system starting method and device of microkernel operating system, equipment and medium
By pre-creating and initializing the image file of the microkernel operating system, independent of the device driver, the problem of long startup time of the microkernel operating system file system is solved, and a faster and more flexible file system startup is achieved.
Patent Information
- Application Number
- CN202311844778.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2024-10-22
AI Technical Summary
The file system of traditional microkernel operating systems takes a long time to start and relies on other device drivers, which limits the system's startup efficiency and flexibility.
By pre-creating the image file of the microkernel operating system, including user mode service package, root service image package and kernel image package, running the system startup program, kernel program and root service program in sequence, initializing the memory file system to include common files and directory operations, and writes the files in the user-mode service package to the memory file system, independent of the device driver.
Significantly improves the startup speed of the file system, making the file system of the microkernel operating system independent of other device drivers, improving startup efficiency and flexibility.
Smart Images

Figure CN118819645A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of microkernel operating systems, and in particular relates to a file system startup method, device, equipment and medium of a microkernel operating system. Background Art
[0002] Computer operating systems can be divided into macrokernel operating systems and microkernel operating systems according to their architecture. A microkernel operating system is a highly modular operating system that runs as many system services as possible as independent processes in user space, with only minimal kernel services running in kernel space.
[0003] The file system is used to organize and allocate space on file storage devices. It is a system responsible for file storage and protection and retrieval of stored files. In a microkernel operating system, the kernel does not contain device drivers, file system services, network services, etc., so the microkernel startup has nothing to do with the file system.
[0004] After the microkernel is started, the file system is not initialized and needs to be started in user mode. Currently, the more typical microkernel operating systems are seL4 and Fuchsia. The seL4 operating system does not support file systems and dynamic loading. The user programs that need to be loaded must be determined during the compilation phase, which has great limitations. In the Fuchsia operating system, after the kernel is started, it needs to go through multiple stages and start multiple user programs in sequence before the real file system can be started, which takes a long time. Summary of the invention
[0005] The embodiments of the present invention provide a file system startup method, device, equipment and medium of a microkernel operating system, which can effectively solve the problem of long startup time in the traditional microkernel file system startup method.
[0006] In a first aspect, an embodiment of the present invention provides a method for starting a file system of a microkernel operating system, the method comprising:
[0007] Pre-create the image file of the microkernel operating system, which includes a user-mode service package, a root service image package, a kernel image package, and a system startup image package;
[0008] Run the system startup program in the system startup image package;
[0009] Start the kernel program in the kernel image package;
[0010] Start the root service program in the root service image package, so that the root service program initializes the memory file system until the initialized memory file system includes common file and directory operations;
[0011] Write all files in the user-mode service package to the memory file system.
[0012] In one practicable implementation, the user-mode service package includes a dynamic linker, a shared library, a driver library, an executable file, and a configuration file.
[0013] In one practicable implementation, pre-creating an image file of a microkernel operating system includes:
[0014] Put the user-mode service package into the root service program for compilation and linking to generate a root service image package;
[0015] Compile and link the kernel program to generate a kernel image package;
[0016] Put the root service image package and the kernel image package into the system startup program for compilation and linking to generate the system startup image package;
[0017] The generated system startup image package is determined as the pre-created image file.
[0018] In an achievable implementation, running a system startup program in a system startup image package includes:
[0019] Extract the root service image package and kernel image package;
[0020] Parse the kernel image package and map the address space of the kernel program;
[0021] Parse the root service image package and transmit the parsing results to the kernel program.
[0022] In one practicable implementation, starting a kernel program in a kernel image package includes:
[0023] Map the address space of the root service program according to the parsing result of the root service image package to create the root service program;
[0024] Schedule root service program.
[0025] In an achievable implementation, before writing all files in the user-mode service package into the memory file system, the method further includes:
[0026] Extract all files in the user-mode service package.
[0027] In an achievable implementation, after all the extracted files are written into the memory file system, the file system startup method further includes:
[0028] Responding to user actions;
[0029] Loading a statically linked user program; and / or
[0030] The dynamically linked user program is loaded through a dynamic linker, wherein the user program includes a specific file system and a driver library.
[0031] In a second aspect, an embodiment of the present invention provides a file system startup device, the device comprising:
[0032] A creation module is used to pre-create the image file of the microkernel operating system. The image file of the microkernel operating system includes a user-mode service package, a root service image package, a kernel image package, and a system startup image package;
[0033] The first running module is used to run the system startup program in the system startup image package;
[0034] The first startup module is used to start the kernel program in the kernel image package;
[0035] A second startup module is used to start the root service program in the root service image package, so that the root service program initializes the memory file system until the initialized memory file system includes common file and directory operations;
[0036] A processing module is used to write all files in the user-mode service package into the memory file system.
[0037] In a third aspect, an embodiment of the present invention provides an electronic device, the device comprising: a processor, and a memory storing computer program instructions;
[0038] The processor reads and executes computer program instructions to implement the file system startup method as described in any one of the first aspects.
[0039] In a fourth aspect, an embodiment of the present invention provides a computer storage medium having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, a file system startup method as described in any one of the first aspects is implemented.
[0040] The file system startup method of the embodiment of the present invention can pre-create the image file of the microkernel operating system, and run the system startup program, the kernel program and the root service program in sequence. After the root service program runs, the memory file system can be initialized, so that the memory file system includes complete file system functions. After that, all files in the user state service package are written into the memory file system, so that the file system of the microkernel operating system at this time does not rely on other device drivers, thereby effectively improving the startup speed of the file system. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the following is a brief introduction to the drawings required for use in the embodiment of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0042] Figure 1 A schematic diagram of a process flow of a file system startup method provided by an embodiment of the present invention is shown;
[0043] Figure 2 It is a flowchart of a process of pre-creating an image file of a microkernel operating system provided in an embodiment of the present application;
[0044] Figure 3 This is a specific application example provided by an embodiment of the present application, which is a schematic diagram of a process of pre-creating an image file of a microkernel operating system;
[0045] Figure 4 It is a flowchart of the operating system startup program provided in an embodiment of the present application;
[0046] Figure 5 It is a flowchart of starting a kernel program provided in an embodiment of the present application;
[0047] Figure 6 A schematic diagram showing a flow chart of a file system startup method provided by yet another embodiment of the present invention;
[0048] Figure 7 It is a structural schematic diagram of a file system startup device of a microkernel operating system provided in an embodiment of the present application;
[0049] Figure 8 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0050] The features and exemplary embodiments of various aspects of the present invention will be described in detail below. In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present invention, rather than to limit the present invention. For those skilled in the art, the present invention can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present invention by illustrating examples of the present invention.
[0051] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0052] The kernel is the core component of a computer operating system. The kernel manages the communication between software and hardware. According to the kernel architecture, computer operating systems can be divided into macrokernel operating systems and microkernel operating systems. Microkernel operating systems adopt a highly modular design concept, running as many system services as possible as independent processes in user space, and only minimal core functions running in kernel space. This design approach helps reduce system complexity and improve system security.
[0053] The file system is a system that organizes and allocates space on file storage devices, is responsible for file storage, and protects and retrieves stored files. In a microkernel operating system, the core functions do not include device drivers, file system services, network services, etc. Therefore, the microkernel startup is separate from the initialization of the file system. After the microkernel is started, the file system is not initialized and needs to be started in user mode.
[0054] Currently, the more typical microkernel operating systems are seL4 and Fuchsia. The design concept of the seL4 operating system is to divide the core functions into independent and extensible modules. This design concept allows the flexible addition or deletion of core functions, and is mainly used for the control and management of key systems. The support for the file system is not direct, so the file system is not directly integrated into the core functions of seL4, which means that it does not support the file system. Dynamic loading is a prerequisite for the startup of the file system. The user program that needs to be loaded is determined during the compilation stage. All other user programs are loaded at once in the first user program, and there are some restrictions on users when using it.
[0055] In the Fuchsia operating system, after the kernel is started, you need to first start the Userboot process in user mode, and then load the bootsvc process to provide a simplified read-only file system. If you want to start a real file system, you also need to start the component manager process on this basis, then start the driver manager process, and then start the fshost process, and finally start a specific file system service in the true sense. In addition, when compiling and linking, Fuchsia's first user program is embedded in the kernel code, and its address and entry function information are parsed by specific tools during compilation.
[0056] In summary, the traditional microkernel file system startup method has some problems, such as long startup time and dependence on other device drivers.
[0057] In order to solve the problems of the prior art, the embodiments of the present invention provide a method, device, equipment and medium for starting a file system of a microkernel operating system. Specifically, the present application creates an image file of a microkernel operating system in advance, and starts a system startup program, a kernel program and a root service program in sequence, so that the root service program can initialize a memory file system. The initialized memory file system includes common file and directory operations and has complete file system functions, thereby making the file system of the microkernel operating system independent of other device drivers, thereby improving the startup speed of the file system.
[0058] The following first introduces the file system startup method of the microkernel operating system provided by the embodiment of the present invention.
[0059] Figure 1 FIG. 1 is a flow chart of a file system startup method 100 provided by an embodiment of the present invention. Figure 1 As shown, the method may include the following steps:
[0060] Step S101, pre-create an image file of a microkernel operating system, the image file of the microkernel operating system including a user state service package, a root service image package, a kernel image package and a system startup image package;
[0061] Step S102, running the system startup program in the system startup image package;
[0062] Step S103, starting the kernel program in the kernel image package;
[0063] Step S104, starting the root service program in the root service image package, so that the root service program initializes the memory file system until the initialized memory file system includes common file and directory operations;
[0064] Step S105: write all files in the user mode service package into the memory file system.
[0065] In step S101, an image file is a file that is a series of specific files that are made into a single file in a certain format to facilitate users to download and use. It is similar to a compressed package and can contain multiple files and directories. In a microkernel operating system, an image file is usually used to contain the core components and configuration information of the entire operating system, thereby simplifying the system configuration process.
[0066] The user-mode service package includes the files required for the application-mode program to run and provides various functions for the application. In a specific implementation scenario, the user-mode service package may include a dynamic linker, various shared libraries, driver libraries, executable files, configuration files, etc. When a specific file system needs to be used, the specific file system and its corresponding driver files need to be packaged.
[0067] It should be noted that the packaging of the user-mode service package can be customized according to the actual needs of the user. This is only an example without any limitation.
[0068] Next, the file composition in the user-mode service package will be introduced in detail.
[0069] Dynamic linker: runs in user mode and is used to dynamically load shared libraries to ensure that the program can find and use the required libraries at runtime.
[0070] Shared libraries: Contains code and data that can be shared by multiple programs, such as standard libraries.
[0071] Driver library: Provides driver interfaces for hardware devices, enabling applications to interact with hardware.
[0072] Executable file: runs in user mode and contains the actual execution code of the program. It can be statically linked or dynamically linked.
[0073] Configuration file: defines the configuration information of the program, such as running parameters, environment variables, etc.
[0074] Then, start the system startup program, kernel program and root service program in sequence. Among them, the executable file of the system startup program can be obtained from the system startup image package. The executable file of the kernel program can be obtained from the kernel image package. The executable file of the root service program can be obtained from the root service image package.
[0075] Thereafter, in step S104, the root service program initializes the memory file system. The initialized memory file system has the remarkable feature of not relying on other device drivers, which makes it independent, flexible and efficient in the whole system. And once the system supports the memory file system, many other functions can be realized more conveniently based on it. The root service program plays a core role here. It is not only responsible for managing, creating and maintaining the memory file system, but also provides various file services through the memory file system. Therefore, the most important function in the root service program is the memory file system.
[0076] Before writing all the files in the user-mode service package into the memory file system in the above step S105, the above file system startup method further includes the following steps:
[0077] Extract all files in the user-mode service package.
[0078] In one embodiment, all files can be extracted from the cpio package through the cpio function code according to the _cpio_data_start and _cpio_data_end addresses in the user mode service package, and loaded into the memory file system.
[0079] It is worth noting that since other specific file systems rely on the device driver library, the corresponding user-mode other specific file systems cannot be started before the driver library can be loaded. However, after the memory file system is started, it can load the driver library and other specific file systems. Therefore, if the system uses other file systems, other specific file system processes are loaded in the memory file system.
[0080] The aforementioned embodiments of the present application create an image file in advance, and run the system startup program, kernel program and root service program in sequence. After the root service program is started, the memory file system is initialized, and the initialized memory file system includes complete file system functions. After that, all files of the user-mode service package are written into the memory file system, so that the file system of the microkernel operating system does not depend on other device drivers, which effectively speeds up the startup time of the file system.
[0081] Figure 2 It is a flowchart of a process 200 of pre-creating an image file of a microkernel operating system provided in an embodiment of the present application. Figure 3 This is a specific application example provided by an embodiment of the present application, which is a schematic diagram of a process 300 of pre-creating an image file of a microkernel operating system.
[0082] In order to support the startup of the microkernel operating system and file system, the linking and organization of various files need to be considered during the compilation and linking phase. Especially for files that need to be included in the image. Figure 2 and attached Figure 3 As shown in , as an example, the above-mentioned pre-creating the image file of the microkernel operating system in this embodiment may include the following steps:
[0083] Step S201, putting the user mode service package into the root service program for compilation and linking to generate a root service image package;
[0084] Step S202, compile and link the kernel program to generate a kernel image package;
[0085] Step S203, putting the root service image package and the kernel image package into the system startup program for compilation and linking to generate a system startup image package.
[0086] Step S204: determine the generated system startup image package as a pre-created image file.
[0087] At step S201, the user-mode service package is first compiled. When compiling the user-mode service package, it is necessary to compile each shared library and executable file first. After the compilation is completed, each file is classified into a suitable folder according to its function and characteristics, and then all files are packaged into one file through the cpio tool. The entire user-mode service package is placed as a data segment in the _cpio_data_start and _cpio_data_end of the root service program, and it is statically linked with the root server program to generate a root service image package.
[0088] It should be noted that cpio is one of the standard commands in the Linux system. cpio will package multiple files into one file. _cpio_data_start and _cpio_data_end are used to indicate the address range of the data inserted into the file so that the data can be read correctly when unpacking.
[0089] The root service program is the first user-mode program started by the system. It mainly runs the functions of the memory file system and is responsible for managing the basic functions of the system and other service processes.
[0090] Next, at step S202, the basic functions of the kernel include process management, system scheduling, memory management, and file system management.
[0091] Then, at step S203, the root service image package (rootserver.elf) and the kernel image package (kernel.elf) are both put into _cpio_data_start and _cpio_data_end of the system startup program as data segments, and statically linked with the system startup program to generate a system startup image package (sysboot.elf).
[0092] At step S204, after the image file is created, the created image file is written into the Flash memory. When the system is running, the boot loader copies the image file in the Flash to the RAM. After the boot loader runs, it needs to perform some initialization work to prepare the system to execute the operating system or application program, and then the boot loader finally jumps to the system startup process through a jump instruction.
[0093] Figure 4 It is a flowchart of the operating system startup program provided in an embodiment of the present application.
[0094] Combined with Figure 4 It can be seen that in the above method step S102, the system startup program in the above running system startup image package in this embodiment may include the following steps:
[0095] Step S401: extracting the root service image package and the kernel image package;
[0096] Among them, the root service image package (rootserver.elf) and the kernel image package (kernel.elf) can be extracted through the cpio function code according to the addresses of _cpio_data_start and _cpio_data_end in the root service image package and the kernel image package.
[0097] Step S402: parsing the kernel image package and mapping the address space of the kernel program;
[0098] The kernel image package is the executable file of the kernel, which contains the kernel code and data. When running the system startup program, the kernel image package is parsed and the physical memory where each code segment or data segment is located is mapped to the virtual address space required by the kernel program. Once the address space mapping is completed, when running the kernel program, it can jump to the entry point of the kernel program and execute the code corresponding to the kernel program.
[0099] Step S403: Parse the root service image package and transmit the parsing result to the kernel program.
[0100] Among them, the root service image package contains the code and data of the root service. By parsing the root service image package, the parsing result is obtained and transmitted to the kernel program, providing a basis for the subsequent startup of the root service program.
[0101] It should be noted here that since the kernel image package and the root service image package are both statically linked, only a simple elf parser is needed in the system startup program to parse the statically linked elf file. In a microkernel operating system, the physical memory of the kernel process is mapped to the kernel address space before entering the kernel process, and then the kernel process code will run in the virtual address space.
[0102] Figure 5 It is a flowchart of starting the kernel program 500 provided in an embodiment of the present application.
[0103] Combined with Figure 6 It can be known that starting the kernel program in the kernel image package in the above step S103 may include the following steps:
[0104] Step S501, mapping the address space of the root service program according to the parsing result of the root service mirror package to create a root service program;
[0105] Step S502, scheduling the root service program.
[0106] At step S501, after the kernel program runs, the first user program, i.e., the root service program, is created. According to the parsing result of the root service image package passed in by the system startup program, the physical memory where each code segment or data segment in the root service image package is located is mapped to the virtual address space required by the root service program, and a series of initialization work is performed. Afterwards, at step S502, the scheduler is started, and the first user program, i.e., the root service program, is selected to run.
[0107] Figure 6 A flowchart of a file system startup method provided by yet another embodiment of the present invention is shown.
[0108] like Figure 6 As shown, in the aforementioned step S105, after all the files in the user-mode service package are written into the memory file system, the aforementioned file system startup method may further include the following steps:
[0109] Step S601, responding to a user's operation;
[0110] Step S602, loading a statically linked user program; and / or
[0111] The dynamically linked user program is loaded through a dynamic linker, wherein the user program includes a specific file system and a driver library.
[0112] It is understandable that after the root service program is started, the memory file system is initialized and the user-mode service package is released to the memory file system. At this time, the memory file system already supports complete file system functions, and because the user-mode service package contains a dynamic linker, it also has a dynamic loading function. Next, you only need to load the corresponding application on demand according to the user's operation.
[0113] Figure 7 It is a structural diagram of a file system startup device 700 of a microkernel operating system provided in an embodiment of the present application.
[0114] Combined with Figure 7 It can be seen that the embodiment of the present application further provides a file system startup device 700, and the file system startup device 700 includes:
[0115] A creation module 701 is used to pre-create an image file of a microkernel operating system, wherein the image file of the microkernel operating system includes a user-mode service package, a root service image package, a kernel image package, and a system startup image package;
[0116] The first running module 702 is used to run the system startup program in the system startup image package;
[0117] The first startup module 703 is used to start the kernel program in the kernel image package;
[0118] The second startup module 704 is used to start the root service program in the root service image package, so that the root service program initializes the memory file system until the initialized memory file system includes common file and directory operations;
[0119] The processing module 705 is used to write all files in the user mode service package into the memory file system.
[0120] It should be noted that the file system startup device 700 is a device corresponding to the above-mentioned file system startup method 100, and all implementation methods in the above-mentioned method embodiment are applicable to the embodiment of the device and can achieve the same technical effect.
[0121] As an implementation of the present application, the creation module 701 in the above device may also include:
[0122] The first compile and link module is used to put the user-mode service package into the root service program for compile and link, and generate a root service image package;
[0123] The second compile and link module is used to compile and link the kernel program to generate a kernel image package;
[0124] The third compile and link module is used to put the root service image package and the kernel image package into the system startup program for compilation and linking to generate a system startup image package;
[0125] The determination module is used to determine the generated system startup image package as a pre-created image file.
[0126] As an implementation of the present application, the first operation module 702 in the above device may further include the following steps:
[0127] The first extraction module is used to extract the root service image package and the kernel image package;
[0128] The first parsing module is used to parse the kernel image package and map the address space of the kernel program;
[0129] The second parsing module is used to parse the root service image package and transmit the parsing result to the kernel program.
[0130] As an implementation of the present application, the first starting module 703 in the above device may further include the following steps:
[0131] A first creation module, used for mapping the address space of the root service program according to the parsing result of the root service mirror package to create the root service program;
[0132] Scheduling module, used to schedule root service programs.
[0133] As an implementation of the present application, the aforementioned file system startup device 700 may further include the following steps:
[0134] The second extraction module is used to extract all files in the user mode service package.
[0135] As an implementation of the present application, the aforementioned file system startup device 700 may further include the following steps:
[0136] A response module, used to respond to user operations;
[0137] The second loading module is used to load a statically linked user program; and / or load a dynamically linked user program through a dynamic linker, wherein the user program includes a specific file system and a driver library.
[0138] Figure 8 It is a schematic diagram of the hardware structure of the electronic device 800 provided in an embodiment of the present application.
[0139] In the electronic device, a processor 801 and a memory 802 storing computer program instructions may be included.
[0140] Specifically, the processor 801 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiment of the present invention.
[0141] The memory 802 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 802 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In an example, the memory 802 may include a removable or non-removable (or fixed) medium, or the memory 802 is a non-volatile solid-state memory. The memory 802 may be inside or outside the integrated gateway disaster recovery device.
[0142] In one example, the memory 802 may be a read-only memory (ROM). In one example, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or a flash memory, or a combination of two or more of these.
[0143] The memory 802 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage media device, an optical storage media device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, in general, the memory includes one or more tangible (non-transitory) computer storage media (e.g., memory devices) encoded with software including computer executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0144] The processor 801 implements any one of the file system startup methods in the above embodiments by reading and executing computer program instructions stored in the memory 802 .
[0145] In one example, the electronic device may further include a communication interface 803 and a bus 804. Figure 3 As shown, the processor 801, the memory 802, and the communication interface 803 are connected via a bus 804 and communicate with each other.
[0146] The communication interface 803 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiment of the present invention.
[0147] Bus 804 includes hardware, software or both, and couples the components of online data traffic billing equipment to each other. For example, but not limitation, the bus may include Accelerated Graphics Port (AGP) or other graphics bus, Enhanced Industry Standard Architecture (EISA) bus, Front Side Bus (FSB), Hyper Transport (HT) interconnection, Industry Standard Architecture (ISA) bus, InfiniBand interconnection, Low Pin Count (LPC) bus, Memory bus, Micro Channel Architecture (MCA) bus, Peripheral Component Interconnect (PCI) bus, PCI-Express (PCI-X) bus, Serial Advanced Technology Attachment (SATA) bus, Video Electronics Standards Association Local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 804 may include one or more buses. Although the embodiments of the present invention describe and illustrate specific buses, the present invention considers any suitable bus or interconnection.
[0148] In addition, in combination with the file system startup method in the above embodiment, the embodiment of the present invention can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any file system startup method in the above embodiment is implemented.
[0149] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.
[0150] The functional blocks shown in the above structural block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), appropriate firmware, plug-in, function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or communication link by a data signal carried in a carrier. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (Read-Only Memory, ROM), flash memory, erasable read-only memory (Erasable ReadOnly Memory, EROM), floppy disks, compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical discs, hard disks, optical fiber media, radio frequency (Radio Frequency, RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0151] It should also be noted that the exemplary embodiments mentioned in the present invention describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in a different order from the embodiments, or several steps can be performed simultaneously.
[0152] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0153] The above is only a specific implementation of the present invention. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system, module and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. It should be understood that the protection scope of the present invention is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be covered within the protection scope of the present invention.
Claims
1. A file system startup method for a microkernel operating system, It is characterized in that include: Pre-creating an image file of a microkernel operating system, wherein the image file of the microkernel operating system includes a user state service package, a root service image package, a kernel image package, and a system startup image package; Running the system startup program in the system startup image package; Start the kernel program in the kernel image package; Starting the root service program in the root service image package, so that the root service program initializes the memory file system until the initialized memory file system includes common file and directory operations; All files in the user-mode service package are written into the memory file system.
2. The file system startup method according to claim 1, It is characterized in that The user mode service package includes a dynamic linker, a shared library, a driver library, an executable file and a configuration file.
3. The file system startup method according to claim 1 or 2, It is characterized in that The step of pre-creating an image file of a microkernel operating system includes: Put the user-mode service package into the root service program for compilation and linking to generate the root service image package; Compile and link the kernel program to generate the kernel image package; Put the root service image package and the kernel image package into the system startup program for compilation and linking to generate a system startup image package; The generated system startup image package is determined as a pre-created image file.
4. The file system startup method according to claim 1, It is characterized in that The running of the system startup program in the system startup image package includes: Extracting the root service image package and the kernel image package; Parsing the kernel image package and mapping the address space of the kernel program; Parse the root service image package and transmit the parsing result to the kernel program.
5. The file system startup method according to claim 4, It is characterized in that The starting of the kernel program in the kernel image package includes: Mapping the address space of the root service program according to the parsing result of the root service mirror package to create a root service program; Schedule root service program.
6. The file system startup method according to claim 1, It is characterized in that Before writing all the files in the user-mode service package into the memory file system, the method further includes: Extract all files in the user-mode service package.
7. The file system startup method according to claim 1, It is characterized in that After writing all the extracted files into the memory file system, the file system startup method further includes: Responding to user operations; Loading a statically linked user program; and / or A dynamically linked user program is loaded through a dynamic linker, wherein the user program includes a specific file system and a driver library.
8. A file system startup device, It is characterized in that The device comprises: A creation module, used to pre-create an image file of a microkernel operating system, wherein the image file of the microkernel operating system includes a user state service package, a root service image package, a kernel image package, and a system startup image package; A first running module, used for running the system startup program in the system startup image package; A first startup module, used to start the kernel program in the kernel image package; A second startup module, used for starting the root service program in the root service image package, so that the root service program initializes the memory file system until the initialized memory file system includes common file and directory operations; A processing module is used to write all files in the user-mode service package into the memory file system.
9. An electronic device, It is characterized in that The device comprises: a processor, and a memory storing computer program instructions; The processor reads and executes the computer program instructions to implement the file system startup method according to any one of claims 1 to 7.
10. A computer storage medium, It is characterized in that The computer storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the file system startup method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Method, device and equipment for configuring mirror image memory and storage medium
CN119377015A
Hyper-kernel method for managing multiple library operating systems on embedded device
CN119759429A
