Jérôme had the idea checking if MSR bit is active before using msr_read/msr_write in generic_x86.cpp if (get_current_cpuid(&cpuInfo, 1) != B_OK || (cpuInfo.eax_1.features & IA32_FEATURE_MSR) == 0) return; #define IA32_FEATURE_MSR (1UL << 5) was added to haiku/trunk/headers/private/kernel/arch/x86/arch_cpu.h First i separated completely, intel from others, i did the following: Index: generic_x86.cpp =================================================================== --- generic_x86.cpp (revision 19851) +++ generic_x86.cpp (working copy) @@ -181,7 +181,7 @@ module_info *modules[] = { (module_info *)&gIntelModule, - (module_info *)&gAMDModule, - (module_info *)&gVIAModule, +// (module_info *)&gAMDModule, +// (module_info *)&gVIAModule, NULL }; Index: Jamfile =================================================================== --- Jamfile (revision 19851) +++ Jamfile (working copy) @@ -4,7 +4,7 @@ KernelAddon generic_x86 : generic_x86.cpp - amd.cpp +# amd.cpp intel.cpp - via.cpp +# via.cpp ; RESULT: the same stacktrace as previous. After some testings i find that function generic_mtrr_compute_physical_mask() in intel.cpp is executing successfully. So, next i try to be sure that generic_dump_mtrrs is executing successfully in intel.cpp: [...] - generic_dump_mtrrs(generic_count_mtrrs()); + generic_dump_mtrrs(0); [...] If i understood correctly we want generic_count_mtrrs() returns 0 in the case of a pentium mmx without mttrs. Surprise!! even with generic_dump_mtrrs(0); a got the same stacktrace. So i focused in generic_dump_mtrrs (in generic_x86.cpp) and did the following: (svn diff generic_x86.cpp > generic_x86.diff) Index: generic_x86.cpp =================================================================== --- generic_x86.cpp (revision 19851) +++ generic_x86.cpp (working copy) @@ -28,6 +28,7 @@ #define IA32_MTRR_ENABLE_FIXED (1UL << 10) #define IA32_MTRR_VALID_RANGE (1UL << 11) +#define IA32_FEATURE_MSR (1UL << 5) struct mtrr_capabilities { mtrr_capabilities(uint64 value) { *(uint64 *)this = value; } @@ -48,7 +49,8 @@ { cpuid_info cpuInfo; if (get_current_cpuid(&cpuInfo, 1) != B_OK - || (cpuInfo.eax_1.features & IA32_FEATURE_MTRR) == 0) + || (cpuInfo.eax_1.features & IA32_FEATURE_MTRR) == 0 + || (cpuInfo.eax_1.features & IA32_FEATURE_MSR) == 0) return 0; mtrr_capabilities capabilities(x86_read_msr(IA32_MSR_MTRR_CAPABILITIES)); @@ -160,6 +162,13 @@ void generic_dump_mtrrs(uint32 count) { + + cpuid_info cpuInfo; + if (get_current_cpuid(&cpuInfo, 1) != B_OK + || (cpuInfo.eax_1.features & IA32_FEATURE_MTRR) == 0 + || (cpuInfo.eax_1.features & IA32_FEATURE_MSR) == 0) + return; + if (x86_read_msr(IA32_MSR_MTRR_DEFAULT_TYPE) & IA32_MTRR_ENABLE) { TRACE(("MTRR enabled\n")); } else { @@ -181,7 +190,7 @@ module_info *modules[] = { (module_info *)&gIntelModule, - (module_info *)&gAMDModule, - (module_info *)&gVIAModule, +// (module_info *)&gAMDModule, +// (module_info *)&gVIAModule, NULL }; RESULT: the module is loaded successfully. I think indeed generic_count_mtrrs() returns 0 and generic_dump_mtrrs returns immediately after the if statement. The problem was indeed the execution of x86_read_msr in generic_dump_mtrrs.Jérôme had the idea checking if MSR bit is active before using msr_read/msr_write in generic_x86.cpp if (get_current_cpuid(&cpuInfo, 1) != B_OK || (cpuInfo.eax_1.features & IA32_FEATURE_MSR) == 0) return; #define IA32_FEATURE_MSR (1UL << 5) was added to haiku/trunk/headers/private/kernel/arch/x86/arch_cpu.h First i separated completely, intel from others, i did the following: Index: generic_x86.cpp =================================================================== --- generic_x86.cpp (revision 19851) +++ generic_x86.cpp (working copy) @@ -181,7 +181,7 @@ module_info *modules[] = { (module_info *)&gIntelModule, - (module_info *)&gAMDModule, - (module_info *)&gVIAModule, +// (module_info *)&gAMDModule, +// (module_info *)&gVIAModule, NULL }; Index: Jamfile =================================================================== --- Jamfile (revision 19851) +++ Jamfile (working copy) @@ -4,7 +4,7 @@ KernelAddon generic_x86 : generic_x86.cpp - amd.cpp +# amd.cpp intel.cpp - via.cpp +# via.cpp ; RESULT: the same stacktrace as previous. After some testings i find that function generic_mtrr_compute_physical_mask() in intel.cpp is executing successfully. So, next i try to be sure that generic_dump_mtrrs is executing successfully in intel.cpp: [...] - generic_dump_mtrrs(generic_count_mtrrs()); + generic_dump_mtrrs(0); [...] If i understood correctly we want generic_count_mtrrs() returns 0 in the case of a pentium mmx without mttrs. Surprise!! even with generic_dump_mtrrs(0); a got the same stacktrace. So i focused in generic_dump_mtrrs (in generic_x86.cpp) and did the following: (svn diff generic_x86.cpp > generic_x86.diff) Index: generic_x86.cpp =================================================================== --- generic_x86.cpp (revision 19851) +++ generic_x86.cpp (working copy) @@ -28,6 +28,7 @@ #define IA32_MTRR_ENABLE_FIXED (1UL << 10) #define IA32_MTRR_VALID_RANGE (1UL << 11) +#define IA32_FEATURE_MSR (1UL << 5) struct mtrr_capabilities { mtrr_capabilities(uint64 value) { *(uint64 *)this = value; } @@ -48,7 +49,8 @@ { cpuid_info cpuInfo; if (get_current_cpuid(&cpuInfo, 1) != B_OK - || (cpuInfo.eax_1.features & IA32_FEATURE_MTRR) == 0) + || (cpuInfo.eax_1.features & IA32_FEATURE_MTRR) == 0 + || (cpuInfo.eax_1.features & IA32_FEATURE_MSR) == 0) return 0; mtrr_capabilities capabilities(x86_read_msr(IA32_MSR_MTRR_CAPABILITIES)); @@ -160,6 +162,13 @@ void generic_dump_mtrrs(uint32 count) { + + cpuid_info cpuInfo; + if (get_current_cpuid(&cpuInfo, 1) != B_OK + || (cpuInfo.eax_1.features & IA32_FEATURE_MTRR) == 0 + || (cpuInfo.eax_1.features & IA32_FEATURE_MSR) == 0) + return; + if (x86_read_msr(IA32_MSR_MTRR_DEFAULT_TYPE) & IA32_MTRR_ENABLE) { TRACE(("MTRR enabled\n")); } else { @@ -181,7 +190,7 @@ module_info *modules[] = { (module_info *)&gIntelModule, - (module_info *)&gAMDModule, - (module_info *)&gVIAModule, +// (module_info *)&gAMDModule, +// (module_info *)&gVIAModule, NULL }; RESULT: the module is loaded successfully. I think indeed generic_count_mtrrs() returns 0 and generic_dump_mtrrs returns immediately after the if statement. The problem was indeed the execution of x86_read_msr in generic_dump_mtrrs.