System startup method and device
By creating the first GPT partition table based on the preset GPT partition table format and using this table for booting during the BIOS startup process, the problem that the BIOS cannot normally start the operating system in the hidden partition is solved, and the reliability and reliability of system startup are improved. Data security.
Patent Information
- Application Number
- CN202210362705.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-07
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2042-04-07
AI Technical Summary
In the prior art, the BIOS cannot normally start the operating system in the hidden partition, causing the file system to be inaccessible and affecting the normal startup of the operating system.
By determining the hidden partition of the hard disk, create the first GPT partition table based on the preset GPT partition table format, and use this partition table for booting during the BIOS startup process to ensure that the operating system in the hidden partition can start smoothly.
It solves the problem that the BIOS cannot normally start the operating system in the hidden partition, improves the reliability of system startup and data security, and realizes the normal use of the hidden partition and the backup and recovery of important data.
Smart Images

Figure CN114816542B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of computer operating system startup, and in particular to a system startup method and device. Background Art
[0002] In the prior art, two types of partition tables, MBR (master boot record) and GPT (globally unique identifier partition table), are generally used to manage hard disk partitions. MBR can only support the management of hard disks with a capacity of less than 2TB, while GPT, as part of the Extensible Firmware Interface (EFI) standard, can support the management of hard disks with a capacity of more than 2TB. GPT processes all blocks of the hard disk with LBA (logical block address, commonly known as sector). With the widespread use of GPT in operating systems such as Windows 10 and various Linux systems, the need for protected storage and smooth access to some important data has become increasingly apparent.
[0003] In order to achieve data protection storage, some LBAs can be hidden on the solid-state drive (SSD) through the HPA ("Hidden Protection Area" technology) method similar to HD, forming a hidden partition on the SSD hard disk. After the storage space of the hidden partition is divided, it is invisible to upper-layer software such as BIOS and OS (operating system), achieving the purpose of data hiding and protection, and theoretically can prevent viruses and prevent data from being illegally accessed or lost after the storage device is stolen. Therefore, the storage space of the hidden partition can be used to back up the user's important data, or install some special applications to take over the computer in the event of a Host OS (host operating system) crash, so as to achieve the purpose of restoring the OS or recovering data.
[0004] However, since the partition information of the file system is stored in both the starting address segment and the ending address segment of the hard disk, there will be a problem of inconsistent GPT partition information when the hidden partition is turned on and off, resulting in different startup methods for the OS installed in the hidden partition and the Host OS. When the OS in the hidden partition is started using the same startup method as the Host OS, the file system cannot be accessed, affecting the OS in the hidden partition from starting normally. Summary of the invention
[0005] The embodiments of the present disclosure provide a system startup method and device, which can solve the problem in the prior art that the BIOS cannot normally start the operating system in the hidden partition.
[0006] According to one of the solutions of the present disclosure, a system startup method is provided, which is applied to an electronic device, including:
[0007] Identify hidden partitions on the hard disk;
[0008] Based on the partition information of the hidden partition, create a first GPT partition table corresponding to the hidden partition;
[0009] During the startup process of the BIOS of the electronic device, the operating system in the hidden partition is started and booted based on the first GPT partition table.
[0010] In some embodiments, creating a first GPT partition table corresponding to the hidden partition based on the partition information of the hidden partition includes:
[0011] The partition information of the hidden partition is filled in accordance with the partition table format of the preset GPT partition table to generate the first GPT partition table.
[0012] In some embodiments, the partition information of the hidden partition is filled in accordance with a partition table format of a preset GPT partition table to generate the first GPT partition table, including:
[0013] Obtaining first partition information of the hidden partition, filling the first partition information into the HLBA2-HLBA33 positions of the first GPT partition table according to the data format of the preset GPT partition table entry, calculating first CRC32 check information of the first partition information, and filling the first CRC32 check information into the check bit corresponding to the HLBA2-HLBA33 position;
[0014] Obtain the second partition information of the hidden partition, fill the second partition information into the HLBA1 position of the first GPT partition table according to the data format of the preset GPT partition table header, calculate the second CRC32 check information of the second partition information, and fill the second CRC32 check information into the check bit corresponding to the HLBA1 position.
[0015] In some embodiments, during the startup process of the BIOS of the electronic device, booting the operating system in the hidden partition based on the first GPT partition table includes:
[0016] During the startup process of the BIOS, the partition table variables corresponding to the hidden partition are parsed based on the first GPT partition table, wherein the partition table variables corresponding to the hidden partition are pre-acquired from the hidden partition of the hard disk;
[0017] Based on the analysis result, obtaining a startup file corresponding to the operating system;
[0018] The operating system is guided to start based on the startup file.
[0019] In some embodiments, parsing the partition table variables corresponding to the hidden partition based on the first GPT partition table includes:
[0020] Read the first GPT partition table;
[0021] Acquire a partition table variable corresponding to the hidden partition based on a second GPT partition table of the hard disk, wherein the second GPT partition table is a GPT partition table preset by the hard disk;
[0022] The partition table variables are dynamically filled into the first GPT partition table, and the partition table variables are parsed.
[0023] In some embodiments, parsing the partition table variables corresponding to the hidden partition based on the first GPT partition table includes:
[0024] Obtaining a first GPT partition table file corresponding to the first GPT partition table;
[0025] Acquire a partition table variable corresponding to the hidden partition based on a second GPT partition table of the hard disk, wherein the second GPT partition table is a GPT partition table preset by the hard disk;
[0026] Assign the content of the first GPT partition table file to the partition table variable, and parse the partition table variable.
[0027] In some embodiments, the method further comprises:
[0028] Storing the first GPT partition table in a file to obtain the first GPT partition table file;
[0029] The first GPT partition table file is stored in the non-volatile memory of the BIOS.
[0030] In some embodiments, the method further comprises:
[0031] Determining that the hidden partition is in an open state;
[0032] Partition the hidden partition and / or install an operating system to obtain partition information of the hidden partition.
[0033] In some embodiments, partitioning and / or installing an operating system on the hidden partition includes:
[0034] Determining the partition attributes of the hidden partition; and / or
[0035] Formatting the file system in the hidden partition; and / or
[0036] An operating system is installed in the hidden partition.
[0037] According to one of the solutions of the present disclosure, a system startup device is also provided, including:
[0038] A determination module configured to determine a hidden partition of the hard disk;
[0039] A creation module, configured to create a first GPT partition table corresponding to the hidden partition based on the partition information of the hidden partition;
[0040] The boot module is configured to boot the operating system in the hidden partition based on the first GPT partition table during the boot process of the BIOS of the electronic device.
[0041] According to one of the solutions of the present disclosure, there is also provided an electronic device, comprising a memory and at least one processor, the memory being used to store at least one computer program instruction, and the at least one processor being used to implement the above-mentioned system startup method by loading and executing the at least one computer program instruction.
[0042] According to one of the solutions of the present disclosure, a computer storage medium is further provided, on which computer program instructions are stored; when the computer program instructions are executed by a processor, the above-mentioned system startup method is implemented.
[0043] The system startup method, device, electronic device and computer storage medium provided by various embodiments of the present disclosure, after determining the hidden partition of the solid-state hard disk, create a first GPT partition table corresponding to the hidden partition based on the partition information of the hidden partition and the data format of the preset GPT partition table, and during the startup process of the BIOS of the electronic device, boot the operating system in the hidden partition based on the first GPT partition table and the partition table variables corresponding to the hidden partition, so that the BIOS of the electronic device can successfully start the operating system in the hidden partition, solve the problem in the prior art that the BIOS cannot normally start the operating system in the hidden partition, and can use the hidden partition to realize the storage of important data (such as backup of the operating system), thereby improving the reliability of system startup and the security of data. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A schematic diagram showing the structure of a GPT partition table;
[0045] Figure 2 A flow chart showing a system startup method according to an embodiment of the present disclosure;
[0046] Figure 3 An actual partition diagram of a hidden partition in the system startup method of an embodiment of the present disclosure (including 3 partitions) is shown;
[0047] Figure 4 A schematic diagram showing a first GPT partition table in a system startup method according to an embodiment of the present disclosure;
[0048] Figure 5 A schematic diagram showing the structure of a system startup device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0049] Various aspects and features of the present disclosure are described herein with reference to the drawings.
[0050] It should be understood that various modifications may be made to the embodiments of the present application. Therefore, the above description should not be considered as limiting, but only as an example of an embodiment. Other modifications within the scope and spirit of the present disclosure will occur to those skilled in the art.
[0051] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the general description of the present disclosure given above and the detailed description of the embodiments given below, serve to explain the principles of the present disclosure.
[0052] These and other characteristics of the present disclosure will become apparent from the following description of a preferred form of embodiment given as a non-limiting example, with reference to the attached drawings.
[0053] It should also be understood that although the disclosure has been described with reference to certain specific examples, those skilled in the art will be able to readily implement many other equivalent forms of the disclosure.
[0054] The above and other aspects, features and advantages of the present disclosure will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.
[0055] Specific embodiments of the present disclosure are described hereinafter with reference to the accompanying drawings; however, it should be understood that the embodiments claimed are merely examples of the present disclosure, which may be implemented in a variety of ways. Well-known and / or repeated functions and structures are not described in detail to avoid obscuring the present disclosure with unnecessary or redundant details. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but merely serve as a basis and representative basis for the claims to teach those skilled in the art to use the present disclosure in a variety of ways with substantially any suitable detailed structure.
[0056] The following is a brief description of the GPT partition table structure.
[0057] Figure 1 FIG. 2 shows a schematic diagram of the structure of the GPT partition table in an embodiment of the present disclosure. Figure 1 As shown, Figure 1 The solid-line box area is a hidden area of the SSD (hard disk or disk for short), which is usually not directly accessible to users; Figure 1The area in the middle dotted box (LBA0 to LBA-1 area segment) is the hard disk area that can be normally accessed by users.
[0058] like Figure 1 As shown in the dotted box area, GPT uses 34 LBA blocks to record partition information. In addition to the first 34 LBAs, GPT uses 33 LBAs at the end of the entire hard disk as a backup. The specific contents of GPT partition information stored on the LBA of the SSD are:
[0059] LBA0 (MBR Compatibility Block): At the very beginning of the GPT partition table, a traditional MBR (LBA0) is still stored for compatibility reasons. This MBR is called Protective MBR. Protective MBR protects GPT disks from being harmed by previously released MBR disk tools. LBA0 stores the boot program + special identifier (indicating that the hard disk is managed with GPT).
[0060] LBA1: Partition table header, which defines the available space of the hard disk and the size and number of items that make up the partition table. The partition table header also records the hard disk GUID, the location and size of the partition table header itself (always LBA1), and the location and size of the backup partition table header and partition table (at the end of the hard disk, LBA-1 to LBA-34). At the same time, it also stores the CRC32 checksum of itself and the partition table. The firmware, boot program and operating system can determine whether the partition table is wrong based on the checksum value when starting. If it is wrong, the software can be used to restore the entire partition table from the last backup GPT of the hard disk. If the backup GPT also has a checksum error, the hard disk will be unusable. That is, the information stored in the LBA1 position is mainly the size of the partition table itself + the location of the backup GPT partition + the partition table checksum. Table 1 shows the specific information of the data format of the GPT partition header.
[0061] Table 1 Data format of GPT partition header
[0062]
[0063]
[0064] LBA2~33: LBA2~33 stores the partition table entry. There are 32 LBAs in total, and each LBA can store 4 groups of partition records, and each group of records can exist independently. The first 16 bytes of a partition table entry are the partition type GUID. The next 16 bytes are the unique GUID of the partition (this GUID refers to the partition itself, and the previous GUID refers to the type of the partition). Next are the 64-bit LBA numbers of the start and end of the partition, as well as the name and attributes of the partition. The specific data format is shown in Table 2.
[0065] Table 2 Data format of GPT partition table entries
[0066]
[0067]
[0068] LBA-1: The data stored is the backup partition header described in LBA1, which is the same as LBA1 and is a backup of LBA1.
[0069] LBA-34~LBA-2: The data content stored is the location and size of the backup partition table described in LBA1 (at the end of the hard disk), which is equivalent to LBA2~LBA33 and has the same content.
[0070] When setting the hidden partition of a hard disk with hidden partition function to visible and operable or invisible and inoperable, the number of LBAs will change. When the hidden partition is set to invisible, according to the storage mechanism of the GPT partition table in the UEFI standard protocol, LBA1 stores the GPT partition table header of the non-hidden area (normal visible area) of the disk, and LBA2~LBA33 stores the partition table information of the non-hidden area; at the same time, the GPT backup partition table header of the non-hidden area is stored on LBA-1, and LBA-33~LBA-2 stores the GPT backup partition table of the non-hidden area. When the hidden partition is set to visible, LBA1 stores the GPT partition table header of the entire area of the disk (including the hidden area and the non-hidden area), and LBA2~LBA33 stores the partition table information of the entire area of the disk; at the same time, the GPT backup partition table header of the entire area of the disk is stored on HLBA-1, and HLBA-2~HLBA-33 stores the GPT backup partition table of the entire area of the disk.
[0071] As mentioned above, different settings of hidden partitions make the LBA location and content of GPT partition table information inconsistent. Although the disk GPT partition table information is stored in LBA1~LBA33, when the hidden partition is invisible, the GPT partition information of the non-hidden partition is stored; when the hidden partition is visible, the GPT partition information of the full disk capacity is stored, that is, the content stored in LBA1~LBA33 at the same location is inconsistent. At the same time, when the hidden partition is invisible, the backup GPT partition information is stored at LAB-34~LBA-1; and when the hidden partition is visible, the backup GPT partition information is stored at HLBA-34~HLBA-1. That is, in the above two situations, the location where the backup GPT partition information needs to be stored according to the UEFI standard protocol is inconsistent, and the stored content is also inconsistent.
[0072] The way BIOS boots the operating system is based on the file system. In the BIOS stage of system startup, the GPT partition information at the beginning of the hard disk is needed. That is, no matter whether the BIOS firmware or the operating system accesses the hard disk according to the file system, it is necessary to parse the LBA1~LBA33 of the hard disk first. Therefore, when the hidden partition is enabled and started, the GPT partition table information contains the information of the HLBA part expanded after the hidden partition is enabled ( Figure 1 However, the information cannot be directly read at this time, resulting in the BIOS being unable to normally boot the operating system in the hidden partition. At the same time, the non-hidden partition may also not be normally accessed.
[0073] In view of the above technical problems, an embodiment of the present disclosure provides a system startup method.
[0074] It should be noted that the file system is a method for the operating system to organize and manage files. To put it bluntly, it presents the data on the hard disk to the user in the form of files. Fat32 and NTFS are both common file system types.
[0075] Figure 2 FIG. 1 is a flow chart showing a method for starting a system according to an embodiment of the present disclosure. Figure 2 As shown, an embodiment of the present disclosure provides a system startup method, which is applied to an electronic device, and the method includes:
[0076] S101: Determine the hidden partition of the hard disk.
[0077] Specifically, after the hard disk is installed in the electronic device, the hard disk can be partitioned and / or the operating system can be installed. Partitioning the hard disk can include setting non-hidden partitions and hidden partitions, and setting the number and size of each partition. Operating system installation refers to installing the operating system (OS) in the corresponding partition. Installing the operating system on the hard disk can include operations such as formatting the file system, setting the file system type, and installing the specific operating system. After partitioning the hidden partition and / or installing the operating system, partition properties such as the number of partitions and the size of the hidden partition, as well as partition information such as the stored file system type can be obtained.
[0078] The electronic device may be a micro or small computer such as a desktop computer (PC), a laptop, a tablet computer, a mobile phone, or a large computer such as a server or an industrial computer. When the electronic device is a desktop computer, the operating system may be an operating system such as Windows or Linux; when the electronic device is a mobile phone, the operating system may be an Android system or an IOS system, etc.
[0079] S102: Creating a first GPT partition table corresponding to the hidden partition based on the partition information of the hidden partition.
[0080] Step S102 specifically includes:
[0081] S1021: Fill the partition information of the hidden partition according to the partition table format of a preset GPT partition table to generate the first GPT partition table.
[0082] Specifically, according to the standard data format of the GPT partition table shown in Table 1 and Table 2, a blank GPT partition table can be created, and the partition information of the hidden partition can be filled in to generate the first GPT partition table. The first GPT partition table is a GPT partition table that is statically filled in according to known variables such as the number of partitions, the partition size, and the file system type of the hidden partition to correspond to the real partition information of the hidden partition in the hard disk. That is, the partition information refers to the fixed format information related to the hidden partition.
[0083] The first GPT partition table includes the following Figure 1 The number of LBAs shown in the dotted box area are HLBA0 to HLBA-1, where HLBA0 to HLBA33 are the primary partition tables of the hidden partition, and HLBA-34 to HLBA-1 are the backup partition tables of the hidden partition.
[0084] S103: During the startup process of the BIOS of the electronic device, the operating system in the hidden partition is started and booted based on the first GPT partition table.
[0085] The partition layout of the first GPT partition table created in step S102 is the same as the partition layout of the hidden partition in the original second GPT partition table of the hard disk. Therefore, the access to the LBA corresponding to the hidden partition in the real second GPT partition table of the hard disk can be skipped. Based on the information in the first GPT partition table, the data on the corresponding LBA is accessed according to the specified GUID file system type, so as to smoothly parse the corresponding data of the hidden partition, obtain the address of the startup file for starting the operating system in the hidden partition, search for the corresponding startup file according to the address, and then boot the operating system in the hidden partition by loading the startup file.
[0086] Since the layout of each HLBA in the first GPT partition table is consistent with the real layout of the hidden partition in the hard disk, the data parsed using the first GPT partition table is the real data corresponding to the hidden partition, ensuring the authenticity and reliability of the parsed data.
[0087] The system startup method provided by the embodiment of the present disclosure, after determining the hidden partition of the solid-state hard disk, creates a first GPT partition table corresponding to the hidden partition based on the partition information of the hidden partition and the data format of the preset GPT partition table, and during the startup process of the BIOS of the electronic device, based on the first GPT partition table and the partition table variables corresponding to the hidden partition, boots the operating system in the hidden partition, so that the BIOS of the electronic device can successfully start the operating system in the hidden partition, solves the problem in the prior art that the BIOS cannot normally start the operating system in the hidden partition, and can use the hidden partition to realize the storage of important data (such as backup of the operating system), thereby improving the reliability of system startup and the security of data.
[0088] In this embodiment, by setting up a hidden partition on the hard disk, not only can data security be improved and subsequent data or operating system recovery be facilitated, but different partitions can concentrate data in certain storage spaces, greatly improving data reading efficiency; at the same time, by starting the operating system in the hidden partition through the above-mentioned system startup method, not only can the operating system in the hidden partition be started quickly and accurately, but other functions can also be customized for the operating system in the hidden partition, thereby improving the performance of the entire electronic device.
[0089] The first GPT partition table complies with the standard UEFI protocol and can be developed at the UEFI firmware layer to statically fill in the GPT partition table information of the hidden partition to generate the first GPT partition table. The development is convenient and can be improved based on the standard data format of the existing GPT partition table of the hard disk.
[0090] In some embodiments, in step S1021, the partition information of the hidden partition is filled according to the partition table format of a preset GPT partition table to generate the first GPT partition table, including:
[0091] 1) obtaining first partition information of the hidden partition, filling the first partition information into the HLBA2-HLBA33 positions of the first GPT partition table according to the data format of the preset GPT partition table entry, calculating first CRC32 check information of the first partition information, and filling the first CRC32 check information into the check bit corresponding to the HLBA2-HLBA33 position;
[0092] 2) Obtain the second partition information of the hidden partition, fill the second partition information into the HLBA1 position in the first GPT partition table according to the data format of the preset GPT partition table header, calculate the second CRC32 check information of the second partition information, and fill the second CRC32 check information into the check bit corresponding to the HLBA1 position.
[0093] Figure 3The actual partition information of the hidden partition (including 3 partitions) is shown. Figure 4 The partition information of the generated first GPT partition table is shown.
[0094] Specifically, the first partition information of the hidden partition is filled into the bit corresponding to the HLBA2 position (LBA2 position of the preset GPT partition table entry) according to the data structure in Table 2 above; and the first CRC32 check information of the first partition information is calculated, and then filled into the 0x28~0x2f bits of HLBA2 (such as Figure 4 As shown in FIG. 14 , the static filling of the first GPT partition table entry HLBA2 is completed. The partition information of the HLBA3 to HLBA33 positions is statically filled in a similar manner.
[0095] Set the starting LBA value of the hidden partition, the last partition ( Figure 3 The second partition information of the hidden partition, such as the LAB-34 value of the last partition among the three partitions in the hidden partition, the partition type GUID value, etc., are respectively filled into the bits corresponding to the HLBA1 position, and the second CRC32 check information of the second partition information is calculated, and then filled into the check bit corresponding to the HLBA1 position, to complete the static filling of the HLBA1 position of the first GPT partition table header. The GPT primary partition table of the hidden partition can be obtained through the above filling. Since the LBA0 position in the preset GPT partition table is an MBR compatible block, therefore, in this embodiment, the LBA0 in the original second GPT partition table of the hard disk can still be used as the HLBA0 in the first GPT partition table.
[0096] The HLBA-34 to HLBA-1 positions are filled with the GPT backup partition table of the hidden partition, which is not used for partitioning. The filling of the HLBA-34 to HLBA-1 positions can be filled according to the HLBA1 to HLBA33 positions filled above, without manual filling. After each position is filled, the static filling of the first GPT partition table is completed.
[0097] In this embodiment, when generating the first GPT partition table, a cyclic redundancy check (CRC) method is used to obtain a check value. In other embodiments, when the preset GPT partition table uses a check method such as parity check or MD5, the check value in the first GPT partition table can be obtained using a corresponding check method.
[0098] In some embodiments, in step S103, during the startup process of the BIOS of the electronic device, booting the operating system in the hidden partition based on the first GPT partition table includes:
[0099] S1031: During the startup process of the BIOS, the partition table variables corresponding to the hidden partition are parsed based on the first GPT partition table, wherein the partition table variables corresponding to the hidden partition are pre-acquired from the hidden partition of the hard disk;
[0100] S1032: Based on the analysis result, obtaining a startup file corresponding to the operating system;
[0101] S1033: Boot the operating system based on the startup file.
[0102] After the BIOS firmware starts to open the hidden function of the hard disk, the BIOS accesses the data on the corresponding LBA according to the first GPT partition table according to the specified GUID file system type, and parses the partition table variables in the hidden partition (such as gpt_pation_table) according to the GPT partition table format specified in the EFI protocol to obtain the parsing result; then, based on the parsing result, the standard operating system startup file is traversed according to the guide partition information in the first GPT partition table, and the corresponding startup file (such as grub64.efi file) is found, and the startup file is used to boot the operating system to achieve the smooth startup of the operating system in the hidden area. The partition table variables in the hidden partition can be found and obtained from the hidden partition based on the partition information in the original second GPT partition table of the hard disk.
[0103] During the specific startup process of the operating system (such as a Linux system), the grub boot system can be used to start up. After finding the grubx64.efi file in step S103, the modules and configuration files under / boot / grub are loaded through the grub loader, and then the operating system startup kernel is loaded.
[0104] In some embodiments, in step S1031, parsing the partition table variables corresponding to the hidden partition based on the first GPT partition table includes:
[0105] S201: Read the first GPT partition table;
[0106] S202: Acquire a partition table variable corresponding to the hidden partition based on a second GPT partition table of the hard disk, wherein the second GPT partition table is a preset GPT partition table of the hard disk;
[0107] S203: Dynamically fill the partition table variables into the first GPT partition table, and parse the partition table variables.
[0108] Specifically, during the BIOS startup process, the information of the first GPT partition table is read, and the partition table variable corresponding to the hidden partition obtained from the original second GPT partition table of the hard disk (for example, the above-mentioned gpt_pation_table) is dynamically filled into the first GPT partition table, and the partition table variable in the hidden partition is parsed to obtain the parsing result, and then the startup file corresponding to the operating system is searched.
[0109] In some other embodiments, in step S1031, parsing the partition table variables corresponding to the hidden partition based on the first GPT partition table includes:
[0110] S301: Obtain a first GPT partition table file corresponding to the first GPT partition table;
[0111] S302: Acquire a partition table variable corresponding to the hidden partition based on a second GPT partition table of the hard disk, wherein the second GPT partition table is a preset GPT partition table of the hard disk;
[0112] S303: Assign the content of the first GPT partition table file to the partition table variable, and parse the partition table variable.
[0113] After obtaining the first GPT partition table, for easy reading, the first GPT partition table can be stored as a first GPT partition table file (e.g., gpt.info). When the BIOS starts the operating system, the first GPT partition table file is quickly read, and the content of the first GPT partition table file is assigned to the partition table variable, so as to perform data parsing on the partition table variable using the format of the first GPT partition table in the first GPT partition table file, thereby finding the startup file corresponding to the operating system according to the parsing result. The method of obtaining the partition table variable in step S302 is the same as that in step S202, and will not be repeated here.
[0114] Before executing step S301, the method further includes:
[0115] S401: storing the first GPT partition table in a file to obtain the first GPT partition table file;
[0116] S402: Store the first GPT partition table file in the non-volatile memory of BIOS.
[0117] In this embodiment, after the first GPT partition table is obtained, it is stored in a file, and the file is stored in a non-volatile memory (such as flash) of BIOS, which can ensure the data security of the first GPT partition table, and store it in the form of a file to facilitate fast reading of data.
[0118] In some embodiments, in step S101, the method further includes:
[0119] Determining that the hidden partition is in an open state;
[0120] Partition setting and / or operating system installation are performed on the hidden partition to obtain partition information of the hidden partition.
[0121] In this embodiment, after the hard disk is installed, the non-hidden partition can be partitioned and the operating system can be installed first. Protective MBR and the GPT primary partition table of the non-hidden partition are stored at LBA0 to LBA34 at the beginning of the hard disk, and the GPT backup partition table of the non-hidden partition is stored at the end of the disk LBA-33 to LBA-1.
[0122] Then, the hidden partition is enabled and set up, and the LBA of the hidden partition is extended to the operating system. Meanwhile, partition settings and operating system installation are performed in the hidden partition, so as to obtain the partition information of the hidden partition.
[0123] Figure 5 FIG. 1 shows a schematic diagram of the structure of the system startup device of the embodiment of the present disclosure. Figure 5 As shown, the embodiment of the present disclosure also provides a system startup device, including:
[0124] An acquisition module 100 is configured to determine a hidden partition of a hard disk;
[0125] A creation module 200, configured to create a first GPT partition table corresponding to the hidden partition based on the partition information of the hidden partition;
[0126] The boot module 300 is configured to boot the operating system in the hidden partition based on the first GPT partition table during the boot process of the BIOS of the electronic device.
[0127] In some embodiments, the creation module 200 is further configured to:
[0128] The partition information of the hidden partition is filled in accordance with the partition table format of the preset GPT partition table to generate the first GPT partition table.
[0129] In some embodiments, the creation module 200 is further configured to:
[0130] Obtaining first partition information of the hidden partition, filling the first partition information into the HLBA2-HLBA33 positions of the first GPT partition table according to the data format of the preset GPT partition table entry, calculating first CRC32 check information of the first partition information, and filling the first CRC32 check information into the check bit corresponding to the HLBA2-HLBA33 position;
[0131] Obtain the second partition information of the hidden partition, fill the second partition information into the HLBA1 position of the first GPT partition table according to the data format of the preset GPT partition table header, calculate the second CRC32 check information of the second partition information, and fill the second CRC32 check information into the check bit corresponding to the HLBA1 position.
[0132] In some embodiments, the boot module 300 is further configured to:
[0133] During the startup process of the BIOS, the partition table variables corresponding to the hidden partition are parsed based on the first GPT partition table, wherein the partition table variables corresponding to the hidden partition are pre-acquired from the hidden partition of the hard disk;
[0134] Based on the analysis result, obtaining a startup file corresponding to the operating system;
[0135] The operating system is guided to start based on the startup file.
[0136] In some embodiments, the boot module 300 is further configured to:
[0137] Read the first GPT partition table;
[0138] Acquire a partition table variable corresponding to the hidden partition based on a second GPT partition table of the hard disk, wherein the second GPT partition table is a GPT partition table preset by the hard disk;
[0139] The partition table variables are dynamically filled into the first GPT partition table, and the partition table variables are parsed.
[0140] In some embodiments, the boot module 300 is further configured to:
[0141] Obtaining a first GPT partition table file corresponding to the first GPT partition table;
[0142] Acquire a partition table variable corresponding to the hidden partition based on a second GPT partition table of the hard disk, wherein the second GPT partition table is a GPT partition table preset by the hard disk;
[0143] Assign the content of the first GPT partition table file to the partition table variable, and parse the partition table variable.
[0144] In some embodiments, a storage module is further included, configured to:
[0145] Storing the first GPT partition table in a file to obtain the first GPT partition table file;
[0146] The first GPT partition table file is stored in the non-volatile memory of the BIOS.
[0147] In some embodiments, a partitioning module is further included, configured to:
[0148] Determining that the hidden partition is in an open state;
[0149] Partition the hidden partition and / or install an operating system to obtain partition information of the hidden partition.
[0150] In some embodiments, the partition module is further configured to:
[0151] Determining the partition attributes of the hidden partition; and / or
[0152] Formatting the file system in the hidden partition; and / or
[0153] An operating system is installed in the hidden partition.
[0154] The system startup device provided in the embodiment of the present disclosure corresponds to the system startup method in the above-mentioned embodiment. Based on the above-mentioned system startup method, technicians in this field can understand the specific implementation methods of the system startup device in the embodiment of the present disclosure and its various variations. Any optional items in the system startup method embodiment are also applicable to the system startup device, which will not be repeated here.
[0155] An embodiment of the present disclosure also provides an electronic device, including a memory and at least one processor, the memory is used to store at least one computer program instruction, and the at least one processor is used to implement the system startup method described in the above embodiment by loading and executing the at least one computer program instruction.
[0156] The memory may be used to store software programs and modules, such as program instructions / modules corresponding to the system startup method in the embodiment of the present disclosure. At least one processor may be the above-mentioned multi-GPU architecture, or an architecture of at least two combinations of CPU, FPGA, and GPU. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, implementing the above-mentioned system startup method.
[0157] Furthermore, the memory may include a BIOS memory to store the first GPT partition table, the first GPT partition table file, etc., to ensure data security and convenient and fast data reading.
[0158] The embodiment of the present disclosure further provides a computer storage medium, on which computer program instructions are stored; when the computer program instructions are executed by a processor, the system startup method described in the above embodiment is implemented.
[0159] It should be noted that all or part of the steps of the above method embodiments implemented in the embodiments of the present disclosure can be completed by hardware related to computer executable instructions (programs), and the above computer executable instructions can be stored in a computer-readable storage medium. When the computer executable instructions are executed, the steps of the above method embodiments are executed; and the aforementioned storage medium includes: Read Only Memory (ROM), Random Access Memory (RAM), mobile storage devices, magnetic disks or optical disks, and other media that can store computer executable instructions. In particular, in this embodiment, the computer storage medium can be the above hard disk to be partitioned or after partitioning.
[0160] The above embodiments are only exemplary embodiments of the present disclosure and are not intended to limit the present disclosure. The protection scope of the present disclosure is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present disclosure within the essence and protection scope of the present disclosure, and such modifications or equivalent substitutions shall also be deemed to fall within the protection scope of the present disclosure.
Claims
1. A system startup method, applied to an electronic device with a hard disk, the method comprising: Determining a hidden partition of the hard disk; Based on the partition information of the hidden partition, create a first GPT partition table corresponding to the hidden partition; During the startup process of the BIOS of the electronic device, booting the operating system in the hidden partition based on the first GPT partition table; The step of creating a first GPT partition table corresponding to the hidden partition based on the partition information of the hidden partition includes: filling the partition information of the hidden partition according to a partition table format of a preset GPT partition table to generate the first GPT partition table; Among them, the partition information of the hidden partition is filled according to the partition table format of the preset GPT partition table to generate the first GPT partition table, including: obtaining the first partition information of the hidden partition, filling the first partition information into the HLBA2-HLBA33 positions of the first GPT partition table according to the data format of the preset GPT partition table item, and calculating the first CRC32 check information of the first partition information, and filling the first CRC32 check information into the check bit corresponding to the HLBA2-HLBA33 position; obtaining the second partition information of the hidden partition, filling the second partition information into the HLBA1 position of the first GPT partition table according to the data format of the preset GPT partition table header, and calculating the second CRC32 check information of the second partition information, and filling the second CRC32 check information into the check bit corresponding to the HLBA1 position.
2. The method according to claim 1, wherein: During the startup process of the BIOS of the electronic device, based on the first GPT partition table, booting the operating system in the hidden partition includes: During the startup process of the BIOS, the partition table variables corresponding to the hidden partition are parsed based on the first GPT partition table, wherein the partition table variables corresponding to the hidden partition are pre-acquired from the hidden partition of the hard disk; Based on the analysis result, obtaining a startup file corresponding to the operating system; The operating system is guided to start based on the startup file.
3. The method according to claim 2, wherein: Parsing the partition table variables corresponding to the hidden partition based on the first GPT partition table includes: Read the first GPT partition table; Acquire a partition table variable corresponding to the hidden partition based on a second GPT partition table of the hard disk, wherein the second GPT partition table is a GPT partition table preset by the hard disk; The partition table variables are dynamically filled into the first GPT partition table, and the partition table variables are parsed.
4. The method according to claim 2, wherein: Parsing the partition table variables corresponding to the hidden partition based on the first GPT partition table includes: Obtaining a first GPT partition table file corresponding to the first GPT partition table; Acquire a partition table variable corresponding to the hidden partition based on a second GPT partition table of the hard disk, wherein the second GPT partition table is a GPT partition table preset by the hard disk; Assign the content of the first GPT partition table file to the partition table variable, and parse the partition table variable.
5. The method according to claim 4, wherein: The method further comprises: Storing the first GPT partition table in a file to obtain the first GPT partition table file; The first GPT partition table file is stored in the non-volatile memory of the BIOS.
6. The method according to claim 1, wherein: The method further comprises: Determining that the hidden partition is in an open state; Partition the hidden partition and / or install an operating system to obtain partition information of the hidden partition.
7. The method according to claim 6, wherein: Partitioning the hidden partition and / or installing an operating system includes: Determining the partition attributes of the hidden partition; and / or Formatting the file system in the hidden partition; and / or An operating system is installed in the hidden partition.
8. A system startup device, the device being used to execute the system startup method according to any one of claims 1 to 7, comprising: A determination module configured to determine a hidden partition of the hard disk; A creation module, configured to create a first GPT partition table corresponding to the hidden partition based on the partition information of the hidden partition; The boot module is configured to boot the operating system in the hidden partition based on the first GPT partition table during the boot process of the BIOS of the electronic device.
Citation Information
Patent Citations
Method and equipment for starting up mobile communication terminal
CN104142838A
Multioperation system management method capable of supporting Macintosh computer and multioperation system management device capable of supporting Macintosh computer
CN106325872A
Portable storage device exploitation startup disk manufacture method and device and computing equipment
CN106502739A
Method for guiding electronic equipment starting system
CN107220071A
Computer file reading method and device, computer system and storage medium
CN111258666A
