I just wrote a little code for HPET and tested under QEmu. It detects the address of the HPET registers properly according to the appropriate ACPI table.
After that I tried to disable the HPET timer with the -no-hpet parameter of QEmu, but the problem is that the HPET ACPI table is still present and valid according to its checksum. My question is that how should I detect that the HPET is disabled?
HPET on QEmu
Re: HPET on QEmu
After checking some of the HPET registers for invalid values, such as the ID register with 0 value, I was able to figure out that the HPET is "invalid".
BTW, it would be better to not even include the HPET ACPI table if it's disabled ...
BTW, it would be better to not even include the HPET ACPI table if it's disabled ...
-
- Member
- Posts: 153
- Joined: Sun Jan 07, 2007 9:40 am
- Contact:
Re: HPET on QEmu
I don't see anything in the wiki on hpet. (Perhaps my blackberry is wacking out). If you could include ur findings for others it would be appreciated.
Re: HPET on QEmu
That could be a bug in QEmu. Although I can imagine that if the HPETs can be enabled by software (BIOS?) that they'd be included in the ACPI tables anyway.giszo wrote:BTW, it would be better to not even include the HPET ACPI table if it's disabled ...
JAL
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: HPET on QEmu
The tables are also generated by the BIOS and I'm not sure what should happen on real hardware. I'm just guessing here but if there was a real machine with a HPET that the BIOS doesn't put in the HPET mode (i.e., runs in PIT compatibility mode), the OS could read the ACPI tables and know it's a HPET and set it in the right mode. However, I doubt QEMU will actually emulate a HPET in PIT mode judging by the flag (i.e., "-no-hpet"). Thus, it's probably a bug in QEMU.
Unfortunately this kind of behavior is probably not formally specified anywhere. As if buggy ACPI tables weren't enough...
Unfortunately this kind of behavior is probably not formally specified anywhere. As if buggy ACPI tables weren't enough...
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]