GithubHelp home page GithubHelp logo

kernel's Introduction

kernel

A collaborative effort to rewrite the kernel with focus on correctness and code quality.

Why?

The kernel code was getting increasingly messy to the point where only the original writer would be able to find and fix bugs. Fortunately, the kernel of Redox is relatively small and such a project is estimated to take only a few months.

What?

The aims of the new kernel should be clear in their order:

  1. Correctness: Above anything else, the kernel should be correct. No hacks, despite how the tiny cool shortcuts might seem, it gives severe backslash later on. Keep it correct and well-written.

  2. Readability and documentation: The code quality should be high, with that follows a detailed documentation, including both API docs (on every item!) and careful comments for anything non-trivial.

  3. Performance: If you can, go for it.

Guidelines

A rotten house is built on a rotten foundation.

Don't fool yourself. You are likely not getting back to the ugly code. Write it the right way first time, and make sure you only move on when it's done right.

Comments

Do not hesitate to put comments all over the place.

Documentation

Every public item should contain API documentation.

Debug assertions

Abusing debug assertions is a wonderful way to catch bugs, and it is very much encouraged.

Static checking

Rust provides a lot of type-system features which can be used to create wonderful safe abstractions, and you should use them whenever you get the chance.

Unsafety should be avoided, and if it is triggered only under some addition insert an assertion. Despite this being a kernel, we prefer kernel panics over security vulnerabilities.

If the condition is (or should be) unreachable, but if not upheld, leading to UB, put an assertion in the start of the function.

Be gentle

Don't just write as much code as you can as quick as possible. Take your time and be careful.

Commits

Use descriptive commits. One way to force yourself to do that is to not pass the -m flag, which will make your editor pop up, so you can conveniently write long commit messages.

kernel's People

Contributors

adamniederer avatar cactorium avatar cwood1 avatar jackpot51 avatar kolipka avatar little-dude avatar pythoneer avatar ticki avatar tones111 avatar yoric avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.