Page 1 of 1

ACPI doesn't want to be enabled.

Posted: Wed Jul 08, 2020 1:51 pm
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.

Re: ACPI doesn't want to be enabled.

Posted: Wed Jul 08, 2020 3:39 pm
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.

Re: ACPI doesn't want to be enabled.

Posted: Thu Jul 09, 2020 1:22 am
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...