f1e030e92622f1b5fdc864cfcba06b8dbb01324e
[reactos.git] / reactos / hal / halx86 / halinit.c
1 /* $Id: halinit.c,v 1.10 2004/11/28 01:30:01 hbirr Exp $
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/hal/x86/halinit.c
6 * PURPOSE: Initalize the x86 hal
7 * PROGRAMMER: David Welch (welch@cwcom.net)
8 * UPDATE HISTORY:
9 * 11/06/98: Created
10 */
11
12 /* INCLUDES *****************************************************************/
13
14 #include <ddk/ntddk.h>
15 #include <roscfg.h>
16 #include <hal.h>
17
18 #ifdef MP
19 #include <mps.h>
20 #endif /* MP */
21
22 #define NDEBUG
23 #include <internal/debug.h>
24
25 /* GLOBALS *****************************************************************/
26
27 PVOID HalpZeroPageMapping = NULL;
28
29 /* FUNCTIONS ***************************************************************/
30
31 NTSTATUS
32 STDCALL
33 DriverEntry(
34 PDRIVER_OBJECT DriverObject,
35 PUNICODE_STRING RegistryPath)
36 {
37 return STATUS_SUCCESS;
38 }
39
40 BOOLEAN STDCALL
41 HalInitSystem (ULONG BootPhase,
42 PLOADER_PARAMETER_BLOCK LoaderBlock)
43 {
44 if (BootPhase == 0)
45 {
46 /* Initialize display and make the screen black */
47 HalInitializeDisplay (LoaderBlock);
48
49 #ifdef MP
50
51 HalpInitMPS();
52
53 #else
54
55 HalpInitPICs();
56
57 /* Setup busy waiting */
58 HalpCalibrateStallExecution();
59
60 #endif /* MP */
61
62 }
63 else if (BootPhase == 1)
64 {
65 HalpInitBusHandlers();
66 HalpInitDma();
67
68 /* Enumerate the devices on the motherboard */
69 HalpStartEnumerator();
70 }
71 else if (BootPhase == 2)
72 {
73 /* Go to blue screen */
74 HalClearDisplay (0x17); /* grey on blue */
75
76 HalpZeroPageMapping = MmMapIoSpace((LARGE_INTEGER)0LL, PAGE_SIZE, MmNonCached);
77 }
78
79 return TRUE;
80 }
81
82 /* EOF */