XyrisOS / xyris

The Xyris Kernel
https://xyr.is
MIT License
153 stars 11 forks source link

Add ACPI Support #132

Open Kfeavel opened 4 years ago

Kfeavel commented 4 years ago

This is a pretty big feature but it's something we'll eventually need.

Kfeavel commented 4 years ago

https://wiki.osdev.org/ACPICA

https://github.com/acpica/acpica

https://github.com/panix-os/acpica

Kfeavel commented 4 years ago

From the OSDev Wiki:

Using ACPICA in your OS I didn't find any good description of integrating the ACPICA source code into an operating system, and the released package is basically just a bundle of C files with little organization. This is what I ended up having to do:

  • I copied the C files from dispatcher/, events/, executer/, hardware/, parser/, namespace/, utilities/, tables/, and resources/ into a single acpi folder.
  • I copied the header files from include/
  • I created my own header file based on aclinux.h where I ripped out all of the userspace stuff, then I changed around the rest to be appropriate to my OS's definitions.
  • I edited the include/platform/acenv.h file to remove the inclusion of aclinux.h and included my header file instead.
  • I copied over acenv.h, acgcc.h, and my header file over to my include/platform/ folder.

This is in addition to writing an AcpiOs interface layer, and it is not well indicated by the reference manual that you have to actually edit header files. Many of the macros defined in the headers are documented, though.

Kfeavel commented 4 years ago

https://acpica.org/sites/acpica/files/acpica-reference_18.pdf