d497e16e02d75d63efe77ac045dfa2c701799a6f
[reactos.git] / reactos / hal / halx86 / halinit.c
1 /* $Id: halinit.c,v 1.5 2003/08/11 18:50:12 chorns 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 /* FUNCTIONS ***************************************************************/
26
27 extern VOID
28 HalClearDisplay (UCHAR CharAttribute);
29
30 NTSTATUS
31 STDCALL
32 DriverEntry(
33 PDRIVER_OBJECT DriverObject,
34 PUNICODE_STRING RegistryPath)
35 {
36 return STATUS_SUCCESS;
37 }
38
39 BOOLEAN STDCALL
40 HalInitSystem (ULONG BootPhase,
41 PLOADER_PARAMETER_BLOCK LoaderBlock)
42 {
43 if (BootPhase == 0)
44 {
45 /* Initialize display and make the screen black */
46 HalInitializeDisplay (LoaderBlock);
47
48 #ifdef MP
49
50 HalpInitMPS();
51
52 #else
53
54 HalpInitPICs();
55
56 /* Setup busy waiting */
57 HalpCalibrateStallExecution();
58
59 #endif /* MP */
60
61 }
62 else if (BootPhase == 1)
63 {
64 HalpInitBusHandlers();
65 HalpCalibrateStallExecution();
66
67 /* Enumerate the devices on the motherboard */
68 HalpStartEnumerator();
69 }
70 else if (BootPhase == 2)
71 {
72 /* Go to blue screen */
73 HalClearDisplay (0x17); /* grey on blue */
74 }
75
76 return TRUE;
77 }
78
79 /* EOF */