Author: ion
Date: Wed May 9 04:29:38 2007
New Revision: 26658
URL:
http://svn.reactos.org/svn/reactos?rev=26658&view=rev
Log:
- Add CcPf (Cache Manager PreFetcher) structures and add a stub function to initailize the
global settings for the pre-fetcher (only a lock and list for now).
- Add hdlsterm.c for Headless Terminal Support and a stub function to detect if anyone is
trying to do this.
- Add xipdisp.c for eXecute-In-Place Support and add a stub function to detect if anyone
is trying this, as well as get various supported command line settings.
- Try to find XIP Memory Descriptor if one was given.
- Get Power Event callback from Win32k in PsEstablishWin32Callouts.
- Notifiy System Time Change callback with PoNotifySystemTimeSet.
- Add safemode and bootlog Message IDs.
Added:
trunk/reactos/ntoskrnl/ex/hdlsterm.c
trunk/reactos/ntoskrnl/ex/xipdisp.c
Modified:
trunk/reactos/ntoskrnl/cc/cacheman.c
trunk/reactos/ntoskrnl/ex/time.c
trunk/reactos/ntoskrnl/include/internal/cc.h
trunk/reactos/ntoskrnl/include/internal/po.h
trunk/reactos/ntoskrnl/ntoskrnl.mc
trunk/reactos/ntoskrnl/ntoskrnl.rbuild
trunk/reactos/ntoskrnl/po/events.c
trunk/reactos/ntoskrnl/ps/win32.c
Modified: trunk/reactos/ntoskrnl/cc/cacheman.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/cacheman.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/cacheman.c (original)
+++ trunk/reactos/ntoskrnl/cc/cacheman.c Wed May 9 04:29:38 2007
@@ -14,7 +14,26 @@
#define NDEBUG
#include <internal/debug.h>
+PFSN_PREFETCHER_GLOBALS CcPfGlobals;
+
/* FUNCTIONS *****************************************************************/
+
+VOID
+NTAPI
+CcPfInitializePrefetcher(VOID)
+{
+ /* Notify debugger */
+ DbgPrintEx(DPFLTR_PREFETCHER_ID,
+ DPFLTR_TRACE_LEVEL,
+ "CCPF: InitializePrefetecher()\n");
+
+ /* Setup the Prefetcher Data */
+ InitializeListHead(&CcPfGlobals.ActiveTraces);
+ InitializeListHead(&CcPfGlobals.CompletedTraces);
+ ExInitializeFastMutex(&CcPfGlobals.CompletedTracesLock);
+
+ /* FIXME: Setup the rest of the prefetecher */
+}
BOOLEAN
NTAPI
Added: trunk/reactos/ntoskrnl/ex/hdlsterm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/hdlsterm.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/hdlsterm.c (added)
+++ trunk/reactos/ntoskrnl/ex/hdlsterm.c Wed May 9 04:29:38 2007
@@ -1,0 +1,32 @@
+/*
+ * PROJECT: ReactOS Kernel
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: ntoskrnl/ex/hdlsterm.c
+ * PURPOSE: Headless Terminal Support
+ * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org)
+ */
+
+/* INCLUDES ******************************************************************/
+
+#include <ntoskrnl.h>
+#include <debug.h>
+
+/* GLOBALS *******************************************************************/
+
+/* FUNCTIONS *****************************************************************/
+
+VOID
+NTAPI
+HeadlessInit(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
+{
+ PHEADLESS_LOADER_BLOCK HeadlessBlock;
+
+ /* Get the headless loader block */
+ HeadlessBlock = LoaderBlock->Extension->HeadlessLoaderBlock;
+ if (HeadlessBlock)
+ {
+ DPRINT1("ReactOS does not currently have Headless Terminal
support!\n");
+ }
+}
+
+/* EOF */
Modified: trunk/reactos/ntoskrnl/ex/time.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/time.c?rev=266…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/time.c (original)
+++ trunk/reactos/ntoskrnl/ex/time.c Wed May 9 04:29:38 2007
@@ -21,6 +21,7 @@
TIME_ZONE_INFORMATION ExpTimeZoneInfo;
ULONG ExpLastTimeZoneBias = -1;
LARGE_INTEGER ExpTimeZoneBias;
+ULONG ExpAltTimeZoneBias;
ULONG ExpTimeZoneId;
ULONG ExpTickCountMultiplier;
ERESOURCE ExpTimeRefreshLock;
Added: trunk/reactos/ntoskrnl/ex/xipdisp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/xipdisp.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/xipdisp.c (added)
+++ trunk/reactos/ntoskrnl/ex/xipdisp.c Wed May 9 04:29:38 2007
@@ -1,0 +1,77 @@
+/*
+ * PROJECT: ReactOS Kernel
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: ntoskrnl/ex/xipdisp.c
+ * PURPOSE: eXecute In Place (XIP) Support.
+ * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org)
+ */
+
+/* INCLUDES ******************************************************************/
+
+#include <ntoskrnl.h>
+#include <debug.h>
+
+/* GLOBALS *******************************************************************/
+
+/* FUNCTIONS *****************************************************************/
+
+PMEMORY_ALLOCATION_DESCRIPTOR
+NTAPI
+XIPpFindMemoryDescriptor(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
+{
+ PLIST_ENTRY NextEntry;
+ PMEMORY_ALLOCATION_DESCRIPTOR Descriptor = NULL;
+
+ /* Loop the memory descriptors */
+ for (NextEntry = LoaderBlock->MemoryDescriptorListHead.Flink;
+ NextEntry != &LoaderBlock->MemoryDescriptorListHead;
+ NextEntry = NextEntry->Flink)
+ {
+ /* Get the current descriptor and check if it's the XIP ROM */
+ Descriptor = CONTAINING_RECORD(NextEntry,
+ MEMORY_ALLOCATION_DESCRIPTOR,
+ ListEntry);
+ if (Descriptor->MemoryType == LoaderXIPRom) return Descriptor;
+ }
+
+ /* Nothing found if we got here */
+ return NULL;
+}
+
+VOID
+NTAPI
+XIPInit(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
+{
+ PCHAR CommandLine, XipBoot, XipRom, XipMegs, XipVerbose;
+ PMEMORY_ALLOCATION_DESCRIPTOR XipDescriptor;
+
+ /* Get the command line */
+ CommandLine = LoaderBlock->LoadOptions;
+ if (!CommandLine) return;
+
+ /* Get XIP settings */
+ XipBoot = strstr(CommandLine, "XIPBOOT");
+ XipRom = strstr(CommandLine, "XIPROM=");
+ XipMegs = strstr(CommandLine, "XIPMEGS=");
+ XipVerbose = strstr(CommandLine, "XIPVERBOSE");
+
+ /* Check if this is a verbose boot */
+ if (XipVerbose)
+ {
+ /* Print out our header */
+ DbgPrint("\n\nXIP: debug timestamp at line %d in %s: <<<%s
%s>>>\n\n",
+ __LINE__,
+ __FILE__,
+ __DATE__,
+ __TIME__);
+ }
+
+ /* Find the XIP memory descriptor */
+ XipDescriptor = XIPpFindMemoryDescriptor(LoaderBlock);
+ if (!XipDescriptor) return;
+
+ /* FIXME: TODO */
+ DPRINT1("ReactOS does not yet support eXecute In Place boot
technology\n");
+}
+
+/* EOF */
Modified: trunk/reactos/ntoskrnl/include/internal/cc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/cc.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/cc.h Wed May 9 04:29:38 2007
@@ -1,5 +1,106 @@
#ifndef __INCLUDE_INTERNAL_CC_H
#define __INCLUDE_INTERNAL_CC_H
+
+typedef struct _PF_SCENARIO_ID
+{
+ WCHAR ScenName[30];
+ ULONG HashId;
+} PF_SCENARIO_ID, *PPF_SCENARIO_ID;
+
+typedef struct _PF_LOG_ENTRY
+{
+ ULONG FileOffset:30;
+ ULONG Type:2;
+ union
+ {
+ ULONG FileKey;
+ ULONG FileSequenceNumber;
+ };
+} PF_LOG_ENTRY, *PPF_LOG_ENTRY;
+
+typedef struct _PFSN_LOG_ENTRIES
+{
+ LIST_ENTRY TraceBuffersLink;
+ LONG NumEntries;
+ LONG MaxEntries;
+ PF_LOG_ENTRY Entries[ANYSIZE_ARRAY];
+} PFSN_LOG_ENTRIES, *PPFSN_LOG_ENTRIES;
+
+typedef struct _PF_SECTION_INFO
+{
+ ULONG FileKey;
+ ULONG FileSequenceNumber;
+ ULONG FileIdLow;
+ ULONG FileIdHigh;
+} PF_SECTION_INFO, *PPF_SECTION_INFO;
+
+typedef struct _PF_TRACE_HEADER
+{
+ ULONG Version;
+ ULONG MagicNumber;
+ ULONG Size;
+ PF_SCENARIO_ID ScenarioId;
+ ULONG ScenarioType; // PF_SCENARIO_TYPE
+ ULONG EventEntryIdxs[8];
+ ULONG NumEventEntryIdxs;
+ ULONG TraceBufferOffset;
+ ULONG NumEntries;
+ ULONG SectionInfoOffset;
+ ULONG NumSections;
+ ULONG FaultsPerPeriod[10];
+ LARGE_INTEGER LaunchTime;
+ ULONGLONG Reserved[5];
+} PF_TRACE_HEADER, *PPF_TRACE_HEADER;
+
+typedef struct _PFSN_TRACE_DUMP
+{
+ LIST_ENTRY CompletedTracesLink;
+ PF_TRACE_HEADER Trace;
+} PFSN_TRACE_DUMP, *PPFSN_TRACE_DUMP;
+
+typedef struct _PFSN_TRACE_HEADER
+{
+ ULONG Magic;
+ LIST_ENTRY ActiveTracesLink;
+ PF_SCENARIO_ID ScenarioId;
+ ULONG ScenarioType; // PF_SCENARIO_TYPE
+ ULONG EventEntryIdxs[8];
+ ULONG NumEventEntryIdxs;
+ PPFSN_LOG_ENTRIES CurrentTraceBuffer;
+ LIST_ENTRY TraceBuffersList;
+ ULONG NumTraceBuffers;
+ KSPIN_LOCK TraceBufferSpinLock;
+ KTIMER TraceTimer;
+ LARGE_INTEGER TraceTimerPeriod;
+ KDPC TraceTimerDpc;
+ KSPIN_LOCK TraceTimerSpinLock;
+ ULONG FaultsPerPeriod[10];
+ LONG LastNumFaults;
+ LONG CurPeriod;
+ LONG NumFaults;
+ LONG MaxFaults;
+ PEPROCESS Process;
+ EX_RUNDOWN_REF RefCount;
+ WORK_QUEUE_ITEM EndTraceWorkItem;
+ LONG EndTraceCalled;
+ PPFSN_TRACE_DUMP TraceDump;
+ NTSTATUS TraceDumpStatus;
+ LARGE_INTEGER LaunchTime;
+ PPF_SECTION_INFO SectionInfo;
+ ULONG SectionInfoCount;
+} PFSN_TRACE_HEADER, *PPFSN_TRACE_HEADER;
+
+typedef struct _PFSN_PREFETCHER_GLOBALS
+{
+ LIST_ENTRY ActiveTraces;
+ KSPIN_LOCK ActiveTracesLock;
+ PPFSN_TRACE_HEADER SystemWideTrace;
+ LIST_ENTRY CompletedTraces;
+ FAST_MUTEX CompletedTracesLock;
+ LONG NumCompletedTraces;
+ PKEVENT CompletedTracesEvent;
+ LONG ActivePrefetches;
+} PFSN_PREFETCHER_GLOBALS, *PPFSN_PREFETCHER_GLOBALS;
typedef struct _BCB
{
@@ -63,6 +164,12 @@
VOID
NTAPI
+CcPfInitializePrefetcher(
+ VOID
+);
+
+VOID
+NTAPI
CcMdlReadComplete2(
IN PMDL MemoryDescriptorList,
IN PFILE_OBJECT FileObject
Modified: trunk/reactos/ntoskrnl/include/internal/po.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/po.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/po.h Wed May 9 04:29:38 2007
@@ -71,6 +71,15 @@
);
//
+// Notifications
+//
+VOID
+NTAPI
+PoNotifySystemTimeSet(
+ VOID
+);
+
+//
// Global data inside the Power Manager
//
extern PDEVICE_NODE PopSystemPowerDeviceNode;
Modified: trunk/reactos/ntoskrnl/ntoskrnl.mc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl.mc?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/ntoskrnl.mc (original)
+++ trunk/reactos/ntoskrnl/ntoskrnl.mc Wed May 9 04:29:38 2007
@@ -1130,6 +1130,38 @@
system vendor for an updated BIOS.
.
+MessageId=0xA8
+Severity=Informational
+Facility=System
+SymbolicName=BOOTING_IN_SAFEMODE_MINIMAL
+Language=English
+The system is booting in safemode - Minimal Services
+.
+
+MessageId=0xA9
+Severity=Informational
+Facility=System
+SymbolicName=BOOTING_IN_SAFEMODE_NETWORK
+Language=English
+The system is booting in safemode - Minimal Services with Network
+.
+
+MessageId=0xAA
+Severity=Informational
+Facility=System
+SymbolicName=BOOTING_IN_SAFEMODE_DSREPAIR
+Language=English
+The system is booting in safemode - Directory Services Repair
+.
+
+MessageId=0xB7
+Severity=Informational
+Facility=System
+SymbolicName=BOOTLOG_ENABLED
+Language=English
+Boot Logging Enabled
+.
+
MessageId=0xBE
Severity=Success
Facility=System
@@ -1337,7 +1369,7 @@
Facility=System
SymbolicName=WINDOWS_NT_MP_STRING
Language=English
-MulitProcessor Kernel
+MultiProcessor Kernel
.
MessageId=0x9D
Modified: trunk/reactos/ntoskrnl/ntoskrnl.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl.rbuild?r…
==============================================================================
--- trunk/reactos/ntoskrnl/ntoskrnl.rbuild (original)
+++ trunk/reactos/ntoskrnl/ntoskrnl.rbuild Wed May 9 04:29:38 2007
@@ -124,6 +124,7 @@
<file>fmutex.c</file>
<file>handle.c</file>
<file>harderr.c</file>
+ <file>hdlsterm.c</file>
<file>init.c</file>
<file>keyedevt.c</file>
<file>locale.c</file>
@@ -141,6 +142,7 @@
<file>uuid.c</file>
<file>win32k.c</file>
<file>work.c</file>
+ <file>xipdisp.c</file>
<file>zone.c</file>
</directory>
<directory name="fsrtl">
Modified: trunk/reactos/ntoskrnl/po/events.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/po/events.c?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/po/events.c (original)
+++ trunk/reactos/ntoskrnl/po/events.c Wed May 9 04:29:38 2007
@@ -10,6 +10,29 @@
#include <ntoskrnl.h>
//#define NDEBUG
#include <internal/debug.h>
+
+PKWIN32_POWEREVENT_CALLOUT PopEventCallout;
+extern PCALLBACK_OBJECT SetSystemTimeCallback;
+
+VOID
+NTAPI
+PoNotifySystemTimeSet(VOID)
+{
+ KIRQL OldIrql;
+
+ /* Check if Win32k registered a notification callback */
+ if (PopEventCallout)
+ {
+ /* Raise to dispatch */
+ KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);
+
+ /* Notify the callback */
+ ExNotifyCallback(SetSystemTimeCallback, NULL, NULL);
+
+ /* Lower IRQL back */
+ KeLowerIrql(OldIrql);
+ }
+}
NTSTATUS
NTAPI
Modified: trunk/reactos/ntoskrnl/ps/win32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/win32.c?rev=26…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/win32.c (original)
+++ trunk/reactos/ntoskrnl/ps/win32.c Wed May 9 04:29:38 2007
@@ -20,6 +20,7 @@
extern PKWIN32_PARSEMETHOD_CALLOUT ExpWindowStationObjectParse;
extern PKWIN32_DELETEMETHOD_CALLOUT ExpWindowStationObjectDelete;
extern PKWIN32_DELETEMETHOD_CALLOUT ExpDesktopObjectDelete;
+extern PKWIN32_POWEREVENT_CALLOUT PopEventCallout;
/* PRIVATE FUNCTIONS *********************************************************/
@@ -112,6 +113,7 @@
ExpWindowStationObjectParse = CalloutData->WindowStationParseProcedure;
ExpWindowStationObjectDelete = CalloutData->WindowStationDeleteProcedure;
ExpDesktopObjectDelete = CalloutData->DesktopDeleteProcedure;
+ PopEventCallout = CalloutData->PowerEventCallout;
}
NTSTATUS