- Rewrote (copied from ntdll) parts of the relocation and import fixup code.

- Don't load no-load sections at the end of the  driver.
- Don't relocate the relocation section itself.
- Set the correct page protection for section which are executable.
- Added a (dirty) fix for the fireport driver.
- Fixed the detection of the noguiboot option.

svn path=/trunk/; revision=11070
This commit is contained in:
Hartmut Birr 2004-09-26 15:07:44 +00:00
parent a2446b3408
commit c8e0c372d9
3 changed files with 794 additions and 782 deletions

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: main.c,v 1.196 2004/09/23 18:00:29 royce Exp $ /* $Id: main.c,v 1.197 2004/09/26 15:07:43 hbirr Exp $
* *
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
* FILE: ntoskrnl/ke/main.c * FILE: ntoskrnl/ke/main.c
@ -338,27 +338,27 @@ ExpInitializeExecutive(VOID)
} }
} }
} }
else if (!_strnicmp(p2, "NOGUIBOOT", 12)) else if (!_strnicmp(p2, "NOGUIBOOT", 9))
{ {
p2 += 12; p2 += 12;
NoGuiBoot = TRUE; NoGuiBoot = TRUE;
} }
else if (!_strnicmp(p2, "CRASHDUMP", 9)) else if (!_strnicmp(p2, "CRASHDUMP", 9))
{ {
p2 += 9; p2 += 9;
if (*p2 == ':') if (*p2 == ':')
{ {
p2++; p2++;
if (!_strnicmp(p2, "FULL", 4)) if (!_strnicmp(p2, "FULL", 4))
{ {
MmCoreDumpType = MM_CORE_DUMP_TYPE_FULL; MmCoreDumpType = MM_CORE_DUMP_TYPE_FULL;
} }
else else
{ {
MmCoreDumpType = MM_CORE_DUMP_TYPE_NONE; MmCoreDumpType = MM_CORE_DUMP_TYPE_NONE;
} }
} }
} }
p1 = p2; p1 = p2;
} }
@ -523,7 +523,6 @@ ExpInitializeExecutive(VOID)
KdInit1(); KdInit1();
IoInit(); IoInit();
PoInit(); PoInit();
LdrInitModuleManagement();
CmInitializeRegistry(); CmInitializeRegistry();
NtInit(); NtInit();
MmInit3(); MmInit3();
@ -977,13 +976,15 @@ _main (ULONG MultiBootMagic, PLOADER_PARAMETER_BLOCK _LoaderBlock)
HalBase = KeLoaderModules[1].ModStart; HalBase = KeLoaderModules[1].ModStart;
DriverBase = LastKernelAddress; DriverBase = LastKernelAddress;
LdrHalBase = (ULONG_PTR)DriverBase;
LdrInitModuleManagement();
/* /*
* Process hal.dll * Process hal.dll
*/ */
LdrSafePEProcessModule((PVOID)HalBase, (PVOID)DriverBase, (PVOID)KERNEL_BASE, &DriverSize); LdrSafePEProcessModule((PVOID)HalBase, (PVOID)DriverBase, (PVOID)KERNEL_BASE, &DriverSize);
LdrHalBase = (ULONG_PTR)DriverBase;
LastKernelAddress += PAGE_ROUND_UP(DriverSize); LastKernelAddress += PAGE_ROUND_UP(DriverSize);
/* /*

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
/* $Id: mminit.c,v 1.68 2004/09/09 20:42:33 hbirr Exp $ /* $Id: mminit.c,v 1.69 2004/09/26 15:07:44 hbirr Exp $
* *
* COPYRIGHT: See COPYING in the top directory * COPYRIGHT: See COPYING in the top directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -401,18 +401,7 @@ MmInit1(ULONG FirstKrnlPhysAddr,
MmDeletePageTable(NULL, 0); MmDeletePageTable(NULL, 0);
#endif #endif
/*
* Create a trap for null pointer references and protect text
* segment
*/
DPRINT("_text_start__ %x _init_end__ %x\n",(int)&_text_start__,(int)&_init_end__);
for (i=PAGE_ROUND_DOWN(((int)&_text_start__));
i<PAGE_ROUND_UP(((int)&_init_end__));i=i+PAGE_SIZE)
{
MmSetPageProtect(NULL,
(PVOID)i,
PAGE_EXECUTE_READ);
}
DPRINT("Invalidating between %x and %x\n", DPRINT("Invalidating between %x and %x\n",
LastKernelAddress, 0xc0600000); LastKernelAddress, 0xc0600000);