[FREELDR]

- Move read-only data into data section (allows to boot with GRUB again).
- Discard .drectve sections.
- Silence "set but not used" warnings.

svn path=/trunk/; revision=52557
This commit is contained in:
Dmitry Gorbachev 2011-07-07 19:19:44 +00:00
parent e462a7a6d3
commit 2a66163177
8 changed files with 17 additions and 19 deletions

View file

@ -34,7 +34,7 @@ GetHarddiskConfigurationData(UCHAR DriveNumber, ULONG* pSize)
{
PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
PCM_DISK_GEOMETRY_DEVICE_DATA DiskGeometry;
EXTENDED_GEOMETRY ExtGeometry;
//EXTENDED_GEOMETRY ExtGeometry;
GEOMETRY Geometry;
ULONG Size;
@ -69,7 +69,7 @@ GetHarddiskConfigurationData(UCHAR DriveNumber, ULONG* pSize)
DiskGeometry = (PVOID)(((ULONG_PTR)PartialResourceList) + sizeof(CM_PARTIAL_RESOURCE_LIST));
/* Get the disk geometry */
ExtGeometry.Size = sizeof(EXTENDED_GEOMETRY);
//ExtGeometry.Size = sizeof(EXTENDED_GEOMETRY);
if(MachDiskGetDriveGeometry(DriveNumber, &Geometry))
{

View file

@ -32,17 +32,18 @@ SECTIONS
*(.data)
*(.data2)
*(SORT(.data$*))
*(.rdata)
*(SORT(.rdata$*))
*(.eh_frame)
__data_end__ = . ;
__bss_start__ = . ;
*(.bss)
*(COMMON)
__bss_end__ = . ;
}
.rdata BLOCK(__section_alignment__) :
/DISCARD/ :
{
*(.rdata)
*(SORT(.rdata$*))
*(.eh_frame)
*(.drectve)
}
.stab BLOCK(__section_alignment__) (NOLOAD) :
{

View file

@ -1196,12 +1196,12 @@ LONG Ext2GetFileInformation(ULONG FileId, FILEINFORMATION* Information)
LONG Ext2Open(CHAR* Path, OPENMODE OpenMode, ULONG* FileId)
{
PEXT2_FILE_INFO FileHandle;
ULONG DeviceId;
//ULONG DeviceId;
if (OpenMode != OpenReadOnly)
return EACCES;
DeviceId = FsGetDeviceId(*FileId);
//DeviceId = FsGetDeviceId(*FileId);
DPRINTM(DPRINT_FILESYSTEM, "Ext2Open() FileName = %s\n", Path);

View file

@ -536,7 +536,7 @@ static BOOLEAN NtfsCompareFileName(PCHAR FileName, PNTFS_INDEX_ENTRY IndexEntry)
static BOOLEAN NtfsFindMftRecord(PNTFS_VOLUME_INFO Volume, ULONGLONG MFTIndex, PCHAR FileName, ULONGLONG *OutMFTIndex)
{
PNTFS_MFT_RECORD MftRecord;
ULONG Magic;
//ULONG Magic;
PNTFS_ATTR_CONTEXT IndexRootCtx;
PNTFS_ATTR_CONTEXT IndexBitmapCtx;
PNTFS_ATTR_CONTEXT IndexAllocationCtx;
@ -557,7 +557,7 @@ static BOOLEAN NtfsFindMftRecord(PNTFS_VOLUME_INFO Volume, ULONGLONG MFTIndex, P
if (NtfsReadMftRecord(Volume, MFTIndex, MftRecord))
{
Magic = MftRecord->Magic;
//Magic = MftRecord->Magic;
IndexRootCtx = NtfsFindAttribute(Volume, MftRecord, NTFS_ATTR_TYPE_INDEX_ROOT, L"$I30");
if (IndexRootCtx == NULL)

View file

@ -180,12 +180,11 @@ BOOLEAN IniParseFile(PCHAR IniFileData, ULONG IniFileSize)
ULONG IniGetNextLineSize(PCHAR IniFileData, ULONG IniFileSize, ULONG CurrentOffset)
{
ULONG Idx;
ULONG LineCharCount = 0;
// Loop through counting chars until we hit the end of the
// file or we encounter a new line char
for (Idx=0; (CurrentOffset < IniFileSize); CurrentOffset++)
for (; (CurrentOffset < IniFileSize); CurrentOffset++)
{
// Increment the line character count
LineCharCount++;
@ -193,7 +192,6 @@ ULONG IniGetNextLineSize(PCHAR IniFileData, ULONG IniFileSize, ULONG CurrentOffs
// Check for new line char
if (IniFileData[CurrentOffset] == '\n')
{
CurrentOffset++;
break;
}
}

View file

@ -225,14 +225,13 @@ BOOLEAN UiInitialize(BOOLEAN ShowGui)
BOOLEAN SetupUiInitialize(VOID)
{
VIDEODISPLAYMODE UiDisplayMode;
CHAR DisplayModeText[260];
ULONG Depth, Length;
DisplayModeText[0] = '\0';
UiDisplayMode = MachVideoSetDisplayMode(DisplayModeText, TRUE);
MachVideoSetDisplayMode(DisplayModeText, TRUE);
MachVideoGetDisplaySize(&UiScreenWidth, &UiScreenHeight, &Depth);
UiVtbl = TuiVtbl;

View file

@ -41,7 +41,7 @@ void WinLdrSetupForNt(PLOADER_PARAMETER_BLOCK LoaderBlock,
ULONG *TssBasePage)
{
ULONG TssSize;
ULONG TssPages;
//ULONG TssPages;
ULONG_PTR Pcr = 0;
ULONG_PTR Tss = 0;
ULONG BlockSize, NumPages;
@ -61,7 +61,7 @@ void WinLdrSetupForNt(PLOADER_PARAMETER_BLOCK LoaderBlock,
/* Allocate TSS */
TssSize = (sizeof(KTSS) + MM_PAGE_SIZE) & ~(MM_PAGE_SIZE - 1);
TssPages = TssSize / MM_PAGE_SIZE;
//TssPages = TssSize / MM_PAGE_SIZE;
Tss = (ULONG_PTR)MmAllocateMemoryWithType(TssSize, LoaderMemoryData);

View file

@ -224,7 +224,7 @@ WinLdrTurnOnPaging(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,
ULONG LastPageIndex, LastPageType, MemoryMapStartPage;
PPAGE_LOOKUP_TABLE_ITEM MemoryMap;
ULONG NoEntries;
PKTSS Tss;
//PKTSS Tss;
BOOLEAN Status;
//
@ -353,7 +353,7 @@ WinLdrTurnOnPaging(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,
/* Map stuff like PCR, KI_USER_SHARED_DATA and Apic */
WinLdrMapSpecialPages(PcrBasePage);
Tss = (PKTSS)(KSEG0_BASE | (TssBasePage << MM_PAGE_SHIFT));
//Tss = (PKTSS)(KSEG0_BASE | (TssBasePage << MM_PAGE_SHIFT));
// Unmap what is not needed from kernel page table
MempDisablePages();