I am currently making a timer for a project I am working on based on RDTSC and I need to calculate the CPU's frequancy to determain how much time has elapsed. I have read the CPUID doc that show you how to calculate the CPU's freqency but I can get this to work for me so my question is it possible to get this method to work on Windows since we dont have access to Ring 0. I have been told it is possible using the 8254 timer 2 but I dont know how to implment this into inline assembly. Can someone please give me some information on how to implement this or point me to a doc that provides more information on this.
Please note I am just starting on learning assembly but I do understand the logic behind the algorithm that was shown in the CPUID doc I just dont know how to impment it using Windows (I tried to impment it using inline assembly but I couldnt get it to compile in the form shown in the CPUID doc for some reason and I get access violations when i did get it to compile). Any help will be appricatied.
Thanks in advance
PS: Here is the doc I am refering to - ftp://download.intel.com/design/Xeon/applnots/24161823.pdf