Background
Conventionally, when a PC (Personal Computer) is powered on, a preset BIOS (Basic Input Output System, a Computer boot firmware specification existing when the PC appears) program is executed, and the program is responsible for searching for a proper boot device and loading an operating System installed on the boot device. Firmware boot under UEFI (Universal Extensible Firmware Interface-the current PC default new computer boot Firmware specification) specification becomes the current factory default setting for the PC. The diskless development also follows the trend, and the development is changed from the original support of only BIOS boot to the support of UEFI boot at the same time.
Diskless systems, broadly referred to as local area networks, are comprised of diskless workstations. Compared with a common PC, the diskless workstation can start and run an operating system without any external memory (such as a floppy disk drive, a hard disk, an optical disk and the like) support. To support such a network architecture, a specialized software system is required, which becomes one of the components of the overall diskless system.
In order to support UEFI boot, in the prior art, an open source software iPXE (an open source support diskless firmware boot program) code is used for modification, and the UEFI environment is self-contained in the iPXE source code instead of the UEFI environment provided by the PC. However, this prior art has the following problems: boot loader used by the diskless Boot operating system is a UEFI environment simulated by an iPX, is not a UEFI environment provided by a PC (personal computer) and is based on an open source software iPX, and does not comply with open source protocol rules (such as authorization or source code disclosure).
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a UEFI diskless starting method.
The purpose of the invention is realized by the following technical scheme: a UEFI diskless boot method comprises the following steps:
the method comprises the steps that when a client is started, a UEFI network boot environment is entered;
a network Boot firmware program in a UEFI environment acquires an IP address through a DHCP, and requests a server disk mirror image service module to download a UEFI Boot loader through a TFTP;
executing the downloaded Boot loader in the UEFI environment;
after the Boot loader is executed, acquiring PXE environment and network card software and hardware information of a local computer, and communicating with a service end by using UDP (user datagram protocol) or TCP (transmission control protocol) under UEFI (unified extensible firmware interface) PXE environment;
after the Boot loader of the UEFI finishes the auxiliary work, the operating system is to be guided; under the UEFI environment, a simulated disk drive of a UEFI specification is required to be provided, and the disk drive at least needs to realize an EFI _ BLOCK _ IO _ PROTOCOL PROTOCOL and an EFI _ BLOCK _ IO2_ PROTOCOL PROTOCOL specified by the UEFI specification; before booting, the UEFI Boot loader downloads and loads a UEFI virtual disk drive from a server disk mirror image service module through a network;
the UEFI virtual disk drive registers a virtual disk interface in a UEFI environment, and then the reading and writing of the disk are performed from a server disk mirror image service module through a network by using a UDP (user datagram protocol) or TCP (transmission control protocol) protocol provided by the UEFI environment;
the UEFI Boot loader finds the Boot files of the operating system from the virtual disk according to the UEFI specification, and loads and executes the Boot files of the operating system;
and the UEFI operating system loads the core and the driver according to the built-in flow and continues to execute.
Furthermore, the server disk image service module is also used for providing the reading and writing of the disk image and the management of the image restore point.
The invention has the beneficial effects that: the invention aims to deeply understand UEFI specification, and combines the prior diskless technology to realize a UEFI diskless starting scheme of an autonomous technology, wherein a Boot loader uses a UEFI environment of a PC, and a network protocol used by the Boot loader is also provided by the UEFI environment of the PC; the problem that the USB flash drive cannot be started without a disk under the UEFI environment is solved, namely the UEFI environment of the PC is supported, the UEFI environment of iPXE simulation is also supported, and meanwhile, the problem of open source protocol constraint does not exist.
Detailed Description
The technical scheme of the invention is further described in detail by combining the attached drawings:
the embodiment needs the following modules to cooperate together to realize:
the server-side disk mirror image service module is used for reading and writing a disk mirror image and managing a mirror image recovery point;
the UEFI Boot loader at the client is responsible for identifying a UEFI environment, guiding an operating system of a UEFI version and reading and writing a disk image before loading the kernel of the operating system;
UEFI virtual disk drive.
As shown in fig. 1, a UEFI diskless boot method includes the following steps:
the method comprises the steps that when a client is started, a UEFI network boot environment is entered;
a network Boot firmware program in a UEFI environment acquires an IP address through a DHCP, and requests a server disk mirror image service module to download a UEFI Boot loader through a TFTP;
executing the downloaded Boot loader in the UEFI environment;
after the Boot loader is executed, acquiring PXE environment and network card software and hardware information of a local computer, and communicating with a service end by using UDP (user datagram protocol) or TCP (transmission control protocol) under UEFI (unified extensible firmware interface) PXE environment;
after the Boot loader of the UEFI finishes the auxiliary work, the operating system is to be guided; reporting a virtual disk through a hook INT 13 under the traditional BIOS environment, and converting disk reading and writing into network reading and writing; in the UEFI environment, a simulated disk drive of the UEFI specification needs to be provided, where the disk drive needs to at least implement the EFI _ BLOCK _ IO _ progress PROTOCOL and the EFI _ BLOCK _ IO2_ progress PROTOCOL specified in the UEFI specification (iPXE implements a simplified UEFI environment, and the disk drive completely complies with the UEFI specification and also supports the UEFI environment of the iPXE); therefore, before booting, the UEFI Boot loader downloads and loads a UEFI virtual disk drive from a server disk mirror image service module through a network;
the UEFI virtual disk drive registers a virtual disk interface in a UEFI environment, and then the reading and writing of the disk are performed from a server disk mirror image service module through a network by using a UDP (user datagram protocol) or TCP (transmission control protocol) protocol provided by the UEFI environment;
the UEFI Boot loader finds the Boot files of the operating system from the virtual disk according to the UEFI specification, and loads and executes the Boot files of the operating system;
and the UEFI operating system loads the core and the driver according to the built-in flow and continues to execute.
While the present invention has been described by way of examples, and not by way of limitation, other variations of the disclosed embodiments, as would be readily apparent to one of skill in the art, are intended to be within the scope of the present invention, as defined by the claims.