# HG changeset patch # User taiki # Date 1359666992 -32400 # Node ID 2013da6b32113debbe4586b14aef96b45bb14d12 # Parent ac5d699b9787239bd28225f94683f2d51696f2d3 start to write reading part. diff -r ac5d699b9787 -r 2013da6b3211 boot/bootx64.c --- a/boot/bootx64.c Tue Jan 29 14:45:00 2013 +0900 +++ b/boot/bootx64.c Fri Feb 01 06:16:32 2013 +0900 @@ -107,6 +107,8 @@ return status; } + /* alloc */ + SetMem(proto, sizeof(EFI_HANDLE), 0); uefi_call_wrapper(BS->LocateHandle, 5, ByProtocol, &proto, NULL, &size, NULL); @@ -133,6 +135,12 @@ return EFI_SUCCESS; } + +static inline void +start_kernel() +{ +} + /* start cbc kernel boot loader. */ EFI_STATUS @@ -148,7 +156,8 @@ Print(L"Set watchdog timer.\n"); EFI_STATUS status = uefi_call_wrapper(BS->HandleProtocol, 3, image, &LoadedImageProtocol, (VOID **) &info); - if (efi_error(L"Load error.\n", status)) { + if (EFI_ERROR(status)) { + Print(L"Load error.\n"); return EFI_LOAD_ERROR; } @@ -159,6 +168,13 @@ UINTN fd; open(kname, &fd, &fs); + load_mach_o(); + + UINTN cookie = 0; + uefi_call_wrapper(BS->ExitBootServices, 2, image, cookie); + + start_kernel(); + status = EFI_SUCCESS; return status; } diff -r ac5d699b9787 -r 2013da6b3211 boot/bootx64.efi Binary file boot/bootx64.efi has changed