I have a C program that runs on bare x86 (without an OS) in protected mode. I need to delay the program's execution for a certain amount of time. Currently, I'm doing this:
for(p=0; p<1000000; ++p) asm("pause");
But this looks very very wrong (I do get a delay, but apparently, I have no real control over its duration: the length of the "pause" is undefined).
Now, I'm not really experienced with stuff at such low level, and I've been searching the net for solutions, but so far the only one that I found involved BIOS interrupts, which don't work in pmode (or so I was told).
So, how do I delay execution when in protected mode?