I tested it 3 times, and each time it showed the following in the bochsout.txt file:
[tt]00000833195i[CPU ] WARNING: HLT instruction with IF=0![/tt]
Then I removed those two instructions from the beginning of the boot sector and moved them to the end of stage 2 (right after I switched to PMode)...
I tested it 3 times again, and it returned the following each time:
[tt]00000843762i[CPU ] WARNING: HLT instruction with IF=0![/tt]
At the end were two instructions that were useless, considering I wasn't using the fs and gs segment registers, so I removed these two lines from the end:
Code: Select all
???mov???fs, eax
???mov???gs, eax
[tt]00000843760i[CPU ] WARNING: HLT instruction with IF=0![/tt]
The timings seem to be very accurate. The difference from removing those 2 instructions was 2 on the bochs timer, which I'm assuming is clock cycles. The bochs timings for disk reads seem to be exactly the same each time, as well.
The total time for the boot code to run from beginning to end, with the 2 instructions removed, was 10,565, which I got by subtracting the beginning time from the end time.
These results seem to be accurate and make it much easier to profile your code.