The purpose of this article is to briefly introduce the UEFI module mechanism:
BIOS is a program that is cured on a computer motherboard, the main function is to initialize the motherboard, and finally load the operating system (OS), and the Uefi popular point is a BIOS specification, it proposes a BIOS implementation architecture and provides a set of open source implementation.
We know that the module mechanism of Linux is to define the entry point of the module through macros (refer to:Linux Learning note kernel initiation process and module mechanism ), and the UEFI module mechanism is easier to understand, each of its modules has an INF file, which describes the details of the module , such as the entry point (Entry function), which source file the module contains, and so on.
Take the USB drive as an example: \mdemodulepkg\bus\usb\usbmassstoragedxe\ (a module of UEFI is a directory)
Usbmassstoragedxe.inf
1 ##2 [defines]3Inf_version =0x000100054Base_name =Usbmassstoragedxe5Module_uni_file =Usbmassstoragedxe.uni6File_guid = 9fb4b4a7-42c0-4bcd-8540-9bcc6711f83e7Module_type =Uefi_driver8Version_string =1.09 Entry_point=UsbmassstorageentrypointTen One ## - [Sources] - UsbMassBoot.h the UsbMassImpl.h - UsbMassBot.h - usbmassbot.c - componentname.c + usbmassimpl.c - usbmassboot.c + ....
Entry_point Indicates the entry point of the module, which is run from the Usbmassstorageentrypoint () function when the module is run.
[Sources] contains the source files for the module.
How are these modules loaded and run?
First, when you build the system, the. fdf. dsc file indicates which modules we want to include (to include a module, add the path of the corresponding INF file to the two files, which are similar to the makefile file), and then, during the execution of the code, or the DXE phase, The entry point of the DXE phase is Dxemain (), after performing some necessary initialization, the Coredispatcher () is executed, and Coredispatcher () is responsible for locating all the modules in the system and performing their entry functions.
The most important phase of the UEFI architecture is the DXE phase, which is similar to the implementation of Linux. Personally, Uefi is designed to derive a lot of inspiration from the design ideas of Linux (such as Linux using macros to specify the module's entry point).
The UEFI module mechanism for BIOS learning notes