- Use WinXP style /SOS output when enabled. (TODO: Display banner/memory/cpu).

- Make more init functions return TRUE/FALSE and bugcheck the system if they failed.
- Add more progress bar update calls.
- Merge MmInit2 and MmInit3 into MmInitSystem with different phase calls.
- Clear KeLoaderBlock after drivers have been loaded.
- Update kernel fun.
- Update symbolic names of certain strings in ntoskrnl.mc. Use WINDOWS_NT... instead of REACTOS because these names are documented and should be kept for cross-code compatibility.

svn path=/trunk/; revision=25629
This commit is contained in:
Alex Ionescu 2007-01-25 17:51:45 +00:00
parent bbf7047df5
commit 819a0ed90a
18 changed files with 151 additions and 140 deletions

View file

@ -306,7 +306,7 @@ CheckVolume(
}
/* Call provider */
PrintString(" Verifying volume %S\n", DrivePath);
//PrintString(" Verifying volume %S\n", DrivePath);
RtlInitUnicodeString(&DrivePathU, DrivePath);
Status = ChkdskFunc(&DrivePathU,
TRUE, // FixErrors
@ -364,7 +364,7 @@ _main(int argc,
CheckVolume(DrivePath);
}
}
PrintString(" Done\n\n");
//PrintString(" Done\n\n");
return 0;
}

View file

@ -926,13 +926,13 @@ LoadAndBootReactOS(PCSTR OperatingSystemName)
* Load boot drivers
*/
FrLdrLoadBootDrivers(szBootPath, 40);
UiUnInitialize("Booting ReactOS...");
//UiUnInitialize("Booting ReactOS...");
/*
* Now boot the kernel
*/
DiskStopFloppyMotor();
MachVideoPrepareForReactOS();
//MachVideoPrepareForReactOS();
FrLdrStartup(0x2badb002);
}

View file

@ -48,7 +48,7 @@
#define CRTC_CURLO 0x0f
#define CHAR_ATTRIBUTE_BLACK 0x00 /* black on black */
#define CHAR_ATTRIBUTE 0x1F /* grey on blue */
#define CHAR_ATTRIBUTE 0x07 /* grey on blue */
/* GLOBALS *******************************************************************/
@ -65,7 +65,7 @@ VidpVgaTextClearDisplay(VOID)
ULONG i;
for (i = 0; i < SizeX * SizeY; i++, ptr++)
*ptr = (0x1700 + ' ');
*ptr = (0x0000 + ' ');
}
static BOOLEAN NTAPI

View file

@ -12,27 +12,26 @@
// - Use APC and DPC Interrupt Dispatchers.
// - CMOS Initialization and CMOS Spinlock.
//
// Fstub:
// - Implement IoAssignDriveLetters using mount manager support.
//
// Kd:
// - Implement KD Kernel Debugging and WinDBG support.
// Global:
// - TODO: Complete the list of bufxies
// - Fix process reference count leak.
// - Fix atapi.sys loading one more time at each boot.
// - Fix LiveCD.
//
///////////////////////////////////////////////////////////////////////////////
// REACTOS GUIDANCE PLAN
// ________________________________________________________________________________________________________
// / \
// | OB, PS, LPC, DBGK, EX => "Code complete". No expected changes until 0.5.0 | |
// | OB, PS, LPC, DBGK, EX, INIT => "Code complete". No expected changes until 0.5.0 | |
// | SE => Not looked at. Interaction with Ps/Io is minimal and currently hacked away. Preserve. |J|
// | INIT => Boot sequence still needs work in terms of interaction with Ke and CPU features. |A|
// | KD/KDBG => Laptop has special version of ROS without these components. Commit in branch. |N|
// | HAL => Needs APC/DPC/IRQL implementation fixed ASAP in terms of interaction with Ke. | |
// | KD/KDBG => Laptop has special version of ROS without these components. Commit in branch. |A|
// | HAL => Needs APC/DPC/IRQL implementation fixed ASAP in terms of interaction with Ke. |N|
// | || || || || || || || || || || || || | |
// | \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ |F|
// | KE => Enable new thread scheduler and ensure it works. |E|
// | KD => Implement KD64 6.0, compatible with WinDBG |B|
// | FSTUB => Needs IoAssignDriveLetters fixed ASAP but not critical to Ke/Ex. Interacts with Io. | |
// | BUGFIXES BUGFIXES BUGFIXES BUGFIXES BUGFIXES BUGFIXES BUGFIXES BUGFIXES BUGFIXES BUGFIXES BUGFIXES |E|
// | KE => Enable new thread scheduler and ensure it works. |B|
// | KD => Implement KD64 6.0, compatible with WinDBG | |
// | || || || || || || || || || || || || |M|
// | \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ |A|
// | CM => TOTAL REWRITE. |R|

View file

@ -16,11 +16,12 @@
/* FUNCTIONS *****************************************************************/
VOID
BOOLEAN
NTAPI
CcInitializeCacheManager(VOID)
{
CcInitView();
return TRUE;
}
/*

View file

@ -314,42 +314,6 @@ ExpInitNls(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
ExpNlsTableBase = SectionBase;
}
VOID
INIT_FUNCTION
ExpDisplayNotice(VOID)
{
CHAR str[50];
if (ExpInTextModeSetup)
{
HalDisplayString(
"\n\n\n ReactOS " KERNEL_VERSION_STR " Setup \n");
HalDisplayString(
" \xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD");
HalDisplayString(
"\xCD\xCD\n");
return;
}
HalDisplayString("Starting ReactOS "KERNEL_VERSION_STR" (Build "
KERNEL_VERSION_BUILD_STR")\n");
HalDisplayString(RES_STR_LEGAL_COPYRIGHT);
HalDisplayString("\n\nReactOS is free software, covered by the GNU General "
"Public License, and you\n");
HalDisplayString("are welcome to change it and/or distribute copies of it "
"under certain\n");
HalDisplayString("conditions. There is absolutely no warranty for "
"ReactOS.\n\n");
/* Display number of Processors */
sprintf(str,
"Found %x system processor(s). [%lu MB Memory]\n",
(int)KeNumberProcessors,
(MmFreeLdrMemHigher + 1088)/ 1024);
HalDisplayString(str);
}
NTSTATUS
NTAPI
ExpLoadInitialProcess(IN OUT PRTL_USER_PROCESS_INFORMATION ProcessInformation)
@ -1083,6 +1047,8 @@ Phase1InitializationDiscard(PVOID Context)
InitWinPEModeType |= (strstr(CommandLine, "INRAM")) ? 0x80000000 : 1;
}
/* FIXME: Print product name, version, and build */
/* Initialize Power Subsystem in Phase 0 */
if (!PoInitSystem(0, AcpiTableDetected)) KeBugCheck(INTERNAL_POWER_ERROR);
@ -1127,6 +1093,11 @@ Phase1InitializationDiscard(PVOID Context)
/* Initialize all processors */
if (!HalAllProcessorsStarted()) KeBugCheck(HAL1_INITIALIZATION_FAILED);
/* FIXME: Print CPU and Memory */
/* Update the progress bar */
InbvUpdateProgressBar(5);
/* Call OB initialization again */
if (!ObInit()) KeBugCheck(OBJECT1_INITIALIZATION_FAILED);
@ -1158,54 +1129,78 @@ Phase1InitializationDiscard(PVOID Context)
}
/* Set up Region Maps, Sections and the Paging File */
MmInit2();
if (!MmInitSystem(1, LoaderBlock)) KeBugCheck(MEMORY1_INITIALIZATION_FAILED);
/* Create NLS section */
ExpInitNls(KeLoaderBlock);
/* Initialize Cache Views */
CcInitializeCacheManager();
if (!CcInitializeCacheManager()) KeBugCheck(CACHE_INITIALIZATION_FAILED);
/* Initialize the Registry */
if (!CmInitSystem1()) KeBugCheck(CONFIG_INITIALIZATION_FAILED);
/* Update progress bar */
InbvUpdateProgressBar(15);
/* Update timezone information */
ExRefreshTimeZoneInformation(&SystemBootTime);
/* Initialize the File System Runtime Library */
FsRtlInitSystem();
if (!FsRtlInitSystem()) KeBugCheck(FILE_INITIALIZATION_FAILED);
/* Report all resources used by HAL */
HalReportResourceUsage();
/* Initialize LPC */
LpcpInitSystem();
/* Call the debugger DLL once we have KD64 6.0 support */
//KdDebuggerInitialize1(LoaderBlock);
/* Enter the kernel debugger before starting up the boot drivers */
if (KdDebuggerEnabled && KdpEarlyBreak) DbgBreakPoint();
/* Setup PnP Manager in phase 1 */
if (!PpInitSystem()) KeBugCheck(PP1_INITIALIZATION_FAILED);
/* Update progress bar */
InbvUpdateProgressBar(20);
/* Initialize LPC */
if (!LpcInitSystem()) KeBugCheck(LPC_INITIALIZATION_FAILED);
/* Initialize the I/O Subsystem */
if (!IoInitSystem(KeLoaderBlock)) KeBugCheck(IO1_INITIALIZATION_FAILED);
/* Unmap Low memory, and initialize the MPW and Balancer Thread */
MmInit3();
#if DBG
extern ULONG Guard;
#endif
ASSERT(Guard == 0xCACA1234);
MmInitSystem(2, LoaderBlock);
/* Update progress bar */
InbvUpdateProgressBar(80);
/* Initialize VDM support */
KeI386VdmInitialize();
/* Initialize Power Subsystem in Phase 1*/
PoInitSystem(1, AcpiTableDetected);
if (!PoInitSystem(1, AcpiTableDetected)) KeBugCheck(INTERNAL_POWER_ERROR);
/* Initialize the Process Manager at Phase 1 */
if (!PsInitSystem(LoaderBlock)) KeBugCheck(PROCESS1_INITIALIZATION_FAILED);
/* Update progress bar */
InbvUpdateProgressBar(85);
/* Make sure nobody touches the loader block again */
if (LoaderBlock == KeLoaderBlock) KeLoaderBlock = NULL;
LoaderBlock = Context = NULL;
/* Update progress bar */
InbvUpdateProgressBar(90);
/* Launch initial process */
Status = ExpLoadInitialProcess(ProcessInfo);
/* Update progress bar */
InbvUpdateProgressBar(100);
/* Allow strings to be displayed */
InbvEnableDisplayString(TRUE);
/* Wait 5 seconds for it to initialize */
Timeout.QuadPart = Int32x32To64(5, -10000000);
Status = ZwWaitForSingleObject(ProcessInfo->ProcessHandle, FALSE, &Timeout);

View file

@ -153,7 +153,7 @@ PUCHAR FsRtlLegalAnsiCharacterArray = LegalAnsiCharacterArray;
/* PRIVATE FUNCTIONS *********************************************************/
VOID
BOOLEAN
NTAPI
FsRtlInitSystem(VOID)
{
@ -179,6 +179,8 @@ FsRtlInitSystem(VOID)
{
ExInitializeResource(&FsRtlPagingIoResources[i]);
}
return TRUE;
}
/* PUBLIC FUNCTIONS **********************************************************/

View file

@ -110,7 +110,7 @@ NTSTATUS
NTAPI
WriteCacheSegment(PCACHE_SEGMENT CacheSeg);
VOID
BOOLEAN
NTAPI
CcInitializeCacheManager(VOID);

View file

@ -47,7 +47,7 @@
//
// Initialization Routines
//
VOID
BOOLEAN
NTAPI
FsRtlInitSystem(
VOID

View file

@ -117,9 +117,9 @@ LpcExitThread(
//
// Initialization functions
//
NTSTATUS
BOOLEAN
NTAPI
LpcpInitSystem(
LpcInitSystem(
VOID
);

View file

@ -550,13 +550,10 @@ MmInit1(
ULONG MaxMemInMeg
);
VOID
BOOLEAN
NTAPI
MmInit2(VOID);
VOID
NTAPI
MmInit3(VOID);
MmInitSystem(IN ULONG Phase,
IN PLOADER_PARAMETER_BLOCK LoaderBlock);
VOID
NTAPI

View file

@ -66,7 +66,6 @@ typedef struct __DESCRIPTOR
/*
* Initalization functions (called once by main())
*/
VOID MmInitSystem(ULONG Phase, PLOADER_PARAMETER_BLOCK LoaderBlock, ULONG LastKernelAddress);
BOOLEAN NTAPI ObInit(VOID);
BOOLEAN NTAPI CmInitSystem1(VOID);
VOID CmShutdownRegistry(VOID);

View file

@ -280,14 +280,30 @@ IopDisplayLoadingMessage(PVOID ServiceName,
BOOLEAN Unicode)
{
CHAR TextBuffer[256];
PCHAR Extra = ".sys";
if (ExpInTextModeSetup) return;
if (Unicode)
{
sprintf(TextBuffer, "Loading %S...\n", (PWCHAR)ServiceName);
if (wcsstr(ServiceName, L".sys")) Extra = "";
sprintf(TextBuffer,
"%s%s%s\\%S%s\n",
KeLoaderBlock->ArcBootDeviceName,
KeLoaderBlock->NtBootPathName,
"System32\\Drivers",
(PWCHAR)ServiceName,
Extra);
}
else
{
sprintf(TextBuffer, "Loading %s...\n", (PCHAR)ServiceName);
if (strstr(ServiceName, ".sys")) Extra = "";
sprintf(TextBuffer,
"%s%s%s\\%s%s\n",
KeLoaderBlock->ArcBootDeviceName,
KeLoaderBlock->NtBootPathName,
"System32\\Drivers",
(PCHAR)ServiceName,
Extra);
}
HalDisplayString(TextBuffer);
}

View file

@ -3398,7 +3398,7 @@ PpInitSystem(VOID)
case 1:
/* Do Phase 1 */
return FALSE;
return TRUE;
//return PiInitPhase1();
default:

View file

@ -31,10 +31,9 @@ static GENERIC_MAPPING LpcpPortMapping =
/* PRIVATE FUNCTIONS *********************************************************/
NTSTATUS
INIT_FUNCTION
BOOLEAN
NTAPI
LpcpInitSystem(VOID)
LpcInitSystem(VOID)
{
OBJECT_TYPE_INITIALIZER ObjectTypeInitializer;
UNICODE_STRING Name;
@ -70,7 +69,7 @@ LpcpInitSystem(VOID)
32);
/* We're done */
return STATUS_SUCCESS;
return TRUE;
}
/* PUBLIC FUNCTIONS **********************************************************/

View file

@ -453,10 +453,12 @@ MmInit1(ULONG_PTR FirstKrnlPhysAddr,
BOOLEAN RmapReady, PageOpReady, SectionsReady, PagingReady;
VOID
BOOLEAN
NTAPI
INIT_FUNCTION
MmInit2(VOID)
MmInitSystem(IN ULONG Phase,
IN PLOADER_PARAMETER_BLOCK LoaderBlock)
{
if (Phase == 1)
{
MmInitializeRmapList();
RmapReady = TRUE;
@ -467,21 +469,11 @@ MmInit2(VOID)
MmInitPagingFile();
PagingReady = TRUE;
}
VOID
INIT_FUNCTION
NTAPI
MmInit3(VOID)
else if (Phase == 2)
{
/*
* Unmap low memory
*/
#ifdef CONFIG_SMP
/* In SMP mode we can unmap the low memory
if all processors are started. */
MmDeletePageTable(NULL, 0);
#endif
MmCreatePhysicalMemorySection();
MiInitBalancerThread();
@ -493,6 +485,9 @@ MmInit3(VOID)
/* FIXME: Read parameters from memory */
}
return TRUE;
}
VOID static
MiFreeInitMemoryPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address,
PFN_TYPE Page, SWAPENTRY SwapEntry,

View file

@ -1089,6 +1089,14 @@ Language=English
PP0_INITIALIZATION_FAILED
.
MessageId=0x90
Severity=Success
Facility=System
SymbolicName=PP1_INITIALIZATION_FAILED
Language=English
PP1_INITIALIZATION_FAILED
.
MessageId=0x94
Severity=Success
Facility=System
@ -1300,42 +1308,42 @@ Language=English
IMPERSONATING_WORKER_THREAD
.
MessageId=0x9A
MessageId=0x7E
Severity=Informational
Facility=System
SymbolicName=REACTOS_BANNER
SymbolicName=WINDOWS_NT_BANNER
Language=English
ReactOS Version %s (Build %s)
ReactOS (R) Version %hs (Build %u%hs)
.
MessageId=0x9B
MessageId=0x87
Severity=Informational
Facility=System
SymbolicName=REACTOS_SERVICE_PACK
SymbolicName=WINDOWS_NT_CSD_STRING
Language=English
Service Pack
.
MessageId=0x9C
MessageId=0x88
Severity=Informational
Facility=System
SymbolicName=REACTOS_INFO_STRING_UNI_PROCESSOR
SymbolicName=WINDOWS_NT_INFO_STRING
Language=English
%u System Processor [%u MB Memory] %Z
.
MessageId=0x89
Severity=Informational
Facility=System
SymbolicName=WINDOWS_NT_MP_STRING
Language=English
MulitProcessor Kernel
.
MessageId=0x9D
Severity=Informational
Facility=System
SymbolicName=REACTOS_MP_KERNEL
Language=English
MulitProcessor Kernel
.
MessageId=0x9E
Severity=Informational
Facility=System
SymbolicName=REACTOS_INFO_STRING_MULTI_PROCESSOR
SymbolicName=WINDOWS_NT_INFO_STRING_PLURAL
Language=English
%u System Processors [%u MB Memory] %Z
.

View file

@ -36,8 +36,8 @@ int _cdecl _main(int argc,
{
NTSTATUS Status = STATUS_SUCCESS;
PrintString("ReactOS Client/Server Run-Time (Build %s)\n",
KERNEL_VERSION_BUILD_STR);
//PrintString("ReactOS Client/Server Run-Time (Build %s)\n",
//KERNEL_VERSION_BUILD_STR);
/*==================================================================
* Initialize the Win32 environment subsystem server.