ACPI doesn't want to be enabled.

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
antoni
Member
Member
Posts: 61
Joined: Sun May 24, 2020 9:11 am
Location: /dev/null

ACPI doesn't want to be enabled.

Post by antoni »

Here's my "enable acpi" function:

Code: Select all

void enable_acpi(FADT_t *fixedadt)
{

        outportb(fixedadt->SMI_command_port, fixedadt->acpi_enable);
        sleep(300);
        while( (inportw(fixedadt->PM1a_control_block) & 1) == 0);

}
It gets stuck on "while( (inportw(fixedadt->PM1a_control_block) & 1) == 0);".

FADT is correct (I checked it in GDB).
outportb works (I didn't check it but my OS is quite a bit advanced already...).
sleep works with 1/100 second precision.

What may go wrong?

I will add that I use qemu and ACPI implemented in it is in version 1.
Octocontrabass
Member
Member
Posts: 5885
Joined: Mon Mar 25, 2013 7:01 pm

Re: ACPI doesn't want to be enabled.

Post by Octocontrabass »

Did you try printing the SMI_command_port, acpi_enable, and PM1a_control_block values to see if you're reading them correctly? (In my version of QEMU, they are 0xB2, 0xF1, and 0x604 respectively.)

You didn't mention if your inportw() function works.
antoni
Member
Member
Posts: 61
Joined: Sun May 24, 2020 9:11 am
Location: /dev/null

Re: ACPI doesn't want to be enabled.

Post by antoni »

Thanks a lot!
I really didn't know what may not work in this simple code. It turned out that... A colon was missing in inportw assembly inline...
Post Reply