Page 1 of 1

Opinions on ACPICA or LAI?

Posted: Mon Oct 12, 2020 6:52 am
by nexos
Hello,
I know I want my OS to support ACPI. I personally think ACPI is a complicated standard, but something as widespread as the PC needs something complicated to control the system. I have started reading the ACPI spec, and know I have a question: How should I handle ACPI? To me, there are 3 options:
Use ACPICA. I would get the largest amount of features, the ability to have full ACPI support out of the box, and more. But it is big and bloated, and I want to understand all the code in my OS :) .
Use LAI. I would get all I really need, not quite full ACPI support, but enough. However, LAI uses different coding conventions then me, and that would create inconstancy. Plus I wouldn't get everything.
Write my own. The most complicated solution, but I would be able to control what things I have support for. I would right all the code, meaning I would understand how it works.
Currently, I am leaning towards writing my own as a learning experience.
What do you think is the best option?
Thanks,
nexos

Re: Opinions on ACPICA or LAI?

Posted: Thu Oct 15, 2020 11:42 am
by PeterX
nexos wrote:Hello,
I know I want my OS to support ACPI. I personally think ACPI is a complicated standard, but something as widespread as the PC needs something complicated to control the system. I have started reading the ACPI spec, and know I have a question: How should I handle ACPI? To me, there are 3 options:
Use ACPICA. I would get the largest amount of features, the ability to have full ACPI support out of the box, and more. But it is big and bloated, and I want to understand all the code in my OS :) .
Use LAI. I would get all I really need, not quite full ACPI support, but enough. However, LAI uses different coding conventions then me, and that would create inconstancy. Plus I wouldn't get everything.
Write my own. The most complicated solution, but I would be able to control what things I have support for. I would right all the code, meaning I would understand how it works.
Currently, I am leaning towards writing my own as a learning experience.
What do you think is the best option?
I would probably go for writing my own and then notice it might be a bit more than I can handle ;) But I probably would write my own nontheless.
But I think here our opinions aren't a good advice. You have to decide that yourself.

What coding conventions are different in/with LAI?

Greetings
Peter

Re: Opinions on ACPICA or LAI?

Posted: Thu Oct 15, 2020 3:31 pm
by nexos
PeterX wrote:I would probably go for writing my own and then notice it might be a bit more than I can handle ;)
ACPI does look like a beast, but I am in no rush to get my OS done :D .
PeterX wrote:What coding conventions are different in/with LAI?
Functions and structures use different styles, i.e. my structures look like

Code: Select all

typedef struct tagACPI_RSDP
{
    BYTE sig[8];
    BYTE checksum;
    BYTE oemId[6];
    BYTE rev;
    DWORD rsdtAddr;
    DWORD len;
    QWORD xsdtAddr;
    BYTE extChecksum;
    BYTE resvd[3];
}__attribute__((packed)) ACPI_RSDP;
While LAI uses Linux style names

Re: Opinions on ACPICA or LAI?

Posted: Fri Oct 16, 2020 9:08 am
by PeterX
nexos wrote:
PeterX wrote:I would probably go for writing my own and then notice it might be a bit more than I can handle ;)
ACPI does look like a beast, but I am in no rush to get my OS done :D .
Yes, similar with me and my OS. BTW that was not critics of you but critics of me. (I'm currently trying to write a linker and start noticing, that with bzt's kind GNU-EFI text I don't need that.)
nexos wrote:
PeterX wrote:What coding conventions are different in/with LAI?
Functions and structures use different styles, i.e. my structures look like

Code: Select all

typedef struct tagACPI_RSDP
{
    BYTE sig[8];
    BYTE checksum;
    BYTE oemId[6];
    BYTE rev;
    DWORD rsdtAddr;
    DWORD len;
    QWORD xsdtAddr;
    BYTE extChecksum;
    BYTE resvd[3];
}__attribute__((packed)) ACPI_RSDP;
While LAI uses Linux style names
You mean LAI uses uint8_t etc.? That's not a big problem, I think. Or is it?

Greetings
Peter

Re: Opinions on ACPICA or LAI?

Posted: Fri Oct 16, 2020 2:09 pm
by Octacone
I would never implement ACPICA myself, because why would I want to add some bloat code that is 100 times the size of my kernel.
LAI sounds like a great alternative, it is light-weight and simple enough to understand.
Anyways, I plan on writing my own implementation.