A method and device for formatting a hard disk in a BIOS configuration interface

By implementing the hard disk formatting function in the BIOS configuration interface, users can directly select and perform formatting operations in the BIOS, solving the problem of using third-party tools or operating systems in the existing technology, and achieving fast and secure hard disk formatting.

CN114510275BActive Publication Date: 2025-03-25KUNLUN TECH (BEIJING) TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111647682.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2025-03-25
Estimated Expiration
2041-12-30

AI Technical Summary

Technical Problem

In the prior art, formatting hard disks usually requires the help of third-party tools or operating systems, which are difficult to directly implement in the BIOS configuration interface, especially in operating system abnormalities or special scenarios.

Method used

By implementing the hard disk formatting function in the BIOS configuration interface, users can log in to the BIOS configuration interface, select the formatting function, and BIOS obtains the serial number of all ports inserted into the hard disk, and store the corresponding relationship in the cache area. After the user selects the hard disk, the BIOS performs comparison and formatting operations.

Benefits of technology

It realizes the direct formatting of the hard disk under the BIOS configuration interface, which quickly and saves resources, is suitable for operating system exceptions or special scenarios, and improves the convenience and security of operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114510275B_ABST
    Figure CN114510275B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for formatting a hard disk in a BIOS configuration interface. In the method, first, the user logs in to the BIOS configuration interface and selects the formatting function; the BIOS obtains the serial number of the hard disk plugged into the computer port, displays it in the BIOS configuration interface, and stores the corresponding relationship between the port and the hard disk serial number in the BIOS cache area; receives the user's selection of the hard disk to be formatted; the BIOS obtains the serial number of the hard disk to be formatted from the disk plug-in port, and compares it with the corresponding serial number stored in the BIOS cache area; if they are consistent, the hard disk formatting operation is performed according to the selected hard disk; if they are inconsistent, a pop-up window is displayed to indicate that the serial number does not match. The present invention does not require the help of a third party, and can directly realize the selection and implementation of hard disk formatting through the BIOS configuration interface, making hard disk formatting faster and saving resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of computer firmware, and in particular relates to a method and device for formatting a hard disk in a BIOS configuration interface. Background Art

[0002] BIOS is used to initialize the computer processor platform and load the operating system. Its basic functions include obtaining system control after the hardware platform is powered on, initializing key components such as the processor, memory, and chipset, enumerating peripherals and allocating resources to them, initializing necessary peripherals such as graphics cards, hard drives, and network cards, establishing a running environment for the operating system, and then handing control over to the operating system.

[0003] The hard disk is an important storage device of the computer, which can store the operating system, installation software, video files, etc. When the data in this hard disk is no longer needed, the hard disk can be formatted.

[0004] In the prior art, the hard disk formatting function is usually implemented by building a server or operating system. That is, when the operating system is abnormal, the formatting operation cannot be completed through the system, and it is usually necessary to use a third party to implement the hard disk formatting. However, the method of using a third party to format the hard disk is still insufficient for special scenarios such as production line production or on-site use. Summary of the invention

[0005] In view of this, the present invention provides a method and device for formatting a hard disk in a BIOS configuration interface, which can directly select and implement hard disk formatting through the BIOS configuration interface without the help of a third party, making hard disk formatting faster and saving resources.

[0006] In order to solve the above technical problems, the present invention is implemented as follows.

[0007] A method for formatting a hard disk in a BIOS configuration interface, comprising:

[0008] Step 1: Log in to the BIOS configuration interface and select the format function;

[0009] Step 2: BIOS obtains the serial numbers of the hard disks plugged into all ports of the computer, displays them in the BIOS configuration interface, and stores the corresponding relationship between the ports and the hard disk serial numbers in the BIOS cache;

[0010] Step 3, receiving the user's selection of the hard disk to be formatted;

[0011] Step 4: BIOS obtains the serial number of the hard disk to be formatted from the disk insertion port, and compares it with the corresponding serial number stored in the BIOS cache; if they are consistent, it will go to step 5; if they are inconsistent, a pop-up window will be displayed to indicate that the serial numbers do not match, and this process ends;

[0012] Step 5. Perform hard disk formatting according to the selected hard disk.

[0013] Preferably, in step 1, a username and password login box is added to the login interface displayed when the BIOS is turned on, and the administrator identity is set; the username and password login box pops up each time the computer is turned on, and the BIOS configuration interface is only allowed to be displayed after the user logs in as an administrator.

[0014] Preferably, the step 5 of performing the hard disk formatting operation includes:

[0015] BIOS automatically performs multiple formatting operations to ensure complete formatting; each formatting process displays the formatting percentage on the BIOS configuration interface;

[0016] During the formatting process, BIOS continues to wait for commands. If the esc key is pressed externally, the hard disk formatting function will be exited; if the pause key is pressed externally, the formatting action will be paused; in the paused state, if the enter key is pressed externally, the hard disk formatting function will continue to be started.

[0017] Preferably, the step 4 determines that the serial numbers are consistent, and a pop-up window is displayed to prompt the user whether to format the hard disk; if the user selects yes, the process proceeds to step 5 to perform the hard disk formatting operation; otherwise, the process ends.

[0018] Preferably, the formatting operation complies with standard ATA / ATAPI-8Spec, and randomly writes all 0s or all Fs to the hard disk.

[0019] Preferably, in step 2, BIOS obtains the serial number of the hard disk plugged into the port by reading the SATA controller and obtaining the hard disk serial number and hard disk size on all SATA ports through the ATA_IDENTIFY_DATA command.

[0020] The present invention also provides a device for formatting a hard disk in a BIOS configuration interface, comprising a serial number acquisition module, a human-computer interaction module, a judgment module and a formatting processing module arranged in the BIOS;

[0021] The serial number acquisition module is used to acquire the serial number of the hard disk inserted into the computer;

[0022] The human-computer interaction module is used to obtain the serial numbers of the hard disks plugged into all ports of the computer by calling the serial number acquisition module when the user logs into the BIOS configuration interface and selects the formatting function, and display the serial numbers in the BIOS configuration interface, and store the corresponding relationship between the ports and the hard disk serial numbers in the BIOS cache area; receive the user's selection of the hard disk to be formatted; and send the user selection information to the judgment module;

[0023] The judgment module is used to call the serial number acquisition module to obtain the serial number of the hard disk to be formatted, search the serial number corresponding to the port where the hard disk to be formatted is located from the BIOS cache area, and compare them; if they are consistent, call the formatting processing module to perform the hard disk formatting operation; if they are inconsistent, the human-computer interaction module pops up a window to prompt that the serial number does not match, and does not perform the formatting operation;

[0024] The formatting processing module is used to perform a formatting operation on the hard disk to be formatted according to the user's selection when being called.

[0025] Preferably, the human-computer interaction module adds a username and password login box to the login interface displayed when the BIOS is turned on, and sets the administrator identity; the username and password login box pops up each time the computer is turned on, and the BIOS configuration interface is only allowed to be displayed after the user logs in as an administrator.

[0026] Preferably, the formatting processing module automatically performs multiple formatting operations when formatting the hard disk to ensure complete formatting; each formatting process displays the formatting percentage on the BIOS configuration interface through the human-computer interaction module;

[0027] During the formatting process, the formatting processing module continuously waits for commands. If the esc key is pressed externally, the hard disk formatting function is exited; if the pause key is pressed externally, the formatting action is paused; in the paused state, if the enter key is pressed externally, the hard disk formatting function is continued.

[0028] Beneficial effects:

[0029] (1) The present invention does not rely on a third party, but directly implements a solution for formatting the hard disk in the BIOS. This solution does not require entering the operating system, and the method of formatting the hard disk can be completed by simply selecting a button in the BIOS configuration interface. This solution provides an optimal solution for the following scenarios, including scenarios where the operating system is abnormal and cannot be formatted through the system; scenarios where data in the test disk needs to be quickly cleared during production on the production line; scenarios where there are many users on the user side and data does not want to be shared after personnel changes and needs to be quickly cleared, and the operation is convenient.

[0030] (2) The BIOS traverses the hard disks on all ports and stores the serial numbers of all ports and the corresponding hard disks on these ports in the BIOS cache area, and compares them before confirming the formatting. When the hard disk on a port is replaced, when the user chooses to format the hard disk on this port, a relevant prompt will be given to let the user know that the hard disk may be replaced and perform the formatting operation with caution. For example, if there is a hard disk with serial number 1 plugged into the SATA1 port, and when confirming the formatting, a hard disk with serial number 2 is replaced and plugged into the SATA1 port, the BIOS will give a corresponding prompt for the client to choose whether to continue the formatting operation.

[0031] (3) Since this method realizes serial number reading between BIOS and port, the serial number can be read through the standard SATA protocol, which is convenient and safe.

[0032] (4) In a preferred embodiment, multiple formatting is used to clean the hard disk, without worrying about residual data or the possibility of special means to recover deleted content.

[0033] (5) The present invention also sets management authority, so that only the administrator has the authority to format the hard disk, preventing others from formatting the hard disk, thereby improving security. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is a module framework diagram of the interaction between BIOS and SATA of the present invention.

[0035] Figure 2 The present invention is a flowchart of a hard disk formatting method under a BIOS configuration interface.

[0036] Figure 3 The present invention is a schematic diagram of the composition of a device for formatting a hard disk in the BIOS configuration interface. DETAILED DESCRIPTION

[0037] The present invention is described in detail below with reference to the accompanying drawings and embodiments.

[0038] The present invention provides a solution for formatting a hard disk in a BIOS configuration interface. The basic idea is to first summarize the existing formatting application scenarios and innovatively propose a solution for formatting a hard disk directly in the BIOS without the help of a third party. The solution does not require entering the operating system, and the method for formatting the hard disk can be completed by selecting a button in the BIOS configuration interface.

[0039] This solution provides optimal solutions for the following scenarios, including scenarios where the operating system is abnormal and cannot be formatted by the system; scenarios where data in the test disk needs to be quickly cleared during production; and scenarios where there are many users on the user side and data does not want to be shared after personnel changes and needs to be cleared quickly.

[0040] See also Figure 1 and Figure 2 The hard disk formatting method under the BIOS configuration interface of the present invention comprises the following steps:

[0041] Step 1: Log in to the BIOS configuration interface and select the format function.

[0042] In this step, users can be divided into administrators and ordinary users. Only administrators have the authority to operate the hard disk formatting function, and other users cannot operate it. Then, in the login interface displayed when the BIOS is turned on, add a username and password login box and set the administrator identity; each time the computer is turned on, the username and password login box pops up, and the BIOS configuration interface is allowed to be displayed only after the user logs in as an administrator.

[0043] Step 2: BIOS obtains the serial number of the hard disk inserted in the computer and displays it in the BIOS configuration interface. At the same time, the corresponding relationship between the port and the hard disk serial number is stored in the BIOS cache area.

[0044] In this step, BIOS obtains the serial number of the hard disk inserted in the computer: reads the SATA controller and obtains the hard disk serial number and hard disk size on all SATA ports through the ATA_IDENTIFY_DATA command.

[0045] The correspondence between the port and the hard disk serial number is stored in the cache area to prevent misoperation. The BIOS needs to reserve a location in the flash cache area to store the hard disk serial number. By storing the correspondence, it is equivalent to binding the SATA port and the hard disk on this port. In this way, when selecting the hard disk to be formatted in the subsequent steps, the BIOS can compare whether the hard disk to be formatted is the hard disk on the SATA port.

[0046] Step 3: Receive the user's selection of the hard disk to be formatted. BIOS can format different file system types, such as FAT, EXT4 or other file system types.

[0047] Step 4. BIOS obtains the serial number of the hard disk that needs to be formatted from the disk port again, and compares it with the serial number stored in the BIOS cache; if they are consistent, proceed to the next step; if they are inconsistent, a pop-up window will be displayed to prompt that the serial numbers do not match, formatting is not recommended, and this process ends.

[0048] For example, if you need to format hard disk 1, select the hard disk 1 format option, and the BIOS will automatically match the serial number of the hard disk to be formatted with the one stored in the cache area to see if they are consistent.

[0049] In a preferred embodiment, when it is determined that the serial numbers are consistent, a pop-up window may be displayed to prompt the user whether to format the hard disk; if the user selects yes, the process proceeds to step five to perform the hard disk formatting operation; otherwise, the process ends.

[0050] Step 5. Format the selected hard disk according to the selected hard disk.

[0051] This step performs the hard disk formatting operation, including: BIOS automatically performs multiple formatting operations to ensure complete formatting; each formatting process displays the formatting percentage on the BIOS configuration interface. During the formatting process, BIOS continues to wait for commands. If the esc key is pressed externally, the hard disk formatting function will be exited; if the pause key is pressed externally, the formatting action will be paused; in the paused state, if the enter key is pressed externally, the hard disk formatting function will continue to start.

[0052] The formatting operation complies with the standard ATA / ATAPI-8Spec, and randomly writes all 0s or all Fs to the hard disk.

[0053] In order to implement the above method, the present invention also provides a device for formatting a hard disk in a BIOS configuration interface, such as Figure 3 As shown, the device includes a serial number acquisition module, a human-computer interaction module, a judgment module and a formatting processing module arranged in the BIOS.

[0054] A serial number acquisition module is used to obtain the serial number of the hard disk inserted into the computer;

[0055] The human-computer interaction module is used to obtain the serial numbers of the hard disks inserted in all ports of the computer by calling the serial number acquisition module when the user logs in to the BIOS configuration interface and selects the formatting function, and displays them in the BIOS configuration interface. At the same time, the corresponding relationship between the port and the hard disk serial number is stored in the BIOS cache area; receive the user's selection of the hard disk to be formatted; and send the user's selection information to the judgment module.

[0056] Preferably, the human-computer interaction module adds a username and password login box to the login interface displayed when the BIOS is turned on, and sets the administrator identity; the username and password login box pops up each time the computer is turned on, and the BIOS configuration interface is only allowed to be displayed after the user logs in as an administrator.

[0057] The judgment module is used to call the serial number acquisition module to obtain the serial number of the hard disk to be formatted, search the serial number corresponding to the port where the hard disk to be formatted is located from the BIOS cache area, and compare them; if they are consistent, call the formatting processing module to perform the hard disk formatting operation; if they are inconsistent, a prompt that the serial number does not match is given through the pop-up window of the human-computer interaction module, and the formatting operation is not performed.

[0058] The formatting processing module is used to perform corresponding formatting operations on the selected hard disk according to the user's selection when called. Preferably, the formatting processing module automatically performs multiple formatting operations when formatting the hard disk to ensure complete formatting; each formatting process displays the formatting percentage on the BIOS configuration interface through the human-computer interaction module.

[0059] During the formatting process, the formatting processing module continuously waits for commands. If the esc key is pressed externally, the hard disk formatting function is exited; if the pause key is pressed externally, the formatting action is paused; in the paused state, if the enter key is pressed externally, the hard disk formatting function is continued.

[0060] The above specific embodiments only describe the design principle of the present invention. The shapes and names of the components in the description may be different and are not limited. Therefore, those skilled in the art in the field of the present invention may modify or replace the technical solutions recorded in the above embodiments; and these modifications and replacements do not deviate from the creative purpose and technical solutions of the present invention and should all fall within the protection scope of the present invention.

Claims

1. A method for formatting a hard disk in a BIOS configuration interface, characterized in that: include: Step 1: Log in to the BIOS configuration interface and select the format function; Step 2: BIOS reads the SATA controller, obtains the serial numbers of the hard disks plugged into all SATA ports of the computer, displays them in the BIOS configuration interface, and stores the corresponding relationship between the ports and the hard disk serial numbers in the BIOS cache; Step 3, receiving the user's selection of the hard disk to be formatted; Step 4: BIOS obtains the serial number of the hard disk to be formatted from the disk insertion port and compares it with the corresponding serial number stored in the BIOS cache; If they are consistent, proceed to step five; If they are inconsistent, a pop-up window will pop up to remind you that the serial numbers do not match, and the process ends; Step 5. Perform hard disk formatting according to the selected hard disk; During the formatting process, BIOS continues to wait for commands. If the esc key is pressed externally, the hard disk formatting function will be exited; if the pause key is pressed externally, the formatting action will be paused; in the paused state, if the enter key is pressed externally, the hard disk formatting function will continue to be started.

2. The method according to claim 1, characterized in that In the step 1, a user name and password login box is added to the login interface displayed when the BIOS is turned on, and the administrator identity is set; the user name and password login box pops up each time the computer is turned on, and the BIOS configuration interface is allowed to be displayed only after the user logs in as an administrator.

3. The method according to claim 1, characterized in that The step 5 of performing the hard disk formatting operation includes: BIOS automatically performs multiple formatting operations to ensure complete formatting; each formatting process displays the formatting percentage on the BIOS configuration interface.

4. The method according to claim 1, characterized in that The step 4 determines that the serial numbers are consistent, and a pop-up window is first displayed to prompt the user whether to format the hard disk; if the user selects yes, the process proceeds to step 5 to perform the hard disk formatting operation; otherwise, the process ends.

5. The method according to claim 1, wherein The formatting operation complies with the standard ATA / ATAPI-8Spec, and randomly writes all 0s or all Fs to the hard disk.

6. A device for formatting a hard disk in a BIOS configuration interface, characterized in that: It includes a serial number acquisition module, a human-computer interaction module, a judgment module and a formatting processing module set in the BIOS; The serial number acquisition module is used to read the SATA controller to obtain the serial numbers of the hard disks inserted into all SATA ports of the computer; The human-computer interaction module is used to obtain the serial numbers of the hard disks inserted into all SATA ports of the computer by calling the serial number acquisition module when the user logs into the BIOS configuration interface and selects the formatting function, and display them in the BIOS configuration interface, and store the corresponding relationship between the port and the hard disk serial number in the BIOS cache area; receive the user's selection of the hard disk to be formatted; and send the user selection information to the judgment module; The judgment module is used to call the serial number acquisition module to obtain the serial number of the hard disk to be formatted, search the serial number corresponding to the port where the hard disk to be formatted is located from the BIOS cache area, and compare them; if they are consistent, call the formatting processing module to perform the hard disk formatting operation; if they are inconsistent, the human-computer interaction module pops up a window to prompt that the serial number does not match, and does not perform the formatting operation; The formatting processing module is used to perform a formatting operation on the hard disk to be formatted according to the user's selection when being called; During the formatting process, the formatting processing module continuously waits for commands. If the esc key is pressed externally, the hard disk formatting function is exited; if the pause key is pressed externally, the formatting action is paused; in the paused state, if the enter key is pressed externally, the hard disk formatting function is continued.

7. The device according to claim 6, characterized in that The human-computer interaction module adds a username and password login box to the login interface displayed when the BIOS is turned on, and sets the administrator identity; the username and password login box pops up each time the computer is turned on, and the BIOS configuration interface is allowed to be displayed only after the user logs in as an administrator.

8. The device according to claim 6, characterized in that When formatting the hard disk, the formatting processing module automatically performs multiple formatting operations to ensure complete formatting; each formatting process displays the formatting percentage on the BIOS configuration interface through the human-computer interaction module.

Citation Information

Patent Citations

  • Basic input / output system (BIOS)-based storage medium information elimination method and device

    CN113721837A