Write your own ACPI driver or using ACPICA?

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
Congdm
Member
Member
Posts: 48
Joined: Wed Aug 01, 2012 10:53 am

Write your own ACPI driver or using ACPICA?

Post by Congdm »

Hi everybody,

I am playing with ACPI and SMP now. According to the wiki, there are 2 ways to implement ACPI: do-it-yourself and using ACPICA. But it didn't say about disadvantages and advantages of each method. Could anyone give me some advices?
User avatar
dozniak
Member
Member
Posts: 723
Joined: Thu Jul 12, 2012 7:29 am
Location: Tallinn, Estonia

Re: Write your own ACPI driver or using ACPICA?

Post by dozniak »

Advantages of ACPICA:
* The AML interpreter is already done for you.
* You only need to write a thin adaptation layer between ACPICA and your OS.
Disadvantages of ACPICA:
* You need to write the glue layer.
* You need to figure out the ACPICA APIs.
* ACPICA is implemented in C, which makes it slightly harder to interface with say Assembly or Haskell OS.

Advantages of writing it yourself:
* You get to learn a lot of intricacies of parsing ACPI tables and running AML scripts.
* Whatever you learn applies directly to ACPI and not the ACPICA APIs.
Disadvantages of doing it yourself:
* You get to learn a lot of intricacies of parsing ACPI tables and running AML scripts. Maybe more than you ever want.

If you want it to get working fast, then ACPICA or very minimal implementation of a subset of ACPI might work.
If you want it to get fully working then ACPICA or very thorough implementation of ACPI is required.

All in all, ACPICA just saves you a bunch of time.
Learn to read.
Post Reply