ELF_support, welcome to HEAD! (just in time for the freeze, too!)

svn path=/trunk/; revision=12400
This commit is contained in:
KJK::Hyperion 2004-12-30 08:05:12 +00:00
parent ca61e32c5c
commit 6948c64efb
9 changed files with 787 additions and 351 deletions

View file

@ -17,4 +17,14 @@ struct _EPROCESS;
#define NTAPI STDCALL
#endif
#define MINCHAR (0x80)
#define MAXCHAR (0x7F)
#define MINSHORT (0x8000)
#define MAXSHORT (0x7FFF)
#define MINLONG (0x80000000)
#define MAXLONG (0x7FFFFFFF)
#define MAXUCHAR (0xFF)
#define MAXUSHORT (0xFFFF)
#define MAXULONG (0xFFFFFFFF)
#endif

View file

@ -1,4 +1,4 @@
/* $Id: zw.h,v 1.39 2004/12/23 20:12:51 ekohl Exp $
/* $Id: zw.h,v 1.40 2004/12/30 08:05:10 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -6479,7 +6479,7 @@ ZwQuerySection(
typedef struct _SECTION_IMAGE_INFORMATION
{
PVOID EntryPoint;
ULONG EntryPoint;
ULONG Unknown1;
ULONG StackReserve;
ULONG StackCommit;

View file

@ -1,4 +1,4 @@
/* $Id: create.c,v 1.91 2004/12/18 13:26:57 weiden Exp $
/* $Id: create.c,v 1.92 2004/12/30 08:05:11 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@ -12,6 +12,7 @@
/* INCLUDES ****************************************************************/
#include <k32.h>
#include <pseh/framebased.h>
#define NDEBUG
#include "../include/debug.h"
@ -1385,11 +1386,11 @@ CreateProcessW
* Create the thread for the kernel
*/
DPRINT("Creating thread for process (EntryPoint = 0x%.08x)\n",
ImageBaseAddress + (ULONG)Sii.EntryPoint);
(PVOID)((ULONG_PTR)ImageBaseAddress + Sii.EntryPoint));
hThread = KlCreateFirstThread(hProcess,
lpThreadAttributes,
&Sii,
ImageBaseAddress + (ULONG)Sii.EntryPoint,
(PVOID)((ULONG_PTR)ImageBaseAddress + Sii.EntryPoint),
dwCreationFlags,
&lpProcessInformation->dwThreadId);
if (hThread == INVALID_HANDLE_VALUE)

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: random.c,v 1.3 2004/08/07 19:13:25 ion Exp $
/* $Id: random.c,v 1.4 2004/12/30 08:05:11 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -31,8 +31,6 @@
#define NDEBUG
#include <debug.h>
#define MAXLONG (0x7fffffff)
static ULONG SavedValue[128] =
{
0x4c8bc0aa, 0x4c022957, 0x2232827a, 0x2f1e7626, /* 0 */

View file

@ -144,6 +144,8 @@ OBJECTS_MM = \
mm/balance.o \
mm/cont.o \
mm/drvlck.o \
mm/elf32.o \
mm/elf64.o \
mm/freelist.o \
mm/iospace.o \
mm/kmap.o \
@ -159,6 +161,7 @@ OBJECTS_MM = \
mm/pageop.o \
mm/pager.o \
mm/paging.o \
mm/pe.o \
mm/pool.o \
mm/ppool.o \
mm/physical.o \

View file

@ -71,6 +71,26 @@ typedef ULONG PFN_TYPE, *PPFN_TYPE;
PAGE_NOACCESS | \
PAGE_NOCACHE)
#define PAGE_IS_READABLE (PAGE_READONLY | \
PAGE_READWRITE | \
PAGE_WRITECOPY | \
PAGE_EXECUTE_READ | \
PAGE_EXECUTE_READWRITE | \
PAGE_EXECUTE_WRITECOPY)
#define PAGE_IS_WRITABLE (PAGE_READWRITE | \
PAGE_WRITECOPY | \
PAGE_EXECUTE_READWRITE | \
PAGE_EXECUTE_WRITECOPY)
#define PAGE_IS_EXECUTABLE (PAGE_EXECUTE | \
PAGE_EXECUTE_READ | \
PAGE_EXECUTE_READWRITE | \
PAGE_EXECUTE_WRITECOPY)
#define PAGE_IS_WRITECOPY (PAGE_WRITECOPY | \
PAGE_EXECUTE_WRITECOPY)
typedef struct
{
ULONG Entry[NR_SECTION_PAGE_ENTRIES];
@ -86,38 +106,35 @@ typedef struct
#define MM_PAGEFILE_SEGMENT (0x1)
#define MM_DATAFILE_SEGMENT (0x2)
#define MM_SECTION_SEGMENT_BSS (0x1)
typedef struct _MM_SECTION_SEGMENT
{
ULONG FileOffset;
ULONG Protection;
ULONG Attributes;
ULONG Length;
LONGLONG FileOffset;
ULONG_PTR VirtualAddress;
ULONG RawLength;
ULONG Length;
ULONG Protection;
FAST_MUTEX Lock;
ULONG ReferenceCount;
SECTION_PAGE_DIRECTORY PageDirectory;
ULONG Flags;
PVOID VirtualAddress;
ULONG Characteristics;
BOOLEAN WriteCopy;
} MM_SECTION_SEGMENT, *PMM_SECTION_SEGMENT;
typedef struct _MM_IMAGE_SECTION_OBJECT
{
PVOID ImageBase;
PVOID EntryPoint;
ULONG StackReserve;
ULONG StackCommit;
ULONG_PTR ImageBase;
ULONG_PTR StackReserve;
ULONG_PTR StackCommit;
ULONG EntryPoint;
ULONG Subsystem;
ULONG MinorSubsystemVersion;
ULONG MajorSubsystemVersion;
ULONG ImageCharacteristics;
USHORT MinorSubsystemVersion;
USHORT MajorSubsystemVersion;
USHORT Machine;
BOOLEAN Executable;
ULONG NrSegments;
MM_SECTION_SEGMENT Segments[0];
PMM_SECTION_SEGMENT Segments;
} MM_IMAGE_SECTION_OBJECT, *PMM_IMAGE_SECTION_OBJECT;
typedef struct _SECTION_OBJECT

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: page.c,v 1.79 2004/12/24 17:07:00 navaraf Exp $
/* $Id: page.c,v 1.80 2004/12/30 08:05:11 hyperion Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/mm/i386/page.c
@ -146,11 +146,11 @@ ProtectToPTE(ULONG flProtect)
{
Attributes = 0;
}
else if (flProtect & (PAGE_READWRITE|PAGE_EXECUTE_READWRITE))
else if (flProtect & PAGE_IS_WRITABLE)
{
Attributes = PA_PRESENT | PA_READWRITE;
}
else if (flProtect & (PAGE_READONLY|PAGE_EXECUTE|PAGE_EXECUTE_READ))
else if (flProtect & (PAGE_IS_READABLE | PAGE_IS_EXECUTABLE))
{
Attributes = PA_PRESENT;
}
@ -160,7 +160,7 @@ ProtectToPTE(ULONG flProtect)
KEBUGCHECK(0);
}
if (Ke386NoExecute &&
!(flProtect & (PAGE_EXECUTE|PAGE_EXECUTE_READ|PAGE_EXECUTE_READWRITE)))
!(flProtect & PAGE_IS_EXECUTABLE))
{
Attributes = Attributes | 0x80000000;
}

File diff suppressed because it is too large Load diff

View file

@ -1486,19 +1486,19 @@ typedef struct _SECTION_BASIC_INFORMATION {
} SECTION_BASIC_INFORMATION, *PSECTION_BASIC_INFORMATION;
typedef struct _SECTION_IMAGE_INFORMATION {
PVOID EntryPoint;
ULONG Unknown1;
ULONG StackReserve;
ULONG StackCommit;
ULONG Subsystem;
USHORT MinorSubsystemVersion;
USHORT MajorSubsystemVersion;
ULONG Unknown2;
ULONG Characteristics;
USHORT ImageNumber;
BOOLEAN Executable;
UCHAR Unknown3;
ULONG Unknown4[3];
ULONG EntryPoint;
ULONG Unknown1;
ULONG_PTR StackReserve;
ULONG_PTR StackCommit;
ULONG Subsystem;
USHORT MinorSubsystemVersion;
USHORT MajorSubsystemVersion;
ULONG Unknown2;
ULONG Characteristics;
USHORT ImageNumber;
BOOLEAN Executable;
UCHAR Unknown3;
ULONG Unknown4[3];
} SECTION_IMAGE_INFORMATION, *PSECTION_IMAGE_INFORMATION;
#if (VER_PRODUCTBUILD >= 2600)