A network boot operating system method and apparatus based on a debugging environment
By setting the target address and file name in the debugging environment and using preset functions to retrieve and download the file from the server, the problem of not being able to use network booting of the operating system in the debugging environment is solved, and efficient network booting of the operating system is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU EBOYLAMP ELECTRONICS CO LTD
- Filing Date
- 2023-11-14
- Publication Date
- 2026-07-24
AI Technical Summary
The operating system cannot be booted via network in the debugging environment because of the lack of a DHCP server and the difficulty in setting up a DHCP service environment. This makes the network boot process complex and time-consuming, affecting debugging efficiency.
By setting the target address and file name in the network boot entry, and using a preset function to obtain the file data volume from the target server and download the target file, the operating system can be booted over the network, avoiding dependence on a DHCP server.
It simplifies the network boot process, shortens the operating system startup time, and improves debugging efficiency.
Smart Images

Figure CN117667231B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer science and technology, and in particular to a method and apparatus for network-booting an operating system based on a debugging environment. Background Technology
[0002] Existing network-bootable operating systems typically obtain IP addresses and download the boot files required to boot the operating system via a DHCP server or TFTP server, thus enabling the operating system to boot over a network.
[0003] In existing network-booted operating systems processes, IP addresses need to be assigned via a DHCP server, which also needs to provide the boot files and their locations. This process is complex and time-consuming, significantly impacting debugging efficiency in debugging environments (i.e., field testing and troubleshooting). Furthermore, debugging environments typically only have standard laptops or computers without a DHCP server, and setting up a DHCP service environment is extremely difficult. Therefore, network-booted operating systems cannot be used in debugging environments. Summary of the Invention
[0004] To address the aforementioned problem of not being able to use network booting of the operating system in a debugging environment, this application provides a method and apparatus for network booting of the operating system based on a debugging environment, the technical solution of which is as follows:
[0005] In a first aspect, embodiments of this application provide a network-booted operating system method based on a debugging environment. The method is applied to a debugging environment, which includes at least one server. The method includes:
[0006] When a network boot option selection operation is detected, the target address and target file name corresponding to the network boot option are determined.
[0007] The target server is determined from at least one server based on the target address, and the file data volume corresponding to the target file name is obtained from the target server through a preset first function;
[0008] When the file data volume is detected to be non-zero, the target file is downloaded from the target server through a preset second function, and the operating system corresponding to the target file is booted.
[0009] In one alternative of the first aspect, the target address includes a first address and a second address;
[0010] The target server is determined from at least one server based on the target address, and the file data corresponding to the target file name is obtained from the target server through a preset first function, including:
[0011] The target server corresponding to the first address is determined from at least one server based on the first address;
[0012] Based on the preset first function, a file search request containing the second address is sent to the target server;
[0013] Receive the amount of file data corresponding to the target file name returned by the target server.
[0014] In another alternative to the first aspect, the target file is downloaded from the target server via a pre-defined second function, including:
[0015] Based on the preset second function, a file download request containing the second address is sent to the target server;
[0016] When the target server returns a download data entry signal indicating a successful download, the target file is extracted from the download data.
[0017] When the target server receives a download failure signal from the download data returned by the target server, a file permission change request containing the second address is sent to the target server.
[0018] When a permission change signal is received from the target server, a file download request containing the second address is sent to the target server based on a preset second function;
[0019] Extract the target file from the download data returned by the target server.
[0020] In another alternative to the first aspect, after obtaining the file data volume corresponding to the target file name from the target server via a preset first function, the process includes:
[0021] When the file data volume is detected to be zero, upload the backup file to the target server;
[0022] The file data size of the backup file is obtained from the target server through a preset first function;
[0023] When the backup file's data volume is detected to be non-zero, the backup file is downloaded from the target server through a preset second function, and the operating system corresponding to the backup file is booted.
[0024] In another alternative to the first aspect, after obtaining the file data size of the backup file from the target server via a preset first function, the process includes:
[0025] When the data size of the backup file is detected to be zero, the first file path is obtained; where the first file path is the file path of the backup file.
[0026] Based on the target file name and the target server, obtain the second file path; where the second file path is the file path of the target file;
[0027] When the first file path is found to be the same as the second file path, a network error signal is output.
[0028] When it is detected that the first file path and the second file path are inconsistent, update the second file path to the first file path;
[0029] Download the backup file based on the preset second function and second file path, and then perform boot processing on the operating system corresponding to the backup file.
[0030] In another alternative to the first aspect, after outputting the network anomaly signal, the following is included:
[0031] The second address is updated based on the network configuration information of the target server;
[0032] Send a file upload request containing the updated second address to the target server, and upload the backup file to the target server;
[0033] The backup file is downloaded from the target server using a pre-defined second function, and the operating system corresponding to the backup file is then booted.
[0034] In another alternative to the first aspect, before determining the target address and target file name corresponding to the network boot entry when a network boot entry selection operation is detected, the following steps are included:
[0035] The target cache block is determined based on the amount of cached data in the preset cache block, and the target cache block is cleared; the amount of cached data in the target cache block is not zero.
[0036] Download the target file from the target server using a pre-defined second function, including:
[0037] The target file is downloaded from the target server using a pre-defined second function, and then saved to a pre-defined cache block.
[0038] Secondly, embodiments of this application provide a network-bootable operating system device based on a debugging environment. This device is applied to a debugging environment that includes at least one server. The device includes:
[0039] The first processing module is used to determine the target address and target file name corresponding to the network boot entry when a network boot entry selection operation is detected.
[0040] The second processing module is used to determine the target server from at least one server based on the target address, and to obtain the amount of file data corresponding to the target file name from the target server through a preset first function;
[0041] The third processing module is used to download the target file from the target server through a preset second function when the file data volume is detected to be non-zero, and to perform boot processing on the operating system corresponding to the target file.
[0042] Thirdly, embodiments of this application provide a network-booted operating system device based on a debugging environment, including a processor and a memory;
[0043] The processor is connected to the memory;
[0044] Memory, used to store executable program code;
[0045] The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the network boot operating system method based on the debugging environment provided by the first aspect or any implementation of the first aspect of the embodiments of this application.
[0046] Fourthly, embodiments of this application provide a computer storage medium storing a computer program, which includes program instructions. When executed by a processor, the program instructions can implement the network boot operating system method based on a debugging environment provided by the first aspect or any implementation of the first aspect of this application.
[0047] The beneficial effects of the technical solutions provided by some embodiments of this specification include at least the following: During the network booting of an operating system in a debugging environment, when a network boot selection operation is detected, the target address and target file name corresponding to the network boot entry are determined; based on the target address, a target server is determined from at least one server, and the file data volume corresponding to the target file name is obtained from the target server through a preset first function; when the file data volume is detected to be non-zero, the target file is downloaded from the target server through a preset second function, and the operating system corresponding to the target file is booted. By establishing network communication between the target address set in the network boot entry and the target server, and during the communication process, based on the target file name, the preset first function, and the preset second function, the file data volume of the target file and the download of the target file are completed. This enables the download of boot files and the completion of booting the operating system using the network in a debugging environment, solving the problem that network booting of the operating system is not possible in a debugging environment. Attached Figure Description
[0048] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0049] Figure 1 A flowchart illustrating an overall method for network-booting an operating system based on a debugging environment, as provided in this application embodiment;
[0050] Figure 2 A schematic diagram of the structure of a network boot operating system device based on a debugging environment is provided in an embodiment of this application;
[0051] Figure 3 This is a schematic diagram of another network boot operating system device based on a debugging environment provided in an embodiment of this application. Detailed Implementation
[0052] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0053] In the following description, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance. The following description provides multiple embodiments of this application, which can be substituted or combined with each other. Therefore, this application can also be considered to include all possible combinations of the same and / or different embodiments described. Thus, if one embodiment includes features A, B, and C, and another embodiment includes features B and D, then this application should also be considered to include embodiments containing one or more other possible combinations of A, B, C, and D, even if such embodiments are not explicitly described in the following text.
[0054] The following description provides examples and does not limit the scope, applicability, or examples set forth in the claims. Changes may be made to the function and arrangement of the described elements without departing from the scope of this application. Various processes or components may be appropriately omitted, substituted, or added to the examples. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Furthermore, features described with respect to some examples may be combined into other examples.
[0055] Please see Figure 1 , Figure 1 The diagram shows an overall flowchart of a network boot operating system method based on a debugging environment provided in an embodiment of this application.
[0056] like Figure 1As shown, this network-based operating system booting method based on a debugging environment may include at least the following steps:
[0057] Step 101: When the selection operation of the network boot entry is detected, determine the target address and target file name corresponding to the network boot entry.
[0058] In existing UEFI BIOS network booting processes, it is typically necessary to assign an IP address and provide the boot file and its path via a DHCP server. This complex process leads to long network boot times and reduces debugging efficiency. Understandably, a typical UEFI BIOS network boot process can be divided into the following five steps: When the client enters the network boot option, it requests an IP address from a DHCP server on the same subnet; the DHCP server returns a dynamic IP address to the client; the client requests a boot file from another DHCP server on the same subnet; the DHCP server returns the boot file and its path; after downloading the boot file via a TFTP server and using the boot file path, the client executes the boot file to complete the booting of the operating system.
[0059] Among them, the client is the terminal device that performs debugging, which can be, but is not limited to, laptops, smartphones, tablets, or other network-connected devices. It is mainly used to communicate with the server over the network, send service requests to the server, receive data returned by the server, or perform specific tasks. The DHCP server is mainly used to automatically assign network configuration information such as IP addresses, subnet masks, and default gateways to clients connected to the network. The TFTP server is a server that runs the TFTP protocol and is usually used to quickly transfer files in computer networks, especially during the boot process of embedded systems or network devices. UEFI (Unified Extended Firmware Interface) BIOS is a new firmware interface standard used in modern computer systems. Compared with the traditional BIOS (Basic Input / Output System), UEFI BIOS has more functions and flexibility, and provides more powerful support for operating system boot and hardware initialization.
[0060] In this embodiment, the network boot operating system method based on the debugging environment can be applied to, but is not limited to, client machines. By establishing network communication between the target address set in the network boot startup item and the target server, and during the communication process, the file data of the target file and the download of the target file are completed according to the target file name, a preset first function, and a preset second function. This enables the download of boot files and the completion of booting the operating system in the debugging environment, thus solving the problem that the network boot operating system cannot be used in the debugging environment.
[0061] It is understood that a debugging environment refers to a real-world scenario where a developed system, device, or component is jointly debugged with other systems or devices to ensure the system's compatibility and stability in a real-world environment. In this invention, the debugging environment includes at least clients, servers, routers, and switches.
[0062] It is worth noting that, in the debugging environment (i.e., field debugging and troubleshooting), this invention simplifies the process of UEFI BIOS network booting the operating system because there is no need to deploy a DHCP server, thus shortening the operating system startup time and improving debugging efficiency.
[0063] Specifically, during the network boot process of the operating system based on the debugging environment, when the user clicks the network boot option button on the UEFI BIOS interface, the target address and target file name pre-set in the network boot option can be read. The reading method can be, but is not limited to, retrieving the corresponding field value based on the field name. For example, if the target address field name is Address and the field value is 192.168.1.1, then address == 192.168.1.1; if the target file name field name is Filename and the field value is bootaa64.efi, then Filename == bootaa64.efi.
[0064] It is worth noting that the target address includes, but is not limited to, the client's IP address and the TFTP server's IP address. The field name corresponding to the client's IP address can be, but is not limited to, IP4_CONFIG_IFR_NVDATA.StationAddress; the field name corresponding to the TFTP server's IP address can be, but is not limited to, IP4_CONFIG_IFR_NVDATA.TftpServerIpAddress.
[0065] In addition, when setting the target address and target file name in advance, you can also set the directory of the target address and target file name. This directory can be, but is not limited to, networkpkg / ip4dxe / ip4config2.vfr.
[0066] Step 102: Determine the target server from at least one server based on the target address, and obtain the file data volume corresponding to the target file name from the target server through a preset first function.
[0067] Specifically, based on the IP address of the TFTP server in the target address, the TFTP server (i.e., the target server) can be determined from all servers in the debugging environment, and a communication connection can be established with it. Furthermore, the name of the boot file to be executed (i.e., the target file name) and the IP address of the TFTP server can be input as parameters to a preset first function that can obtain the file size, such as the PxeBcTftpGetFileSize function. This function obtains the path to the boot file, which is then used to read the boot file from the target server based on the path, calculate the number of bytes read, and thus obtain the file data size (i.e., the file size) of the boot file.
[0068] Step 103: When the file data volume is detected to be non-zero, the target file is downloaded from the target server through the preset second function, and the operating system corresponding to the target file is booted.
[0069] Specifically, after obtaining the file data size of the boot file, the file data size can be checked. When the file data size of the boot file is not zero, it indicates that the boot file is not damaged and contains actual valid data. Then, the name of the boot file and the IP address of the TFTP server can be input as parameters to a preset second function, such as the PxeBcTftpReadFile function, to download the boot file through the target server. The method of downloading the file includes, but is not limited to, reading the boot file line by line or byte by byte, and converting the read data into a string and storing it in a preset array, linked list, stack, or queue.
[0070] Furthermore, after downloading the boot file, the corresponding operating system can be booted by executing the boot file. The boot process can be, but is not limited to, loading the operating system kernel and other necessary components using the boot loader program in the downloaded boot file, and transferring control to the kernel. Subsequently, the operating system kernel mounts the root file system during the boot process to access and manage files and directories. Once the operating system starts, it can download other necessary software packages and configuration files over the network for installation and configuration, thus enabling network booting of the operating system. It is worth noting that boot loaders include, but are not limited to, GRUB, LILO, and Syslinux.
[0071] As an optional embodiment of this application, the target address includes a first address and a second address;
[0072] The target server is determined from at least one server based on the target address, and the file data corresponding to the target file name is obtained from the target server through a preset first function, including:
[0073] The target server corresponding to the first address is determined from at least one server based on the first address;
[0074] Based on the preset first function, a file search request containing the second address is sent to the target server;
[0075] Receive the amount of file data corresponding to the target file name returned by the target server.
[0076] Specifically, the target address includes at least the IP address of the target server (i.e., the first address) and the IP address of the client (i.e., the second address). It is understood that in this application, the target server is a TFTP server, and the client is the local machine that needs to boot the operating system. During the network booting of the operating system based on a debugging environment, the target server required for the network booting process can be determined from all servers in the debugging environment based on the first address. Then, the first address, the second address, and the target file name can be input as parameters to a preset first function, such as the PxeBcTftpGetFileSize function, to send a file search request containing the second address to the target server. Afterward, the target file can be searched for on the target server based on its name, and the target server returns the file data of the target file to the client based on the second address.
[0077] As another optional embodiment of this application, downloading the target file from the target server through a preset second function includes:
[0078] Based on the preset second function, a file download request containing the second address is sent to the target server;
[0079] When the target server returns a download data entry signal indicating a successful download, the target file is extracted from the download data.
[0080] When the target server receives a download failure signal from the download data returned by the target server, a file permission change request containing the second address is sent to the target server.
[0081] When a permission change signal is received from the target server, a file download request containing the second address is sent to the target server based on a preset second function;
[0082] Extract the target file from the download data returned by the target server.
[0083] Specifically, when the detected file data size of the target file is not zero, it indicates that the target file is not corrupted and contains actual valid data. Then, the first address, the second address, and the name of the target file can be input as parameters to a preset second function, such as the PxeBcTftpReadFile function, to send a file download request containing the second address to the target server. Next, based on the identification signal in the received download data, it can be determined whether the download operation was successful. The download data may include an identification signal indicating the download result and the downloaded target file.
[0084] Here, when the received download data shows a successful download signal, it indicates that the target file has been successfully downloaded and saved to the client's default path. The target file can then be extracted from the download data based on the default path. When the received download data shows a failed download signal, it indicates that the target file's permissions may be incorrect, leading to download failure. Therefore, a file permission change request containing a second address can be sent to the target server based on the first address to change the target file's permissions. The method of changing file permissions includes, but is not limited to, using command-line tools or a file manager. Subsequently, when a permission change signal is received from the target server based on the second address, a pre-defined second function can be used to send another file download request to the target server. After the target file download is complete, it can be extracted from the download data returned by the target server based on the second address.
[0085] It's worth noting that if you still cannot download the target file after changing its permissions, you can use the command line to check the target file's permissions and owner to confirm whether the permission changes have taken effect. If the permission changes have not taken effect, you can try changing the permissions again or wait for them to take effect. If the permission changes have taken effect, you can check the target file's attributes to confirm whether the download failure is due to the target file itself.
[0086] As another optional embodiment of this application, after obtaining the file data volume corresponding to the target file name from the target server through a preset first function, the method includes:
[0087] When the file data volume is detected to be zero, upload the backup file to the target server;
[0088] The file data size of the backup file is obtained from the target server through a preset first function;
[0089] When the backup file's data volume is detected to be non-zero, the backup file is downloaded from the target server through a preset second function, and the operating system corresponding to the backup file is booted.
[0090] Specifically, after obtaining the file data size of the target file, if the file data size is detected to be zero, it indicates that the target file may be corrupted and cannot complete the subsequent network boot operating system process. Therefore, a backup file can be uploaded to the target server to replace the corrupted target file, thereby completing the subsequent network boot operating system process. The method of uploading the backup file includes, but is not limited to, retrieving the backup file from a backup device (such as an external hard drive or network share) through a preset alternative path, and implementing the backup file upload using a program framework capable of uploading files, including, but not limited to, the Spring framework in Java and the Flask framework in Python. It is understood that the program framework at least includes functions that implement file upload functionality and code blocks corresponding to operations such as obtaining the file path.
[0091] Next, a file search request containing a second address can be sent to the target server through a preset first function. After that, the backup file can be searched for in the target server according to the name of the backup file, and the target server returns the file data volume of the backup file according to the second address. Subsequently, the client receives the returned file data volume of the backup file.
[0092] Next, after obtaining the file size of the backup file, the file size can be checked. When the file size is not zero, a download request for the backup file can be sent to the target server via a pre-defined second function. The backup file can then be extracted from the download data returned by the target server based on the second address. The extraction methods include, but are not limited to, using absolute or relative paths. An absolute path is a path that completely specifies the file location, starting from the root directory of the file system, such as C:\Documents\Project\data\data.txt. A relative path is a path that specifies the file location relative to the current working directory, such as .. / data / data.txt. It is worth noting that absolute paths can accurately locate the file location regardless of the current working directory, while relative paths simplify the path representation by omitting some common path parts. Here, the appropriate path method can be selected according to actual needs, and the backup file can be extracted using file paths and file extraction functions, including, but not limited to, the read function, std::ifstream function, Files.readString function, and BufferedReader function.
[0093] It is understandable that uploading and then downloading backup files is necessary to complete a crucial step in network booting the operating system, namely obtaining the boot file through network communication to determine the feasibility of network booting the operating system in a debugging environment. Therefore, uploading the backup file and then downloading it is essential.
[0094] Here, after obtaining the backup file, the corresponding operating system can be booted by executing the backup file. The boot process includes, but is not limited to, using the boot loader program in the downloaded backup file to load the operating system kernel and other necessary components, and then transferring control to the kernel, thereby enabling network booting of the operating system. It is worth noting that boot loaders include, but are not limited to, GRUB, LILO, and Syslinux.
[0095] As another optional embodiment of this application, after obtaining the file data volume of the backup file from the target server through a preset first function, the method includes:
[0096] When the data size of the backup file is detected to be zero, the first file path is obtained; where the first file path is the file path of the backup file.
[0097] Based on the target file name and the target server, obtain the second file path; where the second file path is the file path of the target file;
[0098] When the first file path is found to be the same as the second file path, a network error signal is output.
[0099] When it is detected that the first file path and the second file path are inconsistent, update the second file path to the first file path;
[0100] Download the backup file based on the preset second function and second file path, and then perform boot processing on the operating system corresponding to the backup file.
[0101] Specifically, after obtaining the file data volume of the backup file, if the file data volume of the backup file is detected to be zero, it indicates that the backup file was uploaded incorrectly. The upload path of the backup file and the file path of the target file can be obtained first to check whether the backup file was uploaded incorrectly due to an incorrect file path.
[0102] Here, we can first determine whether the upload path is consistent with the location of the target file, that is, whether the file path of the backup file (first file path) and the file path of the target file (second file path) are consistent. When it is found that the first file path and the second file path are consistent, it indicates that the network connection is abnormal and the file path cannot be accessed normally. That is, when uploading the backup file to replace the damaged target file, the upload was incorrect due to network instability. Therefore, a network error signal is output.
[0103] At the same time, when the first file path and the second file path are found to be inconsistent, it indicates that there is an error in the upload path when uploading the backup file. The file path of the damaged target file (i.e., the second file path) can be updated to the upload path of the backup file (i.e., the first file path) to replace the damaged target file with the backup file, and to ensure that the parameters (especially the file path-related parameters) when the function is called to perform related operations during the communication process remain unchanged.
[0104] Next, the backup file can be downloaded using a preset second function and a second file path. For specific implementation details, please refer to the methods described in the other embodiments above. Furthermore, after obtaining the backup file, the operating system corresponding to the backup file can be booted by executing the backup file. For the boot processing method, please refer to the boot processing methods described in the other embodiments above.
[0105] As another optional embodiment of this application, after outputting the network anomaly signal, the following is included:
[0106] The second address is updated based on the network configuration information of the target server;
[0107] Send a file upload request containing the updated second address to the target server, and upload the backup file to the target server;
[0108] The backup file is downloaded from the target server using a pre-defined second function, and the operating system corresponding to the backup file is then booted.
[0109] Specifically, after a backup file upload fails due to network congestion, resulting in a network error signal, the client's IP address can be updated based on the target server's network configuration information to enable uninterrupted network communication. This network configuration information includes, but is not limited to, the target server's IP address, subnet mask, and default gateway. Understandably, for uninterrupted network communication between the client and the TFTP server, they need to be on the same network segment. For example, if the TFTP server's IP address (the first address) is 10.100.0.146, the client's IP address (the second address) can be updated to 10.100.0.1. It's worth noting that when the TFTP server's IP address is 10.100.0.a, to ensure the client and TFTP server are on the same network segment and avoid IP address conflicts, the client's IP address should be in the range of 10.100.x.1~10.100.xa and 10.100.xa~10.100.x.255, where 'a' can be any integer between 1 and 255, and 'x' can be any integer between 0 and 255. Furthermore, the client's subnet mask and default gateway settings can be adjusted based on the TFTP server's subnet mask and default gateway to ensure they are on the same subnet as the TFTP server.
[0110] Next, after updating the second address, a file upload request can be sent to the target server again. This request includes the updated second address to establish a new communication connection and ensure network connectivity. Afterward, the backup file can be re-uploaded to the target server, and a download request for the backup file can be sent to the target server again through a pre-defined second function. The re-uploaded backup file can then be extracted from the download data returned by the target server based on the updated second address. The method for extracting the backup file includes, but is not limited to, using absolute or relative paths.
[0111] It is understandable that the reasoning behind uploading and then downloading backup files here is the same as that in the other embodiments described above.
[0112] Here, after obtaining the backup file, the operating system corresponding to the backup file can be booted. The booting method can be referred to the booting method in the other embodiments described above.
[0113] As another optional embodiment of this application, before determining the target address and target file name corresponding to the network boot entry when a network boot entry selection operation is detected, the following steps are included:
[0114] The target cache block is determined based on the amount of cached data in the preset cache block, and the target cache block is cleared; the amount of cached data in the target cache block is not zero.
[0115] Download the target file from the target server using a pre-defined second function, including:
[0116] The target file is downloaded from the target server using a pre-defined second function, and then saved to a pre-defined cache block.
[0117] Specifically, before checking the selection of network boot entries, the cache blocks can be preprocessed to ensure the accuracy of data storage during the subsequent network booting of the operating system. Preprocessing methods include, but are not limited to: first, determining the amount of cached data in the pre-allocated cache blocks (i.e., the preset cache blocks); then, marking cache blocks with non-zero cached data as target cache blocks; and finally, clearing all target cache blocks. The clearing process includes, but is not limited to, setting each byte or bit of the cache block to zero.
[0118] Subsequently, during the process of downloading the target file from the target server through the preset second function, the target file can be saved in a preset cache block that has been cleared. The preset cache block may, but is not limited to, storing the target file.
[0119] It is worth noting that preprocessing can also be performed on memory modules and external devices here. The preprocessing methods for memory modules include, but are not limited to, address mapping processing, and the preprocessing methods for external devices include, but are not limited to, driver loading processing.
[0120] Understandably, the address mapping process for memory modules includes at least the following: using a command-line tool (CMD) to obtain information about the installed memory modules, such as by entering `wmic memorychip get capacity, manufacturer, partnumber, speed` in CMD. This allows allocating a contiguous physical address space for each installed memory module and generating a logical address including a page number and offset. Next, the page table is used to find the physical page number corresponding to the logical page number, and the base address of the physical page number is added to the offset to obtain the final physical address. This performs the address mapping process, providing an accessible memory range for the operating system and applications.
[0121] Meanwhile, the process of loading drivers for external devices includes at least the following: determining whether a suitable driver exists for the external device based on the existing driver library in the system; if no suitable driver is found, prompting the user to insert a CD containing the device driver or download the device driver. Once a suitable driver is found, the driver file can be copied from the storage device to memory and registered with the operating system's driver management system to load the driver into memory.
[0122] Please see Figure 2 , Figure 2 This illustration shows a schematic diagram of a network boot operating system device based on a debugging environment, as provided in an embodiment of this application.
[0123] like Figure 2 As shown, the network-bootable operating system device based on a debugging environment may include at least a first processing module 201, a second processing module 202, and a third processing module 203, wherein:
[0124] The first processing module 201 is used to determine the target address and target file name corresponding to the network boot entry when a network boot entry selection operation is detected;
[0125] The second processing module 202 is used to determine the target server from at least one server based on the target address, and to obtain the file data volume corresponding to the target file name from the target server through a preset first function;
[0126] The third processing module 203 is used to download the target file from the target server through a preset second function when the file data volume is detected to be non-zero, and to perform boot processing on the operating system corresponding to the target file.
[0127] In some possible embodiments, the target address includes a first address and a second address;
[0128] The target server is determined from at least one server based on the target address, and the file data corresponding to the target file name is obtained from the target server through a preset first function, including:
[0129] The third processing module 203 is specifically used for:
[0130] The target server corresponding to the first address is determined from at least one server based on the first address;
[0131] Based on the preset first function, a file search request containing the second address is sent to the target server;
[0132] Receive the amount of file data corresponding to the target file name returned by the target server.
[0133] In some possible embodiments, downloading the target file from the target server via a preset second function includes:
[0134] The third processing module 203 is specifically used for:
[0135] Based on the preset second function, a file download request containing the second address is sent to the target server;
[0136] When the target server returns a download data entry signal indicating a successful download, the target file is extracted from the download data.
[0137] When the target server receives a download failure signal from the download data returned by the target server, a file permission change request containing the second address is sent to the target server.
[0138] When a permission change signal is received from the target server, a file download request containing the second address is sent to the target server based on a preset second function;
[0139] Extract the target file from the download data returned by the target server.
[0140] In some possible embodiments, after obtaining the file data volume corresponding to the target file name from the target server through a preset first function, the process includes:
[0141] The third processing module 203 is specifically used for:
[0142] When the file data volume is detected to be zero, upload the backup file to the target server;
[0143] The file data size of the backup file is obtained from the target server through a preset first function;
[0144] When the backup file's data volume is detected to be non-zero, the backup file is downloaded from the target server through a preset second function, and the operating system corresponding to the backup file is booted.
[0145] In some possible embodiments, after obtaining the file data size of the backup file from the target server via a preset first function, the process includes:
[0146] The third processing module 203 is specifically used for:
[0147] When the data size of the backup file is detected to be zero, the first file path is obtained; where the first file path is the file path of the backup file.
[0148] Based on the target file name and the target server, obtain the second file path; where the second file path is the file path of the target file;
[0149] When the first file path is found to be the same as the second file path, a network error signal is output.
[0150] When it is detected that the first file path and the second file path are inconsistent, update the second file path to the first file path;
[0151] Download the backup file based on the preset second function and second file path, and then perform boot processing on the operating system corresponding to the backup file.
[0152] In some possible embodiments, after outputting the network anomaly signal, the following is included:
[0153] The third processing module 203 is specifically used for:
[0154] The second address is updated based on the network configuration information of the target server;
[0155] Send a file upload request containing the updated second address to the target server, and upload the backup file to the target server;
[0156] The backup file is downloaded from the target server using a pre-defined second function, and the operating system corresponding to the backup file is then booted.
[0157] In some possible embodiments, before determining the target address and target file name corresponding to the network boot entry when a network boot entry selection operation is detected, the process includes:
[0158] The third processing module 203 is specifically used for:
[0159] The target cache block is determined based on the amount of cached data in the preset cache block, and the target cache block is cleared; the amount of cached data in the target cache block is not zero.
[0160] Download the target file from the target server using a pre-defined second function, including:
[0161] The target file is downloaded from the target server using a pre-defined second function, and then saved to a pre-defined cache block.
[0162] Please see Figure 3 , Figure 3 This illustration shows a schematic diagram of another network boot operating system device based on a debugging environment provided in an embodiment of this application.
[0163] like Figure 3As shown, the network boot operating system device 300 based on the debugging environment may include at least one processor 301, at least one network interface 304, user interface 303, memory 305, and at least one communication bus 302.
[0164] The communication bus 302 can be used to realize the connection and communication of the above components.
[0165] The user interface 303 may include buttons, and the optional user interface may also include a standard wired interface or a wireless interface.
[0166] The network interface 304 may include, but is not limited to, Bluetooth modules, NFC modules, Wi-Fi modules, etc.
[0167] The processor 301 may include one or more processing cores. The processor 301 connects to various parts of the network boot operating system device 300 based on the debugging environment using various interfaces and lines. It executes various functions and processes data of the network boot operating system device 300 by running or executing instructions, programs, code sets, or instruction sets stored in memory 305, and by calling data stored in memory 305. Optionally, the processor 301 may be implemented using at least one hardware form of DSP, FPGA, or PLA. The processor 301 may integrate one or more of the following: CPU, GPU, and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 301 and may be implemented as a separate chip.
[0168] The memory 305 may include RAM or ROM. Optionally, the memory 305 may include a non-transitory computer-readable medium. The memory 305 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 305 may also be at least one storage device located remotely from the aforementioned processor 301. Figure 3 As shown, the memory 305, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a network-bootable operating system application based on a debugging environment.
[0169] Specifically, processor 301 can be used to call the network-booted operating system application based on the debugging environment stored in memory 305, and specifically perform the following operations:
[0170] When a network boot option selection operation is detected, the target address and target file name corresponding to the network boot option are determined.
[0171] The target server is determined from at least one server based on the target address, and the file data volume corresponding to the target file name is obtained from the target server through a preset first function;
[0172] When the file data volume is detected to be non-zero, the target file is downloaded from the target server through a preset second function, and the operating system corresponding to the target file is booted.
[0173] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method. The computer-readable storage medium may include, but is not limited to, any type of disk, including floppy disks, optical disks, DVDs, CD-ROMs, microdrives, as well as magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic cards or optical cards, nanosystems (including molecular memory ICs), or any type of medium or device suitable for storing instructions and / or data.
[0174] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0175] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0176] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some service interface; the indirect coupling or communication connection between apparatuses or units may be electrical or other forms.
[0177] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0178] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0179] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0180] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0181] The above are merely exemplary embodiments of this disclosure and should not be construed as limiting the scope of this disclosure. Any equivalent changes and modifications made in accordance with the teachings of this disclosure shall still fall within the scope of this disclosure. Those skilled in the art will readily conceive of embodiments of this disclosure upon considering the specification and practicing the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not described herein. The specification and embodiments are to be considered exemplary only, and the scope and spirit of this disclosure are defined by the claims.
Claims
1. A method for network-booting an operating system based on a debugging environment, characterized in that, The method is applied to a debugging environment, the debugging environment including at least one server, and the method includes: When a network boot option selection operation is detected, the target address and target file name corresponding to the network boot option are determined; Based on the target address, a target server is determined from the at least one server, and the file data volume corresponding to the target file name is obtained from the target server through a preset first function; When the file data volume is detected to be non-zero, the target file is downloaded from the target server through a preset second function, and the operating system corresponding to the target file is booted. The target address includes a first address and a second address; The step of determining the target server from the at least one server based on the target address, and obtaining the file data volume corresponding to the target file name from the target server through a preset first function, includes: Based on the first address, determine the target server corresponding to the first address from at least one server; Based on a preset first function, a file search request containing the second address is sent to the target server; Receive the amount of file data corresponding to the target file name returned by the target server; The step of downloading the target file from the target server via a preset second function includes: Based on a preset second function, a file download request containing the second address is sent to the target server; When the target server returns a download data entry signal indicating a successful download, the target file is extracted from the download data. When the target server returns a download data with an identifier signal indicating a download failure, a file permission change request containing the second address is sent to the target server. When a permission change signal is received from the target server, a file download request containing the second address is sent to the target server based on a preset second function; Extract the target file from the download data returned by the target server.
2. The method according to claim 1, characterized in that, After obtaining the file data volume corresponding to the target file name from the target server through a preset first function, the process includes: When the file data volume is detected to be zero, the backup file is uploaded to the target server; The file data volume of the backup file is obtained from the target server through the preset first function; When the file data volume of the backup file is detected to be non-zero, the backup file is downloaded from the target server through the preset second function, and the operating system corresponding to the backup file is booted.
3. The method according to claim 2, characterized in that, After obtaining the file data volume of the backup file from the target server through the preset first function, the process includes: When the file data volume of the backup file is detected to be zero, the first file path is obtained; wherein, the first file path is the file path of the backup file; Based on the target file name and the target server, obtain the second file path; wherein, the second file path is the file path of the target file; When the first file path is identified to be the same as the second file path, a network error signal is output. When it is determined that the first file path and the second file path are inconsistent, the second file path is updated to the first file path; The backup file is downloaded based on the preset second function and the second file path, and the operating system corresponding to the backup file is booted.
4. The method according to claim 3, characterized in that, Following the output network anomaly signal, the following is included: Based on the network configuration information of the target server, the second address is updated. Send a file upload request containing the updated second address to the target server, and upload the backup file to the target server; The backup file is downloaded from the target server using the preset second function, and the operating system corresponding to the backup file is then booted.
5. The method according to claim 1, characterized in that, Before determining the target address and target file name corresponding to the network boot entry when the selection operation of the network boot entry is detected, the following steps are included: The target cache block is determined based on the amount of cached data in a preset cache block, and the target cache block is cleared; wherein, the amount of cached data in the target cache block is not zero; The step of downloading the target file from the target server via a preset second function includes: The target file is downloaded from the target server using a preset second function, and the target file is saved to the preset cache block.
6. A network-booted operating system device based on a debugging environment, characterized in that... The apparatus is used in a debugging environment, the debugging environment including at least one server, and the apparatus includes: The first processing module is used to determine the target address and target file name corresponding to the network boot entry when a selection operation of the network boot entry is detected. The second processing module is used to determine the target server from the at least one server based on the target address, and to obtain the file data volume corresponding to the target file name from the target server through a preset first function; The third processing module is used to download the target file from the target server through a preset second function when the file data volume is detected to be non-zero, and to perform boot processing on the operating system corresponding to the target file; The target address includes the first address and the second address; The target server is determined from at least one server based on the target address, and the file data corresponding to the target file name is obtained from the target server through a preset first function, including: The third processing module is specifically used for: The target server corresponding to the first address is determined from at least one server based on the first address; Based on the preset first function, a file search request containing the second address is sent to the target server; Receive the amount of file data corresponding to the target file name returned by the target server; Download the target file from the target server using a pre-defined second function, including: The third processing module is also specifically used for: Based on the preset second function, a file download request containing the second address is sent to the target server; When the target server returns a download data entry signal indicating a successful download, the target file is extracted from the download data. When the target server receives a download failure signal from the download data returned by the target server, a file permission change request containing the second address is sent to the target server. When a permission change signal is received from the target server, a file download request containing the second address is sent to the target server based on a preset second function; Extract the target file from the download data returned by the target server.
7. A network-bootable operating system device based on a debugging environment, characterized in that, Including the processor and memory; The processor is connected to the memory; The memory is used to store executable program code; The processor runs a program corresponding to the executable program code stored in the memory to perform the steps of the method as described in any one of claims 1-5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer-readable storage medium stores instructions that, when executed on a computer or processor, cause the computer or processor to perform the steps of the method as described in any one of claims 1-5.