On x64 platform my system booted successfully.However,when I trying to cross compile the system to other platform such as AArch64,My pascal code failed to boot and this error was located to my procedure efi_initialize that is just a statement that ParentImageHandle:=InputImageHandle;.I cannot understand why this code raises error,it is just a variable=value statement.Why this code is wrong as it is returned a great value for $8000000000000000?
This is my code that error occurs:
Code: Select all
program uefiloader;
{$MODE FPC}
uses uefi,binarybase,bootconfig,graphics;
function efi_main(ImageHandle:efi_handle;systemtable:Pefi_system_table):efi_status;{$ifdef cpux86_64}MS_ABI_Default;{$endif}{$ifdef cpui386}cdecl;{$endif}[public,alias:'_start'];
var {For checking elf file}
sfsp:Pefi_simple_file_system_protocol;
fp:Pefi_file_protocol;
efsl:efi_file_system_list;
i,j,count,procindex:natuint;
status:efi_status;
finfo:efi_file_info;
finfosize:natuint;
proccontent:Pointer;
procsize:natuint;
partstr:PWideChar;
gpl:efi_graphics_list;
isgraphics:boolean;
loaderscreenconfig:screen_config;
{For elf structure}
header:elf64_header;
program_headers:^elf64_program_header;
LowAddress,HighAddress:qword;
PageCount:qword;
KernelRelocateBase:qword;
RelocateOffset:qword;
ZeroStart:^qword;
SourceStart,DestStart:^byte;
KernelEntry:Pointer;
bool:array[1..4] of boolean;
{For loading elf files}
initparam:Psys_parameter_item;
param:sys_parameter;
func:sys_parameter_function;
funcandparam:sys_parameter_function_and_parameter;
res:Pointer;
{For memory initializtion}
memorymap:efi_memory_map;
memoryavailable:efi_memory_result;
addressoffset:natuint;
allocaddress:natuint;
begin
{Initialize the uefi loader}
efi_initialize(ImageHandle,systemtable);{Where the error occurs}
efi_console_initialize(efi_bck_black,efi_lightgrey,0);
efsl:=efi_list_all_file_system(2);
My Repository is on the github:https://github.com/TYDQSoft/UEFIPascalOS.