Git Product home page Git Product logo

mold's People

Contributors

aodhneine avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

followsonik

mold's Issues

Framebuffer is not flexible enough

Currently we have a single function, write_str, which writes a string into a framebuffer. However, if we want to implement a tty-like functionality, we need to be able to write characters directly. However, this means that we can't use simple calculation to get the offset, and we have to implement glyph mapping instead.

Actually implement glyph mapping

Currently glyph mapping is just a dummy implementation for the sake of it just being there fore the future. It doesn't perform any mapping, only returns c as usize - b' ' as usize. We previously discussed it here, but I think it deserves its own issue.

The general idea for the implementation would be something like this:

let mut chars = self.mapping.chars();

loop {
    let range = match chars.next() {
        '\0' => {
            let start = chars.next();
            let end = chars.next();

            start as usize..end as usize
        },
        c => c as usize..c as usize + 1,
    };

    if range.contains(c) {
        return c as usize;
    }
}

return replacement_index;    

Extend build script functionality

Currently we hardcode a lot of values in the build script. We would like to instead accept them as arguments passed to the script, and fallback to a sane default if they were ommitted. For example, running ./build.fish would create kernel.img file, and ./build.fish kernel.bin would create kernel.bin file.

We would also want to be able to specify the location of the kernel executable, as well as the target image size (at least 40 MB).

No instructions how to create the raw font

Currently we take a handmade .png file and use a converter written in C to turn it into a bitmap font file. However, this tool is not yet committed to the repository (we probably should do it.)

The only issue is regarding the licensing of that file. It is based on Cozette font, and Cozette itself is licensed under MIT license. This means that, according to the terms of the license

Permission is hereby granted [...] to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

As our font file is based on 96 glyphs from the font, and it is a derivative work that does not include any original copies of the Cozette font, it should be understood that under MIT license we are allowed to distribute that font file in any form we wish, without having to include the original license.

Make framebuffer `static`

Since framebuffer is tightly coupled with information stivale gives us about the framebuffer it allocated, we should treat it as a global object, rather than require every function to either create its own, or accept it as an argument.

However, this is going to require using static, which, along with mutability, is going to need unsafe in each place we want to access it. Instead we should opt in for an interior mutability, and implement it using Mutex.

But, there's no Mutex in core library. We are going to have to implement our own, probably based on spinlocks, similar to how the spin library does it. There's a good writeup on how to implement fast spinlocks, and we probably also can borrow some ideas from the spin's source code.

Also, there's a writeup by Linus Torvalds about spinlocks, which we might want to check out as well.

There's no instruction how to build the kernel image

Currently there is no information how to build the kernel image so that it's actually bootable. We need to document how to:

  • build the limine bootloader from source,
  • create FAT-formatted disk image,
  • mount it and copy all required files into it.

It probably would be the best to have some sort of script that does all of that.

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.