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.

svn path=/trunk/; revision=3824
This commit is contained in:
Brian Palmer 2002-12-06 04:43:02 +00:00
parent f54c214e8e
commit 0853d8cf3d
9 changed files with 61 additions and 28 deletions

View file

@ -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

View file

@ -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

View file

@ -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 <brianp@sginet.com>"
#define AUTHOR_EMAIL "<brianp@sginet.com>"
#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);

View file

@ -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;

View file

@ -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

View file

@ -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++)

View file

@ -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

View file

@ -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);
}
}

View file

@ -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;