Working with Protocols(使用Protocol)
Any EFI code can operate with protocols during boot time.
任何EFI的程式碼都可以在開機時期運用protocol。
However, af-ter ExitBootServices() is called, the handle database is no longer available.
然而,在ExitBootServices()被呼叫之後,handle database就不再可用。
Several EFI boot time services work with EFI protocols.
一些EFI開機時期的系統服務是使用protocol來運作的。
Multiple Protocol Instances
A handle may have many protocols attached to it.
一個handle可能有需許多protocol附加在它身上。
However, it may have only one protocol of each type.
然而,每一種類型的protocol只能有一個。
In other words, a handle may not have more than one instance of the exact same protocol.
換句話說,一個handle不能有多個完全一樣的protocol。
Otherwise, it would make requests for a particular protocol on a handle nondeterministic.
否則,它將會使得對某一個protocol的請求,處於不確定的處理狀態。
However, drivers may create multiple instances of a particular protocol and attach each instance to a different handle.
然而,驅動程式可以產生多組特定protocol的實體,並將它們附加於不同的handle中。
The PCI I/O Protocol fits this scenario, where the PCI bus driver installs a PCI I/O Protocol instance for each PCI device.
PCI I/O Protocol就適用於此狀況,在PCI bus驅動程式裡,會安裝每一個PCI裝置的PCI I/O Protocol實體。
Each instance of the PCI I/O Protocol is configured with data values that are unique to that PCI device, including the location and size of the EFI Option ROM (OpROM) image.
每一個PCI I/O Protocol的實體會配置屬於PCI裝置的資料,包含EFI OpROM映像檔的位址與大小。
Also, each driver can install customized versions of the same protocol as long as they do not use the same handle.
而且,每個驅動程式可以安裝相同protocol的客製化版本,只要它們不是使用相同的handle。
For example, each EFI driver installs the Component Name Protocol on its driver image handle, yet when the EFI_COMPONENT_NAME_PROTOCOL.GetDriverName() function is called, each handle returns the unique name of the driver that owns that image handle.
例如,每一個驅動程式(EFI driver)都會安裝在驅動程式映像檔資源表(driver image handle)的Component Name Protocol,在EFI_COMPONENT_NAME_PROTOCOL.GetDriverName()函式被呼叫時,每一個handle都會回傳驅動程式自身的映像檔資源表(image handle)上的名稱。
The EFI_COMPONENT_NAME_PROTOCOL.GetDriverName() function on the USB bus driver handle returns “USB bus driver” for the English language, but on the PXE driver handle it returns “PXE base code driver.”
在USB匯流排驅動程式資源表(USB bus driver handle)上的EFI_COMPONENT_NAME_PROTOCOL.GetDriverName()函式,就會回傳“USB bus driver”的英文字,但是在PXE階段的驅動程式資源表(PXE driver handle)卻會回傳“PXE base code driver.”。
沒有留言:
張貼留言