Git Product home page Git Product logo

qboot's Introduction

QBoot Lines of Code Badge

QBoot is a somewhat simple bootloader designed as a learning experience for myself and others, focusing on code style and readability over performance to help others understand how bootloaders work. The name is short for QueerBoot, as the project is meant to be queer-friendly and the intended audience is queer developers, although all allies are welcome too!

Dependencies

To build the bootloader, you need nasm, fdisk, and dd on BIOS, and zig for both BIOS and UEFI. The latest zig build the bootloader was compiled under is 0.12.0-dev.21+ac95cfe44

For those unaware, to build a zig project you run zig build followed by the build step you would like to run, while in the directory containing build.zig. This generates output in the zig-out folder and maintains a cache in zig-cache for faster recompilation. For example, to run the bios build step, run zig build bios.

Build Steps Available

The available build steps are:

  • bios: builds the BIOS version of the bootloader and puts it into zig-out/bios/disk.dd, which is a GPT configured disk made in scripts/make_bios_disk.sh
  • run-bios: does the same as bios but runs it using qemu.
  • debug-bios: does the same as bios but runs it in bochs, which requires bochs on your system compiled with graphical debugger installed. The OSDev Wiki provides instructions for compiling bochs from source properly, which is often required.
  • uefi: builds the UEFI version of the bootloader and put its into zig-out/uefi/EFI/BOOT/BOOTX64.efi
  • run-uefi: does the same as uefi but runs it using qemu.
  • package-uefi: packages the UEFI build, normally just a file that is run raw in qemu, into a hard disk image with the executable in an EFI bootable partition. This disk is located at zig-out/uefi/disk.dd qemu-system-x86_64 is used for run commands, and is configured to run with 4 processors, 256 MB of RAM, and the time set to the local time. Unfortunately, some bugs with OVMF exist and do not allow for using exception handling using qemu, so some UEFI functionality is only available on real hardware. For burning the disk given by package-uefi or bios to a USB, I recommend using Rufus on Windows or dd on Linux.

Features

  • Common
    • Functional API that all platforms can use(see api)
    • EXT2 filesystem parser(see EXT2)
    • GPT parser(see GPT)
    • Config file parser(see config)
    • Relatively portable build system(see build)
    • Elf File loader
    • Framebuffer
    • Pride theming
  • BIOS
    • Stage 1 that loads Stage 2(see boot)
    • ISRs, PIC, and IDT(see IDT and PIC)
    • Clock functionality using int 1Ah(see clock)
    • Memory Map using E820(see memory_map)
    • Disk driver using int 13h extensions(see disk)
    • Keyboard driver using PS/2(see ps2)
    • Paging
  • UEFI
    • Protocol wrapper(see protocol)
    • Matching functionality with BIOS
    • Disk building script for use with real hardware(see make_uefi_disk)
    • Exit boot services and jump to kernel

Goals

  • Reasonable API integration with zig STD(f.e. file system integration)
  • More easily expandable build system(f.e. refactoring to make new targets easier and more automated)
  • Zig host-side tools for build(f.e. zig versions of dd, mkfs.ext2, etc)
  • More readable and documented code with proper references to manuals and documents

Screenshots

BIOS build

Screenshot of the BIOS build in QEMU

UEFI build

Screenshot of the UEFI build in QEMU

qboot's People

Contributors

catgirllunya avatar nas2006-alt avatar

Stargazers

 avatar Jordan Moore avatar Skurhse Rage โˆ… avatar layla 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.