[SMSS]: Remove the ROS_DOESNT_SUCK hack, and correctly started subsystem processes with the first MB reserved.

[CSRSRV]: CSRSS was started with a free address space, and was able to map 0xA0000 into it by luck, because the ReactOS Mm allocator picks address ranges randomly, and it somehow managed to avoid the low 1MB addresses. Were this algorithm to change, or perhaps, were we to implement VADs for VM allocations, the 0xA0000 region might already be allocated (by an early-process-initialization allocation, such as the heap). This is what the flag referenced above was designed for, but it was not used. Using this flag, on the other hand, now makes CSRSS fail, because it attempts to map the RAM into 0xA0000, which fails since you can map a section on top of reserved memory. To work around this Brobdingnagian annoyance, CSRSS simply releases the first MB of memory that SMSS has nicely reserved for it, and then proceeds with the mapping. This fixes the issue of getting 0xA0000 by luck and now guarantees it can be mapped.

svn path=/trunk/; revision=49133
This commit is contained in:
Sir Richard 2010-10-12 21:17:58 +00:00
parent 8bfc61d69d
commit 6f0a1a3598
2 changed files with 16 additions and 3 deletions

View file

@ -108,11 +108,11 @@ FailProcParams:
__FUNCTION__, Status);
return Status;
}
#ifdef ROS_DOESNT_SUCK
/* Reserve lower 1Mb, if requested */
if (Flags & SM_CREATE_FLAG_RESERVE_1MB)
ProcessParameters->Flags |= RTL_USER_PROCESS_PARAMETERS_RESERVE_1MB;
#endif
/* Create the user process */
Status = RtlCreateUserProcess (& ImagePathString,
OBJ_CASE_INSENSITIVE,

View file

@ -38,7 +38,20 @@ InitializeVideoAddressSpace(VOID)
LARGE_INTEGER Offset;
SIZE_T ViewSize;
CHAR IVTAndBda[1024+256];
/* Free the 1MB pre-reserved region. In reality, ReactOS should simply support us mapping the view into the reserved area, but it doesn't. */
BaseAddress = 0;
ViewSize = 1024 * 1024;
Status = ZwFreeVirtualMemory(NtCurrentProcess(),
&BaseAddress,
&ViewSize,
MEM_RELEASE);
if (!NT_SUCCESS(Status))
{
DPRINT1("Couldn't unmap reserved memory (%x)\n", Status);
return 0;
}
/* Open the physical memory section */
InitializeObjectAttributes(&ObjectAttributes,
&PhysMemName,