Skip to content

Abstraction, documentation, and uniformity

Jeremy Soller requested to merge ticki:master into master

Created by: ticki

Main problem: The Redox code base is in a state in which, it has relatively low code quality. There are multiple reasons for so:

  1. Lack of good documentation.
  2. Lack of uniformity in naming, code style, and so on.
  3. Low use of abstraction.
  4. Over use of e.g. heap allocation.

Solution: This PR takes a micro step in the right way.

Changes introduced by this pull request:

  • Follow the naming convention in the syscall module (in particular, we throw the do_sys_ prefix out).
  • Make Context names copy-on-write, effectively reducing the allocations on boot by 40-45%.
  • Add #[deny(warnings)] to avoid regression.
  • Format the code style through a patched version of rustfmt.
  • Add a rustfmt config file.

Drawbacks: None.

TODOs: Lots of things:

  1. There are "FIXME"s and "TO-never-DOs" all over the place in the kernel. Many of which are already solved, or really ought to be solved.
  2. There are no proper Rustdoc documentation for most of the internals.
  3. There are still a long way: We can remove more allocations and avoid more dynamic dispatch.
  4. Compile a list of things that needs cleanup, abstraction, or full rewrite.

Fixes: No issues.

State: Ready.

Blocking/related: Related to #610 (closed).

Merge request reports