aodhneine / mold Goto Github PK
View Code? Open in Web Editor NEWA supposed operating system.
License: BSD Zero Clause License
A supposed operating system.
License: BSD Zero Clause License
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.
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.
Currently there is no information how to build the kernel image so that it's actually bootable. We need to document how to:
It probably would be the best to have some sort of script that does all of that.
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;
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.
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).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.