From 0348b64178cca66759d4585ad59651af25be046a Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Sun, 5 Feb 2017 22:17:07 +0000 Subject: [PATCH] [BOOTMGR]: Fix more gcc warnings. Maybe we should stop building GCC with /Wall but MSVC with /Wnothing? [BOOTLIB]: Hack EfiPrintf temporarily so we can get print outs even in "Protected mode". [ROSLOAD]: Begin implementation. First, many bootlib fixes needed. svn path=/trunk/; revision=73720 --- reactos/boot/environ/app/bootmgr/bootmgr.c | 7 +++---- reactos/boot/environ/app/rosload/rosload.c | 3 +-- reactos/boot/environ/lib/firmware/efi/firmware.c | 5 +++++ reactos/boot/environ/lib/mm/mm.c | 4 ++++ 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/reactos/boot/environ/app/bootmgr/bootmgr.c b/reactos/boot/environ/app/bootmgr/bootmgr.c index c901b71a80d..b1f22a8a332 100644 --- a/reactos/boot/environ/app/bootmgr/bootmgr.c +++ b/reactos/boot/environ/app/bootmgr/bootmgr.c @@ -2901,7 +2901,6 @@ BmMain ( { NTSTATUS Status; PHYSICAL_ADDRESS PhysicalAddress, PhysicalAddress2; - PBL_MEMORY_DESCRIPTOR Found; /* Allocate 1 physical page */ PhysicalAddress.QuadPart = 0; @@ -2913,7 +2912,7 @@ BmMain ( } /* Write some data */ - *(PULONG)PhysicalAddress.QuadPart = 0x55555151; + *(PULONG)((ULONG_PTR)PhysicalAddress.QuadPart) = 0x55555151; /* Free it */ Status = BlMmFreePhysicalPages(PhysicalAddress); @@ -2940,9 +2939,9 @@ BmMain ( } /* The data should still be there, since zero-ing is not on for bootmgr */ - if (*(PULONG)PhysicalAddress2.QuadPart != 0x55555151) + if (*(PULONG)((ULONG_PTR)PhysicalAddress2.QuadPart) != 0x55555151) { - EfiPrintf(L"FAIL: Non-matching data: %lx %lx\r\n", 0x55555151, *(PULONG)PhysicalAddress2.QuadPart); + EfiPrintf(L"FAIL: Non-matching data: %lx %lx\r\n", 0x55555151, *(PULONG)((ULONG_PTR)PhysicalAddress2.QuadPart)); EfiStall(100000000); } diff --git a/reactos/boot/environ/app/rosload/rosload.c b/reactos/boot/environ/app/rosload/rosload.c index 7db6cef1400..012b811ce0f 100644 --- a/reactos/boot/environ/app/rosload/rosload.c +++ b/reactos/boot/environ/app/rosload/rosload.c @@ -47,8 +47,7 @@ OslMain ( 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"); + EfiPrintf(L"ReactOS UEFI OS Loader Initializing...\r\n"); return Status; } diff --git a/reactos/boot/environ/lib/firmware/efi/firmware.c b/reactos/boot/environ/lib/firmware/efi/firmware.c index be4e02e29d3..ea96ca11b23 100644 --- a/reactos/boot/environ/lib/firmware/efi/firmware.c +++ b/reactos/boot/environ/lib/firmware/efi/firmware.c @@ -144,6 +144,11 @@ EfiPrintf ( else { /* FIXME: @TODO: Not yet supported */ + // FIXME: Hack while we are in early rosload mode + if (EfiConOut != NULL) + { + EfiConOut->OutputString(EfiConOut, BlScratchBuffer); + } } /* All done */ diff --git a/reactos/boot/environ/lib/mm/mm.c b/reactos/boot/environ/lib/mm/mm.c index bfa9caeef94..cb4ceea11c2 100644 --- a/reactos/boot/environ/lib/mm/mm.c +++ b/reactos/boot/environ/lib/mm/mm.c @@ -349,6 +349,7 @@ BlpMmInitialize ( LibraryParameters->MinimumAllocationCount); if (!NT_SUCCESS(Status)) { + EfiPrintf(L"PA Mm init failed: %lx\r\n", Status); goto Quickie; } @@ -356,6 +357,7 @@ BlpMmInitialize ( Status = MmTrInitialize(); if (!NT_SUCCESS(Status)) { + EfiPrintf(L"TR Mm init failed: %lx\r\n", Status); //MmArchDestroy(); //MmPaDestroy(1); goto Quickie; @@ -380,6 +382,7 @@ BlpMmInitialize ( if (!NT_SUCCESS(Status)) { /* Kill everything set setup so far */ + EfiPrintf(L"Phase 1 Mm init failed: %lx\r\n", Status); //MmPaDestroy(0); //MmTrDestroy(); //MmArchDestroy(); @@ -415,6 +418,7 @@ BlpMmInitialize ( if (!NT_SUCCESS(Status)) { /* Go back to static descriptors and kill the heap */ + EfiPrintf(L"Phase 2 Mm init failed: %lx\r\n", Status); //MmMdpSwitchToStaticDescriptors(); //HapInitializationStatus = 0; //++MmDescriptorCallTreeCount;