Git Product home page Git Product logo

chocolate_milk's Introduction

Summary

This is a bootloader and kernel written nearly entirely in Rust with no third party dependencies at all. Everything in this code base is all you need code wise.

Building

Requirements

To build this you need Rust, nasm, and lld-link (from LLVM's linker). This bootloader and kernel are built identically regardless of the build system. It should build just fine on Linux, Windows, OSX, BSD, whatever.

You can get nasm here or from apt install nasm

You can get LLVM binaries here or apt install lld

You can get Rust here. You must use nightly Rust!

This project requires that you have the i586-pc-windows-msvc and x86_64-pc-windows-msvc Rust targets installed.

rustup target add i586-pc-windows-msvc x86_64-pc-windows-msvc

Specifically nasm, lld-link, rustup, and cargo must be in your PATH. If one of these are not in your path, you may need to create a symlink to the specific version (eg: lld-link-10)

Building

To build this simply run cargo run this will create a folder called pxe that will contain the folder which needs to be exposed via a TFTP server. Optionally, the files could be copied from the pxe folder to your existing PXE deployment folder.

Usage

This bootloader and kernel require PXE booting. They do not support disks in any way, shape, or form. Everything is done over the network. To use this bootloader and kernel you need to set up a valid PXE boot environment. This is done with a DHCP server and a TFTP server.

The TFTP server must point to the directory containing chocolate_milk.boot and chocolate_milk.kern. And the DHCP server should be configured to point to using chocolate_milk.boot as the boot image. This is a BIOS specific bootloader and will not work with EFI/UEFI.

Design

Build System

We use a Rust-based build system found at src/main.rs. We built the build system in Rust such that we don't have to take on any other dependencies for the build process. This build system has some checks for installed programs which are required for building, builds and flattens the bootloader, and assembles the bootloader.

Bootloader

The bootloader is a simple i586 Rust program emit as a MSVC calling convention PE. This is flattened by our build system src/main.rs into an in-memory image of the loaded PE. This is then directly appended to the initial bootloader/src/stage0.asm entry stub. Once 32-bit mode has been entered and selectors have been set up, we branch directly into bootloader::entry()!

chocolate_milk's People

Contributors

gamozolabs avatar m1el avatar hippie0x90 avatar lqd avatar pacbypass 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.