xemu
xemu copied to clipboard
i386: Implement EBL_CR_POWERON MSR for Xbox CPU
This implements reading of the EBL_CR_POWERON
MSR, which is documented in chapter 2.22 of Intel's Software Developer's Manual Volume 4. Technically some of its bits are supposed to be writable so this implementation is not entirely accurate, but to my knowledge neither the kernel nor the XDK ever access this MSR.
I intend to use this in nxdk in the future to calculate TSC frequency with perfect accuracy.
The value returned was taken from a stock Xbox CPU.
Testing is simple and can be done with a small nxdk app (might need a #include <intrin.h>
):
uint64_t msr = __readmsr(0x2a);
debugPrint("MSR 0x2a: 0x%llx\n", msr);
I only implemented it for the TCG backend, I hope that's ok.
I intend to use this in nxdk in the future to calculate TSC frequency with perfect accuracy.
I had looked into this before ever playing with timers. The MSR does not accurately report over 10X multiplier. With 1.4GHz CPUs the multiplier is 10.5x. They report 0xCFC40000
.
Kinda off-topic, but I already have it implemented and working.
Nice! All the docs I could find stop at 10X.
Pentium III Processor in BGA2 and Micro-PGA2 Packages Linux
As for the PR. I don't think it's appropriate, nxdk apps will assume an incorrect frequency based on this and (likely, I haven't seen your code) the FSB register, however xemu manually sets this via this.
Hi, how was the multipliers >10X confirmed?