Modified kernel initialization sequence

Enabled bus handlers

svn path=/trunk/; revision=1087
This commit is contained in:
Eric Kohl 2000-03-20 18:00:55 +00:00
parent dc3956d8ac
commit a1c9a520cf
9 changed files with 236 additions and 99 deletions

View file

@ -83,7 +83,8 @@ HalpInitBusHandlers (VOID);
ULONG ULONG
STDCALL STDCALL
HalpGetSystemInterruptVector ( HalpGetSystemInterruptVector (
PVOID BusHandler, PVOID BusHandler,
ULONG BusNumber,
ULONG BusInterruptLevel, ULONG BusInterruptLevel,
ULONG BusInterruptVector, ULONG BusInterruptVector,
PKIRQL Irql, PKIRQL Irql,

View file

@ -72,11 +72,6 @@ typedef struct
extern IDT_DESCRIPTOR KiIdt[256]; extern IDT_DESCRIPTOR KiIdt[256];
//extern GDT_DESCRIPTOR KiGdt[256]; //extern GDT_DESCRIPTOR KiGdt[256];
/*
* printf style functions
*/
int vsprintf(char *buf, const char *fmt, va_list args);
int sprintf(char* buf, const char* fmt, ...);
VOID NtInitializeEventImplementation(VOID); VOID NtInitializeEventImplementation(VOID);
VOID NtInit(VOID); VOID NtInit(VOID);
@ -84,7 +79,7 @@ VOID NtInit(VOID);
/* /*
* Initalization functions (called once by main()) * Initalization functions (called once by main())
*/ */
VOID MmInitialize(boot_param* bp, ULONG LastKernelAddress); VOID MmInitSystem(ULONG Phase, boot_param* bp, ULONG LastKernelAddress);
VOID IoInit(VOID); VOID IoInit(VOID);
VOID ObInit(VOID); VOID ObInit(VOID);
VOID PsInit(VOID); VOID PsInit(VOID);

View file

@ -21,7 +21,9 @@
KE_SERVICE_DESCRIPTOR_TABLE_ENTRY KeServiceDescriptorTable[SSDT_MAX_ENTRIES] = KE_SERVICE_DESCRIPTOR_TABLE_ENTRY
__declspec(dllexport)
KeServiceDescriptorTable[SSDT_MAX_ENTRIES] =
{ {
{ MainSSDT, NULL, NUMBER_OF_SYSCALLS, MainSSPT }, { MainSSDT, NULL, NUMBER_OF_SYSCALLS, MainSSPT },
{ NULL, NULL, 0, NULL }, { NULL, NULL, 0, NULL },

View file

@ -1,4 +1,5 @@
/* /* $Id: bus.c,v 1.4 2000/03/20 17:59:41 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
* FILE: ntoskrnl/hal/x86/bus.c * FILE: ntoskrnl/hal/x86/bus.c
@ -8,14 +9,7 @@
* Created 22/05/98 * Created 22/05/98
* *
* *
* NOTE: The bus handler code is under contruction!
* It does NOT work yet!
*
* TODO: * TODO:
* - Add missing default bus handler functions
* - Change ntoskrnl's initialization sequence
* (non-paged pool and spin locks must be available before HalInitSystem()
* is called in system initialization phase 0)
* - Add bus handler functions for all busses * - Add bus handler functions for all busses
*/ */
@ -32,8 +26,35 @@
struct _BUS_HANDLER; struct _BUS_HANDLER;
typedef NTSTATUS (STDCALL *pAdjustResourceList) (
IN struct _BUS_HANDLER *BusHandler,
IN ULONG BusNumber,
IN OUT PCM_RESOURCE_LIST Resources
);
typedef NTSTATUS (STDCALL *pAssignSlotResources) (
IN struct _BUS_HANDLER *BusHandler,
IN ULONG BusNumber,
IN PUNICODE_STRING RegistryPath,
IN PUNICODE_STRING DriverClassName,
IN PDRIVER_OBJECT DriverObject,
IN PDEVICE_OBJECT DeviceObject,
IN ULONG SlotNumber,
IN OUT PCM_RESOURCE_LIST *AllocatedResources
);
typedef ULONG (STDCALL *pGetSetBusData) (
IN struct _BUS_HANDLER *BusHandler,
IN ULONG BusNumber,
IN ULONG SlotNumber,
OUT PVOID Buffer,
IN ULONG Offset,
IN ULONG Length
);
typedef ULONG (STDCALL *pGetInterruptVector) ( typedef ULONG (STDCALL *pGetInterruptVector) (
IN struct _BUS_HANDLER *BusHandler, IN struct _BUS_HANDLER *BusHandler,
IN ULONG BusNumber,
IN ULONG BusInterruptLevel, IN ULONG BusInterruptLevel,
IN ULONG BusInterruptVector, IN ULONG BusInterruptVector,
OUT PKIRQL Irql, OUT PKIRQL Irql,
@ -42,13 +63,12 @@ typedef ULONG (STDCALL *pGetInterruptVector) (
typedef ULONG (STDCALL *pTranslateBusAddress) ( typedef ULONG (STDCALL *pTranslateBusAddress) (
IN struct _BUS_HANDLER *BusHandler, IN struct _BUS_HANDLER *BusHandler,
IN ULONG BusNumber,
IN PHYSICAL_ADDRESS BusAddress, IN PHYSICAL_ADDRESS BusAddress,
IN ULONG Length,
IN OUT PULONG AddressSpace, IN OUT PULONG AddressSpace,
OUT PPHYSICAL_ADDRESS TranslatedAddress OUT PPHYSICAL_ADDRESS TranslatedAddress
); );
typedef struct _BUS_HANDLER typedef struct _BUS_HANDLER
{ {
LIST_ENTRY Entry; LIST_ENTRY Entry;
@ -57,9 +77,10 @@ typedef struct _BUS_HANDLER
ULONG BusNumber; ULONG BusNumber;
ULONG RefCount; ULONG RefCount;
PVOID GetBusData; pGetSetBusData GetBusData;
PVOID SetBusData; pGetSetBusData SetBusData;
PVOID AssignSlotResources; pAdjustResourceList AdjustResourceList;
pAssignSlotResources AssignSlotResources;
pGetInterruptVector GetInterruptVector; pGetInterruptVector GetInterruptVector;
pTranslateBusAddress TranslateBusAddress; pTranslateBusAddress TranslateBusAddress;
@ -68,16 +89,47 @@ typedef struct _BUS_HANDLER
/* GLOBAL VARIABLES **********************************************************/ /* GLOBAL VARIABLES **********************************************************/
//KSPIN_LOCK HalpBusHandlerSpinLock = {0,}; KSPIN_LOCK HalpBusHandlerSpinLock = {0,};
LIST_ENTRY HalpBusHandlerList; LIST_ENTRY HalpBusHandlerList;
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
static
NTSTATUS
STDCALL
HalpNoAdjustResourceList (
PBUS_HANDLER BusHandler,
ULONG BusNumber,
PCM_RESOURCE_LIST Resources
)
{
return STATUS_UNSUCCESSFUL;
}
static
NTSTATUS
STDCALL
HalpNoAssignSlotResources (
PBUS_HANDLER BusHandler,
ULONG BusNumber,
PUNICODE_STRING RegistryPath,
PUNICODE_STRING DriverClassName,
PDRIVER_OBJECT DriverObject,
PDEVICE_OBJECT DeviceObject,
ULONG SlotNumber,
PCM_RESOURCE_LIST *AllocatedResources
)
{
return STATUS_NOT_SUPPORTED;
}
static static
ULONG ULONG
STDCALL
HalpNoBusData ( HalpNoBusData (
PBUS_HANDLER BusHandler, PBUS_HANDLER BusHandler,
ULONG BusNumber,
ULONG SlotNumber, ULONG SlotNumber,
PVOID Buffer, PVOID Buffer,
ULONG Offset, ULONG Offset,
@ -87,6 +139,35 @@ HalpNoBusData (
return 0; return 0;
} }
static
ULONG
STDCALL
HalpNoGetInterruptVector (
PBUS_HANDLER BusHandler,
ULONG BusNumber,
ULONG BusInterruptLevel,
ULONG BusInterruptVector,
PKIRQL Irql,
PKAFFINITY Affinity
)
{
return 0;
}
static
ULONG
STDCALL
HalpNoTranslateBusAddress (
PBUS_HANDLER BusHandler,
ULONG BusNumber,
PHYSICAL_ADDRESS BusAddress,
PULONG AddressSpace,
PPHYSICAL_ADDRESS TranslatedAddress
)
{
return 0;
}
PBUS_HANDLER PBUS_HANDLER
HalpAllocateBusHandler ( HalpAllocateBusHandler (
@ -97,7 +178,9 @@ HalpAllocateBusHandler (
{ {
PBUS_HANDLER BusHandler = NULL; PBUS_HANDLER BusHandler = NULL;
// BusHandler = ExAllocatePool (NonPagedPool, sizeof(BUS_HANDLER)); DPRINT("HalpAllocateBusHandler()\n");
BusHandler = ExAllocatePool (NonPagedPool, sizeof(BUS_HANDLER));
if (BusHandler == NULL) if (BusHandler == NULL)
return NULL; return NULL;
@ -110,27 +193,29 @@ HalpAllocateBusHandler (
BusHandler->BusDataType = BusDataType; BusHandler->BusDataType = BusDataType;
BusHandler->BusNumber = BusNumber; BusHandler->BusNumber = BusNumber;
/* initialize handler function table */ /* initialize default bus handler functions */
BusHandler->GetBusData = HalpNoBusData; BusHandler->GetBusData = HalpNoBusData;
BusHandler->SetBusData = HalpNoBusData; BusHandler->SetBusData = HalpNoBusData;
// BusHandler->AdjustResourceList = HalpNoAdjustResourceList; BusHandler->AdjustResourceList = HalpNoAdjustResourceList;
// BusHandler->AssignSlotResources = HalpNoAssignSlotResources; BusHandler->AssignSlotResources = HalpNoAssignSlotResources;
// BusHandler->GetInterruptVector = HalpNoGetInterruptVector; BusHandler->GetInterruptVector = HalpNoGetInterruptVector;
// BusHandler->TranslateBusAddress = HalpNoTranslateBusAddress; BusHandler->TranslateBusAddress = HalpNoTranslateBusAddress;
/* any more ?? */
DPRINT("HalpAllocateBusHandler() done\n");
return BusHandler; return BusHandler;
} }
VOID VOID
HalpInitBusHandlers (VOID) HalpInitBusHandlers (VOID)
{ {
PBUS_HANDLER BusHandler; PBUS_HANDLER BusHandler;
/* general preparations */ /* general preparations */
// KeInitializeSpinLock (&HalpBusHandlerSpinLock); KeInitializeSpinLock (&HalpBusHandlerSpinLock);
InitializeListHead (&HalpBusHandlerList); InitializeListHead (&HalpBusHandlerList);
/* initialize hal dispatch tables */ /* initialize hal dispatch tables */
@ -148,8 +233,8 @@ HalpInitBusHandlers (VOID)
BusHandler = HalpAllocateBusHandler (Internal, BusHandler = HalpAllocateBusHandler (Internal,
ConfigurationSpaceUndefined, ConfigurationSpaceUndefined,
0); 0);
// BusHandler->GetInterruptVector = BusHandler->GetInterruptVector =
// (pGetInterruptVector)HalpGetSystemInterruptVector; (pGetInterruptVector)HalpGetSystemInterruptVector;
// BusHandler->TranslateBusAddress = // BusHandler->TranslateBusAddress =
// (pTranslateBusAddress)HalpTranslateSystemBusAddress; // (pTranslateBusAddress)HalpTranslateSystemBusAddress;
@ -157,17 +242,32 @@ HalpInitBusHandlers (VOID)
BusHandler = HalpAllocateBusHandler (InterfaceTypeUndefined, BusHandler = HalpAllocateBusHandler (InterfaceTypeUndefined,
Cmos, Cmos,
0); 0);
// BusHandler->GetBusData =
// (pGetSetBusData)HalpGetCmosData;
// BusHandler->SetBusData =
// (pGetSetBusData)HalpSetCmosData;
/* pci bus handler */ /* pci bus handler */
BusHandler = HalpAllocateBusHandler (PCIBus, BusHandler = HalpAllocateBusHandler (PCIBus,
PCIConfiguration, PCIConfiguration,
0); 0);
// BusHandler->GetBusData =
// (pGetSetBusData)HalpGetPciData;
// BusHandler->SetBusData =
// (pGetSetBusData)HalpSetPciData;
// BusHandler->GetInterruptVector =
// (pGetInterruptVector)HalpGetPciInterruptVector;
// BusHandler->AdjustResourceList =
// (pGetSetBusData)HalpAdjustPciResourceList;
// BusHandler->AssignSlotResources =
// (pGetSetBusData)HalpAssignPciSlotResources;
/* isa bus handler */ /* isa bus handler */
BusHandler = HalpAllocateBusHandler (Isa, BusHandler = HalpAllocateBusHandler (Isa,
ConfigurationSpaceUndefined, ConfigurationSpaceUndefined,
0); 0);
// BusHandler->TranslateBusAddress =
// (pTranslateBusAddress)HalpTranslateIsaBusAddress;
} }
@ -180,9 +280,9 @@ HaliHandlerForBus (
{ {
PBUS_HANDLER BusHandler; PBUS_HANDLER BusHandler;
PLIST_ENTRY CurrentEntry; PLIST_ENTRY CurrentEntry;
// KIRQL OldIrql; KIRQL OldIrql;
// KeAcquireSpinLock (&HalpBusHandlerSpinLock, &OldIrql); KeAcquireSpinLock (&HalpBusHandlerSpinLock, &OldIrql);
CurrentEntry = HalpBusHandlerList.Flink; CurrentEntry = HalpBusHandlerList.Flink;
while (CurrentEntry != &HalpBusHandlerList) while (CurrentEntry != &HalpBusHandlerList)
@ -191,12 +291,12 @@ HaliHandlerForBus (
if (BusHandler->InterfaceType == InterfaceType && if (BusHandler->InterfaceType == InterfaceType &&
BusHandler->BusNumber == BusNumber) BusHandler->BusNumber == BusNumber)
{ {
// KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql); KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql);
return BusHandler; return BusHandler;
} }
CurrentEntry = CurrentEntry->Flink; CurrentEntry = CurrentEntry->Flink;
} }
// KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql); KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql);
return NULL; return NULL;
} }
@ -211,9 +311,9 @@ HaliHandlerForConfigSpace (
{ {
PBUS_HANDLER BusHandler; PBUS_HANDLER BusHandler;
PLIST_ENTRY CurrentEntry; PLIST_ENTRY CurrentEntry;
// KIRQL OldIrql; KIRQL OldIrql;
// KeAcquireSpinLock (&HalpBusHandlerSpinLock, &OldIrql); KeAcquireSpinLock (&HalpBusHandlerSpinLock, &OldIrql);
CurrentEntry = HalpBusHandlerList.Flink; CurrentEntry = HalpBusHandlerList.Flink;
while (CurrentEntry != &HalpBusHandlerList) while (CurrentEntry != &HalpBusHandlerList)
@ -222,12 +322,12 @@ HaliHandlerForConfigSpace (
if (BusHandler->BusDataType == BusDataType && if (BusHandler->BusDataType == BusDataType &&
BusHandler->BusNumber == BusNumber) BusHandler->BusNumber == BusNumber)
{ {
// KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql); KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql);
return BusHandler; return BusHandler;
} }
CurrentEntry = CurrentEntry->Flink; CurrentEntry = CurrentEntry->Flink;
} }
// KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql); KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql);
return NULL; return NULL;
} }
@ -242,9 +342,9 @@ HaliReferenceHandlerForBus (
{ {
PBUS_HANDLER BusHandler; PBUS_HANDLER BusHandler;
PLIST_ENTRY CurrentEntry; PLIST_ENTRY CurrentEntry;
// KIRQL OldIrql; KIRQL OldIrql;
// KeAcquireSpinLock (&HalpBusHandlerSpinLock, &OldIrql); KeAcquireSpinLock (&HalpBusHandlerSpinLock, &OldIrql);
CurrentEntry = HalpBusHandlerList.Flink; CurrentEntry = HalpBusHandlerList.Flink;
while (CurrentEntry != &HalpBusHandlerList) while (CurrentEntry != &HalpBusHandlerList)
@ -254,12 +354,12 @@ HaliReferenceHandlerForBus (
BusHandler->BusNumber == BusNumber) BusHandler->BusNumber == BusNumber)
{ {
BusHandler->RefCount++; BusHandler->RefCount++;
// KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql); KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql);
return BusHandler; return BusHandler;
} }
CurrentEntry = CurrentEntry->Flink; CurrentEntry = CurrentEntry->Flink;
} }
// KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql); KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql);
return NULL; return NULL;
} }
@ -274,9 +374,9 @@ HaliReferenceHandlerForConfigSpace (
{ {
PBUS_HANDLER BusHandler; PBUS_HANDLER BusHandler;
PLIST_ENTRY CurrentEntry; PLIST_ENTRY CurrentEntry;
// KIRQL OldIrql; KIRQL OldIrql;
// KeAcquireSpinLock (&HalpBusHandlerSpinLock, &OldIrql); KeAcquireSpinLock (&HalpBusHandlerSpinLock, &OldIrql);
CurrentEntry = HalpBusHandlerList.Flink; CurrentEntry = HalpBusHandlerList.Flink;
while (CurrentEntry != &HalpBusHandlerList) while (CurrentEntry != &HalpBusHandlerList)
@ -286,12 +386,12 @@ HaliReferenceHandlerForConfigSpace (
BusHandler->BusNumber == BusNumber) BusHandler->BusNumber == BusNumber)
{ {
BusHandler->RefCount++; BusHandler->RefCount++;
// KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql); KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql);
return BusHandler; return BusHandler;
} }
CurrentEntry = CurrentEntry->Flink; CurrentEntry = CurrentEntry->Flink;
} }
// KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql); KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql);
return NULL; return NULL;
} }
@ -303,13 +403,13 @@ HaliDereferenceBusHandler (
PBUS_HANDLER BusHandler PBUS_HANDLER BusHandler
) )
{ {
// KIRQL OldIrql; KIRQL OldIrql;
// KeAcquireSpinLock (&HalpBusHandlerSpinLock, &OldIrql); KeAcquireSpinLock (&HalpBusHandlerSpinLock, &OldIrql);
BusHandler->RefCount--; BusHandler->RefCount--;
// KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql); KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql);
} }
@ -319,7 +419,6 @@ HalAdjustResourceList (
PCM_RESOURCE_LIST Resources PCM_RESOURCE_LIST Resources
) )
{ {
#if 0
PBUS_HANDLER BusHandler; PBUS_HANDLER BusHandler;
NTSTATUS Status; NTSTATUS Status;
@ -329,14 +428,12 @@ HalAdjustResourceList (
return STATUS_SUCCESS; return STATUS_SUCCESS;
Status = BusHandler->AdjustResourceList (BusHandler, Status = BusHandler->AdjustResourceList (BusHandler,
BusHandler, Resources->List[0].BusNumber,
Resources); Resources);
HaliDereferenceBusHandler (BusHandler); HaliDereferenceBusHandler (BusHandler);
return Status; return Status;
#endif
UNIMPLEMENTED;
} }
@ -353,17 +450,16 @@ HalAssignSlotResources (
PCM_RESOURCE_LIST *AllocatedResources PCM_RESOURCE_LIST *AllocatedResources
) )
{ {
#if 0
PBUS_HANDLER BusHandler; PBUS_HANDLER BusHandler;
NTSTATUS Status; NTSTATUS Status;
BusHandler = HaliReferenceHandlerForBus (InterfaceType, BusHandler = HaliReferenceHandlerForBus (BusType,
BusNumber); BusNumber);
if (BusHandler == NULL) if (BusHandler == NULL)
return STATUS_NOT_FOUND; return STATUS_NOT_FOUND;
Status = BusHandler->AssignSlotResources (BusHandler, Status = BusHandler->AssignSlotResources (BusHandler,
BusHandler, BusNumber,
RegistryPath, RegistryPath,
DriverClassName, DriverClassName,
DriverObject, DriverObject,
@ -374,8 +470,6 @@ HalAssignSlotResources (
HaliDereferenceBusHandler (BusHandler); HaliDereferenceBusHandler (BusHandler);
return Status; return Status;
#endif
UNIMPLEMENTED;
} }
@ -409,7 +503,6 @@ HalGetBusDataByOffset (
ULONG Length ULONG Length
) )
{ {
#if 0
PBUS_HANDLER BusHandler; PBUS_HANDLER BusHandler;
ULONG Result; ULONG Result;
@ -419,6 +512,7 @@ HalGetBusDataByOffset (
return 0; return 0;
Result = BusHandler->GetBusData (BusHandler, Result = BusHandler->GetBusData (BusHandler,
BusNumber,
SlotNumber, SlotNumber,
Buffer, Buffer,
Offset, Offset,
@ -427,8 +521,6 @@ HalGetBusDataByOffset (
HaliDereferenceBusHandler (BusHandler); HaliDereferenceBusHandler (BusHandler);
return Result; return Result;
#endif
UNIMPLEMENTED;
} }
@ -443,7 +535,6 @@ HalGetInterruptVector (
PKAFFINITY Affinity PKAFFINITY Affinity
) )
{ {
#if 0
PBUS_HANDLER BusHandler; PBUS_HANDLER BusHandler;
ULONG Result; ULONG Result;
@ -453,6 +544,7 @@ HalGetInterruptVector (
return 0; return 0;
Result = BusHandler->GetInterruptVector (BusHandler, Result = BusHandler->GetInterruptVector (BusHandler,
BusNumber,
BusInterruptLevel, BusInterruptLevel,
BusInterruptVector, BusInterruptVector,
Irql, Irql,
@ -461,12 +553,6 @@ HalGetInterruptVector (
HaliDereferenceBusHandler (BusHandler); HaliDereferenceBusHandler (BusHandler);
return Result; return Result;
#endif
return (HalpGetSystemInterruptVector (NULL,
BusInterruptLevel,
BusInterruptVector,
Irql,
Affinity));
} }
@ -500,7 +586,6 @@ HalSetBusDataByOffset (
ULONG Length ULONG Length
) )
{ {
#if 0
PBUS_HANDLER BusHandler; PBUS_HANDLER BusHandler;
ULONG Result; ULONG Result;
@ -510,7 +595,7 @@ HalSetBusDataByOffset (
return 0; return 0;
Result = BusHandler->SetBusData (BusHandler, Result = BusHandler->SetBusData (BusHandler,
BusHandler, BusNumber,
SlotNumber, SlotNumber,
Buffer, Buffer,
Offset, Offset,
@ -519,8 +604,6 @@ HalSetBusDataByOffset (
HaliDereferenceBusHandler (BusHandler); HaliDereferenceBusHandler (BusHandler);
return Result; return Result;
#endif
UNIMPLEMENTED;
} }
@ -534,7 +617,6 @@ HalTranslateBusAddress (
PPHYSICAL_ADDRESS TranslatedAddress PPHYSICAL_ADDRESS TranslatedAddress
) )
{ {
#if 0
PBUS_HANDLER BusHandler; PBUS_HANDLER BusHandler;
BOOLEAN Result; BOOLEAN Result;
@ -544,7 +626,7 @@ HalTranslateBusAddress (
return FALSE; return FALSE;
Result = BusHandler->TranslateBusAddress (BusHandler, Result = BusHandler->TranslateBusAddress (BusHandler,
BusHandler, BusNumber,
BusAddress, BusAddress,
AddressSpace, AddressSpace,
TranslatedAddress); TranslatedAddress);
@ -552,8 +634,6 @@ HalTranslateBusAddress (
HaliDereferenceBusHandler (BusHandler); HaliDereferenceBusHandler (BusHandler);
return Result; return Result;
#endif
UNIMPLEMENTED;
} }
/* EOF */ /* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: halinit.c,v 1.8 2000/03/19 13:34:47 ekohl Exp $ /* $Id: halinit.c,v 1.9 2000/03/20 17:59:42 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -31,13 +31,12 @@ HalInitSystem (
if (Phase == 0) if (Phase == 0)
{ {
HalInitializeDisplay (bp); HalInitializeDisplay (bp);
}
else
{
KeInitExceptions(); KeInitExceptions();
KeInitIRQ(); KeInitIRQ();
KeLowerIrql(DISPATCH_LEVEL); KeLowerIrql(DISPATCH_LEVEL);
}
else
{
HalpInitBusHandlers (); HalpInitBusHandlers ();
/* /*

View file

@ -1,4 +1,4 @@
/* $Id: irq.c,v 1.8 2000/03/19 13:34:47 ekohl Exp $ /* $Id: irq.c,v 1.9 2000/03/20 17:59:42 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -369,6 +369,7 @@ VOID IoDisconnectInterrupt(PKINTERRUPT InterruptObject)
ULONG ULONG
STDCALL STDCALL
HalpGetSystemInterruptVector(PVOID BusHandler, HalpGetSystemInterruptVector(PVOID BusHandler,
ULONG BusNumber,
ULONG BusInterruptLevel, ULONG BusInterruptLevel,
ULONG BusInterruptVector, ULONG BusInterruptVector,
PKIRQL Irql, PKIRQL Irql,

View file

@ -1,4 +1,5 @@
/* /* $Id: isa.c,v 1.5 2000/03/20 17:59:42 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
* FILE: ntoskrnl/hal/isa.c * FILE: ntoskrnl/hal/isa.c
@ -29,3 +30,40 @@ BOOL HalIsaProbe(VOID)
*/ */
return(TRUE); return(TRUE);
} }
#if 0
BOOLEAN
STDCALL
HalpTranslateIsaBusAddress (
PBUS_HANDLER BusHandler,
ULONG BusNumber,
PHYSICAL_ADDRESS BusAddress,
PULONG AddressSpace,
PPHYSICAL_ADDRESS TranslatedAddress
)
{
BOOLEAN Result;
Result = HalpTranslateSystemBusAddress (BusHandler,
BusNumber,
BusAddress,
AddressSpace,
TranslatedAddress);
if (Result != FALSE)
return Result;
/* PCI does not provide memory address space */
if (*AddressSpace == 0)
return Result;
Result = HalTranslateBusAddress (PCIBus,
BusNumber,
BusAddress,
AddressSpace,
TranslatedAddress);
return Result;
}
#endif
/* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: main.c,v 1.40 2000/03/16 18:44:56 dwelch Exp $ /* $Id: main.c,v 1.41 2000/03/20 18:00:24 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -178,7 +178,7 @@ asmlinkage void _main(boot_param* _bp)
strcpy (bp.kernel_parameters, "/DEBUGPORT=SCREEN"); strcpy (bp.kernel_parameters, "/DEBUGPORT=SCREEN");
/* /*
* Initalize the hal (Phase 0) * Initialization phase 0
*/ */
HalInitSystem (0, &bp); HalInitSystem (0, &bp);
@ -203,6 +203,9 @@ asmlinkage void _main(boot_param* _bp)
PAGE_ROUND_UP(bp.module_length[i]); PAGE_ROUND_UP(bp.module_length[i]);
} }
DPRINT("MmInitSystem()\n");
MmInitSystem(0, &bp, last_kernel_address);
/* /*
* Initialize the kernel debugger * Initialize the kernel debugger
*/ */
@ -213,12 +216,16 @@ asmlinkage void _main(boot_param* _bp)
// } // }
/* /*
* Initialization phase 1
* Initalize various critical subsystems * Initalize various critical subsystems
*/ */
DPRINT("Kernel Initialization Phase 1\n");
DPRINT("HalInitSystem()\n"); DPRINT("HalInitSystem()\n");
HalInitSystem (1, &bp); HalInitSystem (1, &bp);
DPRINT("MmInitialize()\n"); DPRINT("MmInitSystem()\n");
MmInitialize(&bp, last_kernel_address); MmInitSystem(1, &bp, 0);
DPRINT("KeInit()\n"); DPRINT("KeInit()\n");
KeInit(); KeInit();
DPRINT("ExInit()\n"); DPRINT("ExInit()\n");

View file

@ -1,4 +1,5 @@
/* /* $Id: mm.c,v 1.24 2000/03/20 18:00:55 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top directory * COPYRIGHT: See COPYING in the top directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
* FILE: ntoskrnl/mm/mm.c * FILE: ntoskrnl/mm/mm.c
@ -109,19 +110,14 @@ VOID MmInitVirtualMemory(boot_param* bp)
Length = ParamLength; Length = ParamLength;
MmCreateMemoryArea(KernelMode,NULL,MEMORY_AREA_SYSTEM,&BaseAddress, MmCreateMemoryArea(KernelMode,NULL,MEMORY_AREA_SYSTEM,&BaseAddress,
Length,0,&kernel_param_desc); Length,0,&kernel_param_desc);
BaseAddress = (PVOID)(KERNEL_BASE + PAGE_ROUND_UP(kernel_len) + PAGESIZE); BaseAddress = (PVOID)(KERNEL_BASE + PAGE_ROUND_UP(kernel_len) + PAGESIZE);
Length = NONPAGED_POOL_SIZE; Length = NONPAGED_POOL_SIZE;
MmCreateMemoryArea(KernelMode,NULL,MEMORY_AREA_SYSTEM,&BaseAddress, MmCreateMemoryArea(KernelMode,NULL,MEMORY_AREA_SYSTEM,&BaseAddress,
Length,0,&kernel_pool_desc); Length,0,&kernel_pool_desc);
// MmDumpMemoryAreas(); // MmDumpMemoryAreas();
CHECKPOINT; DPRINT("MmInitVirtualMemory() done\n");
// while (inb_p(0x60)!=0x1); inb_p(0x60);
MmInitSectionImplementation();
MmInitPagingFile();
} }
NTSTATUS MmCommitedSectionHandleFault(MEMORY_AREA* MemoryArea, PVOID Address) NTSTATUS MmCommitedSectionHandleFault(MEMORY_AREA* MemoryArea, PVOID Address)
@ -406,3 +402,21 @@ void MmInitialize(boot_param* bp, ULONG LastKernelAddress)
*/ */
MmInitVirtualMemory(bp); MmInitVirtualMemory(bp);
} }
VOID
MmInitSystem (ULONG Phase, boot_param* bp, ULONG LastKernelAddress)
{
if (Phase == 0)
{
/* Phase 0 Initialization */
MmInitialize (bp, LastKernelAddress);
}
else
{
/* Phase 1 Initialization */
MmInitSectionImplementation();
MmInitPagingFile();
}
}
/* EOF */