OSDev.org

The Place to Start for Operating System Developers
It is currently Sat Nov 17, 2018 7:41 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Grub2 + Qemu Only has old ACPI tables?
PostPosted: Wed Aug 01, 2018 9:13 pm 
Offline

Joined: Wed Aug 01, 2018 9:09 pm
Posts: 10
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


Top
 Profile  
 
 Post subject: Re: Grub2 + Qemu Only has old ACPI tables?
PostPosted: Thu Aug 02, 2018 8:36 am 
Offline
Member
Member
User avatar

Joined: Thu Aug 11, 2005 11:00 pm
Posts: 1067
Location: Tartu, Estonia
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

_________________
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS


Top
 Profile  
 
 Post subject: Re: Grub2 + Qemu Only has old ACPI tables?
PostPosted: Thu Aug 02, 2018 9:58 am 
Online
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 1335
QEMU emulates an entire computer. The ACPI tables in QEMU describe the emulated hardware, not the host hardware.


Top
 Profile  
 
 Post subject: Re: Grub2 + Qemu Only has old ACPI tables?
PostPosted: Thu Aug 02, 2018 10:16 am 
Offline

Joined: Wed Aug 01, 2018 9:09 pm
Posts: 10
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."


Top
 Profile  
 
 Post subject: Re: Grub2 + Qemu Only has old ACPI tables?
PostPosted: Thu Aug 02, 2018 9:11 pm 
Offline

Joined: Wed Aug 01, 2018 9:09 pm
Posts: 10
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)?


Top
 Profile  
 
 Post subject: Re: Grub2 + Qemu Only has old ACPI tables?
PostPosted: Fri Aug 03, 2018 4:53 pm 
Offline
Member
Member
User avatar

Joined: Sat Jan 15, 2005 12:00 am
Posts: 8561
Location: At his keyboard!
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: CHOSTeam, Google [Bot] and 21 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group