Hi,
JulienDarc wrote:While I certainly agree I plan to buy some used hardware to make a server to test my OS.
For full testing, you'd need to test all the combinations (Intel/AMD, with deadline mode, with "fixed rate" TSC, with HPET, ..., etc). This can get expensive if you're testing on real hardware and actually buy a computer for each different case; especially later when you start caring about many different CPU features.
The simple answer is to use a configurable virtual machine instead. Bochs is free (and does support TSC deadline).
JulienDarc wrote:Nehalem you think?
I tested on my Nehalem (Xeon E5520) with this code:
Code: Select all
int main(void) {
int i;
uint32_t a, b, c, d;
i = 0;
asm volatile ("cpuid" : "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (i), "c" (0));
printf("0x%08X, 0x%08X, 0x%08X, 0x%08X\n", a,b,c,d);
i = 1;
asm volatile ("cpuid" : "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (i), "c" (0));
printf("0x%08X, 0x%08X, 0x%08X, 0x%08X\n", a,b,c,d);
}
Results are:
Code: Select all
0x0000000B, 0x756E6547, 0x6C65746E, 0x49656E69
0x000106A5, 0x03100800, 0x009CE3BD, 0xBFEBFBFF
The "TSC deadline mode" feature flag is bit 24 of ECX, and this flag is clear, so (at least on my Nehalem) it's not supported. I don't have any Sandy Bridge or Ivy Bridge to test on; and I'd assume it's definitely supported on Haswell (and was too lazy to test on that).
Cheers,
Brendan