I'm having some problems with the EFLAGS ID-bit method of detecting if a cpu has the cpuid instruction.
I pushfd, store the flags, switch bit 21, push it on the stack, and popfd, and this works ok.
But when I pushfd again to compare the bit 21 with the stored value, It Reboots (Real hardware) or 3rd Exception CPU (Bochs) (interrupts are disabled, I think it's a trap)
But If i pushfd and popfd the second time with no code inbetween, there is no problem.
What am I doing wrong?
CPUID and trap problem
Re:CPUID and trap problem
When you've been looking at code for a few hours trying to fix something, sometimes you just need a quick break
By the time I'd posted and gone back to my code, I saw the problem. I'd poped the eflags into eax, and hadn't pushed eax back on, between the second pushfd and popfd.
By the time I'd posted and gone back to my code, I saw the problem. I'd poped the eflags into eax, and hadn't pushed eax back on, between the second pushfd and popfd.