[ros-diffs] [ion] 24968: - Properly fix boot/build.

ion at svn.reactos.org ion at svn.reactos.org
Wed Nov 29 18:35:15 CET 2006


Author: ion
Date: Wed Nov 29 20:35:15 2006
New Revision: 24968

URL: http://svn.reactos.org/svn/reactos?rev=24968&view=rev
Log:
- Properly fix boot/build.

Added:
    trunk/reactos/hal/halx86/mp/halinit.c
Modified:
    trunk/reactos/hal/halx86/generic/generic.rbuild
    trunk/reactos/hal/halx86/generic/halinit.c
    trunk/reactos/hal/halx86/generic/timer.c
    trunk/reactos/hal/halx86/mp/halmp.rbuild

Modified: trunk/reactos/hal/halx86/generic/generic.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/generic.rbuild?rev=24968&r1=24967&r2=24968&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/generic/generic.rbuild (original)
+++ trunk/reactos/hal/halx86/generic/generic.rbuild Wed Nov 29 20:35:15 2006
@@ -9,7 +9,6 @@
     <file>cmos.c</file>
     <file>dma.c</file>
 	<file>drive.c</file>
-	<file>halinit.c</file>
 	<file>misc.c</file>
 	<file>pci.c</file>
 	<file>portio.c</file>
@@ -26,6 +25,7 @@
 	<define name="_NTHAL_" />
 	<define name="__USE_W32API" />
 	<file>irql.c</file>
+    <file>halinit.c</file>
 	<file>processor.c</file>
 	<file>spinlock.c</file>
 </module>

Modified: trunk/reactos/hal/halx86/generic/halinit.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/halinit.c?rev=24968&r1=24967&r2=24968&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/generic/halinit.c (original)
+++ trunk/reactos/hal/halx86/generic/halinit.c Wed Nov 29 20:35:15 2006
@@ -93,7 +93,7 @@
         }
 
         /* Initialize the PICs */
-        //HalpInitPICs();
+        HalpInitPICs();
 
         /* Force initial PIC state */
         KfRaiseIrql(KeGetCurrentIrql());

Modified: trunk/reactos/hal/halx86/generic/timer.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/timer.c?rev=24968&r1=24967&r2=24968&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/generic/timer.c (original)
+++ trunk/reactos/hal/halx86/generic/timer.c Wed Nov 29 20:35:15 2006
@@ -116,7 +116,7 @@
 
     /* Normalize between our minimum (1 ms) and maximum (variable) setting */
     if (Increment > HalpLargestClockMS) Increment = HalpLargestClockMS;
-    if (Increment < 0) Increment = 1;
+    if (Increment <= 0) Increment = 1;
 
     /* Set the rate and tell HAL we want to change it */
     HalpNextMSRate = Increment;

Added: trunk/reactos/hal/halx86/mp/halinit.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/mp/halinit.c?rev=24968&view=auto
==============================================================================
--- trunk/reactos/hal/halx86/mp/halinit.c (added)
+++ trunk/reactos/hal/halx86/mp/halinit.c Wed Nov 29 20:35:15 2006
@@ -1,0 +1,153 @@
+/*
+ * PROJECT:         ReactOS HAL
+ * LICENSE:         GPL - See COPYING in the top level directory
+ * FILE:            hal/halx86/generic/halinit.c
+ * PURPOSE:         HAL Entrypoint and Initialization
+ * PROGRAMMERS:     Alex Ionescu (alex.ionescu at reactos.org)
+ */
+
+/* INCLUDES ******************************************************************/
+
+#include <hal.h>
+#define NDEBUG
+#include <debug.h>
+
+/* GLOBALS *******************************************************************/
+
+HALP_HOOKS HalpHooks;
+BOOLEAN HalpPciLockSettings;
+
+/* PRIVATE FUNCTIONS *********************************************************/
+
+VOID
+NTAPI
+HalpGetParameters(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
+{
+    PCHAR CommandLine;
+
+    /* Make sure we have a loader block and command line */
+    if ((LoaderBlock) && (LoaderBlock->LoadOptions))
+    {
+        /* Read the command line */
+        CommandLine = LoaderBlock->LoadOptions;
+
+        /* Check if PCI is locked */
+        if (strstr(CommandLine, "PCILOCK")) HalpPciLockSettings = TRUE;
+
+        /* Check for initial breakpoint */
+        if (strstr(CommandLine, "BREAK")) DbgBreakPoint();
+    }
+}
+
+/* FUNCTIONS *****************************************************************/
+
+/*
+ * @implemented
+ */
+BOOLEAN
+NTAPI
+HalInitSystem(IN ULONG BootPhase,
+              IN PLOADER_PARAMETER_BLOCK LoaderBlock)
+{
+    PKPRCB Prcb = KeGetCurrentPrcb();
+
+    /* Check the boot phase */
+    if (!BootPhase)
+    {
+        /* Phase 0... save bus type */
+        HalpBusType = LoaderBlock->u.I386.MachineType & 0xFF;
+
+        /* Get command-line parameters */
+        HalpGetParameters(LoaderBlock);
+
+        /* Checked HAL requires checked kernel */
+#if DBG
+        if (!(Prcb->BuildType & PRCB_BUILD_DEBUG))
+        {
+            /* No match, bugcheck */
+            KeBugCheckEx(MISMATCHED_HAL, 2, Prcb->BuildType, 1, 0);
+        }
+#else
+        /* Release build requires release HAL */
+        if (Prcb->BuildType & PRCB_BUILD_DEBUG)
+        {
+            /* No match, bugcheck */
+            KeBugCheckEx(MISMATCHED_HAL, 2, Prcb->BuildType, 0, 0);
+        }
+#endif
+
+#ifdef CONFIG_SMP
+        /* SMP HAL requires SMP kernel */
+        if (Prcb->BuildType & PRCB_BUILD_UNIPROCESSOR)
+        {
+            /* No match, bugcheck */
+            KeBugCheckEx(MISMATCHED_HAL, 2, Prcb->BuildType, 0, 0);
+        }
+#endif
+
+        /* Validate the PRCB */
+        if (Prcb->MajorVersion != PRCB_MAJOR_VERSION)
+        {
+            /* Validation failed, bugcheck */
+            KeBugCheckEx(MISMATCHED_HAL, 1, Prcb->MajorVersion, 1, 0);
+        }
+
+        /* Initialize the PICs */
+        HalpInitPICs();
+
+        /* Force initial PIC state */
+        KfRaiseIrql(KeGetCurrentIrql());
+
+        /* Initialize the clock */
+        HalpInitializeClock();
+
+        /* Setup busy waiting */
+        //HalpCalibrateStallExecution();
+
+        /* Fill out the dispatch tables */
+        HalQuerySystemInformation = HaliQuerySystemInformation;
+        HalSetSystemInformation = HaliSetSystemInformation;
+        HalInitPnpDriver = NULL; // FIXME: TODO
+        HalGetDmaAdapter = HalpGetDmaAdapter;
+        HalGetInterruptTranslator = NULL;  // FIXME: TODO
+
+        /* Initialize the hardware lock (CMOS) */
+        KeInitializeSpinLock(&HalpSystemHardwareLock);
+    }
+    else if (BootPhase == 1)
+    {
+        /* Initialize the default HAL stubs for bus handling functions */
+        HalpInitNonBusHandler();
+
+        /* Enable the clock interrupt */
+        ((PKIPCR)KeGetPcr())->IDT[0x30].ExtendedOffset =
+            (USHORT)(((ULONG_PTR)HalpClockInterrupt >> 16) & 0xFFFF);
+        ((PKIPCR)KeGetPcr())->IDT[0x30].Offset =
+            (USHORT)HalpClockInterrupt;
+        HalEnableSystemInterrupt(0x30, CLOCK2_LEVEL, Latched);
+
+        /* Initialize DMA. NT does this in Phase 0 */
+        HalpInitDma();
+    }
+
+    /* All done, return */
+    return TRUE;
+}
+
+/*
+ * @unimplemented
+ */
+VOID
+NTAPI
+HalReportResourceUsage(VOID)
+{
+    /* Initialize PCI bus. */
+    HalpInitializePciBus();
+
+    /* FIXME: This is done in ReactOS MP HAL only*/
+    //HaliReconfigurePciInterrupts();
+
+    /* FIXME: Report HAL Usage to kernel */
+}
+
+/* EOF */

Modified: trunk/reactos/hal/halx86/mp/halmp.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/mp/halmp.rbuild?rev=24968&r1=24967&r2=24968&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/mp/halmp.rbuild (original)
+++ trunk/reactos/hal/halx86/mp/halmp.rbuild Wed Nov 29 20:35:15 2006
@@ -11,6 +11,7 @@
 	<library>hal_generic_pc</library>
 	<library>ntoskrnl</library>
 	<file>apic.c</file>
+    <file>halinit.c</file>
 	<file>halinit_mp.c</file>
 	<file>ioapic.c</file>
 	<file>ipi_mp.c</file>




More information about the Ros-diffs mailing list