File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -334,11 +334,6 @@ CmpInitializeHardwareConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
334334 ULONG Disposition ;
335335 UNICODE_STRING KeyName ;
336336
337- /* Set the alternative system architecture information */
338- #if defined(SARCH_PC98 )
339- SharedUserData -> AlternativeArchitecture = NEC98x86 ;
340- #endif
341-
342337 /* Setup the key name */
343338 RtlInitUnicodeString (& KeyName ,
344339 L"\\Registry\\Machine\\Hardware\\DeviceMap" );
@@ -399,6 +394,30 @@ CmpInitializeHardwareConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
399394 /* Check if we got anything from NTLDR */
400395 if (LoaderBlock -> ConfigurationRoot )
401396 {
397+ #ifdef _M_IX86
398+ /* Set the alternative system architecture information */
399+ const CHAR SystemId_PC98 [] = "NEC PC-98" ;
400+
401+ PCONFIGURATION_COMPONENT_DATA ConfigData ;
402+ ConfigData = KeFindConfigurationEntry (LoaderBlock -> ConfigurationRoot ,
403+ SystemClass ,
404+ MaximumType ,
405+ NULL );
406+ if (ConfigData )
407+ {
408+ /* Check if the system identifier starts with a known string.
409+ * Set kernel flags and initialize variables accordingly. */
410+ if (RtlCompareMemory (ConfigData -> ComponentEntry .Identifier ,
411+ SystemId_PC98 ,
412+ sizeof (SystemId_PC98 ) - 1 ) == sizeof (SystemId_PC98 ) - 1 )
413+ {
414+ /* Running on a NEC PC-9800 or compatible */
415+ KeI386MachineType |= 0x100 ; /* Should probably be one of MACHINE_TYPE_* consts */
416+ SharedUserData -> AlternativeArchitecture = NEC98x86 ;
417+ }
418+ }
419+ #endif
420+
402421 /* Setup the configuration tree */
403422 Status = CmpSetupConfigurationTree (LoaderBlock -> ConfigurationRoot ,
404423 KeyHandle ,
Original file line number Diff line number Diff line change @@ -732,6 +732,7 @@ extern ULONG KeI386FxsrPresent;
732732extern ULONG KiMXCsrMask ;
733733extern ULONG KeI386CpuType ;
734734extern ULONG KeI386CpuStep ;
735+ extern ULONG KeI386MachineType ;
735736extern ULONG KiFastSystemCallDisable ;
736737extern UCHAR KiDebugRegisterTrapOffsets [9 ];
737738extern UCHAR KiDebugRegisterContextOffsets [9 ];
You can’t perform that action at this time.
0 commit comments