Page 1 of 1

Has anyone actually used ACPICA for their OS?

Posted: Tue Jul 07, 2009 10:00 pm
by Matthew
I am curious about whether this can save me a lot of time. Currently it is causing a lot of frustration.

I downloaded the package and noticed there is very little documentation to go with it. I checked online and found a very nice API reference manual. I skimmed the manual and it promises a chapter which discusses "Deployment" of ACPICA. While there is some nice example code of how to use ACPICA, there doesn't seem to be any discussion of exactly what files you need to copy over to your OS in order to make use of it. The mailing list only has archives for this month, populated only by spam.

The source package contains numerous directories with C files alone, and no indication of the proper organization of these files, or their dependencies. I've attempted to guess at that -- assuming that any undefined symbol beginning with "AcpiOs" is a stub I am supposed to fill -- but I still get plenty of other unresolved symbols which do not look like the OS-specific stub functions.

Does anyone have any experience with this?

Re: Has anyone actually used ACPICA for their OS?

Posted: Tue Jul 07, 2009 10:31 pm
by JohnnyTheDon
I used ACPICA for an OS a little while back. IIRC you need to sort out the parts that are for inclusion in your kernel, and the parts that are the ASL compiler and other utilities. I think the only folders you don't need are compiler, generate, and tools. I recommend compiling and linking all the necessary files into a relocatable object file, so they don't have to be linked together every time you change something in your OS.

Re: Has anyone actually used ACPICA for their OS?

Posted: Tue Jul 07, 2009 11:13 pm
by Matthew
That helped a lot. I think I got somewhere now.

This is my ugly way of testing it:

Code: Select all

rm -rf compiler generate tools os_specific common osunixxf.c
find . -name '*.c' -exec gcc -c -I include \{\} \;
gcc *.o 2>&1 | grep undefined | grep -v AcpiOs
Now the only unresolved symbol other than the AcpiOs* functions is "main" which of course won't be an issue.

edit: No, wait. That's not enough. The include files are assuming that I am trying to integrate with the Linux kernel. If I try to prevent that, I get all kinds of errors. Are you sure that all you had to do was compile without those directories? I'm looking at acenv.h and frankly I don't see how this can work without writing a special platform/ac*.h file. Unfortunately there are no details about how to do this.

Re: Has anyone actually used ACPICA for their OS?

Posted: Wed Jul 08, 2009 11:43 am
by Matthew
I managed to compile and link the ACPICA source by gutting the aclinux.h file and reworking it to fit my own OS. This is pretty unsatisfactory though, because (a) I have no documentation about the macros I changed in aclinux.h so I have no idea if I did it right, and (b) nowhere in the documentation or the web does it say that editing the source is necessary. In fact, it says quite the opposite: that I should be able to take portions of ACPICA unchanged and incorporate them into my OS by filling out only a well-documented stub API. But examining the structure of the header files reveals that this integration is quite impossible without editing the header files. So I don't know what to make of this.