CN113326069A - Operating system starting method and device, electronic equipment and storage medium - Google Patents

Operating system starting method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113326069A
CN113326069A CN202010131076.3A CN202010131076A CN113326069A CN 113326069 A CN113326069 A CN 113326069A CN 202010131076 A CN202010131076 A CN 202010131076A CN 113326069 A CN113326069 A CN 113326069A
Authority
CN
China
Prior art keywords
target
controller
hard disk
firmware
kernel
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
CN202010131076.3A
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.)
Guangdong Longxin Zhongke Electronic Technology Co ltd
Original Assignee
Guangdong Longxin Zhongke Electronic 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 Guangdong Longxin Zhongke Electronic Technology Co ltd filed Critical Guangdong Longxin Zhongke Electronic Technology Co ltd
Priority to CN202010131076.3A priority Critical patent/CN113326069A/en
Publication of CN113326069A publication Critical patent/CN113326069A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4406Loading of operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers

Abstract

The embodiment of the invention provides an operating system starting method and device, electronic equipment and a storage medium, and relates to the technical field of computers. The method comprises the following steps: running the firmware; reading a prestored target variable through firmware; when the first PCI scanning is carried out through the firmware, a target controller indicated by a target variable is used as a first bit for scanning; transmitting the identification information of the target controller to a kernel to be started through firmware; loading and starting an inner core of a target hard disk corresponding to a target controller through firmware; and starting the operating system of the target hard disk through the kernel according to the identification information. In the invention, the firmware can obtain the controller information of the target hard disk required by the user through the target variable, and further can start the kernel of the target hard disk after the PCI scanning is finished. In addition, the firmware can also transmit the identification information of the target controller to the kernel before the kernel is started, and then the kernel can start the operating system of the target hard disk according to the identification information.

Description

Operating system starting method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to an operating system booting method, an operating system booting apparatus, an electronic device, and a storage medium.
Background
The processor is one of the main components of the electronic computer, is a core accessory in the electronic computer, and mainly has the functions of interpreting computer instructions and processing data in computer software. The processor has wide market application prospect in products such as servers, high-performance computers, low-energy-consumption data centers, personal high-performance computers, high-end desktop applications, high-throughput computing applications, industrial control, digital signal processing, high-end embedded applications and the like, and plays a significant role in more aspects such as economic development and the like.
When the processor board card is used, a plurality of hard disks are often needed, for example, when an operating system needs to be added, the hard disk corresponding to the operating system needs to be added. However, in many cases, even if a hard disk is added, there is still a need to boot the original system disk first. At present, when a new hard disk is added, the main process of starting an operating system is as follows: the method includes the steps that firstly, a system boot file corresponding to a hard disk can be manually appointed to be read, if an original system disk before a new hard disk is inserted is required to be started, an identification of the original system disk can be appointed, then firmware can read and analyze the boot file of the original system disk according to the appointed identification of the original system disk, a boot option in the boot file can indicate the hard disk from which a kernel is required to be loaded and an operating system corresponding to the hard disk is started, and the boot option indicates the hard disk through the hard disk identification.
Because the hard disk identification corresponding to the boot file is appointed, the firmware can read the boot file of the correct hard disk; however, since the hard disk identifier may change with the plugging position or the plugging sequence of each hard disk, when a new hard disk is added, the original system disk identifier may indicate other hard disks, and the hard disk identifier in the boot file of the original system disk is not changed, so that subsequently, when the kernel is loaded and the operating system is started according to the hard disk identifier in the boot file, the kernel cannot be loaded correctly, and the correct operating system cannot be started.
Disclosure of Invention
In view of the above, embodiments of the present invention are provided to provide an operating system booting method that overcomes or at least partially solves the above-mentioned problems, so as to enable normal booting of the original system disk operating system of a processor board card when a hard disk of the processor board card is added or subtracted.
Correspondingly, the embodiment of the invention also provides an operating system starting device, electronic equipment and a storage medium, which are used for ensuring the realization and application of the method.
In order to solve the above problem, an embodiment of the present invention discloses an operating system starting method, including:
running the firmware;
reading a pre-stored target variable through the firmware; the target variable is used for indicating the controller information of a target controller corresponding to the target hard disk;
when the firmware scans the interconnection of the first external equipment, scanning the target controller indicated by the target variable as a first-bit hard disk controller of the scan;
transmitting the identification information of the target controller to a kernel to be started through the firmware;
loading and starting a kernel corresponding to the target hard disk through the firmware;
and starting an operating system corresponding to the target hard disk through the kernel according to the identification information.
Optionally, when performing interconnection scanning to a first external device through the firmware, scanning the target controller indicated by the target variable as a scanned first hard disk controller includes:
when the firmware is used for carrying out interconnection scanning to a first external device, the target controller indicated by the target variable is exchanged with the scanning sequence of a first hard disk controller in a first preset scanning sequence;
and taking the target controller indicated by the target variable as a first hard disk controller for interconnection scanning of the first external equipment, and scanning through the firmware.
Optionally, when the identification information includes a rank of the target controller in a second preset scanning order, the transmitting, by the firmware, the identification information of the target controller to a kernel to be started includes:
replacing the first parameter with the rank of the target controller in a second preset scanning sequence through the firmware; the first parameter is used for indicating a hard disk controller corresponding to a hard disk where an operating system to be started is located;
transmitting the replaced first parameter to a kernel to be started through the firmware;
the starting, by the kernel, the operating system corresponding to the target hard disk according to the identification information includes:
performing second external device interconnection scanning by the kernel according to the second preset scanning sequence;
selecting the target controller from the scanned hard disk controllers through the kernel according to the ranking of the target controller in the second preset scanning sequence;
determining the target hard disk corresponding to the target controller;
and starting the operating system corresponding to the target hard disk through the kernel.
Optionally, when the identification information includes the controller information, the transmitting, by the firmware, the identification information of the target controller to a kernel to be started includes:
the controller information is used as a second parameter and is transmitted to a kernel to be started through the firmware; the second parameter has a different attribute than the first parameter;
the starting, by the kernel, the operating system corresponding to the target hard disk according to the identification information includes:
when the interconnection scanning of the second external equipment is carried out through the kernel, the scanning sequence of the target controller corresponding to the controller information and a first hard disk controller in a second preset scanning sequence is exchanged;
taking the target controller corresponding to the controller information as a first hard disk controller for interconnection scanning of the second external device, and scanning through the kernel;
and starting the operating system corresponding to the target hard disk corresponding to the head hard disk controller which is interconnected and scanned by the second external equipment through the kernel.
Optionally, before the executing the firmware, the method further includes:
starting and running the firmware under the condition that a new hard disk is inserted into or removed from a processor board card;
when a selection instruction of the target hard disk is received through the firmware, controller information of a target controller corresponding to the target hard disk is acquired;
saving the controller information to the target variable;
restarting the firmware to validate the saved controller information.
Optionally, the controller information includes a bus number, a device number, and a function number of the target controller corresponding to the target hard disk.
The embodiment of the invention also discloses an operating system starting device, which comprises:
the operation module is used for operating the firmware;
the reading module is used for reading a prestored target variable through the firmware; the target variable is used for indicating the controller information of a target controller corresponding to the target hard disk;
the scanning module is used for scanning the target controller indicated by the target variable as a scanned first hard disk controller when the firmware is used for carrying out interconnection scanning on a first external device;
the parameter transmission module is used for transmitting the identification information of the target controller to a kernel to be started through the firmware;
the kernel starting module is used for loading and starting a kernel corresponding to the target hard disk through the firmware;
and the system starting module is used for starting the operating system corresponding to the target hard disk through the kernel according to the identification information.
Optionally, the scanning module comprises:
the first interchange submodule is used for interchanging the scanning sequence of the target controller indicated by the target variable and a first hard disk controller in a first preset scanning sequence when the firmware is used for carrying out interconnection scanning on first external equipment;
and the first scanning submodule is used for taking the target controller indicated by the target variable as a first hard disk controller for the interconnection scanning of the first external equipment and scanning through the firmware.
Optionally, when the identification information includes a rank of the target controller in a second preset scanning order, the parameter transferring module includes:
the replacing submodule is used for replacing the first parameter with the ranking of the target controller in a second preset scanning sequence through the firmware; the first parameter is used for indicating a hard disk controller corresponding to a hard disk where an operating system to be started is located;
the first parameter module is used for transmitting the replaced first parameter to a kernel to be started through the firmware;
the system startup module comprises:
the second scanning submodule is used for carrying out interconnection scanning on second external equipment through the kernel according to the second preset scanning sequence;
the selection submodule is used for selecting the target controller from the scanned hard disk controllers through the kernel according to the ranking of the target controller in the second preset scanning sequence;
the determining submodule is used for determining the target hard disk corresponding to the target controller;
and the first starting submodule is used for starting the operating system corresponding to the target hard disk through the kernel.
Optionally, when the identification information includes the controller information, the parameter transferring module includes:
the second parameter transmission sub-module is used for transmitting the controller information serving as a second parameter to the kernel to be started through the firmware; the second parameter has a different attribute than the first parameter;
the system startup module comprises:
the second interchange submodule is used for interchanging the scanning sequence of the target controller corresponding to the controller information and the first hard disk controller in a second preset scanning sequence when the kernel performs interconnection scanning to a second external device;
the third scanning submodule is used for taking the target controller corresponding to the controller information as a first hard disk controller for interconnection scanning of the second external equipment and scanning through the kernel;
and the second starting submodule is used for starting the operating system corresponding to the target hard disk corresponding to the head hard disk controller which is interconnected and scanned by the second external device through the kernel.
Optionally, the apparatus further comprises:
the firmware starting module is used for starting and running the firmware under the condition that a new hard disk is inserted into or removed from the processor board card;
the acquisition module is used for acquiring the controller information of a target controller corresponding to the target hard disk when the selection instruction of the target hard disk is received through the firmware;
the storage module is used for storing the controller information to the target variable;
and the firmware restarting module is used for restarting the firmware so as to enable the saved controller information to be effective.
Optionally, the controller information includes a bus number, a device number, and a function number of the target controller corresponding to the target hard disk.
An embodiment of the present invention also discloses an electronic device comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for:
running the firmware;
reading a pre-stored target variable through the firmware; the target variable is used for indicating the controller information of a target controller corresponding to the target hard disk;
when the firmware scans the interconnection of the first external equipment, scanning the target controller indicated by the target variable as a first-bit hard disk controller of the scan;
transmitting the identification information of the target controller to a kernel to be started through the firmware;
loading and starting a kernel corresponding to the target hard disk through the firmware;
and starting an operating system corresponding to the target hard disk through the kernel according to the identification information.
The embodiment of the invention also discloses a readable storage medium, and when instructions in the storage medium are executed by a processor of the electronic equipment, the electronic equipment can execute one or more operating system starting methods in the embodiment of the invention.
The embodiment of the invention has the following advantages:
in the embodiment of the present invention, in a case where the firmware is running, the firmware may read a pre-stored target variable, where the target variable is used to indicate controller information of a target controller corresponding to a target hard disk that a user wants to start. When the firmware performs the process of interconnection scanning of the first external device, the target controller indicated by the target variable may be used as a first-order hard disk controller for scanning, so that the firmware may load and start the kernel corresponding to the target hard disk, that is, the kernel can be started to the correct kernel required by the user. In addition, the firmware can also transmit the identification information of the target controller to the kernel to be started before the kernel is started, and then the kernel can start the operating system corresponding to the target hard disk according to the identification information. Therefore, the electronic equipment can start the correct kernel required by the user, and further can start the correct operating system required by the user.
Drawings
FIG. 1 is a flowchart illustrating the steps of one embodiment of a method for booting an operating system;
FIG. 2 is a flowchart illustrating the steps of another operating system boot embodiment of the present invention;
FIG. 3 is a block diagram of an embodiment of an OS boot device according to the present invention;
FIG. 4 is a block diagram illustrating an electronic device for booting an operating system in accordance with an illustrative 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.
Before describing the embodiments of the present invention in detail, the related concepts and the main flow of the prior art will be described.
Hard disk: hard disks are the most important storage devices of computers, wherein a hard disk fixed on a processor board card is called an on-board hard disk, a computer usually has only one on-board hard disk, and in addition, the processor board card usually can also provide other hard disk slots for inserting new hard disks. Each hard disk stores a related function, a file, and the like for starting an operating system, and therefore, if an operating system is used, the corresponding hard disk needs to be started. In the embodiment of the present invention, the onboard hard disk is referred to as a system disk (i.e., hereinafter referred to as an original system disk), and the new hard disk newly inserted into the processor board card is referred to as a hard disk.
The hard disk controller: the hard disk controller is a hard disk information conversion element integrated on the processor board card, and can be understood as a management interface of the hard disk access processor board card, and the hard disk controller controls and allocates resources to the hard disk. When a hard disk is inserted into a hard disk slot, the hard disk can be managed by a corresponding hard disk controller. In the embodiment of the present invention, the hard disk controller refers to a PCI (Peripheral Component Interconnect) device; the hard disk interface is typically a SATA (Serial Advanced Technology Attachment) slot. When PCI scanning is performed, the found hard disk controller is used, and whether a hard disk exists on the corresponding hard disk interface can be judged by the drive of the hard disk controller. In addition, different hard disk slots have different priorities, correspondingly, different hard disk controllers and different inserted hard disks also have different starting priorities, and when one hard disk is inserted into one hard disk slot with a low priority, the starting priority of the hard disk is also low.
Firmware: firmware is also software that is solidified in hardware to boot the hardware. In practical applications, for various technical limitations or commercial reasons, hardware manufacturers want their hardware to be available to more software manufacturers, so that some encapsulation is needed on the hardware to make the hardware easier to manipulate, and firmware is needed to simplify the interaction between software (such as an operating system) and hardware. Common firmware includes BIOS (Basic Input Output System) program and the like.
Kernel: the kernel is an internal kernel program of the operating system, provides kernel management calls for the computer to the outside, and enables a user to operate in an interface of the operating system.
In the prior art, if a processor board card is newly inserted with other hard disks in addition to a system disk, the system disk and the other hard disks both contain operating system programs, which represents that at least two operating systems exist in a computer at present, and when a user starts the computer, the user needs to start one of the operating systems first, and what the user wants to start is usually the operating system corresponding to the original system disk. However, the general logic of the computer is to start the operating system corresponding to the hard disk according to the boot file of the hard disk corresponding to the first hard disk controller scanned by the PCI (or referred to as PCI device scanning), and the PCI scanning is performed according to the priority of the hard disk controller, so that the first hard disk controller scanned by the PCI is the hard disk controller with the highest priority at present.
However, in practical applications, inserting or removing a new hard disk by hot plug or non-hot plug may cause a change in a drive identifier of an original hard disk, that is, the hard disk identifier may be redistributed according to a plugging position or a plugging sequence of each hard disk. For example, the drive letter a indicates the hard disk with the highest priority, that is, the hard disk corresponding to the first hard disk controller performing PCI scanning, before a new hard disk is inserted or removed, the drive letter of the original system disk may be a, and after the new hard disk is inserted or removed, the drive letter of the original system disk may be B, and the drive letter a may correspond to the new hard disk P.
However, since it is possible to manually specify which hard disk corresponds to which boot file to read, it is possible to specify that the computer reads the boot file of the original system disk without reading the boot file of the new hard disk P regardless of the scanning order of the PCI scan, and thus the computer can read the correct boot file. However, since the boot file of the original system disk only considers that only one hard disk exists, in the boot option of the boot file, the disk signature of the original system disk is written to be the disk signature a, that is, the parameter in the boot file indicating which hard disk the firmware loads the kernel from is the disk signature a, and the parameter indicating which hard disk the kernel starts the operating system corresponding to is also the disk signature a. However, since the disk signature a already corresponds to the new hard disk P, this will cause the computer to load the corresponding kernel from the new hard disk P according to the disk signature a and start the operating system corresponding to the new hard disk P, so that the computer cannot load the correct kernel (the kernel corresponding to the original system disk). The subsequent firmware will instruct the kernel to start the parameter of the operating system corresponding to which hard disk, that is, the disk identifier a, to refer to the kernel, but the kernel still cannot enter the correct operating system (the operating system corresponding to the original system disk) according to the disk identifier a.
Of course, the above procedure and principle explanation are also applicable to the case where the user wants to start the operating system corresponding to the hard disk with the current priority not being the highest, and the hard disk with the current priority not being the highest that the user wants to start is referred to as the target hard disk hereinafter.
One of the core concepts of the embodiments of the present invention is that, through a target variable, controller information corresponding to a target hard disk that a user wants to start is pre-stored in firmware, so that the firmware can read the target variable during operation, and according to the target variable, a scanning order of a hard disk controller when the firmware performs PCI scanning is adjusted, so that a target controller corresponding to the controller information stored in the target variable is used as a first scanned controller, that is, the target controller corresponding to the target hard disk is used as the first scanned controller, so that a kernel corresponding to the target hard disk can be loaded and started after the firmware, that is, the kernel can be started correctly. In addition, the firmware can also transmit the identification information of the target controller to the kernel to be started before the kernel is started. Because the target controller corresponds to the hard disk slot, the target controller does not change with the newly inserted hard disk, and the hard disk managed by the target controller does not change with the newly inserted hard disk, and is always the target hard disk, so that the identification information capable of determining the target controller is pre-stored in the firmware, and the correct target hard disk can be uniquely determined. Further, the kernel can start a correct operating system (an operating system corresponding to the target hard disk) according to the identification information of the target controller pre-stored by the firmware. Therefore, the electronic equipment can start the correct kernel, and further can start the correct operating system.
It should be noted that the operating system starting method provided in the embodiment of the present invention may be applied to a case where a new hard disk is added to a processor board card of an MIPS (Microprocessor without interlocked pipeline stages) architecture, or a hard disk is removed when there are multiple hard disks, and may be applied to an electronic device in which a processor of an MIPS architecture is used as a CPU (Central Processing Unit).
Referring to fig. 1, a flowchart illustrating steps of an embodiment of an operating system booting method according to the present invention is shown, which may specifically include the following steps:
step 101, running firmware.
In the embodiment of the present invention, when a new hard disk is inserted into or removed from a processor board card (at least two hard disks are inserted into the processor board card before removal), a user may store, in firmware, controller information of a target controller corresponding to a target hard disk that is to be started by using a target variable, specifically, may assign a value to the target variable, where the assigned value is the controller information.
After that, when the electronic device is powered up again, the firmware in the electronic device may start and run. Generally, after the firmware is run, the CPU, the bridge, the PCI devices, the interrupts, and the like are initialized, where the PCI devices are devices accessed through the PCI interface, such as the hard disks in the embodiment of the present invention. The firmware initializes the PCI device in the middle and later stages of the initialization, the step includes a PCI scanning step, the PCI scanning step is to load a driver corresponding to the accessed PCI device, and each piece of software in the electronic device controls the PCI device through the driver.
Step 102, reading a pre-stored target variable through the firmware; and the target variable is used for indicating the controller information of the target controller corresponding to the target hard disk.
In the embodiment of the present invention, before the firmware performs PCI scanning, the firmware may read a pre-stored target variable to obtain a value of the target variable, that is, controller information of a target controller corresponding to a target hard disk, that is, the firmware may obtain, from the target variable, controller information corresponding to the target hard disk that a user wants to start.
And 103, when the firmware scans the interconnection to the first external device, scanning the target controller indicated by the target variable as a scanned first hard disk controller.
In this embodiment of the present invention, when the firmware performs the first PCI (peripheral component interconnect) scan, that is, the PCI scan executed by the firmware, that is, when the firmware performs the first PCI scan, that is, the first PCI scan, the firmware may find the target controller corresponding to the target hard disk from each hard disk controller to be scanned according to the controller information stored in the target variable, adjust the scanning order of each hard disk controller, and set the target controller as the first scanned hard disk controller for scanning.
And 104, transmitting the identification information of the target controller to a kernel to be started through the firmware.
In the embodiment of the present invention, when the kernel starts the operating system, the system needs to be started according to the parameter, which is transmitted by the firmware and used for indicating which hard disk of the operating system is started, so that before the kernel is started, the firmware can transmit the identification information of the target controller to the kernel to be started.
And 105, loading and starting the kernel corresponding to the target hard disk through the firmware.
In the embodiment of the invention, after the firmware completes the pass-through and other necessary operations, the corresponding kernel of the target hard disk can be loaded and started. Because the mechanism of the firmware itself is to start the kernel of the hard disk corresponding to the first controller performing PCI scanning, the firmware can default to load and start the kernel corresponding to the target hard disk, that is, can start the correct kernel, when the target controller corresponding to the target hard disk is used as the first bit of the PCI scanning of the firmware.
And 106, starting the operating system corresponding to the target hard disk through the kernel according to the identification information.
In the embodiment of the invention, the identification information of the target controller corresponding to the target hard disk is transmitted to the kernel corresponding to the target hard disk by the firmware, so that after the kernel corresponding to the target hard disk is started, the operating system to be started can be determined to be the operating system corresponding to the target hard disk according to the identification information, and further, the correct operating system can be started.
In the embodiment of the present invention, in a case where the firmware is running, the firmware may read a pre-stored target variable, where the target variable is used to indicate controller information of a target controller corresponding to a target hard disk that a user wants to start. When the firmware performs the process of interconnection scanning of the first external device, the target controller indicated by the target variable may be used as a first-order hard disk controller for scanning, so that the firmware may load and start the kernel corresponding to the target hard disk, that is, the kernel can be started to the correct kernel required by the user. In addition, the firmware can also transmit the identification information of the target controller to the kernel to be started before the kernel is started, and then the kernel can start the operating system corresponding to the target hard disk according to the identification information. Therefore, the electronic equipment can start the correct kernel required by the user, and further can start the correct operating system required by the user.
Referring to fig. 2, a flowchart illustrating steps of another embodiment of an operating system booting method according to the present invention is shown, which may specifically include the following steps:
step 201, starting and running the firmware under the condition that a new hard disk is inserted into or removed from the processor board card.
In the embodiment of the invention, after a user inserts a new hard disk into or removes the new hard disk from the processor board card, the electronic device starts and runs the firmware firstly when the electronic device is started for the first time.
Step 202, when the selection instruction of the target hard disk is received through the firmware, obtaining the controller information of the target controller corresponding to the target hard disk.
In the embodiment of the invention, after the firmware runs, a hard disk selection interface can be displayed, and a user can select a target hard disk to be started in the hard disk selection interface, so that the firmware can receive a selection instruction of the target hard disk. After a hard disk is mounted on the PCI bus, the electronic device may acquire the controller information of the hard disk controller corresponding to the hard disk, so that when the firmware receives the selection instruction of the target hard disk, the firmware may acquire the controller information of the target controller corresponding to the target hard disk accessed to the bus.
In practical applications, optionally, the controller information may include a bus number, a device number, and a function number of a target controller corresponding to the target hard disk. Generally, there are 256 PCI buses, each bus can be configured with 32 multifunction devices, each multifunction device can be installed with 8 function sub-devices, so that a hard disk controller can be uniquely identified by a bus number, a device number and a function number, and accordingly, a hard disk can be uniquely determined.
Step 203, storing the controller information to the target variable; and the target variable is used for indicating the controller information of the target controller corresponding to the target hard disk.
In the embodiment of the present invention, the controller information of the target controller corresponding to the target hard disk to be started may be stored in the firmware through a preset target variable, specifically, the target variable may be assigned, and the assigned value is the controller information.
And step 204, restarting the firmware to enable the saved controller information to be effective.
In the embodiment of the present invention, after the controller information is saved in the target variable, in order to enable the assigned value to be valid, the electronic device may be restarted, so that the firmware is also restarted accordingly, after the restart, the controller information saved in the target variable may be valid, and in the case where the accessed hard disk is not changed, the controller information saved in the target variable is valid every subsequent startup.
Step 205, the firmware is run.
In the embodiment of the invention, after the firmware is restarted, the firmware can start to run.
At step 206, the pre-stored target variables are read by the firmware.
The specific implementation manner of this step may refer to step 102, which is not described herein again.
And step 207, when the firmware scans the interconnection to the first external device, scanning the target controller indicated by the target variable as a scanned first hard disk controller.
In the embodiment of the present invention, the step may be specifically implemented by the following method, including: when the firmware is used for carrying out interconnection scanning to a first external device, the target controller indicated by the target variable is exchanged with the scanning sequence of a first hard disk controller in a first preset scanning sequence; and taking the target controller indicated by the target variable as a first hard disk controller for interconnection scanning of the first external equipment, and scanning through the firmware.
The first PCI scan is also a PCI scan process executed by the firmware, an original sequence in which the firmware executes the first PCI scan is a first preset scan sequence, and in the first preset scan sequence, the first scanned hard disk controller is not necessarily a target controller corresponding to the target hard disk, so that when the firmware can perform the first PCI scan, the target controller indicated by the target variable is exchanged with a scan sequence of a head hard disk controller in the first preset scan sequence, and the target controller can be set as the first scanned hard disk controller corresponding to the first PCI scan process.
It should be noted that the first scanned is for all the hard disk controllers, not for all the controllers, that is, after the scanning order is adjusted, the target controller is the first scanned of all the hard disk controllers, and in all the controllers including the hard disk controllers, the target controller is not necessarily the first scanned.
And 208, transmitting the identification information of the target controller to a kernel to be started through the firmware.
In the embodiment of the present invention, after the kernel is started, a PCI scan, that is, a second PCI scan, that is, a PCI scan process performed by the kernel, is also performed, and an original sequence in which the kernel performs the second PCI scan is a second preset scan sequence. Typically, the second preset scan order is the same as the first preset scan order.
In the prior art, the firmware may refer to a kernel to be started, where the kernel is configured to send a first parameter indicating which hard disk operating system the kernel starts, so that the kernel can start a corresponding operating system according to the first parameter, but since a boot file of each hard disk is not changed when a new hard disk is inserted or removed, a hard disk indicated by the first parameter is not a hard disk indicated before the new hard disk is inserted or removed, and therefore, according to the first parameter, the kernel may start an incorrect operating system. Only the scanning sequence of the target controller and the original first hard disk controller is exchanged, so that the change amplitude of scanning is minimum, and other hard disk controllers and other non-hard disk controllers are prevented from being influenced.
Therefore, in an alternative implementation, when the identification information includes the rank of the target controller in the second preset scanning order, this step may be implemented by: replacing the first parameter with the rank of the target controller in a second preset scanning sequence through the firmware; the first parameter is used for indicating a hard disk controller corresponding to a hard disk where an operating system to be started is located; and transmitting the replaced first parameter to a kernel to be started through the firmware.
That is, the firmware may replace the first parameter analyzed from the boot file with the rank of the target controller in the second preset scanning order, and then the firmware may transmit the replaced first parameter to the kernel to be started, so that the kernel may determine the target controller from the scanned hard disk controller according to the first parameter after the second PCI scanning, and then the kernel may start the operating system of the target hard disk for the target controller. In practical applications, the rank of the target controller in the second preset scanning order may be represented by the current disk identifier of the target hard disk, that is, the identification information may be the current disk identifier of the target hard disk.
In another optional implementation manner, when the identification information includes the controller information, this step may also be implemented by: the controller information is used as a second parameter and is transmitted to a kernel to be started through the firmware; the second parameter has a different attribute than the first parameter.
That is, the second parameter is different from the first parameter, and the second parameter may be used to instruct the kernel to adjust the order of the second PCI scan to enter the operating system of the target hard disk indicated by the second parameter. The firmware may pass controller information of the target controller as a second parameter to the kernel to be started. In practice, in one implementation, the processing logic of the firmware may be modified to pass both the first parameter and the second parameter, but the processing logic of the kernel may be modified to boot the operating system based only on the second parameter. In another implementation, the processing logic of the firmware may be modified to pass only the second parameter, but not the first parameter, and modify the processing logic of the kernel to start the operating system according to the second parameter, which is not specifically limited in this embodiment of the present invention.
After the kernel is started by the firmware, the kernel takes over the subsequent process, so that the firmware needs to prepare the parameters needing to be transmitted to the kernel to be started through the parameter transmission instruction before the kernel is started, so that the kernel to be started later acquires the parameters through the parameter transmission instruction. Because the mechanism for starting the kernel by the firmware is the kernel of the hard disk corresponding to the first hard disk controller for starting the PCI scanning, and in the embodiment of the invention, the first hard disk controller for PCI scanning is the target controller corresponding to the target hard disk, the kernel corresponding to the target hard disk can be started after the firmware transmits the parameters required by the kernel, and correspondingly, the transmitted parameters can be acquired by the kernel subsequently.
And step 209, loading and starting the kernel corresponding to the target hard disk through the firmware.
In the embodiment of the invention, after the firmware completes the pass-through and other necessary operations, the corresponding kernel of the target hard disk can be loaded and started. Because the mechanism of the firmware itself is to start the kernel of the hard disk corresponding to the first controller performing PCI scanning, the firmware can default to load and start the kernel corresponding to the target hard disk, that is, can start the correct kernel, when the target controller corresponding to the target hard disk is used as the first bit of the PCI scanning of the firmware.
Step 210, starting an operating system corresponding to the target hard disk through the kernel according to the identification information.
In the embodiment of the present invention, corresponding to two implementation manners in step 209, this step may also be implemented in two manners.
In an optional implementation manner, when the identification information includes a rank of the target controller in a second preset scanning order, this step includes: performing second external device interconnection scanning by the kernel according to the second preset scanning sequence; selecting the target controller from the scanned hard disk controllers through the kernel according to the ranking of the target controller in the second preset scanning sequence; determining the target hard disk corresponding to the target controller; and starting the operating system corresponding to the target hard disk through the kernel.
When the identification information includes the rank of the target controller in the second preset scanning sequence, the kernel can still perform second PCI scanning according to the original second preset scanning sequence, and after the kernel scanning is completed, the kernel can select the target controller from all scanned hard disk controllers according to the rank of the target controller in the second preset scanning sequence, so as to determine a target hard disk corresponding to the target controller, and the kernel can start an operating system corresponding to the target hard disk.
In another optional implementation manner, when the identification information includes the controller information, this step includes: when the interconnection scanning of the second external equipment is carried out through the kernel, the scanning sequence of the target controller corresponding to the controller information and a first hard disk controller in a second preset scanning sequence is exchanged; taking the target controller corresponding to the controller information as a first hard disk controller for interconnection scanning of the second external device, and scanning through the kernel; and starting the operating system corresponding to the target hard disk corresponding to the head hard disk controller which is interconnected and scanned by the second external equipment through the kernel.
When the identification information includes the controller information, the kernel may not scan according to the original second preset scanning order, but may adjust the second preset scanning order according to the controller information of the target controller in the PCI scanning process. That is, the scanning order of the target controller corresponding to the controller information and the first hard disk controller in the second preset scanning order are exchanged, so that the target controller can be set as the first scanned hard disk controller corresponding to the second PCI scanning process. Then, the kernel may directly start the operating system of the hard disk corresponding to the first scanned hard disk controller, and since the first scanned hard disk controller is the controller corresponding to the target hard disk at this time, the kernel starts the system corresponding to the target hard disk.
In addition, an embodiment of the present invention can also provide a method, where after a hard disk is added or deleted, an operating system corresponding to an onboard system disk is started, that is, the system disk can be mounted on a hard disk controller with the highest priority, that is, the hard disk controller that is scanned first, in a design stage of a processor board card, so that a firmware can start a correct kernel according to an original processing logic, and the kernel can start the correct operating system according to the original processing logic.
However, if the processor board card is not designed according to the method, or the default system disk is changed by the user after the processor board card is designed according to the method, the operating system starting method provided by the embodiment of the present invention may be applied to perform system starting, so that the electronic device can still start the correct kernel, and further start the correct operating system.
In the embodiment of the present invention, in a case where the firmware is running, the firmware may read a pre-stored target variable, where the target variable is used to indicate controller information of a target controller corresponding to a target hard disk that a user wants to start. When the firmware performs the process of interconnection scanning of the first external device, the target controller indicated by the target variable may be used as a first-order hard disk controller for scanning, so that the firmware may load and start the kernel corresponding to the target hard disk, that is, the kernel can be started to the correct kernel required by the user. In addition, the firmware can also transmit the identification information of the target controller to the kernel to be started before the kernel is started, and then the kernel can start the operating system corresponding to the target hard disk according to the identification information. Therefore, the electronic equipment can start the correct kernel required by the user, and further can start the correct operating system required by the user.
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 skilled 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 invention.
Referring to fig. 3, a block diagram of an embodiment of an os boot apparatus according to the present invention is shown, where the apparatus 300 may specifically include the following modules:
an operation module 301, configured to operate firmware;
a reading module 302, configured to read a pre-stored target variable through the firmware; the target variable is used for indicating the controller information of a target controller corresponding to the target hard disk;
a scanning module 303, configured to scan, when performing interconnection scanning to a first external device through the firmware, the target controller indicated by the target variable as a scanned first hard disk controller;
a parameter transmission module 304, configured to transmit, through the firmware, the identification information of the target controller to a kernel to be started;
a kernel starting module 305, configured to load and start a kernel corresponding to the target hard disk through the firmware;
and a system starting module 306, configured to start, according to the identification information, an operating system corresponding to the target hard disk through the kernel.
Optionally, the scanning module comprises:
the first interchange submodule is used for interchanging the scanning sequence of the target controller indicated by the target variable and a first hard disk controller in a first preset scanning sequence when the firmware is used for carrying out interconnection scanning on first external equipment;
and the first scanning submodule is used for taking the target controller indicated by the target variable as a first hard disk controller for the interconnection scanning of the first external equipment and scanning through the firmware.
Optionally, when the identification information includes a rank of the target controller in a second preset scanning order, the parameter transferring module includes:
the replacing submodule is used for replacing the first parameter with the ranking of the target controller in a second preset scanning sequence through the firmware; the first parameter is used for indicating a hard disk controller corresponding to a hard disk where an operating system to be started is located;
the first parameter module is used for transmitting the replaced first parameter to a kernel to be started through the firmware;
the system startup module comprises:
the second scanning submodule is used for carrying out interconnection scanning on second external equipment through the kernel according to the second preset scanning sequence;
the selection submodule is used for selecting the target controller from the scanned hard disk controllers through the kernel according to the ranking of the target controller in the second preset scanning sequence;
the determining submodule is used for determining the target hard disk corresponding to the target controller;
and the first starting submodule is used for starting the operating system corresponding to the target hard disk through the kernel.
Optionally, when the identification information includes the controller information, the parameter transferring module includes:
the second parameter transmission sub-module is used for transmitting the controller information serving as a second parameter to the kernel to be started through the firmware; the second parameter has a different attribute than the first parameter;
the system startup module comprises:
the second interchange submodule is used for interchanging the scanning sequence of the target controller corresponding to the controller information and the first hard disk controller in a second preset scanning sequence when the kernel performs interconnection scanning to a second external device;
the third scanning submodule is used for taking the target controller corresponding to the controller information as a first hard disk controller for interconnection scanning of the second external equipment and scanning through the kernel;
and the second starting submodule is used for starting the operating system corresponding to the target hard disk corresponding to the head hard disk controller which is interconnected and scanned by the second external device through the kernel.
Optionally, the apparatus further comprises:
the firmware starting module is used for starting and running the firmware under the condition that a new hard disk is inserted into or removed from the processor board card;
the acquisition module is used for acquiring the controller information of a target controller corresponding to the target hard disk when the selection instruction of the target hard disk is received through the firmware;
the storage module is used for storing the controller information to the target variable;
and the firmware restarting module is used for restarting the firmware so as to enable the saved controller information to be effective.
Optionally, the controller information includes a bus number, a device number, and a function number of the target controller corresponding to the target hard disk.
In the embodiment of the present invention, in a case where the firmware is running, the firmware may read a pre-stored target variable, where the target variable is used to indicate controller information of a target controller corresponding to a target hard disk that a user wants to start. When the firmware performs the process of interconnection scanning of the first external device, the target controller indicated by the target variable may be used as a first-order hard disk controller for scanning, so that the firmware may load and start the kernel corresponding to the target hard disk, that is, the kernel can be started to the correct kernel required by the user. In addition, the firmware can also transmit the identification information of the target controller to the kernel to be started before the kernel is started, and then the kernel can start the operating system corresponding to the target hard disk according to the identification information. Therefore, the electronic equipment can start the correct kernel required by the user, and further can start the correct operating system required by the user.
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. 4 is a block diagram illustrating an electronic device 400 for booting an operating system in accordance with an illustrative 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. 4, electronic device 400 may include one or more of the following components: processing components 402, memory 404, power components 406, multimedia components 408, audio components 410, input/output (I/O) interfaces 412, sensor components 414, and communication components 416.
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 element 402 may include one or more processors 420 to execute instructions to perform all or part 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.
The memory 404 is configured to store various types of data to support operations at the 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 memory 404 may be implemented by any type or combination of volatile or non-volatile memory 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 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 the 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 the temperature of the electronic device 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of a nearby object without 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 component 416 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 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 having instructions therein which, when executed by a processor of an electronic device, enable the electronic device to perform a method of operating system boot, the method comprising:
running the firmware;
reading a pre-stored target variable through the firmware; the target variable is used for indicating the controller information of a target controller corresponding to the target hard disk;
when the firmware scans the interconnection of the first external equipment, scanning the target controller indicated by the target variable as a first-bit hard disk controller of the scan;
transmitting the identification information of the target controller to a kernel to be started through the firmware;
loading and starting a kernel corresponding to the target hard disk through the firmware;
and starting an operating system corresponding to the target hard disk through the kernel according to the identification information.
Optionally, when performing interconnection scanning to a first external device through the firmware, scanning the target controller indicated by the target variable as a scanned first hard disk controller includes:
when the firmware is used for carrying out interconnection scanning to a first external device, the target controller indicated by the target variable is exchanged with the scanning sequence of a first hard disk controller in a first preset scanning sequence;
and taking the target controller indicated by the target variable as a first hard disk controller for interconnection scanning of the first external equipment, and scanning through the firmware.
Optionally, when the identification information includes a rank of the target controller in a second preset scanning order, the transmitting, by the firmware, the identification information of the target controller to a kernel to be started includes:
replacing the first parameter with the rank of the target controller in a second preset scanning sequence through the firmware; the first parameter is used for indicating a hard disk controller corresponding to a hard disk where an operating system to be started is located;
transmitting the replaced first parameter to a kernel to be started through the firmware;
the starting, by the kernel, the operating system corresponding to the target hard disk according to the identification information includes:
performing second external device interconnection scanning by the kernel according to the second preset scanning sequence;
selecting the target controller from the scanned hard disk controllers through the kernel according to the ranking of the target controller in the second preset scanning sequence;
determining the target hard disk corresponding to the target controller;
and starting the operating system corresponding to the target hard disk through the kernel.
Optionally, when the identification information includes the controller information, the transmitting, by the firmware, the identification information of the target controller to a kernel to be started includes:
the controller information is used as a second parameter and is transmitted to a kernel to be started through the firmware; the second parameter has a different attribute than the first parameter;
the starting, by the kernel, the operating system corresponding to the target hard disk according to the identification information includes:
when the interconnection scanning of the second external equipment is carried out through the kernel, the scanning sequence of the target controller corresponding to the controller information and a first hard disk controller in a second preset scanning sequence is exchanged;
taking the target controller corresponding to the controller information as a first hard disk controller for interconnection scanning of the second external device, and scanning through the kernel;
and starting the operating system corresponding to the target hard disk corresponding to the head hard disk controller which is interconnected and scanned by the second external equipment through the kernel.
Optionally, before the executing the firmware, the method further includes:
starting and running the firmware under the condition that a new hard disk is inserted into or removed from a processor board card;
when a selection instruction of the target hard disk is received through the firmware, controller information of a target controller corresponding to the target hard disk is acquired;
saving the controller information to the target variable;
restarting the firmware to validate the saved controller information.
Optionally, the controller information includes a bus number, a device number, and a function number of the target controller corresponding to the target hard disk.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled 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 terminal 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 preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the 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 phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The above detailed description is provided for an operating system starting method and apparatus, an electronic device, and a storage medium, and the specific examples are applied herein to explain the principles and embodiments of the present invention, and the descriptions of the above embodiments are only used to help understand the method and the core ideas of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (14)

1. An operating system boot method, comprising:
running the firmware;
reading a pre-stored target variable through the firmware; the target variable is used for indicating the controller information of a target controller corresponding to the target hard disk;
when the firmware scans the interconnection of the first external equipment, scanning the target controller indicated by the target variable as a first-bit hard disk controller of the scan;
transmitting the identification information of the target controller to a kernel to be started through the firmware;
loading and starting a kernel corresponding to the target hard disk through the firmware;
and starting an operating system corresponding to the target hard disk through the kernel according to the identification information.
2. The method of claim 1, wherein scanning the target controller indicated by the target variable as a scanned head disk controller when scanning to a first external device interconnect through the firmware comprises:
when the firmware is used for carrying out interconnection scanning to a first external device, the target controller indicated by the target variable is exchanged with the scanning sequence of a first hard disk controller in a first preset scanning sequence;
and taking the target controller indicated by the target variable as a first hard disk controller for interconnection scanning of the first external equipment, and scanning through the firmware.
3. The method of claim 1, wherein when the identification information includes a rank of the target controller in a second preset scan order, the passing, by the firmware, the identification information of the target controller to a kernel to be started comprises:
replacing the first parameter with the rank of the target controller in a second preset scanning sequence through the firmware; the first parameter is used for indicating a hard disk controller corresponding to a hard disk where an operating system to be started is located;
transmitting the replaced first parameter to a kernel to be started through the firmware;
the starting, by the kernel, the operating system corresponding to the target hard disk according to the identification information includes:
performing second external device interconnection scanning by the kernel according to the second preset scanning sequence;
selecting the target controller from the scanned hard disk controllers through the kernel according to the ranking of the target controller in the second preset scanning sequence;
determining the target hard disk corresponding to the target controller;
and starting the operating system corresponding to the target hard disk through the kernel.
4. The method of claim 3, wherein when the identification information includes the controller information, the passing, by the firmware, the identification information of the target controller to a kernel to be started comprises:
the controller information is used as a second parameter and is transmitted to a kernel to be started through the firmware; the second parameter has a different attribute than the first parameter;
the starting, by the kernel, the operating system corresponding to the target hard disk according to the identification information includes:
when the interconnection scanning of the second external equipment is carried out through the kernel, the scanning sequence of the target controller corresponding to the controller information and a first hard disk controller in a second preset scanning sequence is exchanged;
taking the target controller corresponding to the controller information as a first hard disk controller for interconnection scanning of the second external device, and scanning through the kernel;
and starting the operating system corresponding to the target hard disk corresponding to the head hard disk controller which is interconnected and scanned by the second external equipment through the kernel.
5. The method of claim 1, wherein prior to the executing the firmware, further comprising:
starting and running the firmware under the condition that a new hard disk is inserted into or removed from a processor board card;
when a selection instruction of the target hard disk is received through the firmware, controller information of a target controller corresponding to the target hard disk is acquired;
saving the controller information to the target variable;
restarting the firmware to validate the saved controller information.
6. The method according to any one of claims 1 to 5, wherein the controller information includes a bus number, a device number, and a function number of the target controller corresponding to the target hard disk.
7. An operating system boot apparatus, comprising:
the operation module is used for operating the firmware;
the reading module is used for reading a prestored target variable through the firmware; the target variable is used for indicating the controller information of a target controller corresponding to the target hard disk;
the scanning module is used for scanning the target controller indicated by the target variable as a scanned first hard disk controller when the firmware is used for carrying out interconnection scanning on a first external device;
the parameter transmission module is used for transmitting the identification information of the target controller to a kernel to be started through the firmware;
the kernel starting module is used for loading and starting a kernel corresponding to the target hard disk through the firmware;
and the system starting module is used for starting the operating system corresponding to the target hard disk through the kernel according to the identification information.
8. The apparatus of claim 7, wherein the scanning module comprises:
the first interchange submodule is used for interchanging the scanning sequence of the target controller indicated by the target variable and a first hard disk controller in a first preset scanning sequence when the firmware is used for carrying out interconnection scanning on first external equipment;
and the first scanning submodule is used for taking the target controller indicated by the target variable as a first hard disk controller for the interconnection scanning of the first external equipment and scanning through the firmware.
9. The apparatus of claim 7, wherein when the identification information includes a ranking of the target controller in a second preset scanning order, the parameter transferring module comprises:
the replacing submodule is used for replacing the first parameter with the ranking of the target controller in a second preset scanning sequence through the firmware; the first parameter is used for indicating a hard disk controller corresponding to a hard disk where an operating system to be started is located;
the first parameter module is used for transmitting the replaced first parameter to a kernel to be started through the firmware;
the system startup module comprises:
the second scanning submodule is used for carrying out interconnection scanning on second external equipment through the kernel according to the second preset scanning sequence;
the selection submodule is used for selecting the target controller from the scanned hard disk controllers through the kernel according to the ranking of the target controller in the second preset scanning sequence;
the determining submodule is used for determining the target hard disk corresponding to the target controller;
and the first starting submodule is used for starting the operating system corresponding to the target hard disk through the kernel.
10. The apparatus of claim 9, wherein when the identification information comprises the controller information, the parameter module comprises:
the second parameter transmission sub-module is used for transmitting the controller information serving as a second parameter to the kernel to be started through the firmware; the second parameter has a different attribute than the first parameter;
the system startup module comprises:
the second interchange submodule is used for interchanging the scanning sequence of the target controller corresponding to the controller information and the first hard disk controller in a second preset scanning sequence when the kernel performs interconnection scanning to a second external device;
the third scanning submodule is used for taking the target controller corresponding to the controller information as a first hard disk controller for interconnection scanning of the second external equipment and scanning through the kernel;
and the second starting submodule is used for starting the operating system corresponding to the target hard disk corresponding to the head hard disk controller which is interconnected and scanned by the second external device through the kernel.
11. The apparatus of claim 7, further comprising:
the firmware starting module is used for starting and running the firmware under the condition that a new hard disk is inserted into or removed from the processor board card;
the acquisition module is used for acquiring the controller information of a target controller corresponding to the target hard disk when the selection instruction of the target hard disk is received through the firmware;
the storage module is used for storing the controller information to the target variable;
and the firmware restarting module is used for restarting the firmware so as to enable the saved controller information to be effective.
12. The apparatus according to any one of claims 7 to 11, wherein the controller information includes a bus number, a device number, and a function number of the target controller corresponding to the target hard disk.
13. An electronic device comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors the one or more programs including instructions for:
running the firmware;
reading a pre-stored target variable through the firmware; the target variable is used for indicating the controller information of a target controller corresponding to the target hard disk;
when the firmware scans the interconnection of the first external equipment, scanning the target controller indicated by the target variable as a first-bit hard disk controller of the scan;
transmitting the identification information of the target controller to a kernel to be started through the firmware;
loading and starting a kernel corresponding to the target hard disk through the firmware;
and starting an operating system corresponding to the target hard disk through the kernel according to the identification information.
14. A readable storage medium, characterized in that instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the operating system boot method according to one or more of method claims 1-6.
CN202010131076.3A 2020-02-28 2020-02-28 Operating system starting method and device, electronic equipment and storage medium Pending CN113326069A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010131076.3A CN113326069A (en) 2020-02-28 2020-02-28 Operating system starting method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010131076.3A CN113326069A (en) 2020-02-28 2020-02-28 Operating system starting method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113326069A true CN113326069A (en) 2021-08-31

Family

ID=77412924

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010131076.3A Pending CN113326069A (en) 2020-02-28 2020-02-28 Operating system starting method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113326069A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114020681A (en) * 2021-10-25 2022-02-08 苏州浪潮智能科技有限公司 Method, device and system for distributing logical drive letter, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1373871A (en) * 1999-08-23 2002-10-09 泰拉斯普林公司 Extensible computing system
CN101364305A (en) * 2007-08-07 2009-02-11 索尼株式会社 Electronic apparatus, motion vector detecting method, and program therefor
CN103246534A (en) * 2013-04-12 2013-08-14 深信服网络科技(深圳)有限公司 Method and device for migrating operating system
CN104199751A (en) * 2014-08-27 2014-12-10 山东超越数控电子有限公司 System identification method of backup redundant hard disk in blade servers
CN104572139A (en) * 2013-10-10 2015-04-29 腾讯科技(深圳)有限公司 Method and device for accelerating starting of application program
CN109918096A (en) * 2019-03-20 2019-06-21 浪潮商用机器有限公司 A kind of installation method of server operating system, system and associated component
CN110569106A (en) * 2019-08-27 2019-12-13 Oppo广东移动通信有限公司 Code loading method and device, electronic equipment and computer readable medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1373871A (en) * 1999-08-23 2002-10-09 泰拉斯普林公司 Extensible computing system
CN101364305A (en) * 2007-08-07 2009-02-11 索尼株式会社 Electronic apparatus, motion vector detecting method, and program therefor
CN103246534A (en) * 2013-04-12 2013-08-14 深信服网络科技(深圳)有限公司 Method and device for migrating operating system
CN104572139A (en) * 2013-10-10 2015-04-29 腾讯科技(深圳)有限公司 Method and device for accelerating starting of application program
CN104199751A (en) * 2014-08-27 2014-12-10 山东超越数控电子有限公司 System identification method of backup redundant hard disk in blade servers
CN109918096A (en) * 2019-03-20 2019-06-21 浪潮商用机器有限公司 A kind of installation method of server operating system, system and associated component
CN110569106A (en) * 2019-08-27 2019-12-13 Oppo广东移动通信有限公司 Code loading method and device, electronic equipment and computer readable medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114020681A (en) * 2021-10-25 2022-02-08 苏州浪潮智能科技有限公司 Method, device and system for distributing logical drive letter, electronic equipment and storage medium
CN114020681B (en) * 2021-10-25 2023-11-10 苏州浪潮智能科技有限公司 Method, device and system for distributing logical drive letter, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
JP6072362B2 (en) Application program processing method, apparatus, program, and storage medium
RU2618937C2 (en) Updating method, device and unit for updates
US9886264B2 (en) Method and device for upgrading firmware
EP3032412A1 (en) Method and device for upgrading firmware
EP3065428A1 (en) Method and device for displaying wifi list
US20170068527A1 (en) Device control method and apparatus
CN103916468B (en) Method for upgrading system, terminal, server and upgrade-system
CN105094904A (en) Application program installation method and device
CN111966410B (en) Start-up processing method and device, electronic equipment and storage medium
CN110851057A (en) Method and device for configuring configuration options of BIOS
RU2630371C2 (en) Firmware update method and device
CN108280342B (en) Application synchronization method and device for application synchronization
US9781198B2 (en) Information processing method and electronic device
CN113326069A (en) Operating system starting method and device, electronic equipment and storage medium
KR20130107844A (en) Apparatus and method for controlling auto focus function in electronic device
CN111198706A (en) Method for updating system function, apparatus for updating system function and storage medium
CN114885322A (en) Switch module, terminal control method and device, equipment and storage medium
CN111813426A (en) Fingerprint data processing method and device
CN110659081B (en) File processing method and device for program object and electronic equipment
CN114816974A (en) System generation method and device, electronic equipment and storage medium
CN110990073B (en) Method and device for verifying customization requirements of application program
CN107463414B (en) Application installation method and device
CN107992333B (en) Theme acquisition method and device
CN115729634A (en) BIOS starting method and device and electronic equipment
CN115129282A (en) Display module identification method and device, terminal and storage 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