use factory method design pattern instead of `init`'ing "modules" directly
- Dominant language
- Rust
- Stars
- 1.5k
- Forks
- 132
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 39
Description
- by running `init` directly, we may increase churn and certain inconsistencies in the source (see below)
- we could initialize modules by having something like a `load_module` function that takes a name and a "function pointer" for "loading" and "unloading"
pros:
- we would avoid inconsistencies in where the conditions for the initialization of a module take place (https://github.com/hermit-os/kernel/pull/1970)
- we could give modules a "name" and modify the macros used so that logs/kernel messages use said name, achieving a more "linux-like dmesg"-type of structure (https://github.com/hermit-os/kernel/pull/1974)
- i.e. custom macros, similarly to `pr_debug` or `pr_info` in the linux kernel
- we could standardize "loading" and "unloading" modules similarly to the linux kernel
- an "enforced structure" wouldn't necessarily compromise flexibility, as we already do things like this anyway.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.