diff options
Diffstat (limited to 'documentation/UEFI_from_spec/EFI_IMAGE_ENTRY_POINT')
-rw-r--r-- | documentation/UEFI_from_spec/EFI_IMAGE_ENTRY_POINT | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/documentation/UEFI_from_spec/EFI_IMAGE_ENTRY_POINT b/documentation/UEFI_from_spec/EFI_IMAGE_ENTRY_POINT new file mode 100644 index 0000000..4f9044e --- /dev/null +++ b/documentation/UEFI_from_spec/EFI_IMAGE_ENTRY_POINT @@ -0,0 +1,97 @@ +System Table contains pointers to the active concole devices, a pointer to the Boot Services Table, +a pointer to the Runtime Services Table, and a pointer to the list of system configuration tables such as +ACPI, SMBIOS and the SAL System Table. + +Entry point is the same for UEFI applications and UEDI drivers. + + +PROTOTYPE + typedef + EFI_STATUS + (EFIAPI *EFI_IMAGE_ENTRY_POINT) ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTabel + ); + +PARAMETERS + ImageHandle The firmware allocated handle for the UEFI image + SystemTable A pointer to the EFI System Table. Contains standard output and input handles, + plus pointers to the EFI_BOOT_SERVICES and EFI RUNTIME_SERVICES tables. + The service tables contain the entry points in the firmware for accessing the core EFI system + functionality. The handles in the system table are used to obtain basci access to the console. + In addition, the System Table contains pointers to other standard tables that a loaded image + may use if the associated pointers are initialized to nonzero values. + Example of such tables: ACPI, SMBIOS, SAL System Table, ... + + + +If the UEFI image is a UEFI application that is not a UEFI OS loader, then the application executes and +either returns or calls the EFI Boot Services EFI_BOOT_SERVICES.Exit(). A UEFI application is always +unloaded from memory when it exits, and its return status is returned to the component that started the +UEFI application. + +EFI_TABLE_HEADER +Datastructure that precedes all of the standard EFI table types + +typedef struct { + UINT64 Signature; + UINT32 Revision; + UINT32 HeaderSize; + UINT32 CRC32; + UINT32 Reserved; + } EFI_TABLE_HEADER; + + +EFI_SYSTEM_TABLE +Except for the table header, all elements in the service tables are pointers to functions as defined +in Section7 (Services - Boot Services) and Section8 (Services - Runtime Services). + +Prior to a call to EFI_BOOT_SERVICES.ExitBootServices(), all of the fields of the EFI System Table are valid. +After an operating system has taken control of the platform with a call to ExitBootServices(), pmöy +Hdr, FirmwareVendor, FirmwareRevision, RuntimeServices, NumberOfTableEntries, ConfigurationTable fields +are valid. + +typedef struct { + EFI_TABLE_HEADER Hdr; + CHAR16 *FirmwareVendor; + UINT32 FirmwareRevision; + EFI_HANDLE ConsoleInHandle; + EFI_SIMPLE_TEXT_INPUT_PROTOCOL *ConIn; + EFI_HANDLE ConsoleOutHandle; + EFI_SYSTEM_TEXT_OUTPUT_PROTOCOL *ConOut; + EFI_HANDLE StandardErrorHandle; + EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *stdErr; + EFI_RUNTIME_SERVICES *RuntimeServices: + EFI_BOOT_SERVICES *BootServices; + UINTN NumberOfTableEntries; + EFI_CONFIGURATION_TABLE *Configuration_Table; + } EFI_SYSTEM_TABLE; + +PARAMETERS + ConcoleHandle The handle for the active console input device. This handle must support + EFI_SIMPLE_TEXT_INPUT_PROTOCOL and EFI_SIMPLE_TECT_INPUT_EX_PROTOCOL. + ConIn A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL interface that is + associated with ConsoleInHandle. + ConsoleOutHandle The handle for the active console output device. This handle must + EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL. + ConOut A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface that is + associated with ConsoleOutHandle. + StandardErrorHandle The handle for the active standard error console device. Must support + EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL. + StdErr A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL inte4rface that is + assiciated with StandardErrorHandle + RuntimeServices A pointer to the EFI Runtime Services Table (Section 4.5) + BootServices Section 4.4 + NumberOfTableEntries Number of system configuration tables in the buffer ConfigurationTable + ConfigurationTable A pointer to the system configuration tables. Number of entries in the table is + NumberOfTableEntries. + + + + + + + + +References +[1] UEFI Specification 2.8 Errata A, February 2020 - 4.1 UEFI Image Entry Point - pp 89 |