Grub2 + Qemu Only has old ACPI tables?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
zaptor
Posts: 10
Joined: Wed Aug 01, 2018 9:09 pm

Grub2 + Qemu Only has old ACPI tables?

Post by zaptor »

I am developing an x86_64, multiboot2 compliant OS (with grub2) and testing it on Qemu. When I run it, the multiboot2 only contains tag 14 (old acpi e.g. v1) not 15 (new acpi e.g. 2.0+). The host machine is a Mac OS X late 2016 with an Intel Core i5 and should be using the new ACPI. I am running qemu with the following flags:

Code: Select all

qemu-system-x86_64 -m 8G -boot d -cdrom $(iso)
.

Ideally, I would like to see ACPI v2.0+ tables so I can use an HPET (for example). There was also no XSDT present in the RSDT. Does anyone know how to get my OS to see the new acpi information with my setup? Any help with this would be greatly appreciated.

Qemu Version:

Code: Select all

$ qemu-system-x86_64 --version
QEMU emulator version 2.12.0
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers
Grub2 Version:

Code: Select all

$ /usr/local/grub2/bin/grub-mkrescue --version
/usr/local/grub2/bin/grub-mkrescue (GRUB) 2.03
User avatar
xenos
Member
Member
Posts: 1121
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: Grub2 + Qemu Only has old ACPI tables?

Post by xenos »

Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
Octocontrabass
Member
Member
Posts: 5586
Joined: Mon Mar 25, 2013 7:01 pm

Re: Grub2 + Qemu Only has old ACPI tables?

Post by Octocontrabass »

QEMU emulates an entire computer. The ACPI tables in QEMU describe the emulated hardware, not the host hardware.
zaptor
Posts: 10
Joined: Wed Aug 01, 2018 9:09 pm

Re: Grub2 + Qemu Only has old ACPI tables?

Post by zaptor »

Octocontrabass wrote:QEMU emulates an entire computer. The ACPI tables in QEMU describe the emulated hardware, not the host hardware.
How do I set the emulated hardware to include the new acpi tables in the multiboot2 header?

According to https://wiki.osdev.org/HPET#Detecting_HPET_using_ACPI: "The HPET specification defines an ACPI 2.0 table that is to be used to detect presence, address and capabilities of HPET present in the system. If this table doesn't exist, you should assume there is no HPET and you should fall back to PIT."
zaptor
Posts: 10
Joined: Wed Aug 01, 2018 9:09 pm

Re: Grub2 + Qemu Only has old ACPI tables?

Post by zaptor »

Ah I think I misread. So I do have an HPET. But, now acpi version 2.0+. How do I get qemu to emulate acpi version 2.0+ (i.e. tag 15 in multiboot2 header)?
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Grub2 + Qemu Only has old ACPI tables?

Post by Brendan »

Hi,
zaptor wrote:I am developing an x86_64, multiboot2 compliant OS (with grub2) and testing it on Qemu. When I run it, the multiboot2 only contains tag 14 (old acpi e.g. v1) not 15 (new acpi e.g. 2.0+).
What this actually means:
  • Tag 14: The original RSDP that only includes a reference to the RSDT (which uses 32-bit addresses for everything); which could be used by any version of ACPI including ACPI 7.0 if the firmware doesn't feel like having an XSDT.
  • Tag 15: The extended RSDP that includes a reference to the RSDT (for backward compatibility with 32-bit operating systems) and a reference to an XSDT (which uses 64-bit physical addresses and probably mostly contains the same as the RSDT just with addresses "zero extended" to 64-bit to avoid avoid having 2 copies of all the tables); which could be used by any version of ACPI (except ACPI version 1.0).
Note that for ACPI tables there isn't a single "ACPI version" that applies to all tables. Each table has its own separate version number, and you can have a mixture of old and new tables (e.g. a version of the MADT that was first defined in ACPI 1.0, plus a version of the FADT that was first defined in ACPI 6.0, plus a version of other tables that were first defined in other versions of the ACPI spec).


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Post Reply