diff --git a/freeldr/freeldr/CHANGELOG b/freeldr/freeldr/CHANGELOG index 91ddeb42673..d3d358339c5 100644 --- a/freeldr/freeldr/CHANGELOG +++ b/freeldr/freeldr/CHANGELOG @@ -1,3 +1,9 @@ +Changes in v1.7.12 (12/05/2002) (brianp) + +- Minor tweak to UI code to allow description + text to be displayed along with the progress + bar. + Changes in v1.7.11 (12/05/2002) (brianp) - Added memory map count to GetBiosMemoryMap() so that diff --git a/freeldr/freeldr/include/ui.h b/freeldr/freeldr/include/ui.h index e4150b536a1..d9e2ffe0d25 100644 --- a/freeldr/freeldr/include/ui.h +++ b/freeldr/freeldr/include/ui.h @@ -67,8 +67,8 @@ VOID UiInfoBox(PUCHAR MessageText); // Displays a info box on the screen VOID UiMessageBox(PUCHAR MessageText); // Displays a message box on the screen with an ok button VOID UiMessageBoxCritical(PUCHAR MessageText); // Displays a message box on the screen with an ok button using no system resources VOID UiMessageLine(PUCHAR MessageText); // Adds a line of text to the message box buffer -VOID UiDrawProgressBarCenter(U32 Position, U32 Range); // Draws the progress bar showing nPos percent filled -VOID UiDrawProgressBar(U32 Left, U32 Top, U32 Right, U32 Bottom, U32 Position, U32 Range); // Draws the progress bar showing nPos percent filled +VOID UiDrawProgressBarCenter(U32 Position, U32 Range, PUCHAR ProgressText); // Draws the progress bar showing nPos percent filled +VOID UiDrawProgressBar(U32 Left, U32 Top, U32 Right, U32 Bottom, U32 Position, U32 Range, PUCHAR ProgressText); // Draws the progress bar showing nPos percent filled VOID UiShowMessageBoxesInSection(PUCHAR SectionName); // Displays all the message boxes in a given section UCHAR UiTextToColor(PUCHAR ColorText); // Converts the text color into it's equivalent color value diff --git a/freeldr/freeldr/include/version.h b/freeldr/freeldr/include/version.h index af32c3cb26a..1ec4d6b1d2c 100644 --- a/freeldr/freeldr/include/version.h +++ b/freeldr/freeldr/include/version.h @@ -22,7 +22,7 @@ /* just some stuff */ -#define VERSION "FreeLoader v1.7.11" +#define VERSION "FreeLoader v1.7.12" #define COPYRIGHT "Copyright (C) 1998-2002 Brian Palmer " #define AUTHOR_EMAIL "" #define BY_AUTHOR "by Brian Palmer" @@ -36,7 +36,7 @@ // #define FREELOADER_MAJOR_VERSION 1 #define FREELOADER_MINOR_VERSION 7 -#define FREELOADER_PATCH_VERSION 11 +#define FREELOADER_PATCH_VERSION 12 PUCHAR GetFreeLoaderVersionString(VOID); diff --git a/freeldr/freeldr/linuxboot.c b/freeldr/freeldr/linuxboot.c index 762b236b50d..43aecfc4bdd 100644 --- a/freeldr/freeldr/linuxboot.c +++ b/freeldr/freeldr/linuxboot.c @@ -50,6 +50,7 @@ UCHAR LinuxCommandLine[260] = ""; U32 LinuxCommandLineSize = 0; PVOID LinuxKernelLoadAddress = NULL; PVOID LinuxInitrdLoadAddress = NULL; +UCHAR LinuxBootDescription[80]; VOID LoadAndBootLinux(PUCHAR OperatingSystemName) { @@ -59,15 +60,15 @@ VOID LoadAndBootLinux(PUCHAR OperatingSystemName) UiDrawBackdrop(); - UiDrawStatusText("Loading Linux..."); - UiDrawProgressBarCenter(0, 100); - // Parse the .ini file section if (!LinuxParseIniSection(OperatingSystemName)) { goto LinuxBootFailed; } + UiDrawStatusText(LinuxBootDescription); + UiDrawProgressBarCenter(0, 100, LinuxBootDescription); + // Open the boot volume if (!FsOpenVolume(BootDrive, BootPartition)) { @@ -147,11 +148,13 @@ VOID LoadAndBootLinux(PUCHAR OperatingSystemName) LinuxSetupSector->LoadFlags = 0; } + getch(); RtlCopyMemory((PVOID)0x90000, LinuxBootSector, 512); RtlCopyMemory((PVOID)0x90200, LinuxSetupSector, SetupSectorSize); RtlCopyMemory((PVOID)0x99000, LinuxCommandLine, LinuxCommandLineSize); UiUnInitialize("Booting Linux..."); + getch(); DiskStopFloppyMotor(); @@ -228,6 +231,16 @@ BOOL LinuxParseIniSection(PUCHAR OperatingSystemName) return FALSE; } + if (IniReadSettingByName(SectionId, "Name", SettingValue, 260)) + { + RemoveQuotes(SettingValue); + sprintf(LinuxBootDescription, "Loading %s..."); + } + else + { + strcpy(LinuxBootDescription, "Loading Linux..."); + } + BootDrive = atoi(SettingValue); BootPartition = 0; @@ -392,7 +405,7 @@ BOOL LinuxReadKernel(PFILE LinuxKernelFile) BytesLoaded += LINUX_READ_CHUNK_SIZE; LoadAddress += LINUX_READ_CHUNK_SIZE; - UiDrawProgressBarCenter(BytesLoaded, LinuxKernelSize + LinuxInitrdSize); + UiDrawProgressBarCenter(BytesLoaded, LinuxKernelSize + LinuxInitrdSize, LinuxBootDescription); } return TRUE; @@ -465,7 +478,7 @@ BOOL LinuxReadInitrd(PFILE LinuxInitrdFile) BytesLoaded += LINUX_READ_CHUNK_SIZE; LinuxInitrdLoadAddress += LINUX_READ_CHUNK_SIZE; - UiDrawProgressBarCenter(BytesLoaded + LinuxKernelSize, LinuxInitrdSize + LinuxKernelSize); + UiDrawProgressBarCenter(BytesLoaded + LinuxKernelSize, LinuxInitrdSize + LinuxKernelSize, LinuxBootDescription); } return TRUE; diff --git a/freeldr/freeldr/reactos/reactos.c b/freeldr/freeldr/reactos/reactos.c index 5d2cb17153c..55e2ca11f87 100644 --- a/freeldr/freeldr/reactos/reactos.c +++ b/freeldr/freeldr/reactos/reactos.c @@ -71,7 +71,7 @@ LoadKernel(PCHAR szFileName, int nPos) */ MultiBootLoadKernel(FilePointer); - UiDrawProgressBarCenter(nPos, 100); + UiDrawProgressBarCenter(nPos, 100, "Loading ReactOS..."); return(TRUE); } @@ -135,7 +135,7 @@ LoadSymbolFile(PCHAR szSystemRoot, */ MultiBootLoadModule(FilePointer, SymbolFileName, NULL); - UiDrawProgressBarCenter(nPos, 100); + UiDrawProgressBarCenter(nPos, 100, "Loading ReactOS..."); return (TRUE); } @@ -172,7 +172,7 @@ LoadDriver(PCHAR szFileName, int nPos) */ MultiBootLoadModule(FilePointer, szFileName, NULL); - UiDrawProgressBarCenter(nPos, 100); + UiDrawProgressBarCenter(nPos, 100, "Loading ReactOS..."); return(TRUE); } @@ -527,7 +527,7 @@ LoadAndBootReactOS(PUCHAR OperatingSystemName) UiDrawBackdrop(); UiDrawStatusText("Loading..."); - UiDrawProgressBarCenter(0, 100); + UiDrawProgressBarCenter(0, 100, "Loading ReactOS..."); /* * Try to open boot drive @@ -654,7 +654,7 @@ LoadAndBootReactOS(PUCHAR OperatingSystemName) RegInitializeRegistry(); RegImportHive(Base, Size); - UiDrawProgressBarCenter(15, 100); + UiDrawProgressBarCenter(15, 100, "Loading ReactOS..."); DbgPrint((DPRINT_REACTOS, "SystemHive loaded at 0x%x size %u", (unsigned)Base, (unsigned)Size)); /* @@ -666,7 +666,7 @@ LoadAndBootReactOS(PUCHAR OperatingSystemName) RegExportHive("\\Registry\\Machine\\HARDWARE", Base, &Size); MultiBootCloseModule(Base, Size); #endif - UiDrawProgressBarCenter(20, 100); + UiDrawProgressBarCenter(20, 100, "Loading ReactOS..."); /* * Initialize the 'currentControlSet' link @@ -687,7 +687,7 @@ LoadAndBootReactOS(PUCHAR OperatingSystemName) LoadSymbolFile(szBootPath, szKernelName, 25); LoadSymbolFile(szBootPath, szHalName, 25); - UiDrawProgressBarCenter(25, 100); + UiDrawProgressBarCenter(25, 100, "Loading ReactOS..."); /* * Load boot drivers diff --git a/freeldr/freeldr/ui/tui.c b/freeldr/freeldr/ui/tui.c index bdc17932024..4465201d394 100644 --- a/freeldr/freeldr/ui/tui.c +++ b/freeldr/freeldr/ui/tui.c @@ -608,7 +608,7 @@ VOID TuiMessageBoxCritical(PUCHAR MessageText) } -VOID TuiDrawProgressBarCenter(U32 Position, U32 Range) +VOID TuiDrawProgressBarCenter(U32 Position, U32 Range, PUCHAR ProgressText) { U32 Left, Top, Right, Bottom; U32 Width = 50; // Allow for 50 "bars" @@ -620,14 +620,17 @@ VOID TuiDrawProgressBarCenter(U32 Position, U32 Range) Top += 2; Bottom = Top + Height + 1; - TuiDrawProgressBar(Left, Top, Right, Bottom, Position, Range); + TuiDrawProgressBar(Left, Top, Right, Bottom, Position, Range, ProgressText); } -VOID TuiDrawProgressBar(U32 Left, U32 Top, U32 Right, U32 Bottom, U32 Position, U32 Range) +VOID TuiDrawProgressBar(U32 Left, U32 Top, U32 Right, U32 Bottom, U32 Position, U32 Range, PUCHAR ProgressText) { U32 i; U32 ProgressBarWidth = (Right - Left) - 3; + // First make sure the progress bar text fits + UiTruncateStringEllipsis(ProgressText, ProgressBarWidth - 4); + if (Position > Range) { Position = Range; @@ -637,7 +640,8 @@ VOID TuiDrawProgressBar(U32 Left, U32 Top, U32 Right, U32 Bottom, U32 Position, TuiDrawBox(Left, Top, Right, Bottom, VERT, HORZ, TRUE, TRUE, ATTR(UiMenuFgColor, UiMenuBgColor)); // Draw the "Loading..." text - TuiDrawText(70/2, Top+1, "Loading...", ATTR(UiTextColor, UiMenuBgColor)); + //TuiDrawText(70/2, Top+1, "Loading...", ATTR(UiTextColor, UiMenuBgColor)); + TuiDrawCenteredText(Left + 2, Top + 2, Right - 2, Top + 2, ProgressText, ATTR(UiTextColor, UiMenuBgColor)); // Draw the percent complete for (i=0; i<(Position*ProgressBarWidth)/Range; i++) diff --git a/freeldr/freeldr/ui/tui.h b/freeldr/freeldr/ui/tui.h index 3767894da2f..9dc7231fb37 100644 --- a/freeldr/freeldr/ui/tui.h +++ b/freeldr/freeldr/ui/tui.h @@ -43,8 +43,8 @@ VOID TuiSaveScreen(PUCHAR Buffer); // Saves the screen so that it can be r VOID TuiRestoreScreen(PUCHAR Buffer); // Restores the screen from a previous save VOID TuiMessageBox(PUCHAR MessageText); // Displays a message box on the screen with an ok button VOID TuiMessageBoxCritical(PUCHAR MessageText); // Displays a message box on the screen with an ok button using no system resources -VOID TuiDrawProgressBarCenter(U32 Position, U32 Range); // Draws the progress bar showing nPos percent filled -VOID TuiDrawProgressBar(U32 Left, U32 Top, U32 Right, U32 Bottom, U32 Position, U32 Range); // Draws the progress bar showing nPos percent filled +VOID TuiDrawProgressBarCenter(U32 Position, U32 Range, PUCHAR ProgressText); // Draws the progress bar showing nPos percent filled +VOID TuiDrawProgressBar(U32 Left, U32 Top, U32 Right, U32 Bottom, U32 Position, U32 Range, PUCHAR ProgressText); // Draws the progress bar showing nPos percent filled UCHAR TuiTextToColor(PUCHAR ColorText); // Converts the text color into it's equivalent color value UCHAR TuiTextToFillStyle(PUCHAR FillStyleText); // Converts the text fill into it's equivalent fill value diff --git a/freeldr/freeldr/ui/ui.c b/freeldr/freeldr/ui/ui.c index b15c2faaf0e..7c2bb460fee 100644 --- a/freeldr/freeldr/ui/ui.c +++ b/freeldr/freeldr/ui/ui.c @@ -503,29 +503,29 @@ UCHAR UiTextToFillStyle(PUCHAR FillStyleText) } } -VOID UiDrawProgressBarCenter(U32 Position, U32 Range) +VOID UiDrawProgressBarCenter(U32 Position, U32 Range, PUCHAR ProgressText) { if (UiDisplayMode == DISPLAYMODE_TEXT) { - TuiDrawProgressBarCenter(Position, Range); + TuiDrawProgressBarCenter(Position, Range, ProgressText); } else { UNIMPLEMENTED(); - //GuiDrawProgressBarCenter(Position, Range); + //GuiDrawProgressBarCenter(Position, Range, ProgressText); } } -VOID UiDrawProgressBar(U32 Left, U32 Top, U32 Right, U32 Bottom, U32 Position, U32 Range) +VOID UiDrawProgressBar(U32 Left, U32 Top, U32 Right, U32 Bottom, U32 Position, U32 Range, PUCHAR ProgressText) { if (UiDisplayMode == DISPLAYMODE_TEXT) { - TuiDrawProgressBar(Left, Top, Right, Bottom, Position, Range); + TuiDrawProgressBar(Left, Top, Right, Bottom, Position, Range, ProgressText); } else { UNIMPLEMENTED(); - //GuiDrawProgressBar(Left, Top, Right, Bottom, Position, Range); + //GuiDrawProgressBar(Left, Top, Right, Bottom, Position, Range, ProgressText); } } diff --git a/freeldr/freeldr/video/pixel.c b/freeldr/freeldr/video/pixel.c index 3736b625fa3..158f6e76437 100644 --- a/freeldr/freeldr/video/pixel.c +++ b/freeldr/freeldr/video/pixel.c @@ -34,6 +34,16 @@ // get this code to work and I have absolutely // no idea why... // +// Someone else can take up this portion of the +// boot loader because my give up... +// +// I was going to store the offscreen buffer as +// a big array of bytes (as opposed to four bits) +// and that makes it a bit easier to set a pixel +// on the offscreen buffer, but will have to be +// handled in the VideoCopyOffScreenBufferToVRAM() +// function. +// VOID VideoSetPixel16(U32 X, U32 Y, U8 Color) { U8 CurrentColor;