A supposed operating system.

Related tags

Miscellaneous mold
Overview

mold

This supposedly does something.

Building

This project is using a simple build script written in fish, which automates the process of compiling the kernel and building a bootable disk image. Simply run ./build.fish to use it.

Dependencies

To run the build script, you need fish itself, as the build script is written in it. You also need dd, sfdisk, losetup, mkfs.fat and mount, which should be already installed on your system if you're running Linux.

Otherwise, you can find dd in coreutils package, sfdisk, losetup and mount in util-linux, and mkfs.fat in dosfstools.

To compile mold for amd64, you need nightly rustc compiler and rust-src component. It is alread specified in the rust-toolchain.toml file, so you don't need to install it manually.

Running

You can use ./run.fish to simplify running the kernel in the QEMU. You need to have qemu-system-x86_64 and OVMF installed. You probably want to configure paths to them, see inside run.fish file for how.

Comments
  • There's no instruction how to build the kernel image

    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:

    • [x] build the limine bootloader from source,
    • [x] create FAT-formatted disk image,
    • [x] 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.

    opened by aodhneine 5
  • Make framebuffer `static`

    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.

    opened by aodhneine 3
  • Extend build script functionality

    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).

    opened by aodhneine 0
  • Actually implement glyph mapping

    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;    
    
    opened by aodhneine 1
  • Framebuffer is not flexible enough

    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.

    opened by aodhneine 1
  • No instructions how to create the raw font

    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.

    opened by aodhneine 2
Owner
Aodhnait Étaín
Software engineer :sparkles: She/her
Aodhnait Étaín
A simple entity-component-system crate for rust with serialization support

Gallium A simple entity-component-system crate for rust with serialization support Usage You can include the library using carge: [dependencies] galli

null 7 Aug 31, 2021
mdzk is a plain text Zettelkasten system that is based on the mdBook API.

mdzk A lovingly designed system and static publishing tool for your plain text Zettelkasten mdzk is a plain text Zettelkasten system that is based on

mdzk 176 Jan 4, 2023
secmem-proc is a crate designed to harden a process against low-privileged attackers running on the same system trying to obtain secret memory contents of the current process.

secmem-proc is a crate designed to harden a process against low-privileged attackers running on the same system trying to obtain secret memory contents of the current process. More specifically, the crate disables core dumps and tries to disable tracing on unix-like OSes.

null 3 Dec 19, 2022
A Rust Based GMod Module for finding system info.

gm_sysinfo Fetching System Information in Rust to Lua. Installation Download the Module. Compile it. Cry because it doesn't work. Spend 2 hours debugg

Joshua Piper 3 May 18, 2022
A Garry's Mod module that lets you check which fonts are available on the system

gm_fontsx Since apparently we're never getting a proper way to check for installed fonts on Garry's Mod, this has to exist ?? Usage require("fontsx")

Earu 4 Mar 14, 2022
A dead-simple, extreme fast permission flag system for Rust with no dependencies

A dead-simple, extreme fast permission flag system for Rust with no dependencies

pan93412 2 Mar 17, 2022
A lightweight microkernel/IPC based operating system built with Rust which is not a clone of any existing operating system

Noble Operating System Noble is a lightweight microkernel and IPC based operating system built with Rust which is not a clone of any existing operatin

Revolution Xenon 3 Jan 10, 2022
Booru software for the 21st century. (Name is supposed to be like Puro, the big monster, but I failed..)

Pooru Booru software for the 21st century. Setup Setup is a little funky, but I hope to fix this funkyness down the road. First and foremost, you will

null 2 May 8, 2022
Human numeric sorting program — does what `sort -h` is supposed to do!

hns — Human Numeric Sort v0.1.0 (⏫︎2022-09-20) © 2022 Fredrick R. Brennan and hns Authors Apache 2.0 licensed, see LICENSE. man page Packages hns_0.1.

Fredrick Brennan 7 Sep 25, 2022
Writing an OS in Rust, To Study Operating System and Computer System

Hun Os Writing an OS in Rust, To Study Operating System and Computer System Reference Os Written In Rust https://github.com/seonghun-dev/blog_os https

Jung Seonghun 2 Dec 15, 2022
A secure embedded operating system for microcontrollers

Tock is an embedded operating system designed for running multiple concurrent, mutually distrustful applications on Cortex-M and RISC-V based embedded

Tock Embedded OS 4.1k Jan 5, 2023
A secure embedded operating system for microcontrollers

Tock is an embedded operating system designed for running multiple concurrent, mutually distrustful applications on Cortex-M and RISC-V based embedded

Tock Embedded OS 4k Jan 2, 2023
A hobby operating system, in Rust

intermezzOS: kernel intermezzOS is a hobby operating system. This repository is for its kernel. See the website for more. License This project is dual

intermezzOS 1.3k Jan 1, 2023
The Stupid Operating System

Stupid Operating System SOS is a simple, tiny toy OS implemented in Rust. I'm writing this mostly for fun, to learn more about OS design and kernel ha

SOS 241 Dec 15, 2022
Operating System development tutorials in Rust on the Raspberry Pi

Operating System development tutorials in Rust on the Raspberry Pi

Rust Embedded 10k Jan 9, 2023
Aero is a new modern, unix based operating system. It is being developed for educational purposes.

Areo Aero is a new modern, unix based operating system written in Rust and is being developed for educational purposes. Aero follows the monolithic ke

Anhad Singh 623 Dec 24, 2022
A new operating system kernel with Linux binary compatibility written in Rust.

Kerla Kerla is a monolithic operating system kernel from scratch in Rust which aims to be compatible with the Linux ABI, that is, runs Linux binaries

Seiya Nuta 3.1k Jan 1, 2023
Operating system written in Rust for NumWorks calculator (model n0110)

RustWorks An OS (eventually) for the Numworks calculator (model n0110). Setup First install Rust by following these instuctions then: rustup target ad

null 30 Nov 10, 2022
The official kernel for Popcorn OS, and operating system designed for handheld devices.

About Popkern is the kernel for Popcorn OS, an operating system designed for handheld devices. As such, the kernel is (to be) optimised at all levels

Team Scena 3 Sep 19, 2021