Author: ion Date: Fri Mar 2 10:23:19 2007 New Revision: 25944
URL: http://svn.reactos.org/svn/reactos?rev=25944&view=rev Log: - Don't depend on LD variables anymore for Mm. - Update KrnlFun.c - Make pushlock.c compile with msvc/wdk. - Fix definition of HIGH_LEVEL_ENTRIES which was way too small (and thus always 0) which caused frees/allocates in the 3rd-level table not to work properly. MSVC statically detected this, it's unlikely we were hitting this in ROS at the moment but it would've been a bad bug to catch later, yay msvc.
Modified: trunk/reactos/ntoskrnl/KrnlFun.c trunk/reactos/ntoskrnl/ex/pushlock.c trunk/reactos/ntoskrnl/include/internal/ex.h trunk/reactos/ntoskrnl/io/iomgr/driver.c trunk/reactos/ntoskrnl/mm/freelist.c trunk/reactos/ntoskrnl/mm/mminit.c
Modified: trunk/reactos/ntoskrnl/KrnlFun.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/KrnlFun.c?rev=2594... ============================================================================== --- trunk/reactos/ntoskrnl/KrnlFun.c (original) +++ trunk/reactos/ntoskrnl/KrnlFun.c Fri Mar 2 10:23:19 2007 @@ -13,7 +13,10 @@ // // Global: // - TODO: Complete the list of bufxies -// - Fix atapi.sys or serial.sys loading one more time at each boot. +// - Fix boot on VMWare. +// - Fix weird crash on boot with 0x867-0x872 EIP. +// - Fix trap.s AMD64 VMWare "Greatlord Issue". +// - Support SSE/MMX. // ///////////////////////////////////////////////////////////////////////////////
Modified: trunk/reactos/ntoskrnl/ex/pushlock.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/pushlock.c?rev=... ============================================================================== --- trunk/reactos/ntoskrnl/ex/pushlock.c (original) +++ trunk/reactos/ntoskrnl/ex/pushlock.c Fri Mar 2 10:23:19 2007 @@ -10,11 +10,13 @@
#include <ntoskrnl.h> #define NDEBUG -#include <internal/debug.h> +#include <debug.h>
/* DATA **********************************************************************/
ULONG ExPushLockSpinCount; +#undef EX_PUSH_LOCK +#undef PEX_PUSH_LOCK
/* PRIVATE FUNCTIONS *********************************************************/
@@ -439,10 +441,10 @@ FASTCALL ExfAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock) { - DEFINE_WAIT_BLOCK(WaitBlock); EX_PUSH_LOCK OldValue = *PushLock, NewValue, TempValue; BOOLEAN NeedWake; ULONG i; + DEFINE_WAIT_BLOCK(WaitBlock);
/* Start main loop */ for (;;) @@ -605,10 +607,10 @@ FASTCALL ExfAcquirePushLockShared(PEX_PUSH_LOCK PushLock) { - DEFINE_WAIT_BLOCK(WaitBlock); EX_PUSH_LOCK OldValue = *PushLock, NewValue; BOOLEAN NeedWake; ULONG i; + DEFINE_WAIT_BLOCK(WaitBlock);
/* Start main loop */ for (;;)
Modified: trunk/reactos/ntoskrnl/include/internal/ex.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/e... ============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ex.h (original) +++ trunk/reactos/ntoskrnl/include/internal/ex.h Fri Mar 2 10:23:19 2007 @@ -92,7 +92,7 @@ // #define LOW_LEVEL_ENTRIES (PAGE_SIZE / sizeof(HANDLE_TABLE_ENTRY)) #define MID_LEVEL_ENTRIES (PAGE_SIZE / sizeof(PHANDLE_TABLE_ENTRY)) -#define HIGH_LEVEL_ENTRIES (65535 / (LOW_LEVEL_ENTRIES * MID_LEVEL_ENTRIES)) +#define HIGH_LEVEL_ENTRIES (16777216 / (LOW_LEVEL_ENTRIES * MID_LEVEL_ENTRIES))
// // Maximum index in each table level before we need another table
Modified: trunk/reactos/ntoskrnl/io/iomgr/driver.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/driver.c?... ============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/driver.c (original) +++ trunk/reactos/ntoskrnl/io/iomgr/driver.c Fri Mar 2 10:23:19 2007 @@ -1305,7 +1305,7 @@
/* Null-terminate it and set it */ ServiceKeyName.Buffer[ServiceKeyName.Length / sizeof(WCHAR)] = UNICODE_NULL; - DriverObject->DriverExtension->ServiceKeyName = ServiceKeyName; + DriverObject->DriverExtension->ServiceKeyName = ServiceKeyName;
/* Also store it in the Driver Object. This is a bit of a hack. */ RtlCopyMemory(&DriverObject->DriverName,
Modified: trunk/reactos/ntoskrnl/mm/freelist.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/freelist.c?rev=... ============================================================================== --- trunk/reactos/ntoskrnl/mm/freelist.c (original) +++ trunk/reactos/ntoskrnl/mm/freelist.c Fri Mar 2 10:23:19 2007 @@ -1153,7 +1153,7 @@ ULONG Count;
/* Free initial kernel memory */ - MiFreeInitMemory(); + //MiFreeInitMemory();
/* Set our priority to 0 */ KeGetCurrentThread()->BasePriority = 0;
Modified: trunk/reactos/ntoskrnl/mm/mminit.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mminit.c?rev=25... ============================================================================== --- trunk/reactos/ntoskrnl/mm/mminit.c (original) +++ trunk/reactos/ntoskrnl/mm/mminit.c Fri Mar 2 10:23:19 2007 @@ -19,6 +19,7 @@ /* * Compiler defined symbols */ +#if 0 extern unsigned int _image_base__; extern unsigned int _text_start__; extern unsigned int _text_end__; @@ -27,7 +28,7 @@ extern unsigned int _init_end__;
extern unsigned int _bss_end__; - +#endif
static BOOLEAN IsThisAnNtAsSystem = FALSE; MM_SYSTEMSIZE MmSystemSize = MmSmallSystem; @@ -38,13 +39,6 @@ ULONG MiNonPagedPoolLength;
VOID INIT_FUNCTION NTAPI MmInitVirtualMemory(ULONG_PTR LastKernelAddress, ULONG KernelLength); - -#if defined (ALLOC_PRAGMA) -#pragma alloc_text(INIT, MmInitVirtualMemory) -#pragma alloc_text(INIT, MmInit1) -#pragma alloc_text(INIT, MmInit2) -#pragma alloc_text(INIT, MmInit3) -#endif
/* FUNCTIONS ****************************************************************/
@@ -83,7 +77,7 @@ { PVOID BaseAddress; ULONG Length; - ULONG ParamLength = KernelLength; + //ULONG ParamLength = KernelLength; NTSTATUS Status; PHYSICAL_ADDRESS BoundaryAddressMultiple; PFN_TYPE Pfn; @@ -159,7 +153,24 @@ 0, BoundaryAddressMultiple);
+#if 0 + DPRINT1("LD Vars: %lx %lx %lx %lx %lx %lx. Last: %lx\n", + &_image_base__, + &_text_start__, + &_text_end__, + &_init_start__, + &_init_end__, + &_bss_end__, + LastKernelAddress); BaseAddress = (PVOID)&_image_base__; + DPRINT1("Non-LD Vars: %lx %lx %lx %lx %lx %lx. Last: %lx\n", + 0, + 0, + 0, + 0, + 0, + 0, + LastKernelAddress); Length = PAGE_ROUND_UP(((ULONG_PTR)&_text_end__)) - (ULONG_PTR)&_image_base__; ParamLength = ParamLength - Length;
@@ -225,6 +236,7 @@ TRUE, 0, BoundaryAddressMultiple); +#endif
BaseAddress = MiNonPagedPoolStart; MmCreateMemoryArea(MmGetKernelAddressSpace(), @@ -515,6 +527,8 @@ return TRUE; }
+#if 0 + VOID static MiFreeInitMemoryPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address, PFN_TYPE Page, SWAPENTRY SwapEntry, @@ -538,3 +552,4 @@ NULL); MmUnlockAddressSpace(MmGetKernelAddressSpace()); } +#endif