[ROSLOAD]: Implement most of OslMain, which will try to initialize BootLib in Virtual...
authorAlex Ionescu <aionescu@gmail.com>
Sun, 5 Feb 2017 06:02:11 +0000 (06:02 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Sun, 5 Feb 2017 06:02:11 +0000 (06:02 +0000)
[BOOTLIB]: Fix GCC build.
Bootmgr now correctly switches execution into rosload, which must now be implemented.

svn path=/trunk/; revision=73693

reactos/boot/environ/app/rosload/rosload.c
reactos/boot/environ/lib/firmware/efi/firmware.c
reactos/boot/environ/lib/misc/image.c

index 000cbee..7db6cef 100644 (file)
@@ -33,7 +33,22 @@ OslMain (
     _In_ PBOOT_APPLICATION_PARAMETER_BLOCK BootParameters
     )
 {
-    EfiPrintf(L"ReactOS UEFI OS Loader Initializing...\r\n");
-    return STATUS_NOT_IMPLEMENTED;
+    BL_LIBRARY_PARAMETERS LibraryParameters;
+    NTSTATUS Status;
+
+    /* Setup the boot library parameters for this application */
+    BlSetupDefaultParameters(&LibraryParameters);
+    LibraryParameters.TranslationType = BlVirtual;
+    LibraryParameters.LibraryFlags = BL_LIBRARY_FLAG_INITIALIZATION_COMPLETED;
+    LibraryParameters.MinimumAllocationCount = 1024;
+    LibraryParameters.MinimumHeapSize = 2 * 1024 * 1024;
+    LibraryParameters.HeapAllocationAttributes = 0x20000;
+    LibraryParameters.FontBaseDirectory = L"\\Reactos\\Boot\\Fonts";
+    LibraryParameters.DescriptorCount = 512;
+    Status = BlInitializeLibrary(BootParameters, &LibraryParameters);
+
+    //EfiPrintf(L"ReactOS UEFI OS Loader Initializing...\r\n");
+    EfiConOut->OutputString(EfiConOut, L"ReactOS UEFI OS Loader Initializing...\r\n");
+    return Status;
 }
 
index a88095d..be4e02e 100644 (file)
@@ -1758,7 +1758,7 @@ BlpFwInitialize (
             /* FIXME: Not supported */
             Status = STATUS_NOT_SUPPORTED;
         }
-        else if (FirmwareData->Version >= 2)
+        else if (FirmwareData->Version >= BL_FIRMWARE_DESCRIPTOR_VERSION)
         {
             /* Version 2 -- save the data */
             EfiFirmwareData = *FirmwareData;
index 2b4fb84..61f8797 100644 (file)
@@ -22,7 +22,7 @@ KDESCRIPTOR IdtRegister;
 KDESCRIPTOR BootAppGdtRegister;
 KDESCRIPTOR BootAppIdtRegister;
 PVOID BootApp32EntryRoutine;
-PVOID BootApp32Parameters;
+PBOOT_APPLICATION_PARAMETER_BLOCK BootApp32Parameters;
 PVOID BootApp32Stack;
 
 /* FUNCTIONS *****************************************************************/
@@ -1710,7 +1710,7 @@ ImgpInitializeBootApplicationParameters (
     ParameterBlock->Signature[1] = BOOT_APPLICATION_SIGNATURE_2;
     ParameterBlock->MemoryTranslationType = MmTranslationType;
     ParameterBlock->ImageType = IMAGE_FILE_MACHINE_I386;
-    ParameterBlock->ImageBase = (ULONGLONG)ImageBase;
+    ParameterBlock->ImageBase = (ULONG_PTR)ImageBase;
     ParameterBlock->ImageSize = NtHeaders->OptionalHeader.SizeOfImage;
 
     /* Get the offset to the memory data */
@@ -1870,9 +1870,6 @@ ImgArchEfiStartBootApplication (
         /* Disable the kernel debugger */
         BlBdStop();
 #endif
-        /* Not yet implemented. This is the last step! */
-        EfiPrintf(L"EFI APPLICATION START!!!\r\n");
-
         /* Make it so */
         Archx86TransferTo32BitApplicationAsm();