OSDev.org
https://forum.osdev.org/

Grub2 + Qemu Only has old ACPI tables?
https://forum.osdev.org/viewtopic.php?f=1&t=33097
Page 1 of 1

Author:  zaptor [ Wed Aug 01, 2018 9:13 pm ]
Post subject:  Grub2 + Qemu Only has old ACPI tables?

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:
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:
$ 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:
$ /usr/local/grub2/bin/grub-mkrescue --version
/usr/local/grub2/bin/grub-mkrescue (GRUB) 2.03

Author:  xenos [ Thu Aug 02, 2018 8:36 am ]
Post subject:  Re: Grub2 + Qemu Only has old ACPI tables?

I haven't checked the ACPI version, but I find an HPET:

https://706-35513943-gh.circle-artifact ... u-pc-1.txt
https://706-35513943-gh.circle-artifact ... -q35-1.txt

Author:  Octocontrabass [ Thu Aug 02, 2018 9:58 am ]
Post subject:  Re: Grub2 + Qemu Only has old ACPI tables?

QEMU emulates an entire computer. The ACPI tables in QEMU describe the emulated hardware, not the host hardware.

Author:  zaptor [ Thu Aug 02, 2018 10:16 am ]
Post subject:  Re: Grub2 + Qemu Only has old ACPI tables?

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."

Author:  zaptor [ Thu Aug 02, 2018 9:11 pm ]
Post subject:  Re: Grub2 + Qemu Only has old ACPI tables?

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)?

Author:  Brendan [ Fri Aug 03, 2018 4:53 pm ]
Post subject:  Re: Grub2 + Qemu Only has old ACPI tables?

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

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/