CN115729634A - BIOS starting method and device and electronic equipment - Google Patents

BIOS starting method and device and electronic equipment Download PDF

Info

Publication number
CN115729634A
CN115729634A CN202211572573.2A CN202211572573A CN115729634A CN 115729634 A CN115729634 A CN 115729634A CN 202211572573 A CN202211572573 A CN 202211572573A CN 115729634 A CN115729634 A CN 115729634A
Authority
CN
China
Prior art keywords
bios
cpu
memory
bus
starting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211572573.2A
Other languages
Chinese (zh)
Inventor
段志伟
周永发
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Longxin Zhongke Xi'an Technology Co ltd
Original Assignee
Longxin Zhongke Xi'an Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Longxin Zhongke Xi'an Technology Co ltd filed Critical Longxin Zhongke Xi'an Technology Co ltd
Priority to CN202211572573.2A priority Critical patent/CN115729634A/en
Publication of CN115729634A publication Critical patent/CN115729634A/en
Pending legal-status Critical Current

Links

Images

Abstract

The embodiment of the invention provides a starting method, a starting device and electronic equipment of a basic input/output system (BIOS). In the method, in response to a system starting instruction, an execution area of a BIOS moving code file is determined according to the type of a storage structure of a Central Processing Unit (CPU); the memory structure type is used for representing whether the CPU supports cache access to the bus space of the bus. And executing the BIOS moving code file in the execution area to move the BIOS starting file stored in the memory to the memory of the CPU through the bus. And starting the BIOS of the electronic equipment in the memory of the CPU based on the BIOS starting file. In the embodiment of the invention, the BIOS starting file in the storage is moved to the memory of the CPU based on the bus between the CPU and the storage and the BIOS moving code file, and the BIOS of the electronic equipment is started in the memory of the CPU. Therefore, the method for starting the BIOS based on the bus is realized, so that the BIOS is not limited to be started only at the stored position, and the limitation of the starting mode can be further reduced to a certain extent.

Description

Starting method and device of Basic Input Output System (BIOS) and electronic equipment
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for starting a BIOS, and an electronic device.
Background
At present, electronic devices are more and more widely applied, a Basic Input Output System (BIOS) is often set in the electronic devices, and the BIOS sets various parameters of System hardware to boot an operating System. Therefore, when the electronic device is started, the BIOS of the electronic device needs to be started first.
In the prior art, the BIOS can only be started in the memory. Thus, the limitation of the starting manner is large.
Disclosure of Invention
In view of the above problems, embodiments of the present invention are proposed to provide a method for booting a BIOS to reduce the limitation of a booting manner, which overcomes or at least partially solves the above problems.
Correspondingly, the embodiment of the invention also provides a starting device of the BIOS, electronic equipment and a storage medium, which are used for ensuring the realization and application of the method.
In order to solve the above problems, the embodiment of the present invention discloses a method for starting a BIOS, which is applied to an electronic device, where the electronic device includes a central processing unit CPU and a memory for storing BIOS start-up files, and the CPU is connected to the memory through a bus; the method comprises the following steps:
responding to a system starting instruction, and determining an execution area of a BIOS (basic input output System) moving code file according to the storage structure type of the CPU; the storage structure type is used for representing whether the CPU supports cache access to a bus space of the bus;
executing the BIOS moving code file in the execution area so as to move the BIOS starting file stored in the memory to a memory of the CPU through the bus;
and starting the BIOS of the electronic equipment in the memory of the CPU based on the BIOS starting file.
The embodiment of the invention also discloses a BIOS starting device, which is applied to electronic equipment, wherein the electronic equipment comprises a Central Processing Unit (CPU) and a memory for storing the BIOS starting file, and the CPU is connected with the memory through a bus; the device comprises:
the first determining module is used for responding to a system starting instruction and determining an execution area of the BIOS for moving the code file according to the storage structure type of the CPU; the storage structure type is used for representing whether the CPU supports cache access to the bus space of the bus or not;
the execution module is used for executing the BIOS moving code file in the execution area so as to move the BIOS starting file stored in the memory to the memory of the CPU through the bus;
and the starting module is used for starting the BIOS of the electronic equipment in the memory of the CPU based on the BIOS starting file.
The embodiment of the invention also discloses an electronic device comprising a processor;
BIOS starts the file memory; and
a program memory storing a program that, when executed by the processor, causes the processor to: responding to a system starting instruction, and determining an execution area of a BIOS moving code file according to the storage structure type of the processor; the storage structure type is used for representing whether the processor supports cache access to a bus space of the bus;
executing the BIOS moving code file in the execution area so as to move the BIOS starting file stored in the BIOS starting file storage to a memory of the processor through the bus;
and starting the BIOS of the electronic equipment in the memory of the processor based on the BIOS starting file.
The embodiment of the invention also discloses a readable storage medium, and when the instructions in the storage medium are executed by a processor of the electronic equipment, the electronic equipment can execute one or more methods in the embodiment of the invention.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, in response to a system starting instruction, an execution area of a BIOS (basic input output System) moving code file is determined according to the type of a storage structure of a CPU (Central processing Unit); the storage structure type is used for representing whether the CPU supports cache access to the bus space of the bus. And executing the BIOS moving code file in the execution area to move the BIOS starting file stored in the memory to the memory of the CPU through the bus. And starting the BIOS of the electronic equipment in the memory of the CPU based on the BIOS starting file. In the embodiment of the invention, the BIOS starting file in the storage is moved to the memory of the CPU based on the bus between the CPU and the storage and the BIOS moving code file, and the BIOS of the electronic equipment is started in the memory of the CPU. Therefore, the method for starting the BIOS based on the bus is realized, so that the BIOS is not limited to be started only at the stored position, and the limitation of a starting mode can be reduced to a certain extent.
Meanwhile, the BIOS starting file is moved and copied to the memory of the CPU and is started in the memory of the CPU, so that the starting efficiency of the BIOS can be improved to a certain extent
Drawings
FIG. 1 is a flow chart of steps in a method for booting a BIOS of the present invention;
FIG. 2 is a diagram illustrating a hardware link according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a process provided by an embodiment of the present invention;
FIG. 4 is a block diagram of an embodiment of a BIOS boot device according to the present invention;
FIG. 5 is a block diagram illustrating a configuration of an electronic device for BIOS boot in accordance with an exemplary embodiment.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
One of the core concepts of the embodiments of the present invention is to move a BIOS start file in a storage to a memory of a Central Processing Unit (CPU) based on a bus between the CPU and the storage and a BIOS move code file, and start a BIOS of an electronic device in the memory of the CPU. Therefore, the method for starting the BIOS based on the bus is realized, so that the BIOS is not limited to be started only at the stored position, and the limitation of a starting mode can be reduced to a certain extent. Meanwhile, the BIOS starting file is moved and copied to the memory of the CPU and is started in the memory of the CPU, so that the starting efficiency of the BIOS can be improved to a certain extent.
Referring to fig. 1, a flow chart of steps of an embodiment of a BIOS startup method of the present invention is shown, and the method may be applied to an electronic device including a CPU and a memory for storing BIOS startup files, where the CPU and the memory are connected by a bus. The method specifically comprises the following steps:
step 101, responding to a system starting instruction, and determining an execution area of a BIOS moving code file according to the storage structure type of the CPU; the storage structure type is used for representing whether the CPU supports cache access to the bus space of the bus.
In an embodiment of the present invention, the memory may be a flash, and the bus is a Peripheral Component Interconnect (PCI) or PCIE. The CPU may refer to a main CPU in the electronic device.
The system boot instruction may be used to instruct booting the BIOS in the electronic device, and may be generated, for example, during an initial power-on phase to boot the BIOS in the electronic device first. The BIOS move code file may be preset and may include a code file for moving the BIOS boot file from the memory to the memory of the CPU. By operating the BIOS to move the code file, the BIOS starting file in the memory can be copied to the memory of the CPU. The BIOS starting file may be a preset file for starting the BIOS, and the BIOS starting file may be a program, that is, a set of code files. Specifically, the BIOS boot file may be a BIOS system file itself.
Further, the storage structure type may be used to characterize whether the CPU supports cache access to the bus space of the bus. The bus space may refer to a space allocated to a bus by the CPU, and the execution region refers to a region for executing the BIOS move code file.
Optionally, in an implementation manner, the step of determining an execution area of the BIOS moving the code file according to the storage structure type of the CPU may specifically include the following steps:
and step 1011, determining the cache as the execution area under the condition that the storage structure type represents that the CPU supports cache access to the bus space of the bus.
Step 1012, determining the memory of the CPU as the execution area when the storage structure type indicates that the CPU does not support cache access to the bus space of the bus.
In an actual application scenario, CPUs used by electronic devices may have differences, and some storage structures of CPUs may include a storage space cache, where the storage space cache may specifically refer to a cache memory inserted between a CPU register and a CPU main memory. The CPU main memory may be the memory of the aforementioned CPU. For example, some CPUs use a storage system that includes registers, a memory space cache for a block area, and a memory. However, some CPU storage structures do not include a cache for a block area, and accordingly, a cache access mode cannot be adopted. The storage structure type can be divided into two types, namely a storage space cache type and a non-storage space cache type, and correspondingly, the storage structure type comprising the storage space cache can represent that the CPU supports cache access to the bus space of the bus, and the storage structure type not comprising the storage space cache can represent that the CPU does not support cache access to the bus space of the bus.
In the embodiment of the present invention, the model of the CPU including the memory space cache in the memory structure, that is, the model of the CPU supporting the cache access to the bus space of the bus, may be collected in advance. The model of the CPU used in the current electronic device is obtained, for example, the parameter information of the CPU in the current electronic device is read, and the model of the CPU is obtained. And then, comparing the acquired model with the model of the CPU collected in advance, and if the model is hit, determining that the storage structure of the CPU comprises a storage space cache, wherein the type of the storage structure of the CPU supports cache access to a bus space of a bus. Otherwise, it may be determined that the CPU storage structure does not include a storage space cache, and the CPU storage structure type does not support cache access to the bus space of the bus.
Accordingly, in the case where the CPU supports cache access to the bus space, and the cache is determined as the execution region, the BIOS move code file may be prefetched from the designated region into the cache based on the bus space. The specified area is an area in which the BIOS move code is stored. In the embodiment of the invention, the cache is determined as the execution area under the condition that the storage structure type representation CPU supports cache access to the bus space of the bus. And under the condition that the storage structure type represents that the CPU does not support cache access to the bus space of the bus, determining the memory of the CPU as an execution area. Because the program running speed in the cache is higher, the running efficiency of the BIOS for moving the codes can be improved to a certain extent, and the starting speed of the BIOS is improved.
And 102, executing the BIOS moving code file in the execution area so as to move the BIOS starting file stored in the storage to the memory of the CPU through the bus.
In the embodiment of the invention, the BIOS can be executed by jumping to the execution area. Accordingly, by executing the BIOS move code file, the BIOS boot file stored in the memory can be moved to the memory of the CPU. Because the memory is connected with the CPU based on the PCI/PCIE bus, the moved BIOS starting file can reach the memory of the CPU through the PCI/PCIE bus. For example, the BIOS move code file may first move the BIOS boot file to the memory of the CPU via the PCI/PCIE bus.
Step 103, starting the BIOS of the electronic device in the memory of the CPU based on the BIOS start file.
Illustratively, the BIOS start-up file may be run, thereby enabling the BIOS to start up in the memory of the CPU.
In summary, in the BIOS starting method provided in the embodiment of the present invention, in response to a system start instruction, according to the storage structure type of the CPU, the execution area of the BIOS moving the code file is determined; the memory structure type is used for representing whether the CPU supports cache access to the bus space of the bus. And executing the BIOS moving code file in the execution area to move the BIOS starting file stored in the memory to the memory of the CPU through the bus. And starting the BIOS of the electronic equipment in the memory of the CPU based on the BIOS starting file. In the embodiment of the invention, the BIOS starting file in the storage is moved to the memory of the CPU based on the bus between the CPU and the storage and the BIOS moving code file, and the BIOS of the electronic equipment is started in the memory of the CPU. Therefore, the method for starting the BIOS based on the bus is realized, so that the BIOS is not limited to be started only at the stored position, and the limitation of the starting mode can be further reduced to a certain extent.
Meanwhile, the BIOS starting file is moved and copied to the memory of the CPU and is started in the memory of the CPU, so that the starting efficiency of the BIOS can be improved to a certain extent.
Optionally, in this embodiment of the present invention, the electronic device may further include an intermediate device, and the intermediate device is connected to the CPU and the memory through the bus, respectively, that is, the CPU and the intermediate device are linked through a PCI/PCIE bus, and the intermediate device and the memory are linked through a PCI/PCIE bus. Correspondingly, before the step of determining the execution area of the BIOS moving the code file according to the storage structure type of the CPU, the following steps may be performed in an embodiment of the present invention:
step 201, under the condition that the CPU is determined to be included in the intermediate device, suspending the CPU included in the intermediate device.
The CPU included in the intermediate Device may be a bridge chip with a CPU core, and the intermediate Device may be a bridge chip or other devices, such as a Field Programmable Gate Array (FPGA) or a Complex Programmable Logic Device (CPLD). Fig. 2 is a schematic diagram of a hardware link according to an embodiment of the present invention, and as shown in fig. 2, a CPU of an electronic device may be linked with an intermediate device through a PCI/PCIE bus, and a memory may be connected behind the intermediate device. The memory may also be attached to the intermediate device, for example, the memory may be a flash attached to the bridge chip. The hardware link mode of the processor shown in fig. 2 may support the method for starting the BIOS based on the PCI/PCIE bus in the embodiment of the present invention.
Specifically, a shutdown instruction may be sent to the CPU included in the intermediate device in the CPU initialization stage to suspend the CPU included in the intermediate device.
Because some intermediate devices are provided with additional CPUs, in the embodiments of the present invention, the CPUs included in the intermediate devices can be suspended when the CPUs are included in the intermediate devices, so as to avoid a conflict between the CPUs included in the intermediate devices and the CPUs of the electronic devices, for example, the CPUs included in the intermediate devices access the memory at the same time, and fetch an instruction in the activated memory, so as to generate a conflict, thereby ensuring that subsequent operations can be performed normally.
Accordingly, during the operation of the above-described CPU, the CPU included in the intermediate device may be controlled not to operate at all times to avoid a collision as much as possible.
Optionally, before executing step 201, in the embodiment of the present invention, determining whether the intermediate device includes a CPU by the following steps, that is, determining that the intermediate device includes a CPU may include:
and 301, acquiring the device type of the intermediate device.
Specifically, type parameters for characterizing the device type of the intermediate device may be obtained from parameter data of the intermediate device. And searching the device type corresponding to the obtained type parameter based on the preset corresponding relation between the device type and the type parameter, and further obtaining the device type of the intermediate device.
Step 302, determining that the intermediate device comprises a CPU when the device type is a first specified type.
Wherein the first specified type is to support a device type including a CPU. The first specified type may be a pre-collected device type that supports including a CPU. For example, a bridge may include a CPU, i.e., the bridge supports including a CPU, while an FPGA may not include a CPU, i.e., the FPGA does not support including a CPU. Accordingly, the first specified type may include a bridge chip and not an FPGA. In the embodiment of the invention, the CPU device type can be included as the first specified type.
Since functions of electronic devices are enriched at present, devices including CPUs are often configured for electronic devices to support the devices including CPUs. Therefore, in the embodiment of the present invention, when the device type is the first designated type, it may be determined that the intermediate device includes the CPU, and thus, efficiency may be ensured to a certain extent. Conversely, if the device type is not the first specified type, it may be determined that the CPU is not included in the intermediate device.
It should be noted that, in the embodiment of the present invention, when the device type is the first specified type, the configuration information of the intermediate device may be further detected, and when the configuration information of the intermediate device indicates that the CPU is configured in the intermediate device, it is determined that the CPU is included in the intermediate device, so as to ensure accuracy of the determination operation. And whether the device type is the first appointed type is determined, and the device is further detected under the condition that the device type is the first appointed type, so that unnecessary detection of the device which does not support the CPU can be avoided, and processing resources are saved to a certain extent.
Optionally, the following steps may also be executed in the embodiment of the present invention:
step 401, in a case that the device type of the intermediate device is a second specified type, after the BIOS boot file stored in the storage is moved to the memory of the CPU through the bus, initializing the intermediate device; wherein initialization of the second specified type of intermediate device comprises an address update operation to the memory.
In the embodiment of the present invention, the execution sequence of the initialization operation of the intermediate device may be adjusted to a sequence after the step of transferring the BIOS boot file stored in the storage to the memory of the CPU through the bus. The second specified type may be preset, and specifically, a device type that updates an address of the memory in the initialization stage may be collected in advance, for example, if the address of the memory is updated in the initialization stage of a certain device, the device type may be the second specified type. Wherein the second specified type may exist for the same device type as the first specified type. For example, the first specified type may include a bridge piece.
Specifically, an initialization prohibition instruction may be issued to the intermediate device, and accordingly, after the step of moving the BIOS startup file stored in the storage to the memory of the CPU through the bus is executed, an initialization prohibition instruction is issued to the intermediate device, so that the execution order of the initialization operation of the intermediate device is adjusted to be after the BIOS startup file is moved to the memory, and the intermediate device executes the initialization operation after the BIOS startup file is moved to the memory.
Illustratively, in the case where the intermediate device is a bridge chip, the window needs to be reconfigured for the bridge chip, i.e., the memory needs to be re-scribed for the bridge chip, and the bridge chip is initialized. If the execution sequence of the initialization operation is not adjusted, the initialization operation of the bridge chip can cause the address of the memory to change, which causes the address of the data in the memory to change, further causes the CPU not to address normally, and cannot acquire the data in the memory. Of course, if the intermediate device is a device whose initialization does not update the address of the memory, for example, FPGA, the intermediate device may be normally initialized without adjusting the sequence.
In the embodiment of the invention, under the condition that the address of the memory is updated by the initialization of the intermediate device, the execution sequence of the initialization operation of the intermediate device is adjusted, and the intermediate device is initialized after the BIOS starting file stored in the memory is moved to the memory of the CPU through the bus. The address of the storage is prevented from changing before the BIOS starting file is moved to the memory of the CPU, and further the problem that the BIOS cannot be started in the CPU due to the fact that the BIOS starting file cannot be acquired is avoided.
Optionally, in this embodiment of the present invention, the BIOS moving code file may be stored in a memory storing the BIOS file in advance. Of course, in practical applications, the information may also be stored in other locations, for example, in other memories, and the embodiment of the present invention is not limited thereto. Taking the case that the BIOS moving code file is pre-stored in the memory for storing the BIOS file, when the storage structure type characterization CPU does not support cache access to the bus space in which the BIOS start file is stored in the memory, and the execution area is the memory, the following steps may be further performed in the embodiment of the present invention:
step 501, copying the entry function code, the BIOS moving code file, and the abnormal output code in the memory to the memory. Accordingly, the BIOS can be skipped to the memory to run the code file.
Correspondingly, the step of executing the BIOS moving the code file based on the execution area may specifically include: and executing the entry function code in the memory to call and run the BIOS transfer code file.
The entry function code may be a C entry function code, and the entry function code may define a call logic, and accordingly, the BIOS move code file may be called by executing the entry function code, and then the BIOS move code file may be run, so that the BIOS start file may reach the memory of the CPU from the flash of the bridge chip through the PCI/PCIE bus.
Therefore, the BIOS can be executed by directly starting to execute the entry function code, and the execution effect can be ensured to a certain extent.
Further, the following operations may also be performed in the embodiment of the present invention: and outputting exception information based on the exception output code when an error occurs in operation. The abnormal output code may be an abnormal print code, and the abnormal output code may be used to locate and output the location information of the fault. If the BIOS moving code has an error in operation, the abnormal output code can be further operated so as to acquire the position information with the fault as the abnormal information and output the abnormal information. Because the BIOS moving code file is copied into the memory for execution, the abnormal output code is further copied into the memory in the embodiment of the invention, so that the abnormal information can be conveniently obtained under the condition of operation error, and further, the fault is conveniently positioned.
Further, in a case that the execution area is a cache of the CPU, the step of executing the BIOS moving the code file based on the execution area may specifically include: and pulling the BIOS moving code file in the memory based on the cache, and executing the pulled BIOS moving code file.
The BIOS moving code file can comprise a plurality of instructions, one instruction can correspond to the other instruction, a part of the BIOS moving code file which can be executed independently can be executed, and moving can be achieved by executing the instructions. In the embodiment of the invention, the cache of the CPU can be initialized firstly. And then, taking the instruction corresponding to the BIOS moving code file from the cache of the CPU and executing the instruction. For the cache access mechanism, if the cache does not exist, a part of instructions are fetched from the memory and executed, and correspondingly, other subsequent parts are written into the cache, so that the cache can be directly accessed for execution subsequently, and the processing speed is further ensured. It should be noted that, in an actual application scenario, an instruction forming an entry function code may be taken first, and an instruction in a BIOS transfer code file that needs to be called is taken in an execution process. It should be noted that, in a case where the CPU supports cache access to a bus space of the bus, in an implementation manner, since the CPU is connected to the memory through the PCI/PCIE bus, when an instruction is fetched from the cache, the instruction may be prefetched into the cache through the PCI/PCIE bus space of the PCI/PCIE bus. For example, the command is first fetched from the designated area storing the BIOS move code to the bus space based on the PCI/PCIE bus, and then the command is fetched from the bus space to the cache. It should be noted that, in an actual application scenario, the BIOS shift code file may also be stored in the cache in advance, so that the BIOS shift code file is directly executed in the cache.
FIG. 3 is a process flow diagram of an embodiment of the present invention, as shown in FIG. 3, for suspending a CPU included in a bridge chip in the case that the CPU is included in the bridge chip. Otherwise, if not, the subsequent operation can be directly performed. Specifically, after power-on, whether the bridge chip includes the CPU may be detected. Further, in the case that the main CPU of the electronic device supports cache access, jumping to the cache and executing the BIOS move code file. Under the condition that a main CPU of the electronic equipment does not support cache access, copying the BIOS moving code file into a memory, and jumping to the memory to execute the BIOS moving code file. The supporting of the cache access by the main CPU may specifically refer to that the main CPU supports the cache access to the bus space of the bus, that is, the cache of the main CPU supports the access to the bus space. And then, moving the BIOS starting file to a memory of the CPU, and starting the BIOS based on the BIOS starting file. And after the BIOS starting file is moved to the memory of the CPU, the bridge chip is initialized. Of course, the initialization operation may be performed on the bridge after the BIOS is successfully started based on the BIOS start file, which is not limited in this embodiment of the present invention.
At present, BIOS starting files are often placed in memories such as nor and nand flash, and can only be started in memories such as nor and nand flash. In the embodiment of the invention, the CPU of the electronic equipment supports the BIOS starting based on the PCI/PCIE, and the method for starting the BIOS in the CPU based on the PCI/PCIE solves the problem that the BIOS can only be started in memories such as nor and nand flash, and provides a new alternative for hardware construction. And different treatments are carried out on the intermediate device according to actual conditions, so that the normal starting of the BIOS is ensured, and the normal starting of the operating system is guided.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those of skill in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the embodiments of the invention.
Referring to fig. 4, a block diagram of a starting apparatus of a BIOS according to an embodiment of the present invention is shown, and is applied to an electronic device, where the electronic device includes a central processing unit CPU and a memory for storing a BIOS start-up file, and the CPU and the memory are connected through a bus; the method specifically comprises the following modules:
a first determining module 21, configured to determine, in response to a system start instruction, an execution area of the BIOS moving code file according to the storage structure type of the CPU; the storage structure type is used for representing whether the CPU supports cache access to the bus space of the bus or not;
the execution module 22 is configured to execute the BIOS moving code file in the execution area, so as to move the BIOS start file stored in the storage to the memory of the CPU through the bus;
a starting module 23, configured to start the BIOS of the electronic device in the memory of the CPU based on the BIOS start file.
Optionally, the electronic device further includes an intermediate device, and the intermediate device is connected to the CPU and the memory through the bus respectively;
the device further comprises:
a suspending module configured to suspend the CPU included in the intermediate device, if it is determined that the CPU is included in the intermediate device.
Optionally, the apparatus further comprises:
the acquisition module is used for acquiring the device type of the intermediate device;
and the second determining module is used for determining that the intermediate device comprises the CPU under the condition that the device type is the first specified type.
Optionally, the apparatus further comprises:
an initialization module, configured to initialize the intermediate device after the BIOS boot file stored in the storage is moved to the memory of the CPU through the bus when the device type of the intermediate device is a second specified type;
wherein initialization of the second specified type of intermediate device comprises an address update operation to the memory.
Optionally, the first determining module 21 is specifically configured to:
under the condition that the storage structure type represents that the CPU supports cache access to the bus space of the bus, determining the cache as the execution area;
and under the condition that the storage structure type represents that the CPU does not support cache access to the bus space of the bus, determining the memory of the CPU as the execution area.
Optionally, in a case that the execution region is the memory, the apparatus further includes:
the copying module is used for copying the entry function code, the BIOS moving code file and the abnormal output code in the memory into the memory;
the execution module is specifically configured to:
executing the entry function code in the memory to call and run the BIOS moving code file;
the device further comprises: and the output module is used for outputting the abnormal information based on the abnormal output code when an error occurs in operation.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
FIG. 5 is a block diagram illustrating a configuration of an electronic device for BIOS boot in accordance with an exemplary embodiment. For example, the electronic device 400 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 5, electronic device 400 may include one or more of the following components: processing component 402, program memory 404, power component 406, multimedia component 408, audio component 410, input/output (I/O) interface 412, sensor component 414, communication component 416, and BIOS boot file memory 418.
The processing component 402 generally controls overall operation of the electronic device 400, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 402 can include one or more modules that facilitate interaction between the processing component 402 and other components. For example, the processing component 402 can include a multimedia module to facilitate interaction between the multimedia component 408 and the processing component 402.
Program memory 404 is configured to store various types of data to support operations at device 400. Examples of such data include instructions for any application or method operating on the electronic device 400, contact data, phonebook data, messages, pictures, videos, and so forth. The program memory 404 may be implemented by any type or combination of volatile or non-volatile storage devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks. The BIOS boot file memory 418 may have a BIOS boot file stored therein. The programs in the program memory 404, when executed by the processing component 402, cause the processing component 402 to perform the following operations:
in response to the system boot instruction, determining an execution region of the BIOS move code file according to a storage structure type of the processor 420 in the processing component 402; the storage structure type is used for characterizing whether the processor 420 supports cache access to a bus space of the bus;
executing the BIOS moving code file in the execution area to move the BIOS boot file stored in the BIOS boot file storage 418 to the memory of the processor 420 through the bus;
starting the BIOS of the electronic device in the memory of the processor 420 based on the BIOS start-up file.
The power supply component 406 provides power to the various components of the electronic device 400. Power components 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for electronic device 400.
The multimedia component 408 comprises a screen providing an output interface between the electronic device 400 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 400 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 410 is configured to output and/or input audio signals. For example, the audio component 410 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 400 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 404 or transmitted via the communication component 416. In some embodiments, audio component 410 also includes a speaker for outputting audio signals.
The I/O interface 412 provides an interface between the processing component 402 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 414 includes one or more sensors for providing various aspects of status assessment for the electronic device 400. For example, the sensor component 414 can detect an open/closed state of the device 400, the relative positioning of components, such as a display and keypad of the electronic device 400, the sensor component 414 can also detect a change in position of the electronic device 400 or a component of the electronic device 400, the presence or absence of user contact with the electronic device 400, orientation or acceleration/deceleration of the electronic device 400, and a change in temperature of the electronic device 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of a nearby object in the absence of any physical contact. The sensor assembly 414 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 416 is configured to facilitate wired or wireless communication between the electronic device 400 and other devices. The electronic device 400 may access a wireless network based on a communication standard, such as WiFi,2G or 3G, or a combination thereof. In an exemplary embodiment, the communication section 414 receives a broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 414 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 400 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 404 comprising instructions, executable by the processor 420 of the electronic device 400 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium in which instructions, when executed by a processor of a terminal, enable the terminal to perform a method of launching an application, the method comprising: responding to a system starting instruction, and determining an execution area of a BIOS moving code file according to the storage structure type of the CPU; the storage structure type is used for representing whether the CPU supports cache access to the bus space of the bus or not;
executing the BIOS moving code file in the execution area so as to move the BIOS starting file stored in the memory to a memory of the CPU through the bus;
in the memory of the CPU, each embodiment in the BIOS specification that starts the electronic device based on the BIOS startup file is described in a progressive manner, where each embodiment focuses on a difference from other embodiments, and the same and similar parts in each embodiment are referred to each other.
As will be appreciated by one of skill in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a predictive manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all changes and modifications that fall within the true scope of the embodiments of the present invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or terminal device that comprises the element.
The above detailed description is given to the BIOS starting method and apparatus, the electronic device, and the storage medium provided in the present invention, and specific examples are applied herein to explain the principle and the implementation of the present invention, and the description of the above embodiments is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (14)

1. A starting method of a Basic Input Output System (BIOS) is characterized by being applied to electronic equipment, wherein the electronic equipment comprises a Central Processing Unit (CPU) and a memory for storing BIOS starting files, and the CPU is connected with the memory through a bus; the method comprises the following steps:
responding to a system starting instruction, and determining an execution area of a BIOS moving code file according to the storage structure type of the CPU; the storage structure type is used for representing whether the CPU supports cache access to a bus space of the bus;
executing the BIOS moving code file in the execution area so as to move the BIOS starting file stored in the memory to a memory of the CPU through the bus;
and starting the BIOS of the electronic equipment in the memory of the CPU based on the BIOS starting file.
2. The method according to claim 1, wherein the electronic device further comprises an intermediate device, the intermediate device is respectively connected with the CPU and the memory through the bus;
before determining the execution area of the BIOS moving the code file according to the storage structure type of the CPU, the method further includes:
in a case where it is determined that the CPU is included in the intermediate device, the CPU included in the intermediate device is suspended.
3. The method of claim 2, wherein determining that the intermediate device comprises a CPU comprises:
obtaining the device type of the intermediate device;
and determining that the intermediate device comprises a CPU under the condition that the device type is a first specified type.
4. A method according to claim 2 or 3, characterized in that the method further comprises:
when the device type of the intermediate device is a second specified type, initializing the intermediate device after the BIOS starting file stored in the memory is moved to the memory of the CPU through the bus;
wherein initialization of the second specified type of intermediate device comprises an address update operation to the memory.
5. The method of claim 1, wherein determining the execution region of the BIOS move code file according to the storage structure type of the CPU comprises:
determining the cache as the execution area under the condition that the storage structure type represents that the CPU supports cache access to the bus space of the bus;
and under the condition that the storage structure type represents that the CPU does not support cache access to the bus space of the bus, determining the memory of the CPU as the execution area.
6. The method of claim 5, wherein if the execution region is the memory, the method further comprises:
copying the entry function code, the BIOS moving code file and the abnormal output code in the memory to the memory;
the executing the BIOS move code file based on the execution area comprises:
executing the entry function code in the memory to call and run the BIOS moving code file;
the method further comprises the following steps: and outputting exception information based on the exception output code when an error occurs in operation.
7. The starting device of the BIOS is characterized by being applied to electronic equipment, wherein the electronic equipment comprises a Central Processing Unit (CPU) and a memory for storing BIOS starting files, and the CPU is connected with the memory through a bus; the device comprises:
the first determining module is used for responding to a system starting instruction and determining an execution area of the BIOS moving code file according to the storage structure type of the CPU; the storage structure type is used for representing whether the CPU supports cache access to the bus space of the bus or not;
the execution module is used for executing the BIOS moving code file in the execution area so as to move the BIOS starting file stored in the memory to the memory of the CPU through the bus;
and the starting module is used for starting the BIOS of the electronic equipment in the memory of the CPU based on the BIOS starting file.
8. The apparatus of claim 7, wherein the electronic device further comprises an intermediate device, the intermediate device being connected to the CPU and the memory via the bus, respectively;
the device further comprises:
a suspending module configured to suspend the CPU included in the intermediate device if it is determined that the CPU is included in the intermediate device.
9. The apparatus of claim 8, further comprising:
the acquisition module is used for acquiring the device type of the intermediate device;
and the second determining module is used for determining that the intermediate device comprises the CPU under the condition that the device type is the first specified type.
10. The apparatus of claim 7, further comprising:
the initialization module is used for initializing the intermediate device after the BIOS starting file stored in the storage is moved to the memory of the CPU through the bus under the condition that the device type of the intermediate device is a second specified type;
wherein initialization of the second specified type of intermediate device comprises an address update operation to the memory.
11. The apparatus of claim 7, wherein the first determining module is specifically configured to:
determining the cache as the execution area under the condition that the storage structure type represents that the CPU supports cache access to the bus space of the bus;
and under the condition that the storage structure type represents that the CPU does not support cache access to the bus space of the bus, determining the memory of the CPU as the execution area.
12. The apparatus of claim 11, wherein in the case that the execution region is the memory, the apparatus further comprises:
a copy module, configured to copy the entry function code, the BIOS moving code file, and the abnormal output code in the memory to the memory;
the execution module is specifically configured to:
executing the entry function code in the memory to call and run the BIOS moving code file;
the device further comprises: and the output module is used for outputting the abnormal information based on the abnormal output code when an error occurs in operation.
13. An electronic device, comprising:
a processor;
BIOS starts the file memory; and
a program memory storing a program that, when executed by the processor, causes the processor to:
responding to a system starting instruction, and determining an execution area of a BIOS (basic input output System) moving code file according to the storage structure type of the processor; the storage structure type is used for representing whether the processor supports cache access to a bus space of the bus;
executing the BIOS moving code file in the execution area so as to move the BIOS starting file stored in the BIOS starting file storage to a memory of the processor through the bus;
and starting the BIOS of the electronic equipment in the memory of the processor based on the BIOS starting file.
14. A readable storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method of any of method claims 1-6.
CN202211572573.2A 2022-12-08 2022-12-08 BIOS starting method and device and electronic equipment Pending CN115729634A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211572573.2A CN115729634A (en) 2022-12-08 2022-12-08 BIOS starting method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211572573.2A CN115729634A (en) 2022-12-08 2022-12-08 BIOS starting method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN115729634A true CN115729634A (en) 2023-03-03

Family

ID=85300730

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211572573.2A Pending CN115729634A (en) 2022-12-08 2022-12-08 BIOS starting method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN115729634A (en)

Similar Documents

Publication Publication Date Title
CN107967141B (en) Operating system upgrading method and device and terminal
CN105955765B (en) Application preloading method and device
EP2945058B1 (en) Processing method and device for application program
US9886264B2 (en) Method and device for upgrading firmware
EP3096224B1 (en) Method and apparatus for processing application installation package
US20180365004A1 (en) Method and device for calling software development kit
WO2016011743A1 (en) Storage space saving method and apparatus
CN107291626B (en) Data storage method and device
CN111966410B (en) Start-up processing method and device, electronic equipment and storage medium
US10824410B2 (en) Method and equipment for executing a file
CN109725943B (en) Program jumping method and device, electronic equipment and storage medium
RU2632396C2 (en) Method and device to control router plug-in module
CN106502740B (en) Using installation method and device
CN116257706A (en) Application loading method, device and storage medium
CN115729634A (en) BIOS starting method and device and electronic equipment
CN113326069A (en) Operating system starting method and device, electronic equipment and storage medium
CN111813426A (en) Fingerprint data processing method and device
CN112083981A (en) Method and device for creating page view component
CN112214252A (en) Information expansion method and device and electronic equipment
CN111767063A (en) Resource updating method, device and equipment for application program
CN113377410B (en) Vehicle machine system, upgrading method and readable storage medium
CN110990068B (en) Display method, display device, electronic equipment and storage medium
CN110377312B (en) Software upgrading method, device and medium
CN112256274A (en) Application program processing method and device and storage medium
CN116775133A (en) Cache consistency verification method, device, equipment and medium

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