Mercurial > hg > Members > taiki > EFIKernel
view boot/bootx64.c @ 13:479240de2d64
fix mach-o header
author | taiki |
---|---|
date | Tue, 22 Jan 2013 02:47:24 +0900 |
parents | e6715e03b87a |
children | ac5d699b9787 |
line wrap: on
line source
#include <efi.h> #include <efilib.h> #include "mach-o/loader.h" EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *system_table) { InitializeLib(image, system_table); /* EFI_LOADED_IMAGE *loaded_image = NULL; EFI_GUID loaded_image_protocol = LOADED_IMAGE_PROTOCOL; EFI_STATUS status; uefi_call_wrapper(BS->SetWatchdogTimer, 4, 0, 0x0, 0, NULL); status = uefi_call_wrapper( system_table->BootServices->HandleProtocol, 3, image, &loaded_image_protocol, (void **) &loaded_image); if (EFI_ERROR(status)) { Print(L"handleprotocol: %r\n", status); } Print(L"Image base: %lx\n", loaded_image->ImageBase); Print(L"Image size: %lx\n", loaded_image->ImageSize); Print(L"Image file: %s\n", DevicePathToStr(loaded_image->FilePath)); */ Print(L"Hello, World\n"); return EFI_SUCCESS; }