mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 05:52:57 +00:00
[FREELDR] Replace some macros/inline functions and global variables with functions
This allows to easily import them from a 2nd stage loader without having to bother about _declspec(dllimport)
This commit is contained in:
parent
aa46e0f0a7
commit
2f9dde09e1
27 changed files with 216 additions and 90 deletions
|
@ -40,4 +40,25 @@ ArcGetRelativeTime(VOID)
|
|||
return ret;
|
||||
}
|
||||
|
||||
PCONFIGURATION_COMPONENT_DATA
|
||||
MachHwDetect(_In_opt_ PCSTR Options)
|
||||
{
|
||||
return MachVtbl.HwDetect(Options);
|
||||
}
|
||||
|
||||
VOID MachPrepareForReactOS(VOID)
|
||||
{
|
||||
MachVtbl.PrepareForReactOS();
|
||||
}
|
||||
|
||||
VOID MachGetExtendedBIOSData(PULONG ExtendedBIOSDataArea, PULONG ExtendedBIOSDataSize)
|
||||
{
|
||||
MachVtbl.GetExtendedBIOSData(ExtendedBIOSDataArea, ExtendedBIOSDataSize);
|
||||
}
|
||||
|
||||
VOID MachVideoGetFontsFromFirmware(PULONG RomFontPointers)
|
||||
{
|
||||
MachVtbl.VideoGetFontsFromFirmware(RomFontPointers);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -243,3 +243,18 @@ FldrCreateComponentKey(
|
|||
/* Return the child */
|
||||
*ComponentKey = ComponentData;
|
||||
}
|
||||
|
||||
ULONG ArcGetDiskCount(VOID)
|
||||
{
|
||||
return reactos_disk_count;
|
||||
}
|
||||
|
||||
PARC_DISK_SIGNATURE_EX ArcGetDiskInfo(ULONG Index)
|
||||
{
|
||||
if (Index >= reactos_disk_count)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &reactos_arc_disk_info[Index];
|
||||
}
|
||||
|
|
|
@ -25,6 +25,11 @@ DBG_DEFAULT_CHANNEL(HWDETECT);
|
|||
|
||||
BOOLEAN AcpiPresent = FALSE;
|
||||
|
||||
BOOLEAN IsAcpiPresent(VOID)
|
||||
{
|
||||
return AcpiPresent;
|
||||
}
|
||||
|
||||
static PRSDP_DESCRIPTOR
|
||||
FindAcpiBios(VOID)
|
||||
{
|
||||
|
|
|
@ -24,6 +24,11 @@ BOOLEAN AcpiPresent = FALSE;
|
|||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
BOOLEAN IsAcpiPresent(VOID)
|
||||
{
|
||||
return AcpiPresent;
|
||||
}
|
||||
|
||||
static
|
||||
PRSDP_DESCRIPTOR
|
||||
FindAcpiBios(VOID)
|
||||
|
|
|
@ -85,7 +85,7 @@ WarnDeprecated(
|
|||
CHAR msgString[300];
|
||||
|
||||
/* If the user didn't cancel the timeout, don't display the warning */
|
||||
if (BootMgrInfo.TimeOut >= 0)
|
||||
if (GetBootMgrInfo()->TimeOut >= 0)
|
||||
return;
|
||||
|
||||
va_start(ap, MsgFmt);
|
||||
|
@ -183,6 +183,7 @@ BuildArgvForOsLoader(
|
|||
PCHAR* Argv;
|
||||
PCHAR* Args;
|
||||
PCHAR SettingName, SettingValue;
|
||||
PCCHAR BootPath = FrLdrGetBootPath();
|
||||
|
||||
*pArgc = 0;
|
||||
|
||||
|
@ -208,7 +209,7 @@ BuildArgvForOsLoader(
|
|||
/* i == 0: Program name */
|
||||
// TODO: Provide one in the future...
|
||||
/* i == 1: SystemPartition : from where FreeLdr has been started */
|
||||
Size += (strlen("SystemPartition=") + strlen(FrLdrBootPath) + 1) * sizeof(CHAR);
|
||||
Size += (strlen("SystemPartition=") + strlen(BootPath) + 1) * sizeof(CHAR);
|
||||
/* i == 2: LoadIdentifier : ASCII string that may be used
|
||||
* to associate an identifier with a set of load parameters */
|
||||
if (LoadIdentifier)
|
||||
|
@ -236,7 +237,7 @@ BuildArgvForOsLoader(
|
|||
/* i == 1: SystemPartition */
|
||||
{
|
||||
strcpy(SettingName, "SystemPartition=");
|
||||
strcat(SettingName, FrLdrBootPath);
|
||||
strcat(SettingName, BootPath);
|
||||
|
||||
*Args++ = SettingName;
|
||||
SettingName += (strlen(SettingName) + 1);
|
||||
|
@ -333,7 +334,7 @@ MainBootMenuKeyPressFilter(
|
|||
IN PVOID Context OPTIONAL)
|
||||
{
|
||||
/* Any key-press cancels the global timeout */
|
||||
BootMgrInfo.TimeOut = -1;
|
||||
GetBootMgrInfo()->TimeOut = -1;
|
||||
|
||||
switch (KeyPress)
|
||||
{
|
||||
|
@ -394,7 +395,7 @@ VOID RunLoader(VOID)
|
|||
#endif
|
||||
|
||||
/* Debugger main initialization */
|
||||
DebugInit(BootMgrInfo.DebugString);
|
||||
DebugInit(GetBootMgrInfo()->DebugString);
|
||||
|
||||
/* UI main initialization */
|
||||
if (!UiInitialize(TRUE))
|
||||
|
@ -427,7 +428,7 @@ VOID RunLoader(VOID)
|
|||
}
|
||||
|
||||
/* Find all the message box settings and run them */
|
||||
UiShowMessageBoxesInSection(BootMgrInfo.FrLdrSection);
|
||||
UiShowMessageBoxesInSection(GetBootMgrInfo()->FrLdrSection);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
|
@ -442,7 +443,7 @@ VOID RunLoader(VOID)
|
|||
OperatingSystemDisplayNames,
|
||||
OperatingSystemCount,
|
||||
DefaultOperatingSystem,
|
||||
BootMgrInfo.TimeOut,
|
||||
GetBootMgrInfo()->TimeOut,
|
||||
&SelectedOperatingSystem,
|
||||
FALSE,
|
||||
MainBootMenuKeyPressFilter,
|
||||
|
@ -455,12 +456,12 @@ VOID RunLoader(VOID)
|
|||
/* Load the chosen operating system */
|
||||
LoadOperatingSystem(&OperatingSystemList[SelectedOperatingSystem]);
|
||||
|
||||
BootMgrInfo.TimeOut = -1;
|
||||
GetBootMgrInfo()->TimeOut = -1;
|
||||
|
||||
/* If we get there, the OS loader failed. As it may have
|
||||
* messed up the display, re-initialize the UI. */
|
||||
#ifndef _M_ARM
|
||||
UiVtbl.UnInitialize();
|
||||
UiUnInitialize("");
|
||||
#endif
|
||||
UiInitialize(TRUE);
|
||||
}
|
||||
|
|
|
@ -1647,7 +1647,7 @@ LoadBootDeviceDriver(VOID)
|
|||
#endif
|
||||
|
||||
/* Create full ntbootdd.sys path */
|
||||
strcpy(NtBootDdPath, FrLdrBootPath);
|
||||
strcpy(NtBootDdPath, FrLdrGetBootPath());
|
||||
strcat(NtBootDdPath, "\\NTBOOTDD.SYS");
|
||||
|
||||
/* Load ntbootdd.sys */
|
||||
|
|
|
@ -124,3 +124,18 @@ double log10(double x)
|
|||
__debugbreak();
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
PCCHAR FrLdrGetBootPath(VOID)
|
||||
{
|
||||
return FrLdrBootPath;
|
||||
}
|
||||
|
||||
UCHAR FrldrGetBootDrive(VOID)
|
||||
{
|
||||
return FrldrBootDrive;
|
||||
}
|
||||
|
||||
ULONG FrldrGetBootPartition(VOID)
|
||||
{
|
||||
return FrldrBootPartition;
|
||||
}
|
||||
|
|
|
@ -153,3 +153,7 @@ DiskGetPartitionEntry(
|
|||
* SCSI support (disk/scsiport.c)
|
||||
*/
|
||||
ULONG LoadBootDeviceDriver(VOID);
|
||||
|
||||
PCCHAR FrLdrGetBootPath(VOID);
|
||||
UCHAR FrldrGetBootDrive(VOID);
|
||||
ULONG FrldrGetBootPartition(VOID);
|
||||
|
|
|
@ -83,3 +83,4 @@ BOOLEAN IniAddSection(PCSTR SectionName, ULONG_PTR* SectionId);
|
|||
BOOLEAN IniAddSettingValueToSection(ULONG_PTR SectionId, PCSTR SettingName, PCSTR SettingValue);
|
||||
BOOLEAN IniModifySettingValue(ULONG_PTR SectionId, PCSTR SettingName, PCSTR SettingValue);
|
||||
VOID IniCleanup(VOID);
|
||||
PLIST_ENTRY IniGetFileSectionListHead(VOID);
|
||||
|
|
|
@ -97,8 +97,6 @@ VOID MachInit(const char *CmdLine);
|
|||
MachVtbl.VideoGetDisplaySize((W), (H), (D))
|
||||
#define MachVideoGetBufferSize() \
|
||||
MachVtbl.VideoGetBufferSize()
|
||||
#define MachVideoGetFontsFromFirmware(RomFontPointers) \
|
||||
MachVtbl.VideoGetFontsFromFirmware((RomFontPointers))
|
||||
#define MachVideoSetTextCursorPosition(X, Y) \
|
||||
MachVtbl.VideoSetTextCursorPosition((X), (Y))
|
||||
#define MachVideoHideShowTextCursor(Show) \
|
||||
|
@ -117,10 +115,6 @@ VOID MachInit(const char *CmdLine);
|
|||
MachVtbl.VideoSync()
|
||||
#define MachBeep() \
|
||||
MachVtbl.Beep()
|
||||
#define MachPrepareForReactOS() \
|
||||
MachVtbl.PrepareForReactOS()
|
||||
#define MachGetExtendedBIOSData(ExtendedBIOSDataArea, ExtendedBIOSDataSize) \
|
||||
MachVtbl.GetExtendedBIOSData((ExtendedBIOSDataArea), (ExtendedBIOSDataSize))
|
||||
#define MachGetFloppyCount() \
|
||||
MachVtbl.GetFloppyCount()
|
||||
#define MachDiskReadLogicalSectors(Drive, Start, Count, Buf) \
|
||||
|
@ -133,9 +127,6 @@ VOID MachInit(const char *CmdLine);
|
|||
#define MachInitializeBootDevices() \
|
||||
MachVtbl.InitializeBootDevices()
|
||||
|
||||
#define MachHwDetect(Options) \
|
||||
MachVtbl.HwDetect(Options)
|
||||
|
||||
#define MachHwIdle() \
|
||||
MachVtbl.HwIdle()
|
||||
|
||||
|
@ -144,4 +135,9 @@ VOID MachInit(const char *CmdLine);
|
|||
TIMEINFO* ArcGetTime(VOID);
|
||||
ULONG ArcGetRelativeTime(VOID);
|
||||
|
||||
PCONFIGURATION_COMPONENT_DATA MachHwDetect(_In_opt_ PCSTR Options);
|
||||
VOID MachPrepareForReactOS(VOID);
|
||||
VOID MachGetExtendedBIOSData(PULONG ExtendedBIOSDataArea, PULONG ExtendedBIOSDataSize);
|
||||
VOID MachVideoGetFontsFromFirmware(PULONG RomFontPointers);
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -118,7 +118,7 @@ BOOLEAN MmAreMemoryPagesAvailable(PVOID PageLookupTable, PFN_NUMBER TotalPageCou
|
|||
VOID MmSetMemoryType(PVOID MemoryAddress, SIZE_T MemorySize, TYPE_OF_MEMORY NewType); // Use with EXTREME caution!
|
||||
|
||||
PPAGE_LOOKUP_TABLE_ITEM MmGetMemoryMap(PFN_NUMBER *NoEntries); // Returns a pointer to the memory mapping table and a number of entries in it
|
||||
|
||||
PFN_NUMBER MmGetTotalPagesInLookupTable(VOID);
|
||||
|
||||
//BOOLEAN MmInitializeMemoryManager(ULONG LowMemoryStart, ULONG LowMemoryLength);
|
||||
BOOLEAN MmInitializeMemoryManager(VOID);
|
||||
|
@ -129,12 +129,14 @@ VOID MmFreeMemory(PVOID MemoryPointer);
|
|||
PVOID MmAllocateMemoryAtAddress(SIZE_T MemorySize, PVOID DesiredAddress, TYPE_OF_MEMORY MemoryType);
|
||||
PVOID MmAllocateHighestMemoryBelowAddress(SIZE_T MemorySize, PVOID DesiredAddress, TYPE_OF_MEMORY MemoryType);
|
||||
|
||||
PFN_NUMBER MmGetHighestPhysicalPage(VOID);
|
||||
PFN_NUMBER MmGetLoaderPagesSpanned(VOID);
|
||||
ULONG MmGetBiosMemoryMap(_Out_ PFREELDR_MEMORY_DESCRIPTOR *MemoryMap);
|
||||
|
||||
/* Heap */
|
||||
#define DEFAULT_HEAP_SIZE (1024 * 1024)
|
||||
#define TEMP_HEAP_SIZE (32 * 1024 * 1024)
|
||||
|
||||
extern PVOID FrLdrDefaultHeap;
|
||||
extern PVOID FrLdrTempHeap;
|
||||
extern SIZE_T FrLdrImageSize;
|
||||
|
||||
PVOID
|
||||
|
@ -169,34 +171,17 @@ FrLdrHeapFreeEx(
|
|||
PVOID Pointer,
|
||||
ULONG Tag);
|
||||
|
||||
FORCEINLINE
|
||||
PVOID
|
||||
FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
|
||||
{
|
||||
return FrLdrHeapAllocateEx(FrLdrDefaultHeap, MemorySize, Tag);
|
||||
}
|
||||
FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag);
|
||||
|
||||
FORCEINLINE
|
||||
VOID
|
||||
FrLdrHeapFree(PVOID MemoryPointer, ULONG Tag)
|
||||
{
|
||||
FrLdrHeapFreeEx(FrLdrDefaultHeap, MemoryPointer, Tag);
|
||||
}
|
||||
FrLdrHeapFree(PVOID MemoryPointer, ULONG Tag);
|
||||
|
||||
FORCEINLINE
|
||||
PVOID
|
||||
FrLdrTempAlloc(
|
||||
_In_ SIZE_T Size,
|
||||
_In_ ULONG Tag)
|
||||
{
|
||||
return FrLdrHeapAllocateEx(FrLdrTempHeap, Size, Tag);
|
||||
}
|
||||
_In_ ULONG Tag);
|
||||
|
||||
FORCEINLINE
|
||||
VOID
|
||||
FrLdrTempFree(
|
||||
PVOID Allocation, ULONG Tag)
|
||||
{
|
||||
FrLdrHeapFreeEx(FrLdrTempHeap, Allocation, Tag);
|
||||
}
|
||||
|
||||
PVOID Allocation, ULONG Tag);
|
||||
|
|
|
@ -17,6 +17,8 @@ typedef struct _BOOTMGRINFO
|
|||
|
||||
extern BOOTMGRINFO BootMgrInfo;
|
||||
|
||||
PBOOTMGRINFO GetBootMgrInfo(VOID);
|
||||
|
||||
VOID
|
||||
LoadSettings(
|
||||
_In_opt_ PCSTR CmdLine);
|
||||
|
|
|
@ -103,6 +103,12 @@ VOID
|
|||
UiMessageBoxCritical(
|
||||
_In_ PCSTR MessageText);
|
||||
|
||||
ULONG
|
||||
UiGetScreenHeight(VOID);
|
||||
|
||||
UCHAR
|
||||
UiGetMenuBgColor(VOID);
|
||||
|
||||
/* Loading Progress-Bar Functions ********************************************/
|
||||
|
||||
/*
|
||||
|
@ -302,6 +308,9 @@ typedef struct tagUIVTBL
|
|||
|
||||
VOID UiInit(const char *CmdLine);
|
||||
|
||||
VOID
|
||||
UiResetForSOS(VOID);
|
||||
|
||||
extern UIVTBL UiVtbl;
|
||||
|
||||
/*
|
||||
|
|
|
@ -22,6 +22,11 @@
|
|||
#include <debug.h>
|
||||
DBG_DEFAULT_CHANNEL(INIFILE);
|
||||
|
||||
PLIST_ENTRY IniGetFileSectionListHead(VOID)
|
||||
{
|
||||
return &IniFileSectionListHead;
|
||||
}
|
||||
|
||||
BOOLEAN IniOpenSection(PCSTR SectionName, ULONG_PTR* SectionId)
|
||||
{
|
||||
PLIST_ENTRY Entry;
|
||||
|
|
|
@ -31,8 +31,8 @@ DBG_DEFAULT_CHANNEL(HEAP);
|
|||
#define REDZONE_LOW(Block) ((ULONG64*)Block->Data + 1)
|
||||
#define REDZONE_HI(Block) ((ULONG64*)((PUCHAR)Block->Data + 16 + *REDZONE_SIZE(Block)))
|
||||
|
||||
PVOID FrLdrDefaultHeap;
|
||||
PVOID FrLdrTempHeap;
|
||||
static PVOID FrLdrDefaultHeap;
|
||||
static PVOID FrLdrTempHeap;
|
||||
|
||||
typedef struct _BLOCK_DATA
|
||||
{
|
||||
|
@ -529,6 +529,32 @@ FrLdrHeapFreeEx(
|
|||
#endif
|
||||
}
|
||||
|
||||
PVOID
|
||||
FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
|
||||
{
|
||||
return FrLdrHeapAllocateEx(FrLdrDefaultHeap, MemorySize, Tag);
|
||||
}
|
||||
|
||||
VOID
|
||||
FrLdrHeapFree(PVOID MemoryPointer, ULONG Tag)
|
||||
{
|
||||
FrLdrHeapFreeEx(FrLdrDefaultHeap, MemoryPointer, Tag);
|
||||
}
|
||||
|
||||
PVOID
|
||||
FrLdrTempAlloc(
|
||||
_In_ SIZE_T Size,
|
||||
_In_ ULONG Tag)
|
||||
{
|
||||
return FrLdrHeapAllocateEx(FrLdrTempHeap, Size, Tag);
|
||||
}
|
||||
|
||||
VOID
|
||||
FrLdrTempFree(
|
||||
PVOID Allocation, ULONG Tag)
|
||||
{
|
||||
FrLdrHeapFreeEx(FrLdrTempHeap, Allocation, Tag);
|
||||
}
|
||||
|
||||
/* Wrapper functions *********************************************************/
|
||||
|
||||
|
|
|
@ -34,6 +34,19 @@ PFREELDR_MEMORY_DESCRIPTOR BiosMemoryMap;
|
|||
ULONG BiosMemoryMapEntryCount;
|
||||
SIZE_T FrLdrImageSize;
|
||||
|
||||
ULONG
|
||||
MmGetBiosMemoryMap(_Out_ PFREELDR_MEMORY_DESCRIPTOR *MemoryMap)
|
||||
{
|
||||
*MemoryMap = BiosMemoryMap;
|
||||
return BiosMemoryMapEntryCount;
|
||||
}
|
||||
|
||||
PFN_NUMBER
|
||||
MmGetTotalPagesInLookupTable(VOID)
|
||||
{
|
||||
return TotalPagesInLookupTable;
|
||||
}
|
||||
|
||||
#if DBG
|
||||
typedef struct
|
||||
{
|
||||
|
@ -702,3 +715,9 @@ BOOLEAN MmAreMemoryPagesAvailable(PVOID PageLookupTable, PFN_NUMBER TotalPageCou
|
|||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
PFN_NUMBER
|
||||
MmGetHighestPhysicalPage(VOID)
|
||||
{
|
||||
return MmHighestPhysicalPage;
|
||||
}
|
||||
|
|
|
@ -303,3 +303,8 @@ PPAGE_LOOKUP_TABLE_ITEM MmGetMemoryMap(PFN_NUMBER *NoEntries)
|
|||
return RealPageLookupTable;
|
||||
}
|
||||
|
||||
PFN_NUMBER
|
||||
MmGetLoaderPagesSpanned(VOID)
|
||||
{
|
||||
return LoaderPagesSpanned;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ NTAPI
|
|||
RtlpAllocateMemory(ULONG Bytes,
|
||||
ULONG Tag)
|
||||
{
|
||||
return FrLdrHeapAllocateEx(FrLdrDefaultHeap, Bytes, Tag);
|
||||
return FrLdrHeapAlloc(Bytes, Tag);
|
||||
}
|
||||
|
||||
|
||||
|
@ -44,7 +44,7 @@ NTAPI
|
|||
RtlpFreeMemory(PVOID Mem,
|
||||
ULONG Tag)
|
||||
{
|
||||
FrLdrHeapFreeEx(FrLdrDefaultHeap, Mem, Tag);
|
||||
FrLdrHeapFree(Mem, Tag);
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
|
|
|
@ -145,8 +145,8 @@ LoadAndBootSector(
|
|||
BiosDriveNumber = 0;
|
||||
if (!BiosDriveNumber)
|
||||
{
|
||||
BiosDriveNumber = FrldrBootDrive;
|
||||
PartitionNumber = FrldrBootPartition;
|
||||
BiosDriveNumber = FrldrGetBootDrive();
|
||||
PartitionNumber = FrldrGetBootPartition();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ MempAllocatePageTables(VOID)
|
|||
// Max number of entries = MaxPageNum >> 10
|
||||
// FIXME: This is a number to describe ALL physical memory
|
||||
// and windows doesn't expect ALL memory mapped...
|
||||
NumPageTables = TotalPagesInLookupTable >> 10;
|
||||
NumPageTables = MmGetTotalPagesInLookupTable() >> 10;
|
||||
|
||||
TRACE("NumPageTables = %d\n", NumPageTables);
|
||||
|
||||
|
|
|
@ -15,12 +15,10 @@
|
|||
#include <debug.h>
|
||||
DBG_DEFAULT_CHANNEL(WINDOWS);
|
||||
|
||||
// FIXME: Find a better way to retrieve ARC disk information
|
||||
extern ULONG reactos_disk_count;
|
||||
extern ARC_DISK_SIGNATURE_EX reactos_arc_disk_info[];
|
||||
ULONG ArcGetDiskCount(VOID);
|
||||
PARC_DISK_SIGNATURE_EX ArcGetDiskInfo(ULONG Index);
|
||||
|
||||
extern ULONG LoaderPagesSpanned;
|
||||
extern BOOLEAN AcpiPresent;
|
||||
BOOLEAN IsAcpiPresent(VOID);
|
||||
|
||||
extern HEADLESS_LOADER_BLOCK LoaderRedirectionInformation;
|
||||
extern BOOLEAN WinLdrTerminalConnected;
|
||||
|
@ -199,7 +197,8 @@ WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock,
|
|||
InitializeListHead(&LoaderBlock->ArcDiskInformation->DiskSignatureListHead);
|
||||
|
||||
/* Convert ARC disk information from freeldr to a correct format */
|
||||
for (i = 0; i < reactos_disk_count; i++)
|
||||
ULONG DiscCount = ArcGetDiskCount();
|
||||
for (i = 0; i < DiscCount; i++)
|
||||
{
|
||||
PARC_DISK_SIGNATURE_EX ArcDiskSig;
|
||||
|
||||
|
@ -208,12 +207,12 @@ WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock,
|
|||
if (!ArcDiskSig)
|
||||
{
|
||||
ERR("Failed to allocate ARC structure! Ignoring remaining ARC disks. (i = %lu, DiskCount = %lu)\n",
|
||||
i, reactos_disk_count);
|
||||
i, DiscCount);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Copy the data over */
|
||||
RtlCopyMemory(ArcDiskSig, &reactos_arc_disk_info[i], sizeof(ARC_DISK_SIGNATURE_EX));
|
||||
RtlCopyMemory(ArcDiskSig, ArcGetDiskInfo(i), sizeof(ARC_DISK_SIGNATURE_EX));
|
||||
|
||||
/* Set the ARC Name pointer */
|
||||
ArcDiskSig->DiskSignature.ArcName = PaToVa(ArcDiskSig->ArcName);
|
||||
|
@ -248,7 +247,7 @@ WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock,
|
|||
Extension->Profile.Status = 2;
|
||||
|
||||
/* Check if FreeLdr detected a ACPI table */
|
||||
if (AcpiPresent)
|
||||
if (IsAcpiPresent())
|
||||
{
|
||||
/* Set the pointer to something for compatibility */
|
||||
Extension->AcpiTable = (PVOID)1;
|
||||
|
@ -1265,7 +1264,7 @@ LoadAndBootWindowsCommon(
|
|||
WinLdrSetProcessorContext(OperatingSystemVersion);
|
||||
|
||||
/* Save final value of LoaderPagesSpanned */
|
||||
LoaderBlock->Extension->LoaderPagesSpanned = LoaderPagesSpanned;
|
||||
LoaderBlock->Extension->LoaderPagesSpanned = MmGetLoaderPagesSpanned();
|
||||
|
||||
TRACE("Hello from paged mode, KiSystemStartup %p, LoaderBlockVA %p!\n",
|
||||
KiSystemStartup, LoaderBlockVA);
|
||||
|
|
|
@ -79,23 +79,6 @@ extern BOOLEAN SosEnabled;
|
|||
extern BOOLEAN PaeModeOn;
|
||||
#endif
|
||||
|
||||
FORCEINLINE
|
||||
VOID
|
||||
UiResetForSOS(VOID)
|
||||
{
|
||||
#ifdef _M_ARM
|
||||
/* Re-initialize the UI */
|
||||
UiInitialize(TRUE);
|
||||
#else
|
||||
/* Reset the UI and switch to MiniTui */
|
||||
UiVtbl.UnInitialize();
|
||||
UiVtbl = MiniTuiVtbl;
|
||||
UiVtbl.Initialize();
|
||||
#endif
|
||||
/* Disable the progress bar */
|
||||
UiProgressBar.Show = FALSE;
|
||||
}
|
||||
|
||||
VOID
|
||||
NtLdrOutputLoadMsg(
|
||||
_In_ PCSTR FileName,
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
#include <debug.h>
|
||||
DBG_DEFAULT_CHANNEL(WINDOWS);
|
||||
|
||||
extern ULONG LoaderPagesSpanned;
|
||||
|
||||
static const PCSTR MemTypeDesc[] = {
|
||||
"ExceptionBlock ", // ?
|
||||
"SystemBlock ", // ?
|
||||
|
@ -47,11 +45,6 @@ static VOID
|
|||
WinLdrInsertDescriptor(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||
IN PMEMORY_ALLOCATION_DESCRIPTOR NewDescriptor);
|
||||
|
||||
extern PFREELDR_MEMORY_DESCRIPTOR BiosMemoryMap;
|
||||
extern ULONG BiosMemoryMapEntryCount;
|
||||
extern PFN_NUMBER MmLowestPhysicalPage;
|
||||
extern PFN_NUMBER MmHighestPhysicalPage;
|
||||
|
||||
/* GLOBALS ***************************************************************/
|
||||
|
||||
MEMORY_ALLOCATION_DESCRIPTOR *Mad;
|
||||
|
@ -114,7 +107,7 @@ MempSetupPagingForRegion(
|
|||
BasePage, PageCount, Type);
|
||||
|
||||
/* Make sure we don't map too high */
|
||||
if (BasePage + PageCount > LoaderPagesSpanned) return;
|
||||
if (BasePage + PageCount > MmGetLoaderPagesSpanned()) return;
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
|
@ -310,12 +303,16 @@ WinLdrSetupMemoryLayout(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock)
|
|||
MadCount++;
|
||||
}
|
||||
#endif
|
||||
PFREELDR_MEMORY_DESCRIPTOR BiosMemoryMap;
|
||||
ULONG BiosMemoryMapEntryCount;
|
||||
|
||||
BiosMemoryMapEntryCount = MmGetBiosMemoryMap(&BiosMemoryMap);
|
||||
|
||||
/* Now we need to add high descriptors from the bios memory map */
|
||||
for (i = 0; i < BiosMemoryMapEntryCount; i++)
|
||||
{
|
||||
/* Check if its higher than the lookup table */
|
||||
if (BiosMemoryMap->BasePage > MmHighestPhysicalPage)
|
||||
if (BiosMemoryMap->BasePage > MmGetHighestPhysicalPage())
|
||||
{
|
||||
/* Copy this descriptor */
|
||||
MempAddMemoryBlock(LoaderBlock,
|
||||
|
|
|
@ -244,9 +244,9 @@ VOID DisplayBootTimeOptions(VOID)
|
|||
|
||||
/* Display the chosen boot options */
|
||||
UiDrawText(0,
|
||||
UiScreenHeight - 2,
|
||||
UiGetScreenHeight() - 2,
|
||||
BootOptions,
|
||||
ATTR(COLOR_LIGHTBLUE, UiMenuBgColor));
|
||||
ATTR(COLOR_LIGHTBLUE, UiGetMenuBgColor()));
|
||||
}
|
||||
|
||||
VOID AppendBootTimeOptions(PCHAR BootOptions)
|
||||
|
|
|
@ -75,7 +75,7 @@ InitOperatingSystemList(
|
|||
return NULL;
|
||||
|
||||
/* Retrieve the default OS */
|
||||
DefaultOSName = BootMgrInfo.DefaultOs;
|
||||
DefaultOSName = GetBootMgrInfo()->DefaultOs;
|
||||
|
||||
/* Now loop through the operating system section and load each item */
|
||||
for (i = 0; i < Count; ++i)
|
||||
|
|
|
@ -120,7 +120,7 @@ LoadSettings(
|
|||
CmdLineParse(CmdLine);
|
||||
return;
|
||||
}
|
||||
else if (IsListEmpty(&IniFileSectionListHead))
|
||||
else if (IsListEmpty(IniGetFileSectionListHead()))
|
||||
{
|
||||
// ERR("LoadSettings() called but no freeldr.ini\n");
|
||||
return;
|
||||
|
@ -188,4 +188,9 @@ LoadSettings(
|
|||
}
|
||||
}
|
||||
|
||||
PBOOTMGRINFO GetBootMgrInfo(VOID)
|
||||
{
|
||||
return &BootMgrInfo;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -636,4 +636,32 @@ BOOLEAN UiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
|
|||
return UiVtbl.EditBox(MessageText, EditTextBuffer, Length);
|
||||
}
|
||||
|
||||
VOID
|
||||
UiResetForSOS(VOID)
|
||||
{
|
||||
#ifdef _M_ARM
|
||||
/* Re-initialize the UI */
|
||||
UiInitialize(TRUE);
|
||||
#else
|
||||
/* Reset the UI and switch to MiniTui */
|
||||
UiVtbl.UnInitialize();
|
||||
UiVtbl = MiniTuiVtbl;
|
||||
UiVtbl.Initialize();
|
||||
#endif
|
||||
/* Disable the progress bar */
|
||||
UiProgressBar.Show = FALSE;
|
||||
}
|
||||
|
||||
ULONG
|
||||
UiGetScreenHeight(VOID)
|
||||
{
|
||||
return UiScreenHeight;
|
||||
}
|
||||
|
||||
UCHAR
|
||||
UiGetMenuBgColor(VOID)
|
||||
{
|
||||
return UiMenuBgColor;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue