OSDev.org

The Place to Start for Operating System Developers
It is currently Sun May 24, 2020 4:18 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: How to use ACPICA in my own OS
PostPosted: Sat Dec 26, 2015 1:46 pm 
Offline
Member
Member

Joined: Fri Jun 28, 2013 1:48 am
Posts: 43
Hi, everyone. I want to use ACPICA in my own OS. I downloaded the ACPICA for Unix source code, copied the all the C files in `components/` and header files in `include/` to a single directory (except files in `debugger` and `disassembler` folders). I also modified `platform/acenv.h` and created a configure header for my own OS based on `aclinux.h`.

My makefile automatically finds all the C file and compiles it. But I got compile errors from ACPICA code:

Code:
kernel/driver/acpi/acpica/evxfregn.c:79:1: error: redefinition of 'AcpiInstallAddressSpaceHandler'
AcpiInstallAddressSpaceHandler (
^
kernel/driver/acpi/acpica/acpixf.h:778:1: note: previous definition is here
AcpiInstallAddressSpaceHandler (
^
kernel/driver/acpi/acpica/platform/acwheel.h:96:24: note: expanded from macro
      'ACPI_EXTERNAL_RETURN_STATUS'
    static ACPI_INLINE Prototype {return(AE_NOT_CONFIGURED);}
                       ^
kernel/driver/acpi/acpica/evxfregn.c:145:14: error: use of undeclared identifier
      'AcpiGbl_RegMethodsExecuted'
        if (!AcpiGbl_RegMethodsExecuted)
             ^
kernel/driver/acpi/acpica/evxfregn.c:168:1: warning: type specifier missing, defaults to 'int'
      [-Wimplicit-int]
ACPI_EXPORT_SYMBOL (AcpiInstallAddressSpaceHandler)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/driver/acpi/acpica/platform/acwheel.h:109:37: note: expanded from macro 'ACPI_EXPORT_SYMBOL'
#define ACPI_EXPORT_SYMBOL(symbol)  EXPORT_SYMBOL(symbol);
                                    ^~~~~~~~~~~~~
kernel/driver/acpi/acpica/evxfregn.c:168:21: error: a parameter list without types is only allowed
      in a function definition
ACPI_EXPORT_SYMBOL (AcpiInstallAddressSpaceHandler)
                    ^
kernel/driver/acpi/acpica/platform/acwheel.h:109:51: note: expanded from macro 'ACPI_EXPORT_SYMBOL'
#define ACPI_EXPORT_SYMBOL(symbol)  EXPORT_SYMBOL(symbol);
                                                  ^
kernel/driver/acpi/acpica/evxfregn.c:186:1: error: redefinition of 'AcpiRemoveAddressSpaceHandler'
AcpiRemoveAddressSpaceHandler (
^
kernel/driver/acpi/acpica/acpixf.h:787:1: note: previous definition is here
AcpiRemoveAddressSpaceHandler (
^
kernel/driver/acpi/acpica/platform/acwheel.h:96:24: note: expanded from macro
      'ACPI_EXTERNAL_RETURN_STATUS'
    static ACPI_INLINE Prototype {return(AE_NOT_CONFIGURED);}
                       ^
kernel/driver/acpi/acpica/evxfregn.c:222:19: error: use of undeclared identifier 'AcpiGbl_RootNode'
         (Node != AcpiGbl_RootNode)))
                  ^
kernel/driver/acpi/acpica/evxfregn.c:315:1: warning: type specifier missing, defaults to 'int'
      [-Wimplicit-int]
ACPI_EXPORT_SYMBOL (AcpiRemoveAddressSpaceHandler)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/driver/acpi/acpica/platform/acwheel.h:109:37: note: expanded from macro 'ACPI_EXPORT_SYMBOL'
#define ACPI_EXPORT_SYMBOL(symbol)  EXPORT_SYMBOL(symbol);
                                    ^~~~~~~~~~~~~
kernel/driver/acpi/acpica/evxfregn.c:315:21: error: a parameter list without types is only allowed
      in a function definition
ACPI_EXPORT_SYMBOL (AcpiRemoveAddressSpaceHandler)
                    ^
kernel/driver/acpi/acpica/platform/acwheel.h:109:51: note: expanded from macro 'ACPI_EXPORT_SYMBOL'
#define ACPI_EXPORT_SYMBOL(symbol)  EXPORT_SYMBOL(symbol);
                                                  ^


So what should I do if I just want to use ACPICA. There's not much information on the internet.

_________________
Reinventing the Wheel, code: https://github.com/songziming/wheel


Top
 Profile  
 
 Post subject: Re: How to use ACPICA in my own OS
PostPosted: Sat Dec 26, 2015 2:17 pm 
Offline
Member
Member

Joined: Mon Jan 03, 2011 6:58 pm
Posts: 283
http://wiki.osdev.org/ACPICA

- Monk


Top
 Profile  
 
 Post subject: Re: How to use ACPICA in my own OS
PostPosted: Sun Dec 27, 2015 7:22 am 
Offline
Member
Member

Joined: Fri Jun 28, 2013 1:48 am
Posts: 43
I have read that several times. And I did exactly what the wiki says.

I created an `acpica_adapter.c` file and implemented all the OS layer functions. And I copied the files into a single directory, also created the configure header file for my os based on `aclinux.h` and include it from `acenv.h`. Although most of the OSL functions are simple empty, but that should at least make the kernel COMPILE.

But the kernel won't compile. I'm getting compiler errors from ACPICA. I noticed that many errors are related with macros, is there any important macros that I need to adjust?

_________________
Reinventing the Wheel, code: https://github.com/songziming/wheel


Top
 Profile  
 
 Post subject: Re: How to use ACPICA in my own OS
PostPosted: Sun Dec 27, 2015 3:20 pm 
Offline
Member
Member

Joined: Mon Jan 03, 2011 6:58 pm
Posts: 283
Seeing as you said you grabbed the ACPICA code from linux source, you clearly didn't follow what it said.

- Monk


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: klange and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group