Implement new module providing a basic support for PE/COFF executables
This commit is contained in:
21
xtldr/modules/pecoff/includes/globals.h
Normal file
21
xtldr/modules/pecoff/includes/globals.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* PROJECT: ExectOS
|
||||
* COPYRIGHT: See COPYING.md in the top level directory
|
||||
* FILE: xtldr/modules/pecoff/includes/globals.h
|
||||
* DESCRIPTION: Basic PE/COFF executable file format support global variables
|
||||
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
|
||||
*/
|
||||
|
||||
#ifndef __XTLDR_PECOFF_GLOBALS_H
|
||||
#define __XTLDR_PECOFF_GLOBALS_H
|
||||
|
||||
#include <xtblapi.h>
|
||||
|
||||
|
||||
/* XTOS PE/COFF Image Protocol */
|
||||
EXTERN XTBL_EXECUTABLE_IMAGE_PROTOCOL PeCoffProtocol;
|
||||
|
||||
/* EFI XT Loader Protocol */
|
||||
EXTERN PXTBL_LOADER_PROTOCOL XtLdrProtocol;
|
||||
|
||||
#endif /* __XTLDR_PECOFF_GLOBALS_H */
|
68
xtldr/modules/pecoff/includes/pecoff.h
Normal file
68
xtldr/modules/pecoff/includes/pecoff.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/**
|
||||
* PROJECT: ExectOS
|
||||
* COPYRIGHT: See COPYING.md in the top level directory
|
||||
* FILE: xtldr/modules/pecoff/includes/pecoff.h
|
||||
* DESCRIPTION: Basic PE/COFF executable file format support header
|
||||
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
|
||||
*/
|
||||
|
||||
#ifndef __XTLDR_PECOFF_H
|
||||
#define __XTLDR_PECOFF_H
|
||||
|
||||
#include <xtblapi.h>
|
||||
#include <globals.h>
|
||||
|
||||
|
||||
/* PE/COFF image protocol related routines forward references */
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
PeGetEntryPoint(IN PVOID ImagePointer,
|
||||
OUT PVOID *EntryPoint);
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
PeGetMachineType(IN PVOID ImagePointer,
|
||||
OUT PUSHORT MachineType);
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
PeGetSection(IN PVOID ImagePointer,
|
||||
IN PCHAR SectionName,
|
||||
OUT PULONG *RawData);
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
PeGetSubSystem(IN PVOID ImagePointer,
|
||||
OUT PUSHORT SubSystem);
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
PeGetVersion(IN PVOID ImagePointer,
|
||||
OUT PUSHORT Version);
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
PeLoadImage(IN PEFI_FILE_HANDLE FileHandle,
|
||||
IN LOADER_MEMORY_TYPE MemoryType,
|
||||
IN PVOID VirtualAddress,
|
||||
OUT PVOID *ImagePointer);
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
PeRelocateImage(IN PVOID ImagePointer,
|
||||
IN EFI_VIRTUAL_ADDRESS Address);
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
PeVerifyImage(IN PVOID ImagePointer);
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
PepRelocateLoadedImage(IN PPECOFF_IMAGE_CONTEXT Image);
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
BlXtLdrModuleMain(IN EFI_HANDLE ImageHandle,
|
||||
IN PEFI_SYSTEM_TABLE SystemTable);
|
||||
|
||||
#endif /* __XTLDR_PECOFF_H */
|
Reference in New Issue
Block a user