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

A question about staged implementations? #81

Closed
ethindp opened this issue May 25, 2024 · 2 comments
Closed

A question about staged implementations? #81

ethindp opened this issue May 25, 2024 · 2 comments

Comments

@ethindp
Copy link

ethindp commented May 25, 2024

So, I really want to use this for my ACPI library, it looks great! However, I curious how stage-based implementation might work. That is, if I want to pull in the library and only implement parts at a time (for instance, maybe I don't have a scheduler, or no concept of threads). What's the best strategy for handling cases like this one? Is it required that an OS have all of this functionality before implementing uACPI?

@d-tatianin
Copy link
Member

Hey there and thanks for the feedback, I'm glad you like it!

As for your question: you can stub out a lot of the helpers and it will work just fine! There's a UACPI_STAUTS_UNIMPLEMENTED error code for such cases.

Mutexes might be required though, but you can totally "fake" them if you don't have a scheduler nor any sort of concurrency.
Example:

uacpi_handle uacpi_kernel_create_mutex(void)
{
    // any non-null value should work
    return (uacpi_handle)1;
}

uacpi_bool uacpi_kernel_acquire_mutex(uacpi_handle, uacpi_u16)
{
     return true;
}

void uacpi_kernel_release_mutex(uacpi_handle)
{
}

Hope this answers your question.

@ethindp
Copy link
Author

ethindp commented May 25, 2024

Mutexes and such I believe I have implemented via my languages stdlib, it's just threads I'm concerned about. Was thinking I could make threads as processor-based for now, but I need to flesh out that implementation strategy (was thinking of a virtual ISA of sorts... Might get complex though lol). Thanks so much, I love this library -- so, so much simpler than ACPICA! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants