CN114816542A - System starting method and device - Google Patents

System starting method and device Download PDF

Info

Publication number
CN114816542A
CN114816542A CN202210362705.2A CN202210362705A CN114816542A CN 114816542 A CN114816542 A CN 114816542A CN 202210362705 A CN202210362705 A CN 202210362705A CN 114816542 A CN114816542 A CN 114816542A
Authority
CN
China
Prior art keywords
partition
gpt
hidden
partition table
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210362705.2A
Other languages
Chinese (zh)
Inventor
和志华
李高强
曹先念
葛鹏程
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lenovo Kaitian Technology Co Ltd
Original Assignee
Lenovo Kaitian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lenovo Kaitian Technology Co Ltd filed Critical Lenovo Kaitian Technology Co Ltd
Priority to CN202210362705.2A priority Critical patent/CN114816542A/en
Publication of CN114816542A publication Critical patent/CN114816542A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0643Management of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0674Disk device
    • G06F3/0676Magnetic disk device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4406Loading of operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Stored Programmes (AREA)

Abstract

The disclosure relates to a system starting method and a device, wherein the method is applied to electronic equipment and comprises the following steps: determining a hidden partition of a hard disk; based on the partition information of the hidden partition, creating a first GPT partition table corresponding to the hidden partition; and in the starting process of the BIOS of the electronic equipment, starting and guiding the operating system in the hidden partition based on the first GPT partition table. According to the method and the device, the operating system in the hidden partition can be smoothly started through the BIOS, the storage of important data can be realized by utilizing the hidden partition, and the reliability of system starting and the safety of data are improved.

Description

System starting method and device
Technical Field
The disclosure relates to the technical field of computer operating system starting, in particular to a system starting method and device.
Background
In the prior art, two types of partition tables, mbr (master boot record) and GPT (global unique identifier partition table), are generally used to manage hard disk partitions. MBRs can only support hard disk management for capacities below 2TB, and GPTs, as part of the Extensible Firmware Interface (EFI) standard, can support hard disk management for capacities above 2 TB. GPT handles all blocks of a hard disk as LBAs (logical block addresses, colloquially referred to as sectors). With the wide use of GPT in Windows 10 and various Linux systems, the need for secure storage and smooth access to some important data is increasingly apparent.
In order to realize the protected storage of data, the hiding of a part of the LBA can be realized on a Solid State Disk (SSD) by means of HD-like HPA ("hidden protected area" technology), and a hidden partition is formed on the SSD hard disk. After the storage space of the hidden partition is divided, the hidden partition is invisible to upper layer software such as a BIOS (basic input output System) and an OS (operating system), the purposes of hiding and protecting data are achieved, and theoretically, viruses can be prevented, and data of the storage device after being stolen can be prevented from being illegally accessed or lost. Therefore, important data of a user can be backed up by using the storage space of the hidden partition, or some special application programs are installed to take over the computer in the case of crash of the Host OS (Host operating system), so as to achieve the purpose of recovering the OS or recovering the data.
However, since the partition information of the file system is stored in both the start address field and the end address field of the hard disk, there is a problem that the GPT partition information is inconsistent in both cases of opening and closing the hidden partition, so that the starting modes of the installed hidden partition OS and the Host OS are different, and when the OS in the hidden partition is started by using the same starting mode as the Host OS, the file system cannot be accessed, which affects that the OS in the hidden partition cannot be normally started.
Disclosure of Invention
The embodiment of the disclosure provides a system starting method and device, which can solve the problem that a BIOS (basic input output System) in a hidden partition cannot be started normally in the prior art.
According to one aspect of the present disclosure, a system booting method applied to an electronic device is provided, including:
determining a hidden partition of a hard disk;
based on the partition information of the hidden partition, creating a first GPT partition table corresponding to the hidden partition;
and in the starting process of the BIOS of the electronic equipment, starting and guiding the operating system in the hidden partition based on the first GPT partition table.
In some embodiments, creating a first GPT partition table corresponding to the hidden partition based on the partition information of the hidden partition includes:
and 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.
In some embodiments, the step of 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 includes:
acquiring first partition information of the hidden partition, respectively filling and writing the first partition information to HLBA 2-HLBA 33 positions in a first GPT partition table according to a data format of a preset GPT partition table entry, calculating first CRC32 verification information of the first partition information, and filling the first CRC32 verification information to a verification bit corresponding to the HLBA 2-HLBA 33 positions;
and acquiring second partition information of the hidden partition, filling the second partition information to an HLBA1 position in a first GPT partition table according to a data format of a preset GPT partition table header, calculating second CRC32 check information of the second partition information, and filling the second CRC32 check information to a check bit corresponding to the HLBA1 position.
In some embodiments, during a boot process of a BIOS of an electronic device, boot an operating system within the hidden partition based on the first GPT partition table includes:
in the starting process of the BIOS, analyzing a partition table variable corresponding to the hidden partition based on the first GPT partition table, wherein the partition table variable corresponding to the hidden partition is obtained from the hidden partition of the hard disk in advance;
acquiring a starting file corresponding to the operating system based on the analysis result;
and guiding the operating system to start based on the starting file.
In some embodiments, parsing a partition table variable corresponding to the hidden partition based on the first GPT partition table includes:
reading the first GPT partition table;
acquiring 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;
and dynamically filling the partition table variable into the first GPT partition table, and analyzing the partition table variable.
In some embodiments, parsing a partition table variable corresponding to the hidden partition based on the first GPT partition table includes:
acquiring a first GPT partition table file corresponding to the first GPT partition table;
acquiring 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;
and assigning the content of the first GPT partition table file to the partition table variable, and analyzing the partition table variable.
In some embodiments, the method further comprises:
storing the first GPT partition table in a file to obtain a first GPT partition table file;
and storing the first GPT partition table file in a nonvolatile memory of a BIOS.
In some embodiments, the method further comprises:
determining that the hidden partition is in an open state;
and carrying out partition and/or operating system installation on the hidden partition to obtain partition information of the hidden partition.
In some embodiments, partitioning and/or operating system installation of the hidden partition comprises:
determining partition attributes of the hidden partition; and/or
Formatting a file system within the hidden partition; and/or
Installing an operating system in the hidden partition.
According to one aspect of the present disclosure, there is also provided a system starting apparatus, including:
a determination module configured to determine a hidden partition of a hard disk;
the creating module is configured to create a first GPT partition table corresponding to the hidden partition based on the partition information of the hidden partition;
and the boot starting module is configured to start and boot the operating system in the hidden partition based on the first GPT partition table in the boot process of the BIOS of the electronic device.
According to one of the aspects of the present disclosure, there is also provided an electronic device, including a memory for storing at least one computer program instruction and at least one processor for implementing the system startup method described above by loading and executing the at least one computer program instruction.
According to one of the aspects of the present disclosure, there is also provided a computer storage medium having computer program instructions stored thereon; the computer program instructions, when executed by a processor, implement the system startup method described above.
Various embodiments of the present disclosure provide a system starting method, apparatus, electronic device and computer storage medium, after the hidden partition of the solid state disk is determined, a first GPT partition table corresponding to the hidden partition is created based on the partition information of the hidden partition and the data format of a preset GPT partition table, and based on the first GPT partition table and the partition table variable corresponding to the hidden partition during the starting process of the BIOS of the electronic equipment, the operating system in the hidden partition is booted, so that the BIOS of the electronic device can smoothly boot the operating system in the hidden partition, the problem that the BIOS in the hidden partition cannot normally boot the operating system in the hidden partition in the prior art is solved, the storage of important data (such as backup of an operating system) can be realized by utilizing the hidden partition, and the reliability of system startup and the safety of the data are improved.
Drawings
FIG. 1 shows a structural schematic diagram of a GPT partition table;
FIG. 2 illustrates a flow chart of a system startup method of an embodiment of the present disclosure;
FIG. 3 is a diagram illustrating an actual partition of a hidden partition in the system boot method according to an embodiment of the present disclosure (including 3 partitions);
FIG. 4 is a diagram illustrating a first GPT partition table in a system boot method according to an embodiment of the present disclosure;
fig. 5 shows a schematic structural diagram of a system starting apparatus according to an embodiment of the present disclosure.
Detailed Description
Various aspects and features of the disclosure are described herein with reference to the drawings.
It will be understood that various modifications may be made to the embodiments of the present application. Accordingly, the foregoing description should not be considered as limiting, but merely as exemplifications of embodiments. Other modifications will occur to those skilled in the art within the scope and spirit of the disclosure.
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the disclosure and, together with a general description of the disclosure given above, and the detailed description of the embodiments given below, serve to explain the principles of the disclosure.
These and other characteristics of the present disclosure will become apparent from the following description of preferred forms of embodiment, given as non-limiting examples, with reference to the attached drawings.
It is also to be understood that although the present disclosure has been described with reference to certain specific examples, those skilled in the art will be able to ascertain many other equivalents to the present disclosure.
The above and other aspects, features and advantages of the present disclosure will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.
Specific embodiments of the present disclosure are described hereinafter with reference to the accompanying drawings; however, it is to be understood that the disclosed embodiments are merely exemplary of the disclosure that may be embodied in various forms. Well-known and/or repeated functions and structures have not been described in detail so as not to obscure the present disclosure with unnecessary or unnecessary detail. Therefore, specific structural and functional details disclosed herein are not to be interpreted as limiting, but merely as a basis for the claims and as a representative basis for teaching one skilled in the art to variously employ the present disclosure in virtually any appropriately detailed structure.
The GPT partition table structure is briefly described below.
Fig. 1 shows a schematic structural diagram of a GPT partition table according to an embodiment of the present disclosure. As shown in fig. 1, the solid-line box area in fig. 1 is a hidden area of an SSD (hard disk or magnetic disk for short), which cannot be accessed directly by a user; the dotted-line block area (LBA0 to LBA-1 area segment) in fig. 1 is an area of the hard disk that can be normally accessed by the user.
As shown by the dashed square area in fig. 1, the GPT uses 34 LBA blocks to record partition information, and the GPT uses 33 LBAs as backup in the last of the whole hard disk except the first 34 LBAs. The content of the GPT partition information specified to be stored on the LBA of the SSD specifically is:
LBA0(MBR compatible block): at the very beginning of the GPT partition table, a conventional MBR (LBA0) is still stored for compatibility, this MBR being called a protective MBR (protective MBR). The protective MBR protects the GPT disk from damage by previously released MBR disk tools. LBA0 stores boot loader + special identifier (indicating that the hard disk is managed by GPT).
LBA 1: and the partition table header defines the available space of the hard disk and the size and the number of the items forming the partition table. The partition header also records the GUID of the hard disk, the location (always LBA1) and size of the partition header itself, and the location and size of the backup partition header and partition table (at the end of the hard disk, LBA-1 to LBA-34). It also stores its own and partition table CRC32 checks. The firmware, the bootstrap program and the operating system can judge whether the partition table has errors according to the check value when starting, if so, software can be used for recovering the whole partition table from the last backup GPT of the hard disk, and if the backup GPT also checks the errors, the hard disk cannot be used. That is, the information stored in the LBA1 location is mainly the size of the location of the partition table itself + the location where the GPT partition for backup is placed + the partition table check code. Table 1 shows specific information of a data format of the GPT partition header.
Table 1 data format of GPT partition header
Figure BDA0003584593730000061
Figure BDA0003584593730000071
LBA2 ~ 33: the LBA2 ~ 33 storage is the partition table entry. For 32 LBAs, each LBA can store 4 sets of partition records, and each set of records can exist independently. The first 16 bytes of a partition entry is 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, 64-bit LBA numbers of the start and end of the partition, and names and attributes of the partition, and the specific data format is shown in table 2.
Table 2 data format for GPT partition table entries
Figure BDA0003584593730000072
Figure BDA0003584593730000081
LBA-1: the stored data content is the backup partition header depicted in LBA1, which is the same as LBA1, and is a backup of LBA 1.
LBA-34 to LBA-2: the data content stored is the position and size (at the end of the hard disk) of the backup partition table described in LBA1, and is equivalent to LBA2 LBA33 and the content is consistent.
When the hard disk with the hidden partition function is set to be visible and inoperable, the number of the LBAs may change. When the hidden partition is set to be invisible, according to a storage mechanism of a GPT partition table in a UEFI standard protocol, the LBA1 at the moment stores a GPT partition table header of a non-hidden area (normal visible area) of a disk, and the LBAs 2-LBA 33 store partition table information of the non-hidden area; meanwhile, a GPT backup partition table head of the non-hidden area is stored on the LBA-1, and the GPT backup partition tables of the non-hidden area are stored on the LBA-33-LBA-2. When the hidden partition is set to be visible, the LBA1 stores the GPT partition table header of all the areas (including the hidden area and the non-hidden area) of the disk, and the LBAs 2-LBA 33 store the partition table information of all the areas of the disk; meanwhile, the HLBA-1 stores GPT backup partition table headers of all the areas of the disk to be backed up, and the HLBA-2-HLBA-33 stores GPT backup partition tables of all the areas of the disk.
As described above, the different settings of the hidden partition make the LBA location and content storing the GPT partition table information inconsistent. Although the GPT partition table information of the disk is stored in LBA 1-LBA 33, 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 contents stored in the LBA1 to LBA33 at the same position are not the same. Meanwhile, when the hidden partition is invisible, the backup GPT partition information is stored in the positions of LAB-34 to LBA-1; and when the hidden partition is visible, the backup GPT partition information is stored in the HLBA-34-HLBA-1 positions. That is, in the two cases, the positions where the backup GPT partition information needs to be stored according to the UEFI standard protocol are inconsistent, and the contents stored at the same time are also inconsistent.
The mode of the BIOS starting the operating system is based on a file system, and in the BIOS stage of system start, the GPT partition information of the start position of the hard disk is needed, that is, when the BIOS firmware or the operating system accesses the hard disk according to the file system, the LBA1 to LBA33 of the hard disk need to be analyzed first, so when the hidden partition is opened and started, because the GPT partition table information includes information of the HLBA portion (solid line square area portion in fig. 1) expanded after the hidden partition is opened, but at this time, the information cannot be directly read, the BIOS cannot normally boot and start the operating system in the hidden partition, and meanwhile, the non-hidden partition may also not be normally accessed.
In view of the above technical problem, the embodiments of the present disclosure provide a system booting method.
It should be noted that the file system is a method for the operating system to organize and manage files, and it is to say that the data on the hard disk is presented to the user in the form of files. Fat32, NTFS are both common file system types.
Fig. 2 shows a flow chart of a system startup method of an embodiment of the present disclosure. As shown in fig. 2, an embodiment of the present disclosure provides a system starting method applied to an electronic device, where the method includes:
s101: a hidden partition of the hard disk is determined.
Specifically, after the hard disk is installed in the electronic device, the hard disk may be partitioned and/or the operating system may be installed. The partitioning of the hard disk may include setting a non-hidden partition and a hidden partition, and setting the number and size of each partition. Operating system installation refers to installing an Operating System (OS) within a corresponding partition. The installation of the operating system on the hard disk may include operations of formatting a file system, setting a file system type, and installing a specific operating system. After the hidden partition is partitioned and/or the operating system is installed, partition attributes such as the partition number and the partition size of the hidden partition, and partition information such as the type of the stored file system can be obtained.
The electronic device may be a micro or small computer such as a desktop computer (PC), a notebook computer, a tablet PC, and a mobile phone, or a large computer such as a server and an industrial personal computer. When the electronic equipment is a desktop computer, the operating system can be Windows, Linux and other operating systems; when the electronic device is a mobile phone, the operating system may be an Android system or an IOS system.
S102: and creating a first GPT partition table corresponding to the hidden partition based on the partition information of the hidden partition.
Step S102 specifically includes:
s1021: and 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.
Specifically, a blank GPT partition table may be created according to the standard data format specification of the GPT partition table shown in table 1 and table 2, and partition information of the hidden partition is filled into the blank GPT partition table, so as to generate the first GPT partition table. The first GPT partition table is a GPT partition table which is statically filled according to known variables such as the partition number, the partition size and the file system type of the hidden partition, and corresponds to the real partition information of the hidden partition in the hard disk. Namely, the partition information refers to information of a fixed format related to the hidden partition.
The first GPT partition table includes LBAs with the number shown by the dotted square area in fig. 1, which are HLBA0 to HLBA-1, respectively, where HLBA0 to HLBA33 are main partition tables of hidden partitions, and HLBA-34 to HLBA-1 are backup partition tables of hidden partitions.
S103: and in the starting process of the BIOS of the electronic equipment, starting and booting the operating system in the hidden partition based on the first GPT partition table.
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, so that access to the LBA corresponding to the hidden partition in the real second GPT partition table of the hard disk can be skipped, data access to the data on the corresponding LBA is performed according to the specified GUID file system type based on the information in the first GPT partition table, smooth analysis of the data corresponding to the hidden partition is achieved, the address of the boot file for booting the operating system in the hidden partition is obtained, the corresponding boot file is searched according to the address, and then the operating system in the hidden partition is booted by loading the boot file.
Because 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 analyzed by using the first GPT partition table is the real data corresponding to the hidden partition, and the real reliability of the analyzed data is ensured.
According to the system starting method provided by the embodiment of the disclosure, after the hidden partition of the solid state disk is determined, the first GPT partition table corresponding to the hidden partition is created based on the partition information of the hidden partition and the data format of the preset GPT partition table, and in the starting process of the BIOS of the electronic device, the operating system in the hidden partition is started and guided based on the first GPT partition table and the partition table variable corresponding to the hidden partition, so that the BIOS of the electronic device can smoothly start the operating system in the hidden partition, the problem that the BIOS cannot normally start the operating system in the hidden partition in the prior art is solved, important data (such as backup of the operating system) can be stored by using the hidden partition, and the reliability of system starting and the safety of data are improved.
In the embodiment, the hidden partition is arranged on the hard disk, so that the data security can be improved, the recovery of subsequent data or an operating system is facilitated, the data is concentrated in a certain storage space by different partitions, and the data reading efficiency is greatly improved; meanwhile, the operating system in the hidden partition is started through the system starting method, so that the operating system in the hidden partition can be quickly and accurately started, other functions can be customized for the operating system in the hidden partition, and the performance of the whole electronic equipment is improved.
The first GPT partition table conforms to a standard UEFI protocol, can be developed in a UEFI firmware layer, is convenient to develop and is improved based on a standard data format of the existing GPT partition table of the hard disk, and GPT partition table information of the hidden partition is statically filled to generate the first GPT partition table.
In some embodiments, in step S1021, filling the partition information of the hidden partition according to a partition table format of a preset GPT partition table, and generating the first GPT partition table includes:
1) acquiring first partition information of the hidden partition, respectively filling and writing the first partition information to HLBA 2-HLBA 33 positions in a first GPT partition table according to a data format of a preset GPT partition table entry, calculating first CRC32 verification information of the first partition information, and filling the first CRC32 verification information to a verification bit corresponding to the HLBA 2-HLBA 33 positions;
2) and acquiring second partition information of the hidden partition, filling the second partition information to an HLBA1 position in a first GPT partition table according to a data format of a preset GPT partition table header, calculating second CRC32 check information of the second partition information, and filling the second CRC32 check information to a check bit corresponding to the HLBA1 position.
Fig. 3 shows the actual partition information of the hidden partition (containing 3 partitions), and fig. 4 shows the partition information of the generated first GPT partition table.
Specifically, the first partition information of the hidden partition is filled in the bit corresponding to the HLBA2 position (the LBA2 position of the GPT partition table entry is preset) according to the data structure in table 2; and calculating the check information of the first CRC32 of the first partition information, and filling the check information into bits (shown in FIG. 4) of 0x 28-0 x2f of the HLBA2, thereby completing the static filling of the HLBA2 position of the first GPT partition table entry. Partition information for HLBA 3-HLBA 33 locations is statically filled in a similar manner.
Filling the second partition information of the hidden partition, such as the starting LBA value of the hidden partition, the LAB-34 value of the last partition (the last partition in the three partitions in FIG. 3), the partition type GUID value, and the like, into the bit corresponding to the HLBA1 position, calculating the second CRC32 check information of the second partition information, and then filling the check information into the check bit corresponding to the HLBA1 position, thereby completing the static filling of the HLBA1 position of the header of the first GPT partition. The GPT main partition table of the hidden partition can be obtained through the filling. Since the LBA0 in the preset GPT partition table is an MBR-compatible block, in this embodiment, the LBA0 in the original second GPT partition table of the hard disk may still be used as the HLBA0 in the first GPT partition table.
The HLBA-34-HLBA-1 positions are filled with GPT backup partition tables of hidden partitions, the GPT backup partition tables are not used for partitioning, and the HLBA-34-HLBA-1 position contents can be filled according to the filled HLBA 1-HLBA 33 position contents without manual filling. After each location is populated, the static population of the first GPT partition table is completed.
In this embodiment, when the first GPT partition table is generated, a Cyclic Redundancy Check (CRC) method is used to obtain a Check value. In other embodiments, when the preset GPT partition table adopts a parity check method, an MD5, or other check methods, the check value in the first GPT partition table may be obtained by using a corresponding check method.
In some embodiments, in step S103, in the starting process of the BIOS of the electronic device, the starting and booting of the operating system in the hidden partition based on the first GPT partition table includes:
s1031: analyzing a partition table variable corresponding to the hidden partition based on the first GPT partition table in the starting process of the BIOS, wherein the partition table variable corresponding to the hidden partition is obtained from the hidden partition of the hard disk in advance;
s1032: acquiring a starting file corresponding to the operating system based on the analysis result;
s1033: and guiding the operating system to start based on the starting file.
After the BIOS firmware starts a hidden function of the open hard disk, the BIOS performs data access on the corresponding LBA according to the specified GUID file system type according to the first GPT partition table, and performs data analysis on partition table variables (such as GPT _ space _ table) in the hidden partition according to a GPT partition table format specified in an EFI protocol to obtain an analysis result; then, traversing the standard operating system boot file according to the guidance partition information in the first GPT partition table based on the analysis result, finding a corresponding boot file (for example, grub64.efi file), and booting the operating system by using the boot file, thereby realizing smooth boot of the operating system in the hidden partition. The partition table variable in the hidden partition can be searched and obtained from the hidden partition based on the partition information in the original second GPT partition table of the hard disk.
In a specific starting process of an operating system (e.g., a Linux system), the grub boot system may be used for starting, after the grubx64.efi file is found in step S103, a module and a configuration file under the grub loader/boot/grub are loaded, and then an operating system start kernel is loaded.
In some embodiments, in step S1031, analyzing the partition table variable corresponding to the hidden partition based on the first GPT partition table includes:
s201: reading the first GPT partition table;
s202: acquiring 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;
s203: and dynamically filling the partition table variable into the first GPT partition table, and analyzing the partition table variable.
Specifically, in the BIOS startup process, information of the first GPT partition table is read, a partition table variable (e.g., GPT _ path _ table) corresponding to a hidden partition, which is obtained from an original second GPT partition table of the hard disk, is dynamically filled in the first GPT partition table, data analysis is performed on the partition table variable in the hidden partition, an analysis result is obtained, and then a startup file corresponding to the operating system is searched.
In some embodiments, in step S1031, analyzing the partition table variable corresponding to the hidden partition based on the first GPT partition table includes:
s301: acquiring a first GPT partition table file corresponding to the first GPT partition table;
s302: acquiring 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;
s303: and assigning the content of the first GPT partition table file to the partition table variable, and analyzing the partition table variable.
After the first GPT partition table is obtained, for convenience of reading, the first GPT partition table may 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 that the partition table variable is subjected to data analysis by using the format of the first GPT partition table in the first GPT partition table file, and thus a start file corresponding to the operating system is searched according to the analysis result. The obtaining manner of the partition table variables in step S302 is the same as that in step S202, and is not described herein again.
Before performing step S301, the method further includes:
s401: storing the first GPT partition table in a file to obtain a first GPT partition table file;
s402: and storing the first GPT partition table file in a nonvolatile memory of a BIOS.
In this embodiment, after the first GPT partition table is obtained, the first GPT partition table is stored in a file, and the file is stored in a nonvolatile memory (e.g., a flash) of the BIOS, so that the data security of the first GPT partition table can be ensured, and the first GPT partition table is stored in a file form, which is convenient for fast reading of data.
In some embodiments, in step S101, the method further comprises:
determining that the hidden partition is in an open state;
and carrying out partition setting and/or operating system installation on the hidden partition to obtain partition information of the hidden partition.
In this embodiment, after the hard disk is installed, partition setting and operating system installation may be performed on the non-hidden partition first. LBA0 LBA34 stores the Protective MBR and GPT primary partition table of the non-hidden partition at the beginning of the hard disk, and the GPT backup partition table of the non-hidden partition at the last LBA-33 LBA-1 of the hard disk.
And then, opening the hidden partition, setting the hidden partition, expanding the LBA of the hidden partition to an operating system, and simultaneously, performing partition setting, operating system installation and the like on the hidden partition so as to obtain the partition information of the hidden partition.
Fig. 5 shows a schematic structural diagram of a system startup device according to an embodiment of the present disclosure. As shown in fig. 5, an embodiment of the present disclosure further provides a system starting apparatus, including:
an obtaining module 100 configured to determine a hidden partition of a hard disk;
a creating module 200 configured to create a first GPT partition table corresponding to the hidden partition based on the partition information of the hidden partition;
and a boot starting module 300 configured to start and boot the operating system in the hidden partition based on the first GPT partition table during a boot process of the BIOS of the electronic device.
In some embodiments, the creation module 200 is further configured to:
and 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.
In some embodiments, the creation module 200 is further configured to:
acquiring first partition information of the hidden partition, respectively filling and writing the first partition information to HLBA 2-HLBA 33 positions in a first GPT partition table according to a data format of a preset GPT partition table entry, calculating first CRC32 verification information of the first partition information, and filling the first CRC32 verification information to a verification bit corresponding to the HLBA 2-HLBA 33 positions;
and acquiring second partition information of the hidden partition, filling the second partition information to an HLBA1 position in a first GPT partition table according to a data format of a preset GPT partition table header, calculating second CRC32 check information of the second partition information, and filling the second CRC32 check information to a check bit corresponding to the HLBA1 position.
In some embodiments, the boot module 300 is further configured to:
analyzing a partition table variable corresponding to the hidden partition based on the first GPT partition table in the starting process of the BIOS, wherein the partition table variable corresponding to the hidden partition is obtained from the hidden partition of the hard disk in advance;
acquiring a starting file corresponding to the operating system based on the analysis result;
and guiding the operating system to start based on the starting file.
In some embodiments, the boot module 300 is further configured to:
reading the first GPT partition table;
acquiring 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;
and dynamically filling the partition table variable into the first GPT partition table, and analyzing the partition table variable.
In some embodiments, the boot module 300 is further configured to:
acquiring a first GPT partition table file corresponding to the first GPT partition table;
acquiring 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;
and assigning the content of the first GPT partition table file to the partition table variable, and analyzing the partition table variable.
In some embodiments, further comprising a storage module configured to:
storing the first GPT partition table in a file to obtain a first GPT partition table file;
and storing the first GPT partition table file in a nonvolatile memory of a BIOS.
In some embodiments, further comprising a partitioning module configured to:
determining that the hidden partition is in an open state;
and carrying out partition and/or operating system installation on the hidden partition to obtain partition information of the hidden partition.
In some embodiments, the partition module is further configured to:
determining partition attributes of the hidden partition; and/or
Formatting a file system within the hidden partition; and/or
Installing an operating system in the hidden partition.
The system starting apparatus provided in the embodiment of the present disclosure corresponds to the system starting method in the embodiment described above, and based on the system starting method described above, a person skilled in the art can understand the specific implementation manner of the system starting apparatus in the embodiment of the present disclosure and various variations thereof, and any optional items in the embodiment of the system starting method are also applicable to the system starting apparatus, and are not described herein again.
The disclosed embodiments also provide an electronic device, which includes a memory and at least one processor, where 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 according to the above embodiments by loading and executing the at least one computer program instruction.
The memory may be used to store software programs and modules, such as program instructions/modules corresponding to the system booting method in the embodiments of the present disclosure. The at least one processor may be a multi-GPU architecture as described above, or an architecture that combines at least two of a CPU, an FPGA, and a GPU. The processor executes various functional applications and data processing by running software programs and modules stored in the memory, that is, the system starting method is realized.
Further, the memory may include a BIOS memory to store the first GPT partition table, the first GPT partition table file, and the like, so as to ensure data security and convenience and rapidness in data reading.
The disclosed embodiments also provide a computer storage medium having computer program instructions stored thereon; the computer program instructions, when executed by a processor, implement the system startup method as described in the above embodiments.
It should be noted that all or part of the steps of the method embodiments described above may be implemented by hardware associated with computer-executable instructions (programs), which may be stored in a computer-readable storage medium, and when executed, the computer-executable instructions perform the steps including the method embodiments described above; and the aforementioned storage medium includes: read Only Memory (ROM), Random Access Memory (RAM), removable storage devices, magnetic or optical disks, and the like, may store various media that may be used to store computer-executable instructions. In particular, in this embodiment, the computer storage medium may be the above hard disk to be partitioned or partitioned.
The above embodiments are merely exemplary embodiments of the present disclosure, which is not intended to limit the present disclosure, and the scope of the present disclosure is defined by the claims. Various modifications and equivalents of the disclosure may occur to those skilled in the art within the spirit and scope of the disclosure, and such modifications and equivalents are considered to be within the scope of the disclosure.

Claims (10)

1. A system starting method is applied to electronic equipment and comprises the following steps:
determining a hidden partition of a hard disk;
based on the partition information of the hidden partition, creating a first GPT partition table corresponding to the hidden partition;
and in the starting process of the BIOS of the electronic equipment, starting and guiding the operating system in the hidden partition based on the first GPT partition table.
2. The method of claim 1, wherein creating a first GPT partition table corresponding to the hidden partition based on the partition information of the hidden partition comprises:
and 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.
3. The method of claim 2, wherein the step of 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 comprises:
acquiring first partition information of the hidden partition, respectively filling and writing the first partition information to HLBA 2-HLBA 33 positions in a first GPT partition table according to a data format of a preset GPT partition table entry, calculating first CRC32 verification information of the first partition information, and filling the first CRC32 verification information to a verification bit corresponding to the HLBA 2-HLBA 33 positions;
and acquiring second partition information of the hidden partition, filling the second partition information to an HLBA1 position in a first GPT partition table according to a data format of a preset GPT partition table header, calculating second CRC32 check information of the second partition information, and filling the second CRC32 check information to a check bit corresponding to the HLBA1 position.
4. The method of claim 1, wherein boot-up booting an operating system within the hidden partition based on the first GPT partition table during boot-up of a BIOS of an electronic device comprises:
analyzing a partition table variable corresponding to the hidden partition based on the first GPT partition table in the starting process of the BIOS, wherein the partition table variable corresponding to the hidden partition is obtained from the hidden partition of the hard disk in advance;
acquiring a starting file corresponding to the operating system based on the analysis result;
and guiding the operating system to start based on the starting file.
5. The method of claim 4, wherein resolving the partition table variable corresponding to the hidden partition based on the first GPT partition table comprises:
reading the first GPT partition table;
acquiring 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;
and dynamically filling the partition table variable into the first GPT partition table, and analyzing the partition table variable.
6. The method of claim 4, wherein resolving the partition table variable corresponding to the hidden partition based on the first GPT partition table comprises:
acquiring a first GPT partition table file corresponding to the first GPT partition table;
acquiring 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;
and assigning the content of the first GPT partition table file to the partition table variable, and analyzing the partition table variable.
7. The method of claim 6, wherein the method further comprises:
storing the first GPT partition table in a file to obtain a first GPT partition table file;
and storing the first GPT partition table file in a nonvolatile memory of a BIOS.
8. The method of claim 1, wherein the method further comprises:
determining that the hidden partition is in an open state;
and carrying out partition and/or operating system installation on the hidden partition to obtain partition information of the hidden partition.
9. The method of claim 8, wherein partitioning and/or operating system installation of the hidden partition comprises:
determining partition attributes of the hidden partition; and/or
Formatting a file system within the hidden partition; and/or
Installing an operating system in the hidden partition.
10. A system startup device comprising:
a determination module configured to determine a hidden partition of a hard disk;
the creating module is configured to create a first GPT partition table corresponding to the hidden partition based on the partition information of the hidden partition;
and the boot starting module is configured to start and boot the operating system in the hidden partition based on the first GPT partition table in the boot process of the BIOS of the electronic device.
CN202210362705.2A 2022-04-07 2022-04-07 System starting method and device Pending CN114816542A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210362705.2A CN114816542A (en) 2022-04-07 2022-04-07 System starting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210362705.2A CN114816542A (en) 2022-04-07 2022-04-07 System starting method and device

Publications (1)

Publication Number Publication Date
CN114816542A true CN114816542A (en) 2022-07-29

Family

ID=82534406

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210362705.2A Pending CN114816542A (en) 2022-04-07 2022-04-07 System starting method and device

Country Status (1)

Country Link
CN (1) CN114816542A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030014622A1 (en) * 2001-07-03 2003-01-16 Jean-Francois Larvoire System and method to enable a legacy BIOS system to boot from a disk that includes EFI GPT partitions
CN1877539A (en) * 2005-06-07 2006-12-13 英业达股份有限公司 Data backup/recovery system under cold start mode and implementing method therefor
CN104142838A (en) * 2014-07-02 2014-11-12 青岛海信移动通信技术股份有限公司 Method and equipment for starting up mobile communication terminal
CN106325872A (en) * 2016-08-26 2017-01-11 武汉噢易云计算股份有限公司 Multioperation system management method capable of supporting Macintosh computer and multioperation system management device capable of supporting Macintosh computer
CN106502739A (en) * 2016-10-31 2017-03-15 北京深之度科技有限公司 Method, device and the computing device that boot disk is made using movable storage device
CN107220071A (en) * 2016-03-22 2017-09-29 北京蓝光引力网络股份有限公司 A kind of method for guiding electronic equipment activation system
CN111258666A (en) * 2020-01-22 2020-06-09 奇安信科技集团股份有限公司 Reading method and device of computer file, computer system and storage medium
US20200241747A1 (en) * 2019-01-25 2020-07-30 Dell Products L.P. GPT-Based Data Storage Partition Securing System
US20210064386A1 (en) * 2018-01-05 2021-03-04 Wayne Inc. Booting disc supporting file storage function

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030014622A1 (en) * 2001-07-03 2003-01-16 Jean-Francois Larvoire System and method to enable a legacy BIOS system to boot from a disk that includes EFI GPT partitions
CN1877539A (en) * 2005-06-07 2006-12-13 英业达股份有限公司 Data backup/recovery system under cold start mode and implementing method therefor
CN104142838A (en) * 2014-07-02 2014-11-12 青岛海信移动通信技术股份有限公司 Method and equipment for starting up mobile communication terminal
CN107220071A (en) * 2016-03-22 2017-09-29 北京蓝光引力网络股份有限公司 A kind of method for guiding electronic equipment activation system
CN106325872A (en) * 2016-08-26 2017-01-11 武汉噢易云计算股份有限公司 Multioperation system management method capable of supporting Macintosh computer and multioperation system management device capable of supporting Macintosh computer
CN106502739A (en) * 2016-10-31 2017-03-15 北京深之度科技有限公司 Method, device and the computing device that boot disk is made using movable storage device
US20210064386A1 (en) * 2018-01-05 2021-03-04 Wayne Inc. Booting disc supporting file storage function
US20200241747A1 (en) * 2019-01-25 2020-07-30 Dell Products L.P. GPT-Based Data Storage Partition Securing System
CN111258666A (en) * 2020-01-22 2020-06-09 奇安信科技集团股份有限公司 Reading method and device of computer file, computer system and storage medium

Similar Documents

Publication Publication Date Title
US7702894B2 (en) System and method for loading programs from HDD independent of operating system
EP3764237A1 (en) System startup method and apparatus, electronic device and storage medium
US8370835B2 (en) Method for dynamically generating a configuration for a virtual machine with a virtual hard disk in an external storage device
US9286164B2 (en) Electronic device to restore MBR, method thereof, and computer-readable medium
US9477487B2 (en) Virtualized boot block with discovery volume
US20070180206A1 (en) Method of updating a duplicate copy of an operating system on the same disk
US11544223B2 (en) Write operation verification method and apparatus
JP2007012056A (en) File system having authentication of postponed data integrity
US20100241815A1 (en) Hybrid Storage Device
CN111258666B (en) Method and device for reading computer file, computer system and storage medium
TWI700639B (en) Booting disk supporting file storage function
JP2007012054A (en) Startup authentication of optimized file system integrity
US20160019002A1 (en) Partial snapshots in virtualized environments
US9218249B2 (en) Electronic apparatus, method of restoring guid partition table (GPT) and computer-readable recording medium
US8788800B2 (en) OS processing method, system and non-transitory computer readable storage medium thereof
US11210024B2 (en) Optimizing read-modify-write operations to a storage device by writing a copy of the write data to a shadow block
CN114816542A (en) System starting method and device
CN112416657A (en) System cloning method
US20200026453A1 (en) Method and system for dynamically expanding a storage system
US11803313B2 (en) Method of constructing a file system based on a hierarchy of nodes
CN117707431A (en) BIOS-based software RAID data reading method and device
JP2009064301A (en) Removable memory unit
KR20060093509A (en) Booting method of operating system on hard disk
CN115686654A (en) Starting and guiding method and device of operating system
CN115827323A (en) Method, apparatus and computer readable medium for restoring files

Legal Events

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