UEFI规范中对UEFI Driver的介绍有两章分别是第2章overview(2.5节Uefi Driver Model)和第10章Uefi Driver Model详细介绍,对UEFI类型的驱动即UEFI Driver的实现方式进行了规定,下面结合代码以PS2键盘驱动的实现为例,对UEFI Driver 的实现方式进行介绍,详细如下:
1、PS2键盘驱动的组成:
1)PS2键盘驱动函数实现在Ps2Keyboard.c里面,Ps2Keyboard.c包含在Ps2KeyboardDxe.inf模块里,如图1所示;
2)打开Ps2KeyboardDxe.inf文件,可知该“模块”的入口点为InitializePs2Keyboard();函数,如图2所示,该函数的具体实现即图1中InitializePs2Keyboard();函数;
3)InitializePs2Keyboard();函数中通过EfiLibInstallDriverBindingComponentName2();函数将 gKeyboardControllerDriver()函数注册到Iange Handle上(驱动程序通过LoadIma