#1315 APIC Timer calibrates wrong

Adam Clark

I calibrate the APIC timer to interrupt once per second. In Bochs, it interrupts about 20 times per second. I have tested my code on real hardware and get the results I am expecting.


  • Adam Clark

    Adam Clark - 2012-09-06

    Test case for APIC timer at 1 second intervals

  • Adam Clark

    Adam Clark - 2012-09-06

    I have included a disk image for a test case. After the line "Starting CentruyOS", expect an "*" to appear on the next line and beyond at a rate of 1/sec.

  • Stanislav Shwartsman

    Please define what do you call "second".

    I guess it might appear once a second but seconds run differently inside Bochs, not like on real hardware.

    In Bochs a "second" length depends on your IPS setting in the machine. Every "IPS" instructions executed a second passes. You forgot to attach your .bochsrc so I cannot guess about your configuration at all.

    I believe this is not a bug.


  • Adam Clark

    Adam Clark - 2012-09-07

    Config file

  • Adam Clark

    Adam Clark - 2012-09-07

    I cannot find a .bochsrc file on my system. I use the following command line to launch:

    bochs_cmdline="bochs -q -f /home/adam/century/util/bochs2.cfg"

    bochs2.cfg is now attached.

    In my report, the word "second" is a measure of time equivalent to 1/60th of a minute (not trying to be smart, but just not sure what you are looking for...), measured in real time.

    So, I guess that from what I am understanding from your reply, the actual interrupt frequency is not dependent on the calibration of the timer; but rather based on how many instructions you want to execute in a second. If this is the case, then this logic is similar to looping while counting to 1,000,000 to execute a 1-second delay and having that same code break when you buy a new PC.

    Is there a doc or wiki that shows how to tune this properly?

  • Stanislav Shwartsman

    I see your IPS is set tp 4M and you simulating 2 CPU.
    I don't know what is your hardware but this settings looks way to low for me.
    How did you determine this number ?

    Normally you should set IPS to the value that appear you in the GUI window through show-ips feature -> in thiscase you should have more or less some correlation between host clock and guest clock.

    But in general host clock and guest clock have no relation between them. The guest time is emulated based on IPS. IPS doesn't mean how many instructions you want to execute per second. It would define a second matching to this many instructions. I know it might be not very clear from user docs (in case your ead them).

  • Volker Ruppert

    Volker Ruppert - 2014-05-26

    No response, closing this item.

  • Volker Ruppert

    Volker Ruppert - 2014-05-26
    • status: open --> closed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks