mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 21:25:43 +00:00
- Properly fix boot/build.
svn path=/trunk/; revision=24968
This commit is contained in:
parent
09f6f9fded
commit
f675588849
5 changed files with 157 additions and 3 deletions
|
@ -9,7 +9,6 @@
|
||||||
<file>cmos.c</file>
|
<file>cmos.c</file>
|
||||||
<file>dma.c</file>
|
<file>dma.c</file>
|
||||||
<file>drive.c</file>
|
<file>drive.c</file>
|
||||||
<file>halinit.c</file>
|
|
||||||
<file>misc.c</file>
|
<file>misc.c</file>
|
||||||
<file>pci.c</file>
|
<file>pci.c</file>
|
||||||
<file>portio.c</file>
|
<file>portio.c</file>
|
||||||
|
@ -26,6 +25,7 @@
|
||||||
<define name="_NTHAL_" />
|
<define name="_NTHAL_" />
|
||||||
<define name="__USE_W32API" />
|
<define name="__USE_W32API" />
|
||||||
<file>irql.c</file>
|
<file>irql.c</file>
|
||||||
|
<file>halinit.c</file>
|
||||||
<file>processor.c</file>
|
<file>processor.c</file>
|
||||||
<file>spinlock.c</file>
|
<file>spinlock.c</file>
|
||||||
</module>
|
</module>
|
||||||
|
|
|
@ -93,7 +93,7 @@ HalInitSystem(IN ULONG BootPhase,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize the PICs */
|
/* Initialize the PICs */
|
||||||
//HalpInitPICs();
|
HalpInitPICs();
|
||||||
|
|
||||||
/* Force initial PIC state */
|
/* Force initial PIC state */
|
||||||
KfRaiseIrql(KeGetCurrentIrql());
|
KfRaiseIrql(KeGetCurrentIrql());
|
||||||
|
|
|
@ -116,7 +116,7 @@ HalSetTimeIncrement(IN ULONG Increment)
|
||||||
|
|
||||||
/* Normalize between our minimum (1 ms) and maximum (variable) setting */
|
/* Normalize between our minimum (1 ms) and maximum (variable) setting */
|
||||||
if (Increment > HalpLargestClockMS) Increment = HalpLargestClockMS;
|
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 */
|
/* Set the rate and tell HAL we want to change it */
|
||||||
HalpNextMSRate = Increment;
|
HalpNextMSRate = Increment;
|
||||||
|
|
153
reactos/hal/halx86/mp/halinit.c
Normal file
153
reactos/hal/halx86/mp/halinit.c
Normal file
|
@ -0,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@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 */
|
|
@ -11,6 +11,7 @@
|
||||||
<library>hal_generic_pc</library>
|
<library>hal_generic_pc</library>
|
||||||
<library>ntoskrnl</library>
|
<library>ntoskrnl</library>
|
||||||
<file>apic.c</file>
|
<file>apic.c</file>
|
||||||
|
<file>halinit.c</file>
|
||||||
<file>halinit_mp.c</file>
|
<file>halinit_mp.c</file>
|
||||||
<file>ioapic.c</file>
|
<file>ioapic.c</file>
|
||||||
<file>ipi_mp.c</file>
|
<file>ipi_mp.c</file>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue