diff --git a/drivers/base/bootvid/CMakeLists.txt b/drivers/base/bootvid/CMakeLists.txt index 4a48107ed629b..1b08c11c5122d 100644 --- a/drivers/base/bootvid/CMakeLists.txt +++ b/drivers/base/bootvid/CMakeLists.txt @@ -1,29 +1,11 @@ spec2def(bootvid.dll bootvid.spec ADD_IMPORTLIB) -if((ARCH STREQUAL "i386") OR (ARCH STREQUAL "amd64")) - if(SARCH STREQUAL "pc98") - list(APPEND SOURCE - i386/pc98/pc98.h - i386/pc98/bootvid.c) - elseif(SARCH STREQUAL "xbox") - list(APPEND SOURCE - i386/xbox/xbox.h - i386/xbox/bootvid.c) - else() - list(APPEND SOURCE - i386/pc/pc.h - i386/pc/cmdcnst.h - i386/pc/bootvid.c - i386/pc/bootdata.c - i386/pc/vga.h - i386/pc/vga.c) - endif() -elseif(ARCH STREQUAL "arm") - list(APPEND SOURCE - arm/arm.h - arm/bootvid.c) -endif() +set(SOURCE) + +list(APPEND SOURCE + framebuf/framebuf.h + framebuf/bootvid.c) list(APPEND SOURCE common.c @@ -40,8 +22,3 @@ add_importlibs(bootvid ntoskrnl hal) add_pch(bootvid precomp.h SOURCE) add_dependencies(bootvid psdk) add_cd_file(TARGET bootvid DESTINATION reactos/system32 NO_CAB FOR all) - - -## TEMPORARY HACKISH WAY TO COMPILE A SEPARATE FBBVID.DLL ## -## Used for UEFI or when (SARCH STREQUAL "xbox") -include(fbbvid.cmake) diff --git a/drivers/base/bootvid/framebuf/bootvid.c b/drivers/base/bootvid/framebuf/bootvid.c index b49333c5e4a34..588aef76eeaf5 100644 --- a/drivers/base/bootvid/framebuf/bootvid.c +++ b/drivers/base/bootvid/framebuf/bootvid.c @@ -157,54 +157,31 @@ VidInitialize( } /* Convert from bus-relative to physical address, and map it into system space */ - PHYSICAL_ADDRESS TranslatedAddress; + // PHYSICAL_ADDRESS TranslatedAddress; ULONG AddressSpace = 0; - if (!HalTranslateBusAddress(Interface, - BusNumber, - FrameBuffer, - &AddressSpace, - &TranslatedAddress)) + DPRINT1("Framebuffer %p\n", FrameBuffer.QuadPart); + FrameBufferStart = (ULONG_PTR)MmMapIoSpace(FrameBuffer, + gBootDisp.BufferSize, + MmNonCached); + if (!FrameBufferStart) { - DPRINT1("Could not map 0x%p\n", FrameBuffer.QuadPart); + DPRINT1("Out of memory!\n"); goto Failure; } - - if (AddressSpace == 0) - { - FrameBufferStart = (ULONG_PTR)MmMapIoSpace(TranslatedAddress, - gBootDisp.BufferSize, - MmNonCached); - if (!FrameBufferStart) - { - DPRINT1("Out of memory!\n"); - goto Failure; - } - } - else - { - /* The base is the translated address, no need to map */ - FrameBufferStart = (ULONG_PTR)TranslatedAddress.LowPart; // Yes, LowPart. - } + DPRINT1("Framebuffer mapped %p\n", FrameBufferStart); /* * Reserve off-screen area for the backbuffer that contains * 8-bit indexed color screen image, plus preserved row data. */ - ULONG BackBufferSize = SCREEN_WIDTH * (SCREEN_HEIGHT + (BOOTCHAR_HEIGHT + 1)); /* If there is enough video memory in the physical framebuffer, * place the backbuffer in the hidden part of the framebuffer, * otherwise allocate a zone for the backbuffer. */ - if (gBootDisp.BufferSize >= FrameBufferSize + BackBufferSize) - { - /* Place backbuffer in the hidden part of framebuffer */ - BackBuffer = (PUCHAR)(FrameBufferStart + gBootDisp.BufferSize - BackBufferSize); - } - else // if (gBootDisp.BufferSize - FrameBufferSize < BackBufferSize) - { + /* Allocate framebuffer. 600kb works out to 640x480@16bpp */ - SIZE_T BackBufferSize = 600 * 1024; + SIZE_T BackBufferSize = gBootDisp.BufferSize; // PHYSICAL_ADDRESS PhysicalAddress; // PhysicalAddress.QuadPart = -1; // BackBuffer = MmAllocateContiguousMemory(BackBufferSize, PhysicalAddress); @@ -214,12 +191,13 @@ VidInitialize( DPRINT1("Out of memory!\n"); goto Failure; } - } - + + DPRINT1("everyting is setup\n"); /* Now check if we have to set the mode */ if (SetMode) VidResetDisplay(TRUE); + DPRINT1("VidInitialize return true\n"); /* Video is ready */ return TRUE; @@ -249,9 +227,6 @@ VidResetDisplay( VidpCurrentY = 0; /* Clear the screen with HAL if we were asked to */ - if (HalReset) - HalResetDisplay(); - /* Re-initialize the palette and fill the screen black */ RtlZeroMemory((PVOID)FrameBufferStart, gBootDisp.BufferSize); InitializePalette();