Opinions on ACPICA or LAI?

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
nexos
Member
Member
Posts: 1081
Joined: Tue Feb 18, 2020 3:29 pm
Libera.chat IRC: nexos

Opinions on ACPICA or LAI?

Post 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
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg
PeterX
Member
Member
Posts: 590
Joined: Fri Nov 22, 2019 5:46 am

Re: Opinions on ACPICA or LAI?

Post 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
nexos
Member
Member
Posts: 1081
Joined: Tue Feb 18, 2020 3:29 pm
Libera.chat IRC: nexos

Re: Opinions on ACPICA or LAI?

Post 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
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg
PeterX
Member
Member
Posts: 590
Joined: Fri Nov 22, 2019 5:46 am

Re: Opinions on ACPICA or LAI?

Post 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
User avatar
Octacone
Member
Member
Posts: 1138
Joined: Fri Aug 07, 2015 6:13 am

Re: Opinions on ACPICA or LAI?

Post 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.
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
Post Reply