Author: fireball
Date: Thu Jul 24 07:18:26 2008
New Revision: 34737
URL: http://svn.reactos.org/svn/reactos?rev=34737&view=rev
Log:
- MiGetLastKernelAddress was totally broken on x86 and always returned the highest available physical page, thus the PFN database always end up at the address 0x80000000 and higher (just before the kernel). And when PFN database's size was bigger than usual (e.g. 1Gb of RAM and more), the PFN database zeroed out the kernel. This logic was introduced by 32640 commit.
- Fix the logic so it really gives the last kernel address, as function name suggests. If you want to change the logic of the function, then rename it accordingly.
See issue #3507 for more details.
Modified:
trunk/reactos/ntoskrnl/mm/mminit.c
Modified: trunk/reactos/ntoskrnl/mm/mminit.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mminit.c?rev=3…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/mminit.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/mminit.c [iso-8859-1] Thu Jul 24 07:18:26 2008
@@ -342,19 +342,22 @@
PLIST_ENTRY NextEntry;
PMEMORY_ALLOCATION_DESCRIPTOR Md;
ULONG_PTR LastKrnlPhysAddr = 0;
-
+
for (NextEntry = KeLoaderBlock->MemoryDescriptorListHead.Flink;
NextEntry != &KeLoaderBlock->MemoryDescriptorListHead;
NextEntry = NextEntry->Flink)
{
Md = CONTAINING_RECORD(NextEntry, MEMORY_ALLOCATION_DESCRIPTOR, ListEntry);
- if (Md->MemoryType != LoaderFree)
+
+ if (Md->MemoryType != LoaderFree &&
+ Md->MemoryType != LoaderFirmwareTemporary &&
+ Md->MemoryType != LoaderSpecialMemory)
{
if (Md->BasePage+Md->PageCount > LastKrnlPhysAddr)
- LastKrnlPhysAddr = Md->BasePage+Md->PageCount;
+ LastKrnlPhysAddr = Md->BasePage+Md->PageCount;
}
}
-
+
/* Convert to a physical address */
return LastKrnlPhysAddr << PAGE_SHIFT;
}
Author: tkreuzer
Date: Thu Jul 24 05:26:15 2008
New Revision: 34733
URL: http://svn.reactos.org/svn/reactos?rev=34733&view=rev
Log:
- create 512 2 MB pages first, so we have a max of 1 GB available memory. This gets us much further through hardware detection. the setup screen loads and then it stops with "failed to load the ANSI codepage file"
Modified:
branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/arch.S
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/arch.S
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
==============================================================================
--- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/arch.S [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/arch.S [iso-8859-1] Thu Jul 24 05:26:15 2008
@@ -92,8 +92,8 @@
/*
- * We defines one 2MB page at the start of memory, so we can access the first
- * 2MBs as if paging was disabled
+ * We define 512 2MB pages at the start of memory, so we can access the first
+ * 1 GB as if paging was disabled
*/
#define PML4_PAGENUM 60 // Put it high enough so it doesn't interfere with freeldr
@@ -115,29 +115,33 @@
xor di, di
/* One entry in the PML4 pointing to PDP */
- mov ax, ((PDP_PAGENUM << 12) & 0xffff) | 0x00f
- stosw
- mov ax, (PDP_PAGENUM >> 4)
- stosw
+ mov eax, (PDP_PAGENUM << 12) | 0x00f
+ stosd
xor ax,ax
mov cx, 0x07fe
rep stosw
/* One entry in the PDP pointing to PD */
- mov ax, ((PD_PAGENUM << 12) & 0xffff) | 0x00f
- stosw
- mov ax, (PD_PAGENUM >> 4)
- stosw
- xor ax,ax
- mov cx, 0x07fe
- rep stosw
-
- /* One entry in the PD defining a 2MB page */
- mov ax, 0x018f
- stosw
- xor ax,ax
- mov cx,0x07ff
- rep stosw
+ mov eax, (PD_PAGENUM << 12) | 0x00f
+ stosd
+
+ xor eax, eax
+ mov ecx, 0x03ff
+ rep stosd
+
+ /* 512 entries in the PD defining a 2MB page each */
+ mov ecx, 512
+ mov eax, 0x008f
+
+Bpt2:
+ mov es: [di], eax
+ mov dword ptr es: [di + 4], 0
+ add eax, 512 << 12 // add 512 4k pages
+ add di, 8
+
+ /* Loop it */
+ dec cx
+ jnz Bpt2
/* Return */
pop es
@@ -258,6 +262,7 @@
ret
+
/** Some data *****************************************************************/
.code64
Author: pschweitzer
Date: Thu Jul 24 03:19:00 2008
New Revision: 34731
URL: http://svn.reactos.org/svn/reactos?rev=34731&view=rev
Log:
Bugfix in FsRtlIsHpfsDbcsLegal and FsRtlIsFatDbcsLegal:
First byte of double byte character cannot finish the string
Modified:
branches/pierre-fsd/ntoskrnl/fsrtl/dbcsname.c
Modified: branches/pierre-fsd/ntoskrnl/fsrtl/dbcsname.c
URL: http://svn.reactos.org/svn/reactos/branches/pierre-fsd/ntoskrnl/fsrtl/dbcsn…
==============================================================================
--- branches/pierre-fsd/ntoskrnl/fsrtl/dbcsname.c [iso-8859-1] (original)
+++ branches/pierre-fsd/ntoskrnl/fsrtl/dbcsname.c [iso-8859-1] Thu Jul 24 03:19:00 2008
@@ -252,6 +252,8 @@
/* First make sure the character it's not the Lead DBCS */
if (FsRtlIsLeadDbcsCharacter(FirstPart.Buffer[i]))
{
+ if (i == (FirstPart.Length / sizeof(CHAR)) - 1)
+ return FALSE;
i++;
}
else if ((FirstPart.Buffer[i] < 0x1F) || (FirstPart.Buffer[i] == 0x22) ||
@@ -392,6 +394,8 @@
/* First make sure the character it's not the Lead DBCS */
if (FsRtlIsLeadDbcsCharacter(FirstPart.Buffer[i]))
{
+ if (i == (FirstPart.Length / sizeof(CHAR)) - 1)
+ return FALSE;
i++;
}
else if ((FirstPart.Buffer[i] < 0x1F) || (FirstPart.Buffer[i] == 0x22) ||