some improvements

svn path=/branches/ros-amd64-bringup/; revision=44832
This commit is contained in:
Timo Kreuzer 2009-12-31 19:26:37 +00:00
parent 6d68ae384a
commit bda3767dfb
3 changed files with 26 additions and 18 deletions

View file

@ -62,7 +62,7 @@ HalInitSystem(IN ULONG BootPhase,
PKPRCB Prcb = KeGetCurrentPrcb(); PKPRCB Prcb = KeGetCurrentPrcb();
/* Check the boot phase */ /* Check the boot phase */
if (!BootPhase) if (BootPhase == 0)
{ {
/* Phase 0... save bus type */ /* Phase 0... save bus type */
HalpBusType = LoaderBlock->u.I386.MachineType & 0xFF; HalpBusType = LoaderBlock->u.I386.MachineType & 0xFF;
@ -70,8 +70,8 @@ HalInitSystem(IN ULONG BootPhase,
/* Get command-line parameters */ /* Get command-line parameters */
HalpGetParameters(LoaderBlock); HalpGetParameters(LoaderBlock);
/* Checked HAL requires checked kernel */
#if DBG #if DBG
/* Checked HAL requires checked kernel */
if (!(Prcb->BuildType & PRCB_BUILD_DEBUG)) if (!(Prcb->BuildType & PRCB_BUILD_DEBUG))
{ {
/* No match, bugcheck */ /* No match, bugcheck */
@ -101,18 +101,21 @@ HalInitSystem(IN ULONG BootPhase,
/* Validation failed, bugcheck */ /* Validation failed, bugcheck */
KeBugCheckEx(MISMATCHED_HAL, 1, Prcb->MajorVersion, 1, 0); KeBugCheckEx(MISMATCHED_HAL, 1, Prcb->MajorVersion, 1, 0);
} }
DPRINT1("HalInitSystem 2\n");
DPRINT1("HalInitSystem 1\n");
/* Initialize the PICs */ /* Initialize the PICs */
HalpInitPICs(); HalpInitPICs();
DPRINT1("HalInitSystem 3\n");
/* Force initial PIC state */ DPRINT1("HalInitSystem 2\n");
KfRaiseIrql(KeGetCurrentIrql());
DPRINT1("HalInitSystem 4\n");
/* Initialize the clock */ /* Initialize the clock */
HalpInitializeClock(); HalpInitializeClock();
DPRINT1("HalInitSystem 5\n");
/* Setup busy waiting */ DPRINT1("HalInitSystem 3\n");
//HalpCalibrateStallExecution();
/* Calibrate counters */
// HalpCalibrateCounters();
/* Fill out the dispatch tables */ /* Fill out the dispatch tables */
HalQuerySystemInformation = HaliQuerySystemInformation; HalQuerySystemInformation = HaliQuerySystemInformation;
@ -121,7 +124,9 @@ DPRINT1("HalInitSystem 5\n");
// HalGetDmaAdapter = HalpGetDmaAdapter; // HalGetDmaAdapter = HalpGetDmaAdapter;
HalGetInterruptTranslator = NULL; // FIXME: TODO HalGetInterruptTranslator = NULL; // FIXME: TODO
// HalResetDisplay = HalpBiosDisplayReset; // HalResetDisplay = HalpBiosDisplayReset;
DPRINT1("HalInitSystem 6\n");
DPRINT1("HalInitSystem 4\n");
/* Initialize the hardware lock (CMOS) */ /* Initialize the hardware lock (CMOS) */
KeInitializeSpinLock(&HalpSystemHardwareLock); KeInitializeSpinLock(&HalpSystemHardwareLock);
@ -134,11 +139,8 @@ DPRINT1("HalInitSystem 6\n");
//HalpInitBusHandler(); //HalpInitBusHandler();
/* Enable the clock interrupt */ /* Enable the clock interrupt */
PKIDTENTRY64 IdtEntry = &((PKIPCR)KeGetPcr())->IdtBase[0x30]; HalpSetInterruptGate(0x30, HalpClockInterrupt);
IdtEntry->OffsetLow = (((ULONG_PTR)HalpClockInterrupt) & 0xFFFF); HalEnableSystemInterrupt(0x30, CLOCK_LEVEL, Latched);
IdtEntry->OffsetMiddle = (((ULONG_PTR)HalpClockInterrupt >> 16) & 0xFFFF);
IdtEntry->OffsetHigh = ((ULONG_PTR)HalpClockInterrupt >> 32);
// HalEnableSystemInterrupt(0x30, CLOCK_LEVEL, Latched);
/* Initialize DMA. NT does this in Phase 0 */ /* Initialize DMA. NT does this in Phase 0 */
HalpInitDma(); HalpInitDma();

View file

@ -164,6 +164,10 @@ HalpGetDmaAdapter(
VOID HaliInitBSP(VOID); VOID HaliInitBSP(VOID);
VOID HaliStartApplicationProcessor(ULONG Cpu, ULONG Stack); VOID HaliStartApplicationProcessor(ULONG Cpu, ULONG Stack);
VOID NTAPI HalpInitIdtEntry(PKIDTENTRY64 Idt, PVOID Address);
VOID NTAPI HalpSetInterruptGate(ULONG Index, PVOID Address);
VOID NTAPI HalpInitCpuInterruptHandling(ULONG Cpu);
extern PVOID HalpRealModeStart; extern PVOID HalpRealModeStart;
extern PVOID HalpRealModeEnd; extern PVOID HalpRealModeEnd;

View file

@ -25,8 +25,7 @@ NTAPI
HalInitializeProcessor(IN ULONG ProcessorNumber, HalInitializeProcessor(IN ULONG ProcessorNumber,
IN PLOADER_PARAMETER_BLOCK LoaderBlock) IN PLOADER_PARAMETER_BLOCK LoaderBlock)
{ {
/* Set default IDR and stall count */ /* Set default stall count */
// KeGetPcr()->IDR = 0xFFFFFFFB;
KeGetPcr()->StallScaleFactor = INITIAL_STALL_COUNT; KeGetPcr()->StallScaleFactor = INITIAL_STALL_COUNT;
/* Update the interrupt affinity and processor mask */ /* Update the interrupt affinity and processor mask */
@ -36,6 +35,9 @@ HalInitializeProcessor(IN ULONG ProcessorNumber,
/* Register routines for KDCOM */ /* Register routines for KDCOM */
HalpRegisterKdSupportFunctions(); HalpRegisterKdSupportFunctions();
/* Do per CPU interrupt handling initialization */
// HalpInitCpuInterruptHandling(ProcessorNumber);
} }
/* /*