Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel Example with ACPI #125

Open
asensio-project opened this issue Oct 12, 2022 · 3 comments
Open

Kernel Example with ACPI #125

asensio-project opened this issue Oct 12, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@asensio-project
Copy link

Hello everyone,

I am developing a little kernel based on Phil's Blog, I want to add support to ACPI by using this crate but It's a little bit confusing starting from zero.

Is there any minimal example for using it?

Thanks!

@IsaacWoods IsaacWoods added the enhancement New feature or request label Oct 18, 2022
@IsaacWoods
Copy link
Member

Hi!

There's not currently an example kernel, although this would potentially be a good idea for helping to get people started. Just a fair warning that ACPI is fairly 'in the weeds' of x86 and so if you're getting started with OS dev you might find other things easier or more fun to start adapting from Phil's tutorials.

That being said, getting started is not too hard: you'll need to write an implementation of AcpiHandler to map and unmap regions of memory - iirc Phil uses a direct mapping so this should be relatively simple. You can see an example from my kernel here. The bootloader will then need to give you the RSDP address somehow (I'm not using bootloader so I can't tell you how this works I'm afraid) - with that you can initialise the Acpi struct (read this for some guidance).

Finally, have a look at the docs for the various things you can get from an Acpi - you can either parse tables yourself, or read the PlatformInfo data for a nicer parsed form of some of it.

@asensio-project
Copy link
Author

Thank you so much!

I will keep it in mind.

@rsribeiro
Copy link

You can also find an example on the MOROS Project. It also started from Phil's tutorial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants