CN109697077B - Method, device and equipment for starting hard disk firmware - Google Patents

Method, device and equipment for starting hard disk firmware Download PDF

Info

Publication number
CN109697077B
CN109697077B CN201711003879.5A CN201711003879A CN109697077B CN 109697077 B CN109697077 B CN 109697077B CN 201711003879 A CN201711003879 A CN 201711003879A CN 109697077 B CN109697077 B CN 109697077B
Authority
CN
China
Prior art keywords
hard disk
firmware
memory
electronic device
register
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.)
Active
Application number
CN201711003879.5A
Other languages
Chinese (zh)
Other versions
CN109697077A (en
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201711003879.5A priority Critical patent/CN109697077B/en
Publication of CN109697077A publication Critical patent/CN109697077A/en
Application granted granted Critical
Publication of CN109697077B publication Critical patent/CN109697077B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal

Abstract

The application provides a method, a device and equipment for starting hard disk firmware, wherein the method comprises the following steps: after the hard disk is determined to be powered on or reset, the hard disk controller acquires position information of firmware in a memory of the electronic equipment, wherein the firmware is used for managing and controlling the hard disk; the hard disk controller acquires the firmware in the memory of the electronic equipment in a Direct Memory Access (DMA) mode according to the position information; the hard disk controller stores the firmware in the memory of the hard disk. In the method, the firmware is not permanently stored in the storage medium of the hard disk, but the latest firmware is acquired in the memory of the electronic equipment after the hard disk is powered on or reset every time, so that the firmware in the hard disk is always the latest firmware, and the electronic equipment does not need to independently maintain the firmware in each hard disk because the firmware is not permanently stored in the hard disk, thereby simplifying the maintenance process of the firmware.

Description

Method, device and equipment for starting hard disk firmware
Technical Field
The present application relates to the field of hard disk technologies, and in particular, to a method, an apparatus, and a device for starting a hard disk firmware.
Background
Electronic devices (e.g., servers, computers, etc.) are generally provided with a hard disk interface through which a hard disk can be inserted into the electronic device so that the electronic device can use the hard disk through the hard disk interface. In order to ensure that the hard disk can normally operate, firmware needs to be loaded in the hard disk, and the hard disk is controlled by the firmware, for example, the hard disk can be driven and detected by the firmware. The firmware is realized by software, and the firmware of the hard disk can be upgraded according to actual needs.
In the prior art, firmware is usually fixedly stored in a hard disk, and after the hard disk is started, the stored firmware is directly loaded. When the firmware needs to be upgraded, the electronic equipment obtains the latest firmware, and the electronic equipment independently upgrades the firmware in each hard disk. When the firmware in the hard disk is upgraded, the electronic device and each hard disk need to interact for many times, the firmware in the hard disk can be upgraded only by storing the firmware of the latest version in the position area of the fixed storage firmware preset by each hard disk and deleting the firmware of the old version fixedly stored in the position area of the fixed storage firmware.
However, in the practical application process, when the number of hard disks in the electronic device is large, the electronic device needs to update and maintain the firmware in each hard disk, and needs to maintain the location area of the fixed storage firmware preset in each hard disk, which results in a complicated firmware maintenance process.
Disclosure of Invention
The application provides a method, a device and equipment for starting a hard disk firmware, which simplify the maintenance process of the firmware.
In a first aspect, the present application provides a method for starting a hard disk firmware, where after determining that a hard disk is powered on or reset, a hard disk controller obtains location information of the firmware in a memory of an electronic device, obtains the firmware in the memory of the electronic device in a DMA manner according to the location information, and stores the firmware in the memory of the hard disk.
In the above process, the storage medium of the hard disk does not permanently store the firmware, but after the hard disk is powered on or reset each time, the latest firmware is acquired from the memory of the electronic device, and the acquired latest firmware is directly started in the hard disk. Therefore, the firmware in the hard disk can be ensured to be the latest firmware all the time, and further, the electronic equipment does not need to maintain the firmware in each hard disk independently because the firmware is not stored in the hard disk permanently, so that the maintenance process of the firmware is simplified.
Optionally, the location information includes a start address of the firmware in the memory of the electronic device and a size of the firmware; alternatively, the location information includes a start address and an end address of the firmware in a memory of the electronic device. Optionally, when the location information includes a start address and an end address of the firmware in the memory of the electronic device, a continuous storage space for storing the firmware is located between the start address and the end address.
In one possible embodiment, the hard disk controller may obtain the location information by querying a first register of the hard disk.
Optionally, before the hard disk controller obtains the location information, the hard disk controller may first query a value in a second register of the hard disk, and when it is determined that the value in the second register is the first preset value, the hard disk controller obtains the location information by querying the first register of the hard disk.
In the above process, when the first register is a nonvolatile memory, after the hard disk is powered on or reset, the value in the first register is a value written by the hard disk in the last operation process, and the location information of the firmware in the memory of the electronic device may be different in different operation processes of the hard disk. When the hard disk controller inquires that the value in the second register is the first preset value, the position information in the first register can be determined to be written in the current operation process of the hard disk, namely, the position information in the first register is correct, so that the hard disk controller can be prevented from obtaining wrong position information.
In another possible implementation, when the hard disk controller obtains the firmware in the memory of the electronic device in the DMA manner, the hard disk controller may first query a value in a third register of the hard disk, and when it is determined that the value in the third register is the second preset value, the hard disk controller obtains the firmware in the memory of the electronic device in the DMA manner according to the location information.
In the above process, after the hard disk controller obtains the location information, the electronic device controller may not complete storing the firmware in the memory of the electronic device, and at this time, the hard disk controller may not successfully obtain the firmware in the memory of the electronic device. When the hard disk controller inquires that the value in the third register is the second preset value, the firmware is stored in the memory, and at this time, the hard disk controller can successfully acquire the firmware from the memory of the electronic device. Therefore, the hard disk controller can be prevented from carrying out invalid acquisition operation in the memory of the electronic equipment, and resource waste is further avoided.
In another possible implementation, the hard disk controller generally needs to acquire the firmware in the memory of the electronic device through the data bus, and in order to determine that the hard disk controller can successfully acquire the firmware, it is necessary to ensure that the link device of the data bus is in a normal state.
Optionally, the hard disk controller modifies the value of the fifth register to indicate that the communication link of the data bus is reset, and modifies the value of the sixth register to indicate that the communication link of the data bus is established, so that repairing the data bus can be implemented to switch the state of the data bus to a normal state.
In a second aspect, the present application provides a method for starting a firmware of a hard disk, where after a controller of an electronic device is started, the controller of the electronic device obtains a latest firmware, stores the firmware in a memory of the electronic device, and stores location information of the firmware in the memory of the electronic device in a first register of the hard disk.
In the above process, the storage medium of the hard disk does not permanently store the firmware, but after the hard disk is powered on or reset each time, the latest firmware is acquired from the memory of the electronic device, and the acquired latest firmware is directly started in the hard disk. Therefore, the firmware in the hard disk can be ensured to be the latest firmware all the time, and further, the electronic equipment does not need to maintain the firmware in each hard disk independently because the firmware is not stored in the hard disk permanently, so that the maintenance process of the firmware is simplified.
In a possible embodiment, in order to ensure that the hard disk controller can obtain correct location information, after the electronic device controller stores the location information of the firmware in the memory of the electronic device into the first register of the hard disk, the value in the second register of the hard disk may be set to a first preset value, where the first preset value is used to instruct the hard disk controller to obtain the location information in the first register.
In another possible embodiment, in order to avoid resource waste caused by the hard disk controller performing an invalid acquiring operation in the memory of the electronic device, after the electronic device controller stores the firmware in the memory of the electronic device, a value in a third register of the hard disk may be set to a second preset value, where the second preset value is used to instruct the hard disk controller to acquire the firmware in the memory of the electronic device in a DMA manner.
In a third aspect, the present application provides a hard disk firmware boot apparatus, a first obtaining module, a second obtaining module, and a storage module, wherein,
the first acquisition module is used for acquiring the position information of firmware in the memory of the electronic equipment after the hard disk is determined to be powered on or reset, wherein the firmware is used for managing and controlling the hard disk;
the second obtaining module is used for obtaining the firmware in the memory of the electronic equipment in a Direct Memory Access (DMA) mode according to the position information;
the storage module is used for storing the firmware in the memory of the hard disk.
In a possible implementation manner, the first obtaining module is specifically configured to:
and acquiring the position information by inquiring a first register of the hard disk.
In another possible implementation manner, the first obtaining module is specifically configured to:
and when the value in the second register of the hard disk is inquired to be a first preset value, acquiring the position information by inquiring the first register of the hard disk, wherein the first preset value is used for indicating that the position information is acquired in the first register.
In another possible implementation manner, the second obtaining module is specifically configured to:
and when the value in the third register of the hard disk is inquired to be a second preset value, acquiring the firmware in the memory of the electronic equipment in a DMA mode according to the position information, wherein the second preset value is used for indicating that the firmware is acquired in the memory of the electronic equipment in the DMA mode.
In another possible implementation, the location information includes a start address of the firmware in a memory of the electronic device and a size of the firmware; alternatively, the first and second electrodes may be,
the location information includes a start address and an end address of the firmware in a memory of the electronic device.
In another possible embodiment, the apparatus further comprises a link management module, wherein,
the link management module is configured to determine a link state of a data bus of the electronic device by querying a fourth register of a hard disk before the second obtaining module obtains the firmware in the memory of the electronic device according to the location information;
the link management module is further configured to repair the data bus when the link management module determines that the link state is an abnormal state until the link state of the data bus is switched to a normal state.
In another possible implementation manner, the link management module is specifically configured to:
modifying a value of a fifth register to indicate a reset of a communication link of the data bus;
modifying a value of a sixth register to indicate that a communication link of the data bus is established.
The hard disk firmware starting device provided by the present application can implement the technical solution shown in any one of the above first aspects, and the implementation principle and the beneficial effects thereof are similar and will not be described herein again.
In a fourth aspect, the present application provides a hard disk firmware boot apparatus, comprising an obtaining module and a storing module, wherein,
the acquisition module is used for acquiring the latest firmware after starting;
the storage module is used for storing the firmware in a memory of the electronic equipment;
the storage module is further configured to store the location information of the firmware in the memory of the electronic device to a first register of a hard disk.
In a possible implementation manner, the storage module is further configured to, after the storage module stores the location information of the firmware in the memory of the electronic device to a first register of a hard disk, set a value in a second register of the hard disk to a first preset value, where the first preset value is used to indicate that the location information is obtained in the first register.
In a further possible embodiment of the method according to the invention,
the storage module is further configured to, after the storage module stores the firmware in the memory of the electronic device, set a value in a third register of the hard disk to a second preset value, where the second preset value is used to instruct to acquire the firmware in the memory of the electronic device in a direct memory access DMA manner.
The hard disk firmware starting device provided by the present application can execute the technical solution shown in any one of the above second aspects, and the implementation principle and the beneficial effect thereof are similar, and are not described herein again.
In a fifth aspect, the present application provides a hard disk, including a processor, a memory, and a communication bus, where the communication bus is used to implement connection between components, the memory is used to store program instructions, and the processor is used to read the program instructions in the memory, and execute the following steps according to the program instructions in the memory:
after determining that the hard disk is powered on or reset, acquiring position information of firmware in a memory of the electronic equipment, wherein the firmware is used for managing and controlling the hard disk;
acquiring the firmware in a memory of the electronic equipment in a Direct Memory Access (DMA) mode according to the position information;
and storing the firmware in a memory of the hard disk.
In one possible implementation, the processor is specifically configured to:
and acquiring the position information by inquiring a first register of the hard disk.
In another possible implementation, the processor is specifically configured to:
and when the value in the second register of the hard disk is inquired to be a first preset value, acquiring the position information by inquiring the first register of the hard disk, wherein the first preset value is used for indicating that the position information is acquired in the first register.
In another possible implementation, the processor is specifically configured to:
and when the value in the third register of the hard disk is inquired to be a second preset value, acquiring the firmware in the memory of the electronic equipment in a Direct Memory Access (DMA) mode according to the position information, wherein the second preset value is used for indicating that the firmware is acquired in the memory of the electronic equipment in a DMA mode.
In another possible implementation, the location information includes a start address of the firmware in a memory of the electronic device and a size of the firmware; or the location information includes a start address and an end address of the firmware in a memory of the electronic device.
In another possible implementation manner, the processor is further configured to determine a link state of a data bus of the electronic device by querying a fourth register of a hard disk before the processor acquires the firmware from the memory of the electronic device according to the location information;
the processor is further configured to repair the data bus when the processor determines that the link state is an abnormal state until the link state of the data bus is switched to a normal state.
In another possible implementation, the processor is specifically configured to:
modifying a value of a fifth register to indicate a reset of a communication link of the data bus;
modifying a value of a sixth register to indicate that a communication link of the data bus is established.
The hard disk provided by the present application may perform the method shown in any one of the first aspect, and the implementation principle and the beneficial effect thereof are similar, which are not described herein again.
In a sixth aspect, the present application provides an electronic device, including a processor, a memory, and a communication bus, where the communication bus is used to implement connection between components, the memory is used to store program instructions, and the processor is used to read the program instructions in the memory and execute the following steps according to the program instructions in the memory:
obtaining the latest firmware after starting;
storing the firmware in a memory of the electronic device;
and storing the position information of the firmware in the memory of the electronic equipment to a first register of a hard disk.
In one possible implementation, the processor is further configured to:
after the processor stores the position information of the firmware in the memory of the electronic equipment to a first register of a hard disk, setting a value in a second register of the hard disk to be a first preset value, wherein the first preset value is used for indicating a hard disk controller to acquire the position information in the first register.
In another possible implementation, the processor is further configured to:
after the processor stores the firmware in the memory of the electronic device, setting a value in a third register of the hard disk to be a second preset value, wherein the second preset value is used for instructing the hard disk controller to acquire the firmware in the memory of the electronic device in a Direct Memory Access (DMA) mode.
The electronic device provided by the present application may perform the method shown in any one of the second aspects, and the implementation principle and the beneficial effect thereof are similar, and are not described herein again.
In a seventh aspect, the present application provides a computer-readable storage medium, where computer-executable instructions are stored in the computer-readable storage medium, and when at least one processor of a hard disk executes the computer-executable instructions, the hard disk executes the method shown in any one of the first aspect.
In an eighth aspect, the present application further provides a computer-readable storage medium having stored therein computer-executable instructions, which when executed by at least one processor of an electronic device, cause the electronic device to perform the method of any one of the second aspects.
In a ninth aspect, the present application further provides a computer program product, which includes computer executable instructions, the computer executable instructions being stored in a computer readable storage medium, which can be read by at least one processor of a hard disk, and the at least one processor executes the computer to perform the method of any one of the first aspect.
In a tenth aspect, the present application further provides a computer program product comprising computer executable instructions stored in a computer readable storage medium, the computer executable instructions being readable from the computer readable storage medium by at least one processor of an electronic device, the at least one processor executing the computer executable instructions to cause the electronic device to perform the method of any of the second aspects.
In an eleventh aspect, the present application further provides a chip system, where the chip system includes a processor, and is configured to support a hard disk to implement the method in any one of the first aspect.
In a twelfth aspect, the present application further provides a chip system, where the chip system includes a processor, and is configured to support an electronic device to implement the method of any one of the second aspects.
According to the firmware starting method, the firmware starting device and the electronic equipment, after the electronic equipment controller is started each time, the electronic equipment controller stores the latest firmware in the memory of the electronic equipment, and writes the position information of the firmware in the memory of the electronic equipment into the first register of the hard disk. After the hard disk is powered on or reset, the hard disk controller acquires the position information of the firmware in the memory of the electronic equipment from the first register, acquires the firmware in the memory of the electronic equipment according to the position information, and stores the firmware in the memory of the hard disk. In the application, the firmware is not stored permanently in the storage medium of the hard disk, but the latest firmware is acquired in the memory of the electronic device after the hard disk is powered on or reset every time, and the acquired latest firmware is directly started in the hard disk. Therefore, the firmware in the hard disk can be ensured to be the latest firmware all the time, and further, the electronic equipment does not need to maintain the firmware in each hard disk independently because the firmware is not stored in the hard disk permanently, so that the maintenance process of the firmware is simplified.
Drawings
FIG. 1 is a block diagram of a storage system provided herein;
FIG. 2 is a diagram illustrating an exemplary configuration of the controller of the electronic device of FIG. 1 provided herein;
FIG. 3 is a block diagram of the hard disk of FIG. 1 provided herein;
fig. 4 is a first flowchart illustrating a hard disk firmware boot method provided in the present application;
fig. 5 is a flowchart illustrating a second method for starting a hard disk firmware according to the present application;
fig. 6 is a schematic structural diagram of a hard disk controller according to the present application;
fig. 7 is a third schematic flowchart of a hard disk firmware boot method provided in the present application;
fig. 8A is a first schematic structural diagram of a hard disk firmware boot apparatus provided in the present application;
fig. 8B is a schematic structural diagram of a hard disk firmware boot apparatus provided in the present application;
FIG. 9 is a schematic structural diagram of another hard disk firmware boot apparatus provided in the present application;
fig. 10 is a schematic structural diagram of a hard disk provided in the present application;
fig. 11 is a schematic structural diagram of an electronic device provided in the present application.
Detailed Description
Fig. 1 is a block diagram of a storage system provided in the present application. Referring to fig. 1, an electronic device control 11 and at least one hard disk 12 are included.
The electronic device controller 11 is connected to a host computer (not shown in the drawings) via a Storage Area Network (SAN). The electronic device controller 11 may be a computing device such as a server, desktop computer, or the like. The electronic device controller 11 is provided with a writing system and an application program. The electronic device controller 11 may receive an input output (I/O) request from a host. The electronic device controller 11 may also store data carried in the I/O request and write the data to the hard disk 12. The electronic device controller 11 belongs to a system controller, which is a separate device, different from the control chip in the hard disk 12. The present embodiment refers to the control chip of the hard disk 12 as a hard disk controller.
The hard disk 12 is a memory using a flash memory chip as a storage medium, and the hard disk 12 may also be referred to as a Solid State Drive (SSD) in this application.
Fig. 2 is a diagram illustrating a structure of the electronic device controller in fig. 1 according to the present application. Referring to fig. 2, the electronic device controller 11 includes an interface card 110, a memory 111, a processor 112, and an interface card 113.
Interface card 110 for communicating with a host and for receiving instructions sent by the host, and electronic device controller 11 may receive write instructions from the host through interface card 110.
And an interface card 113 for communicating with the hard disk 12, and the electronic device controller 11 may transmit a write data command to the hard disk 12 through the interface card 113 for storage.
The processor 112 is a Central Processing Unit (CPU). In embodiments of the present invention, the processor 112 may be used to receive write instructions or read instructions from a host and process these instructions. The processor 112 may also send the data in the write command to the hard disk 12.
Memory 111, including volatile memory, non-volatile memory, or a combination thereof. Volatile memory is, for example, random-access memory (RAM). The non-volatile memory is, for example, a floppy disk, a hard disk 12, a Solid State Disk (SSD), an optical disk, or various machine-readable media capable of storing program codes. The memory 111 has a power-saving function, which means that data stored in the memory 111 cannot be lost when the system is powered off and powered on again. The memory 111 may have one or more memories for temporarily storing data received from the host or data read from the hard disk 12, for example, when the electronic device controller 11 receives a plurality of write commands sent by the host, the data in the plurality of write commands may be temporarily stored in the memory 111.
Fig. 3 is a structural diagram of the hard disk in fig. 1 provided in the present application. Referring to fig. 3, the hard disk 12 includes a hard disk controller 121, a memory 122, a storage medium 123, and at least one register 124.
The hard disk controller 121 may be a control chip in the hard disk 12, and is configured to control the hard disk 12.
The memory 122, which may also be referred to as an internal memory, is used for temporarily storing operation data in the processor and data exchanged with other memories. The memory 122 may be volatile memory such as random-access memory (RAM). The memory 122 does not have a power conservation function, i.e., the data stored in the memory 121 is lost when the hard disk 12 is powered down and powered up again.
The storage medium 123 is typically a non-volatile memory, for example, a non-volatile memory such as a floppy disk, a hard disk, an SSD, an optical disk, and various machine-readable media that can store program codes. The storage medium 123 has a power-saving function, that is, when the hard disk 12 is powered down and powered up again, the data stored in the storage medium 123 is not lost.
The register 124 is used for temporarily storing information such as instructions, data and addresses. For example, the register 124 may include a data register for storing an integer number, an address register for storing an address, an instruction register for storing an instruction, and the like, and during an actual application process, the number of the registers 124 and data stored in the registers may be set according to actual needs, which is not specifically limited in this embodiment of the present application.
In the present application, the firmware is not permanently stored in the storage medium of the hard disk 12, but the latest firmware is acquired in the memory of the electronic device after the hard disk 12 is powered on or reset each time, and the acquired latest firmware is directly started in the hard disk 12. Therefore, the firmware in the hard disk 12 can be ensured to be the latest firmware all the time, and further, the electronic device does not need to maintain the firmware in each hard disk 12 independently because the firmware is not stored in the hard disk 12 permanently, thereby simplifying the maintenance process of the firmware.
The technical means shown in the present application will be described in detail below with reference to specific examples. It should be noted that the following embodiments may be combined with each other, and the description of the same or similar contents in different embodiments is not repeated.
Fig. 4 is a first flowchart illustrating a hard disk firmware boot method provided in the present application. Referring to fig. 4, the method may include:
s401, after the electronic device controller 11 is started, the electronic device controller 11 acquires the latest firmware.
At least one hard disk 12 may be inserted in the electronic device shown in the present application. For example, the electronic device may be a computer, a server, or the like, and of course, the electronic device may also be of other types, which is not specifically limited in this application.
Alternatively, the electronic device controller 11 may obtain the latest firmware in other devices through a network, or the electronic device controller 11 may also obtain the latest firmware in a local preset memory, where the latest firmware in the local preset memory may be maintained by a worker. Of course, the electronic device controller 11 may also obtain the latest firmware through other possible implementations.
S402, the electronic device controller 11 stores the firmware in the memory of the electronic device.
The memory of the electronic device is typically a non-permanent storage medium, i.e., the contents of the memory of the electronic device will be lost after the electronic device is powered off, so the electronic device controller 11 needs to store the latest firmware in the memory of the electronic device after each boot-up of the electronic device (or the electronic device controller 11).
Optionally, the electronic device controller 11 may apply for a storage space with a suitable size in the memory of the electronic device according to the size of the firmware, and store the firmware in the storage space obtained by the application.
Optionally, after the size of the firmware is usually within the preset range, the electronic device controller 11 may further use a part of the fixed storage space in the memory as the storage space for storing the firmware. In this way, when the electronic device controller 11 needs to store the firmware in the memory of the electronic device, the firmware may be directly stored in the fixed storage space.
Optionally, a firmware management module is disposed in the electronic device, the firmware management module is usually implemented by software, and in a process of managing the firmware by the electronic device controller 11, the electronic device controller 11 may load the firmware management module to a memory of the electronic device and execute a program instruction corresponding to the firmware management module, so as to implement the function shown in S401. Therefore, when the management mode of the firmware needs to be updated, only the program instruction in the firmware management module needs to be updated, so that the flexibility of managing the firmware is better.
S403, the electronic device controller 11 stores the location information of the firmware in the memory of the electronic device in the first register of the hard disk 12.
Alternatively, the first register of the hard disk 12 is typically only used to store the location information of the firmware in the memory of the electronic device.
After the electronic device controller 11 stores the firmware in the memory of the electronic device, the electronic device controller 11 acquires the location information of the firmware in the memory of the electronic device and writes the location information of the firmware in the memory of the electronic device into the first register of the hard disk 12.
Alternatively, the electronic device controller 11 may write the position information to the first register through a data bus.
In S401, when the electronic device controller 11 stores the firmware in the fixed storage space in the memory of the electronic device and the first register of the hard disk 12 is the nonvolatile memory, the electronic device controller 11 only needs to write the location information once into the first register. That is, the electronic device controller 11 only needs to write the location information of the firmware in the memory of the electronic device into the first register when the electronic device is first started, and the electronic device controller 11 does not need to write the location information of the firmware in the memory of the electronic device into the first register when the electronic device is subsequently started (after the second time and after the second time).
That is, in the second and subsequent boot processes of the electronic device, S403 is an optional step. Therefore, in the second and later starting processes of the electronic equipment, the information interaction process can be simplified, and the starting efficiency of the firmware is improved.
Optionally, the hard disk controller 121 generally has a link management function, and after the hard disk 12 is powered on, the hard disk controller 121 may determine the link state of the data bus of the electronic device by querying the fourth register of the hard disk 12, and repair the data bus when the hard disk controller 121 determines that the link state is the abnormal state until the link state of the data bus is switched to the normal state.
Optionally, the fourth register is generally only used for storing the link status of the data bus, for example, when the value in the fourth register is 1, the link status of the data bus is determined to be a normal status, and when the value in the fourth register is 0, the link status of the data bus is determined to be an abnormal status. Optionally, the fourth register is typically a read-only memory.
Alternatively, the hard disk controller 121 may repair the data bus by the following feasible implementation manners: the hard disk controller 121 modifies the value of the fifth register to reset the communication link of the data bus, and the hard disk controller 121 modifies the value of the sixth register to establish the communication link of the data bus.
Optionally, the fifth register is a readable and writable register, and when the value in the fifth register is the corresponding preset value, the data bus is reset.
Optionally, the sixth register is a readable and writable register, and when the value in the sixth register is the corresponding preset value, the communication link of the data bus is established.
Of course, the link status of the data bus may also be managed by the electronic device controller 11, which is not specifically limited in this application.
It should be noted that, before S402, the electronic device controller 11 needs to determine the location information of the firmware in the memory of the electronic device, and accordingly, S402 and S403 may be executed sequentially or simultaneously, and the execution sequence of S402 and S403 is not specifically limited in this embodiment of the application.
S404, after determining that the hard disk 12 is powered on or reset, the hard disk controller 121 obtains the location information of the firmware in the memory of the electronic device by querying the first register.
In practical applications, after the electronic device is started, the electronic device usually supplies power to the interface of the hard disk 12 corresponding to the hard disk 12 to power on the hard disk 12 inserted in the electronic device, so that the hard disk 12 inserted in the electronic device can be powered on within a short period of time after the electronic device is started.
Of course, during the operation of the electronic device and the hard disk 12, the hard disk 12 may be reset by a preset instruction.
Optionally, after determining that the hard disk 12 is powered on or reset, the hard disk controller 121 queries the first register of the hard disk 12 to obtain the location information of the firmware in the memory of the electronic device.
Optionally, the location information includes a start address of the firmware in the memory and a size of the firmware; or the position information comprises a starting address and an ending address of the firmware in the memory, wherein a continuous storage space is formed between the starting address and the ending address.
It should be noted that, after the electronic device controller 11 writes the location information into the first register, if the value of the second register of the hard disk 12 is modified to the first preset value, the first preset value is used to instruct the hard disk controller 121 to acquire the location information in the first register, and correspondingly, when the hard disk controller 121 determines that the value of the second register is the first preset value, the location information of the firmware in the memory of the electronic device is acquired. If the hard disk 12 does not include the second register, or after the electronic device controller 11 writes the architectural location information into the first register, if the value of the second register is modified, the hard disk controller 121 may obtain the location information in real time, until the location information is obtained.
S405, the hard disk controller 121 obtains the firmware in the Memory of the electronic device in a Direct Memory Access (DMA) manner according to the location information.
The hard disk controller 121 is integrated with a DMA controller, that is, the hard disk controller 121 has the idle power of the DMA controller, and accordingly, the hard disk controller 121 may determine the location of the firmware in the memory of the electronic device according to the obtained location information, and obtain the firmware in the memory of the electronic device in a DMA manner according to the location of the firmware in the memory of the electronic device.
S406, the hard disk controller 121 stores the firmware in the memory of the hard disk 12.
After the hard disk controller 121 obtains the firmware, the firmware is stored in the memory of the hard disk 12. Optionally, after the hard disk controller 121 stores the firmware in the memory of the hard disk 12, the program instructions corresponding to the firmware may be executed to start the firmware in the hard disk 12.
According to the firmware starting method provided by the application, after the electronic device controller 11 is started each time, the electronic device controller 11 stores the latest firmware in the memory of the electronic device, and writes the position information of the firmware in the memory of the electronic device into the first register of the hard disk 12. After the hard disk 12 is powered on or reset, the hard disk controller 121 obtains the location information of the firmware in the memory of the electronic device from the first register, obtains the firmware in the memory of the electronic device according to the location information, and stores the firmware in the memory of the hard disk 12. In the present application, the firmware is not permanently stored in the storage medium of the hard disk 12, but the latest firmware is acquired in the memory of the electronic device after the hard disk 12 is powered on or reset each time, and the acquired latest firmware is directly started in the hard disk 12. Therefore, the firmware in the hard disk 12 can be ensured to be the latest firmware all the time, and further, the electronic device does not need to maintain the firmware in each hard disk 12 independently because the firmware is not stored in the hard disk 12 permanently, thereby simplifying the maintenance process of the firmware.
On the basis of any of the above embodiments, the embodiment shown in fig. 4 will be described in further detail below with reference to the embodiment shown in fig. 5.
Fig. 5 is a flowchart illustrating a second method for starting a hard disk firmware according to the present application. Referring to fig. 5, the method may include:
s501, after the electronic device controller 11 is started, the electronic device controller 11 obtains the latest firmware, and determines location information of a storage space for storing the firmware in a memory of the electronic device.
It should be noted that the execution process of S501 may refer to S401, and is not described herein again.
S502, the electronic device controller 11 stores the location information of the firmware in the memory of the electronic device in the first register of the hard disk 12.
It should be noted that the execution process of S502 may refer to S403, and is not described herein again.
S503, the electronic device controller 11 sets the value in the second register of the hard disk 12 to the first preset value.
The first preset value in the second register is used to instruct the hard disk controller 121 to obtain the location information in the first register.
Optionally, the first preset value in the second register is also used to indicate that the electronic device controller 11 has stored the location information in the first register.
After the electronic device determines that the location information is obtained, S502-S503, and S504 (storing the firmware into the memory of the electronic device) may be performed simultaneously, because the firmware is large and the process of writing data into the register is fast, when the electronic device sets the value in the second register to the first threshold value, the electronic device may not complete storing the firmware into the memory of the electronic device.
Optionally, after the hard disk 12 is powered down, the value in the second register is set to null, or a default value.
In the above process, when the first register is a nonvolatile memory, the hard disk controller 121 may be prevented from obtaining wrong location information by setting the value of the second register.
It should be further noted that S503 is an optional step, that is, the second register may not be set in the hard disk 12, and correspondingly, the first preset value may not be written in the second register after the electronic device stores the position information in the register of the hard disk 12.
And S504, the electronic equipment controller 11 stores the firmware into the memory of the electronic equipment according to the position information.
It should be noted that the execution process of S504 may refer to S401, and is not described herein again.
It should be noted that S502-S503 and S504 may be executed sequentially or simultaneously, and the execution order of S502-S503 and S504 is not specifically limited in the present application.
S505, the electronic device controller 11 sets the value in the third register of the hard disk 12 to the second preset value.
The second preset value in the third register is used to instruct the hard disk controller 121 to obtain the firmware in the memory of the electronic device in a DMA manner.
Optionally, the second preset value in the third register may also be used to indicate that the electronic device controller 11 has stored the firmware into the memory of the electronic device according to the location information.
It should be noted that S505 is an optional step, that is, the hard disk 12 may not be provided with a third register, and correspondingly, after the electronic device stores the firmware into the memory of the electronic device, the second preset value may not be written in the third register.
S506, after determining that the hard disk 12 is powered on or reset, when the value in the second register of the hard disk 12 is the first preset value, the hard disk controller 121 obtains the location information by querying the first register of the hard disk 12.
Optionally, in S506, after determining that the hard disk 12 is powered on or reset, the hard disk controller 121 may also query the first register in real time or periodically until the location information is obtained.
In the above process, when the first register is a nonvolatile memory, after the hard disk 12 is powered on or reset, the value in the first register is the value written by the hard disk 12 in the last operation process, and the location information of the firmware in the memory of the electronic device may be different in the different operation processes of the hard disk 12. When the hard disk controller 121 queries that the value in the second register is the first preset value, it may be determined that the location information in the first register is written in the hard disk 12 in the current operation process, that is, the location information in the first register is correct, so that it may be avoided that the hard disk controller 121 obtains the wrong location information.
S507, when the value in the third register of the hard disk 12 is the second preset value, the hard disk controller 121 obtains the firmware in the memory of the electronic device in a DMA manner according to the location information.
In an actual application process, after the hard disk controller 121 obtains the location information, the electronic device controller 11 may not complete storing the firmware in the memory of the electronic device, and at this time, the hard disk controller 121 may not successfully obtain the firmware in the memory of the electronic device. When the hard disk controller 121 queries that the value in the third register is the second preset value, it indicates that the firmware is stored in the memory, and at this time, the hard disk controller 121 may successfully obtain the firmware from the memory of the electronic device. In this way, the hard disk controller 121 may be prevented from performing an invalid acquisition operation in the memory of the electronic device, and further resource waste is avoided.
Optionally, in S507, after the hard disk controller 121 obtains the location information, the electronic device controller 11 may not complete storing the firmware into the memory of the electronic device, at this time, the hard disk controller 121 may obtain the firmware in the memory of the electronic device in a DMA manner according to the location information in real time or periodically until the hard disk controller 121 obtains the firmware.
For example, after the hard disk controller 121 obtains the location information, the hard disk controller 121 may obtain the firmware in the memory of the electronic device in a DMA manner according to the location information, at this time, if the firmware is not stored in the memory of the electronic device, the hard disk controller 121 cannot obtain the firmware in the memory, after a preset time period, the hard disk controller 121 obtains the firmware in the memory of the electronic device in the DMA manner according to the location information again, and the process is repeated until the hard disk controller 121 obtains the firmware in the memory of the electronic device. For example, the preset time duration may be 1 millisecond, 2 milliseconds, and the like, and in an actual application process, the preset time duration may be set according to actual needs, which is not specifically limited in this application.
S508, the hard disk controller 121 stores the firmware in the memory of the hard disk 12.
In the embodiment shown in fig. 5, after the electronic device controller 11 writes the location information into the first register, the value of the second register is set to the first preset value, and accordingly, the location information is obtained from the first register after the hard disk controller 121 inquires that the value of the second register is set to the first preset value, so that obtaining the wrong location information from the first register can be avoided. After the electronic device controller 11 stores the firmware in the memory of the electronic device, the value of the third register is set to the second preset value, and accordingly, the firmware is acquired from the memory of the electronic device only after the hard disk controller 121 queries that the value of the third register is set to the second preset value, so that the hard disk controller 121 is prevented from performing invalid acquisition operation in the memory of the electronic device, and further, resource waste is avoided.
On the basis of any of the above embodiments, optionally, the hard disk controller 121 may be divided into a plurality of modules, and different modules may perform different operations, and the modules included in the hard disk controller 121 are described in detail below with reference to fig. 6.
Fig. 6 is a schematic structural diagram of a hard disk controller according to the present application. Referring to fig. 3, the hard disk controller 121 may include a direct DMA module, a Design for X (DFX) module, a firmware boot module, and a link management module, where the DMA module is configured to directly obtain firmware in a memory of the electronic device, the DFX module is configured to perform data consistency check on the firmware, the firmware boot module is configured to start the firmware in the hard disk 12, and the link management module is configured to manage and maintain a data bus.
Next, taking the structure of the hard disk controller 121 as the structure shown in fig. 6 as an example, the embodiment shown in fig. 4 will be described in further detail with reference to the embodiment shown in fig. 7 in addition to the embodiment shown in fig. 4.
Fig. 7 is a third schematic flowchart of a hard disk firmware boot method provided in the present application. Referring to fig. 7, the method may include:
s701, after the electronic device controller 11 is started, the electronic device controller 11 acquires the latest firmware.
S702, the electronic device controller 11 stores the firmware in the memory of the electronic device.
S703, the electronic device controller 11 stores the location information of the firmware in the memory of the electronic device in the first register of the hard disk 12.
It should be noted that the execution processes of S701 to S703 may refer to S401 to S402, which are not described herein again.
S704, after determining that the hard disk 12 is powered on or reset, the DMA module acquires the position information of the firmware in the memory of the electronic device by inquiring the first register.
S705, the DMA module acquires the firmware in the memory of the electronic equipment according to the position information.
S706, the DMA module sends the firmware to the DFX module.
And S707, the DFX module checks the data consistency of the firmware.
Optionally, the DFX module may perform a Cyclic Redundancy Check (CRC) on the firmware to ensure the integrity and correctness of data in the firmware.
S708, after the DFX module passes the firmware verification, the firmware is sent to the firmware boot module.
S709, the firmware boot module stores the firmware in the memory of the hard disk 12.
And S710, the firmware boot module runs the program code corresponding to the firmware to start the firmware.
In the embodiment shown in fig. 7, the firmware is not permanently stored in the storage medium of the hard disk 12, but after the hard disk 12 is powered on or reset each time, the DMA module obtains the latest firmware from the memory of the electronic device, and after the DFX module verifies the firmware, the firmware boot module is responsible for starting the firmware in the hard disk 12, so that the firmware in the hard disk 12 is always the latest firmware, and further, since the firmware is not permanently stored in the hard disk 12, the electronic device does not need to separately maintain the firmware in each hard disk 12, thereby simplifying the firmware maintenance process.
Fig. 8A is a schematic structural diagram of a hard disk firmware boot apparatus provided in the present application. Referring to fig. 8A, the apparatus includes a first obtaining module 801, a second obtaining module 802, and a storing module 803, wherein,
the first obtaining module 801 is configured to, after determining that the hard disk 12 is powered on or reset, obtain location information of a firmware in a memory of the electronic device, where the firmware is used to manage and control the hard disk 12;
the second obtaining module 802 is configured to obtain the firmware in the memory of the electronic device in a direct memory access DMA manner according to the location information;
the storage module 803 is configured to store the firmware in the memory of the hard disk 12.
It should be noted that the hard disk firmware starting apparatus provided in the present application may execute the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects thereof are similar and will not be described herein again.
In a possible implementation manner, the first obtaining module 801 is specifically configured to:
the location information is obtained by querying a first register of the hard disk 12.
In another possible implementation manner, the first obtaining module 801 is specifically configured to:
when the value in the second register of the hard disk 12 is a first preset value, the position information is acquired by inquiring the first register of the hard disk 12, and the first preset value is used for indicating that the position information is acquired in the first register.
In another possible implementation manner, the second obtaining module 802 is specifically configured to:
when the value in the third register of the hard disk 12 is a second preset value, the firmware is obtained in the memory of the electronic device in a DMA manner according to the position information, and the second preset value is used for indicating that the firmware is obtained in the memory of the electronic device in the DMA manner.
In another possible implementation, the location information includes a start address of the firmware in a memory of the electronic device and a size of the firmware; alternatively, the first and second electrodes may be,
the location information includes a start address and an end address of the firmware in a memory of the electronic device.
Fig. 8B is a schematic structural diagram of a hard disk firmware boot apparatus provided in the present application. In addition to the embodiment shown in fig. 8A, referring to fig. 8B, the apparatus further includes a link management module 804, wherein,
the link management module 804 is configured to determine a link state of a data bus of the electronic device by querying a fourth register of the hard disk 12 before the second obtaining module 802 obtains the firmware in the memory of the electronic device according to the location information;
the link management module 804 is further configured to repair the data bus when the link management module 804 determines that the link state is the abnormal state until the link state of the data bus is switched to the normal state.
In another possible implementation manner, the link management module 804 is specifically configured to:
modifying a value of a fifth register to indicate a reset of a communication link of the data bus;
modifying a value of a sixth register to indicate that a communication link of the data bus is established.
It should be noted that the hard disk firmware starting apparatus provided in the present application may execute the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects thereof are similar and will not be described herein again.
In the embodiments shown in fig. 8A to 8B, optionally, the first obtaining module 801 may be implemented by a hard disk controller 121 in the hard disk 12, and the specific function implementation may refer to S404 in the embodiment shown in fig. 4, or S506 in the embodiment shown in fig. 5, or S704 in the embodiment shown in fig. 7, which is not described herein again.
Optionally, the second obtaining module 802 may be implemented by a hard disk controller 121 in the hard disk 12, and specific functional implementation may refer to S405 in the embodiment shown in fig. 4, or S507 in the embodiment shown in fig. 5, or S705 in the embodiment shown in fig. 7, which is not described herein again.
Optionally, the storage module 803 may be implemented by a hard disk controller 121 in the hard disk 12, and the specific function implementation may refer to S406 in the embodiment shown in fig. 4, or S508 in the embodiment shown in fig. 5, or S709 in the embodiment shown in fig. 7, which is not described herein again.
Optionally, the link management module 804 may be implemented by a hard disk controller 121 in the hard disk 12, for example, the link management module 804 may be the link management module shown in the embodiment in fig. 6, and specific function implementation may refer to S403 in the embodiment shown in fig. 4, which is not described herein again
Fig. 9 is a schematic structural diagram of another hard disk firmware boot apparatus provided in the present application. Referring to fig. 9, the apparatus may include an obtaining module 901 and a storing module 902, wherein,
the obtaining module 901 is configured to obtain the latest firmware after starting;
the storage module 902 is configured to store the firmware in a memory of the electronic device;
the storage module 902 is further configured to store the location information of the firmware in the memory of the electronic device to a first register of the hard disk 12.
The hard disk firmware starting device provided by the application can execute the technical scheme shown in the method embodiment, the implementation principle and the beneficial effect are similar, and the description is omitted here.
In a possible implementation manner, the storage module 902 is further configured to, after the storage module 902 stores the location information of the firmware in the memory of the electronic device to a first register of a hard disk 12, set a value in a second register of the hard disk 12 to a first preset value, where the first preset value is used to indicate that the location information is acquired in the first register.
In another possible implementation manner, the storage module 902 is further configured to, after the storage module stores 902 the firmware in the memory of the electronic device, set a value in a third register of the hard disk 12 to a second preset value, where the second preset value is used to instruct to obtain the firmware in the memory of the electronic device in a direct memory access DMA manner.
The hard disk firmware starting device provided by the application can execute the technical scheme shown in the method embodiment, the implementation principle and the beneficial effect are similar, and the description is omitted here.
In the embodiment shown in fig. 9, optionally, the obtaining module 901 may be implemented by the electronic device controller 11, and specific functional implementation may refer to S401 in the embodiment shown in fig. 4, or S501 in the embodiment shown in fig. 5, or S701 in the embodiment shown in fig. 7, which is not described herein again.
Optionally, the storage module 902 may be implemented by the electronic device controller 11, and specific functional implementation may refer to S402-S403 in the embodiment shown in fig. 4, S502-S505 in the embodiment shown in fig. 5, or S702-S703 in the embodiment shown in fig. 7, which is not described herein again.
Fig. 10 is a schematic structural diagram of a hard disk provided in the present application. Referring to fig. 10, the electronic device includes a processor 1001, a memory 1002, and a communication bus 1003, where the communication bus 1003 is used to implement connection between each component, the memory 1002 is used to store program instructions, and the processor 1001 is used to read the program instructions in the memory 1002, and execute the following steps according to the program instructions in the memory 1002:
after determining that the hard disk 12 is powered on or reset, acquiring location information of firmware in a memory of the electronic device, wherein the firmware is used for managing and controlling the hard disk 12;
acquiring the firmware in a memory of the electronic equipment in a Direct Memory Access (DMA) mode according to the position information;
the firmware is stored in the memory of the hard disk 12.
The hard disk 12 provided by the present application may execute the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects thereof are similar, and are not described herein again.
In one possible implementation, the processor 1001 is specifically configured to:
the location information is obtained by querying a first register of the hard disk 12.
In another possible implementation, the processor 1001 is specifically configured to:
when the value in the second register of the hard disk 12 is a first preset value, the position information is acquired by inquiring the first register of the hard disk 12, and the first preset value is used for indicating that the position information is acquired in the first register.
In another possible implementation, the processor 1001 is specifically configured to:
when the value in the third register of the hard disk 12 is a second preset value, the firmware is obtained in the memory of the electronic device in a Direct Memory Access (DMA) manner according to the position information, and the second preset value is used for indicating that the firmware is obtained in the memory of the electronic device in a DMA manner.
In another possible implementation, the location information includes a start address of the firmware in a memory of the electronic device and a size of the firmware; or the location information includes a start address and an end address of the firmware in a memory of the electronic device.
In another possible implementation manner, the processor 1001 is further configured to determine a link state of a data bus of the electronic device by querying a fourth register of the hard disk 12 before the processor 1001 acquires the firmware from the memory of the electronic device according to the location information;
the processor 1001 is further configured to repair the data bus when the processor 1001 determines that the link state is the abnormal state until the link state of the data bus is switched to the normal state.
In another possible implementation, the processor 1001 is specifically configured to:
modifying a value of a fifth register to indicate a reset of a communication link of the data bus;
modifying a value of a sixth register to indicate that a communication link of the data bus is established.
The hard disk 12 provided by the present application may execute the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects thereof are similar, and are not described herein again.
Fig. 11 is a schematic structural diagram of an electronic device provided in the present application. Referring to fig. 11, the electronic device includes a processor 1101, a memory 1102 and a communication bus 1103, where the communication bus 1103 is used to implement connection between components, the memory 1102 is used to store program instructions, and the processor 1101 is used to read the program instructions in the memory 1102 and execute the following steps according to the program instructions in the memory 1102:
obtaining the latest firmware after starting;
storing the firmware in a memory of the electronic device;
and storing the position information of the firmware in the memory of the electronic equipment to a first register of the hard disk 12.
The electronic device provided by the application can execute the technical scheme shown in the method embodiment, and the implementation principle and the beneficial effect are similar, which are not described herein again.
In one possible implementation, the processor 1101 is further configured to:
after the processor 1101 stores the location information of the firmware in the memory of the electronic device to the first register of the hard disk 12, setting a value in the second register of the hard disk 12 to a first preset value, where the first preset value is used to instruct the hard disk controller 121 to obtain the location information in the first register.
In another possible implementation, the processor 1101 is further configured to:
after the processor 1101 stores the firmware in the memory of the electronic device, a value in a third register of the hard disk 12 is set to a second preset value, where the second preset value is used to instruct the hard disk controller 121 to obtain the firmware in the memory of the electronic device in a direct memory access DMA manner.
The electronic device provided by the application can execute the technical scheme shown in the method embodiment, and the implementation principle and the beneficial effect are similar, which are not described herein again.
The present application further provides a computer-readable storage medium, in which computer-executable instructions are stored, and when at least one processor of the hard disk 12 executes the computer-executable instructions, the hard disk 12 executes the method shown in the above method embodiment.
The present application further provides a computer-readable storage medium, in which computer-executable instructions are stored, and when at least one processor of an electronic device executes the computer-executable instructions, the electronic device executes the method shown in the above method embodiment.
The present application also provides a computer program product comprising computer executable instructions stored in a computer readable storage medium, which can be read by at least one processor of the hard disk 12, and the execution of the computer executable instructions by the at least one processor causes the hard disk 12 to execute the method shown in the above method embodiments. Alternatively, the processor in the hard disk 12 may be a hard disk controller 121.
The present application further provides a computer program product comprising computer executable instructions stored in a computer readable storage medium, which can be read by at least one processor of an electronic device, and the execution of the computer executable instructions by the at least one processor causes the electronic device to execute the method shown in the above method embodiments.
The present application further provides a chip system, where the chip system includes a processor, and is used to support the hard disk 12 to implement the method shown in the foregoing method embodiment.
The application further provides a chip system, where the chip system includes a processor, and is used to support an electronic device to implement the method shown in the foregoing method embodiment.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk), among others.

Claims (22)

1. A method for starting hard disk firmware is applied to a hard disk, wherein the hard disk comprises a hard disk controller, and the method comprises the following steps:
after determining that the hard disk is powered on or reset, the hard disk controller acquires position information of firmware in a memory of the electronic equipment, wherein the firmware is used for managing and controlling the hard disk;
the hard disk controller acquires the firmware in the memory of the electronic equipment in a Direct Memory Access (DMA) mode according to the position information;
and the hard disk controller stores the firmware in the internal memory of the hard disk.
2. The method of claim 1, wherein obtaining the location information of the firmware in the memory of the electronic device comprises:
and the hard disk controller acquires the position information by inquiring a first register of the hard disk.
3. The method of claim 2, wherein the hard disk controller obtains the location information by querying a first register of the hard disk, comprising:
and when the value in the second register of the hard disk is inquired to be a first preset value, the hard disk controller acquires the position information by inquiring the first register of the hard disk, wherein the first preset value is used for indicating the hard disk controller to acquire the position information in the first register.
4. The method according to any one of claims 1-3, wherein the hard disk controller obtains the firmware in the memory of the electronic device in a Direct Memory Access (DMA) manner according to the location information, comprising:
and when the value in the third register of the hard disk is inquired to be a second preset value, the hard disk controller acquires the firmware in the memory of the electronic equipment in a Direct Memory Access (DMA) mode according to the position information, wherein the second preset value is used for indicating the hard disk controller to acquire the firmware in the memory of the electronic equipment in a DMA mode.
5. The method according to any one of claims 1 to 3,
the position information comprises a starting address of the firmware in a memory of the electronic equipment and the size of the firmware; alternatively, the first and second electrodes may be,
the location information includes a start address and an end address of the firmware in a memory of the electronic device.
6. A method for starting hard disk firmware is characterized by comprising the following steps:
after the electronic equipment controller is started, the electronic equipment controller acquires the latest firmware;
the electronic equipment controller stores the firmware in a memory of the electronic equipment;
and the electronic equipment controller stores the position information of the firmware in the memory of the electronic equipment to a first register of a hard disk.
7. The method of claim 6, further comprising, after the electronic device controller stores the location information of the firmware in the memory of the electronic device to a first register of a hard disk:
and the electronic equipment controller sets a value in a second register of the hard disk to be a first preset value, wherein the first preset value is used for indicating the hard disk controller to acquire the position information in the first register.
8. The method of claim 6 or 7, further comprising, after the electronic device controller stores the firmware in the memory of the electronic device:
and the electronic equipment controller sets a value in a third register of the hard disk to be a second preset value, wherein the second preset value is used for indicating the hard disk controller to acquire the firmware in the memory of the electronic equipment in a Direct Memory Access (DMA) mode.
9. The hard disk firmware starting device is characterized by comprising a first acquisition module, a second acquisition module and a storage module, wherein,
the first acquisition module is used for acquiring the position information of firmware in the memory of the electronic equipment after the hard disk is determined to be powered on or reset, wherein the firmware is used for managing and controlling the hard disk;
the second obtaining module is used for obtaining the firmware in the memory of the electronic equipment in a Direct Memory Access (DMA) mode according to the position information;
the storage module is used for storing the firmware in the memory of the hard disk.
10. The apparatus of claim 9, wherein the first obtaining module is specifically configured to:
and acquiring the position information by inquiring a first register of the hard disk.
11. The apparatus of claim 10, wherein the first obtaining module is specifically configured to:
and when the value in the second register of the hard disk is inquired to be a first preset value, acquiring the position information by inquiring the first register of the hard disk, wherein the first preset value is used for indicating that the position information is acquired in the first register.
12. The apparatus according to any one of claims 9 to 11, wherein the second obtaining module is specifically configured to:
and when the value in the third register of the hard disk is inquired to be a second preset value, acquiring the firmware in the memory of the electronic equipment in a DMA mode according to the position information, wherein the second preset value is used for indicating that the firmware is acquired in the memory of the electronic equipment in the DMA mode.
13. The apparatus according to any one of claims 9 to 11,
the position information comprises a starting address of the firmware in a memory of the electronic equipment and the size of the firmware; alternatively, the first and second electrodes may be,
the location information includes a start address and an end address of the firmware in a memory of the electronic device.
14. The hard disk firmware starting device is characterized by comprising an acquisition module and a storage module, wherein,
the acquisition module is used for acquiring the latest firmware after starting;
the storage module is used for storing the firmware in a memory of the electronic equipment;
the storage module is further configured to store the location information of the firmware in the memory of the electronic device to a first register of a hard disk.
15. The apparatus of claim 14, wherein,
the storage module is further configured to, after the storage module stores the location information of the firmware in the memory of the electronic device to a first register of a hard disk, set a value in a second register of the hard disk to a first preset value, where the first preset value is used to indicate that the location information is acquired in the first register.
16. The apparatus of claim 14 or 15,
the storage module is further configured to, after the storage module stores the firmware in the memory of the electronic device, set a value in a third register of the hard disk to a second preset value, where the second preset value is used to instruct to acquire the firmware in the memory of the electronic device in a direct memory access DMA manner.
17. A hard disk comprising a processor, a memory and a communication bus, wherein the communication bus is used for realizing the connection between each component, the memory is used for storing program instructions, and the processor is used for reading the program instructions in the memory and executing the method according to the program instructions in the memory, and any one of claims 1 to 5 is also included in the hard disk.
18. An electronic device, comprising a processor, a memory and a communication bus, wherein the communication bus is used for realizing the connection between the components, the memory is used for storing program instructions, and the processor is used for reading the program instructions in the memory and executing the method according to the program instructions in the memory.
19. A computer-readable storage medium having computer-executable instructions stored thereon, wherein when the computer-executable instructions are executed by at least one processor of a hard disk, the hard disk performs the method of any one of claims 1-5.
20. A computer-readable storage medium having computer-executable instructions stored therein, wherein when the computer-executable instructions are executed by at least one processor of an electronic device, the electronic device performs the method of any one of claims 6-8.
21. A computer program product comprising computer executable instructions stored in a computer readable storage medium from which at least one processor of a hard disk can read the computer executable instructions, the execution of the computer executable instructions by the at least one processor causing the hard disk to perform the method of any one of claims 1 to 5.
22. A computer program product comprising computer executable instructions stored in a computer readable storage medium, the computer executable instructions being readable from the computer readable storage medium by at least one processor of an electronic device, execution of the computer executable instructions by the at least one processor causing the electronic device to perform the method of any one of claims 6 to 8.
CN201711003879.5A 2017-10-24 2017-10-24 Method, device and equipment for starting hard disk firmware Active CN109697077B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711003879.5A CN109697077B (en) 2017-10-24 2017-10-24 Method, device and equipment for starting hard disk firmware

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711003879.5A CN109697077B (en) 2017-10-24 2017-10-24 Method, device and equipment for starting hard disk firmware

Publications (2)

Publication Number Publication Date
CN109697077A CN109697077A (en) 2019-04-30
CN109697077B true CN109697077B (en) 2021-09-17

Family

ID=66228016

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711003879.5A Active CN109697077B (en) 2017-10-24 2017-10-24 Method, device and equipment for starting hard disk firmware

Country Status (1)

Country Link
CN (1) CN109697077B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108446009A (en) * 2018-03-10 2018-08-24 北京联想核芯科技有限公司 Power down control method, device, equipment and medium
CN110780931A (en) * 2019-09-25 2020-02-11 芯创智(北京)微电子有限公司 Self-adaptive firmware starting method and system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5603002A (en) * 1992-08-07 1997-02-11 Kabushiki Kaisha Toshiba Hard disk drive having buffer memory employing directory based cache controller with data replacement scheme
CN101344812A (en) * 2008-08-19 2009-01-14 华南理工大学 Magnetic disk dynamic power supply management method based on embedded system
CN101373459A (en) * 2008-10-27 2009-02-25 成都市华为赛门铁克科技有限公司 Method, system and apparatus for manufacturing solid-state hard disk
CN102693198A (en) * 2012-05-12 2012-09-26 北京忆恒创源科技有限公司 DMA (direct memory access) transmission method and system
CN103530251A (en) * 2012-07-02 2014-01-22 株式会社东芝 Bridge device, storage device and recording medium
CN104375923A (en) * 2014-11-24 2015-02-25 英业达科技有限公司 Hard disk drive (HDD) running state detection system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5603002A (en) * 1992-08-07 1997-02-11 Kabushiki Kaisha Toshiba Hard disk drive having buffer memory employing directory based cache controller with data replacement scheme
CN101344812A (en) * 2008-08-19 2009-01-14 华南理工大学 Magnetic disk dynamic power supply management method based on embedded system
CN101373459A (en) * 2008-10-27 2009-02-25 成都市华为赛门铁克科技有限公司 Method, system and apparatus for manufacturing solid-state hard disk
CN102693198A (en) * 2012-05-12 2012-09-26 北京忆恒创源科技有限公司 DMA (direct memory access) transmission method and system
CN103530251A (en) * 2012-07-02 2014-01-22 株式会社东芝 Bridge device, storage device and recording medium
CN104375923A (en) * 2014-11-24 2015-02-25 英业达科技有限公司 Hard disk drive (HDD) running state detection system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
非易失性存储发展现状及展望;吴丽芳;《电脑知识与技术(学术交流)》;20161231;第12卷;第229-231页 *

Also Published As

Publication number Publication date
CN109697077A (en) 2019-04-30

Similar Documents

Publication Publication Date Title
US11726770B2 (en) Method, device, and apparatus for updating application program, and storage medium
EP2375323A1 (en) Firmware image update and management
CN105718281B (en) A kind of touch screen firmware upgrade method and device
EP3200077B1 (en) Vehicle control device, reprogramming system
CN103365696A (en) BIOS (Basic Input Output System) image file obtaining method and device
CN107908417B (en) Firmware upgrading method and electronic equipment
KR20110094047A (en) Electronic device and electronic device system
CN111813428A (en) Method and device for upgrading terminal firmware, electronic equipment and storage medium
WO2021136200A1 (en) Bootloader loading method, storage medium, and embedded terminal
TWI778811B (en) Method for upgrade, computer system and remote upgrade equipment
TWI707274B (en) A computer-implemented method, a computer system, and a computer-readable storage medium for updating the rom code of a system
WO2016033941A1 (en) Boot on-line upgrading apparatus and method
CN109697077B (en) Method, device and equipment for starting hard disk firmware
CN105103142A (en) Sharing firmware among agents in a computing node
CN110597533A (en) FPGA board card program updating system and method
CN111026417A (en) Embedded equipment upgrading method and embedded equipment
JP2019120974A (en) Computer system, baseboard management controller, OS installation method, and program
CN110750285A (en) Firmware upgrading method and device, computer equipment and storage medium
CN110134423B (en) Firmware updating method and device and computer readable storage medium
CN112860595B (en) PCI (peripheral component interconnect express) equipment or PCIE (peripheral component interconnect express) equipment, data access method and related assembly
CN112667444A (en) System upgrading method, storage medium and terminal equipment
CN106445571B (en) Mainboard and starting method
JP2016157245A (en) Information processing apparatus, system setting method, and computer program
CN106548311B (en) Inventory management setting system
CN112470121A (en) Restoring images via data block download

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
GR01 Patent grant
GR01 Patent grant