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.
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
Stanislav
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Test case for APIC timer at 1 second intervals
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.
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.
Stanislav
Config file
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?
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).
No response, closing this item.