All Projects → o8vm → Krabs

o8vm / Krabs

Licence: other
An x86 bootloader written in Rust.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Krabs

mbr-boot-manager
💾 Master Boot Record with a boot menu written in Assembly
Stars: ✭ 57 (-86.2%)
Mutual labels:  boot, bootloader, bios
GrubFM-Installer
GrubFM Installer
Stars: ✭ 27 (-93.46%)
Mutual labels:  boot, bios
Toaruos
A completely-from-scratch hobby operating system: bootloader, kernel, drivers, C library, and userspace including a composited graphical UI, dynamic linker, syntax-highlighting text editor, network stack, etc.
Stars: ✭ 4,687 (+1034.87%)
Mutual labels:  bootloader, osdev
biefircate
Running x86-16 or x86-32 code from x86-64 UEFI; _very experimental_ • mirror of https://gitlab.com/tkchia/biefircate • developer notes at https://gitlab.com/tkchia/biefircate/-/blob/main/doc/NOTES.asciidoc
Stars: ✭ 47 (-88.62%)
Mutual labels:  osdev, bios
Cyjon
A simple, clean code, multi-tasking operating system written in pure assembly language for 64-bit processors from the AMD64 family.
Stars: ✭ 184 (-55.45%)
Mutual labels:  bootloader, osdev
MultiOS-USB
Boot operating systems directly from ISO files
Stars: ✭ 106 (-74.33%)
Mutual labels:  boot, bios
uefi-elf-bootloader
UEFI ELF Bootloader example
Stars: ✭ 40 (-90.31%)
Mutual labels:  osdev, bootloader
Aio Boot
AIO Boot is an All-in-One bootable software for USB and HDD. Is one of the best Multiboot USB Creator for Windows.
Stars: ✭ 300 (-27.36%)
Mutual labels:  bootloader, boot
UEFI MULTI
UEFI_MULTI - Make Multi-Boot USB-Drive
Stars: ✭ 33 (-92.01%)
Mutual labels:  boot, bios
BootProg
FAT12/16/32 Bootsector for .COMs/.EXEs
Stars: ✭ 74 (-82.08%)
Mutual labels:  bootloader, bios
Bootmine
Bootable minesweeper game in a 512-byte boot sector
Stars: ✭ 136 (-67.07%)
Mutual labels:  bootloader, bios
systemboot
SystemBoot is a LinuxBoot distribution that works as a system firmware + bootloader, based on u-root
Stars: ✭ 103 (-75.06%)
Mutual labels:  boot, bootloader
Monkos
an experimental 64-bit operating system
Stars: ✭ 100 (-75.79%)
Mutual labels:  bootloader, osdev
Limine
x86/x86_64 BIOS Bootloader
Stars: ✭ 288 (-30.27%)
Mutual labels:  bootloader, bios
Dgos
Operating System
Stars: ✭ 90 (-78.21%)
Mutual labels:  bootloader, osdev
Toaru Nih
NOTICE: The ToaruOS-NIH Project has been MERGED UPSTREAM. This repository is now archived.
Stars: ✭ 66 (-84.02%)
Mutual labels:  bootloader, osdev
Rufus
The Reliable USB Formatting Utility
Stars: ✭ 16,917 (+3996.13%)
Mutual labels:  bios, boot
Stm32 Bootloader
Customizable Bootloader for STM32 microcontrollers. This example demonstrates how to perform in-application-programming of a firmware located on an external SD card with FAT32 file system.
Stars: ✭ 541 (+30.99%)
Mutual labels:  bootloader, boot
Arch
These are easy, in-depth instructions on how to install Arch Linux.
Stars: ✭ 16 (-96.13%)
Mutual labels:  boot, bios
stoomboot
An x86 real mode multiboot-ish ELF bootloader
Stars: ✭ 19 (-95.4%)
Mutual labels:  osdev, bootloader

KRaBs: Kernel Reader and Booters

KRaBs is an x86/x86_64 chain loader written in pure Rust.

What is KRaBs?

KRaBs is working on booting vmlinux and other kernels formatted in ELF on 32-bit/64-bit PCs and is under the development. Krabs also aims to support only the minimal Linux x86/x86_64 boot protocol. This allows you to use the kernel command line and initrd/initramfs.

Other features:

  • Supports GPT and FAT32 File System on EFI System Partition(ESP).
  • You can configure KRaBs's boot option in CONFIG.TXT on FAT32 ESP.
  • CONFIG.TXT is a simple matrix-oriented text file. See CONFIG.TXT formats.

News

  • 2020/08: Currently, KRaBs can boot kernel-5.8.3! initrd and kernel command line also work fine!!. see details
    cargo run -- -we disk.img
    

sample

Getting Started

To get started with KRaBs, build it from source.

Requirements

  1. rust-src and llvm-tools-preview
  2. GPTed disk image that has BIOS Boot Partition and EFI System Partition.
  3. CONFIG.TXT, kernel image and initrd on FAT32 FileSystem on EFI System Partition.
  4. (option) qemu-system-x86

Prepare rust-src and llvm-tools-preview

$ cd /path/to/krabs
$ rustup component add rust-src
$ rustup component add llvm-tools-preview

Example of GPT disk image:

$ gdisk -l disk.img 
...
Found valid GPT with protective MBR; using GPT.
Disk disk2.img: 204800 sectors, 100.0 MiB
Sector size (logical): 512 bytes
Disk identifier (GUID): 2A1F86BB-74EA-47C5-923A-7A3BAF83B5DF
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 204766
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048            4095   1024.0 KiB  EF02  BIOS boot partition
   2            4096          106495   50.0 MiB    EF00  EFI system partition
   3          106496          204766   48.0 MiB    8300  Linux filesystem
$ sudo kpartx -av disk.img
$ sudo mkfs.fat -F 32 /dev/mapper/loop0p2
$ sudo mkfs.ext4 /dev/mapper/loop0p3

Prepare CONFIG.TXT, kernel, initrd:

$ sudo mount /dev/mapper/loop0p2 /mnt
$ ls /mnt
CONFIG.TXT  initramfs.cpio.gz vmlinux-5.8.3

CONFIG.TXT format

simple matrix-oriented text file

main.kernel vmlinux-5.8.3
main.initrd initramfs.cpio.gz
main.cmdlin clocksource=tsc net.ifnames=0

Build

cargo build

Burn

cargo run -- -w disk.img

Test

cargo run -- -e disk.img

Examples

Examples for x86-64 Linux is described in the docs of 'Creating Custom Linux Images and Booting'.

Contributing

KRaBs welcomes all contributions. To contribute to KRaBs, check out the getting started guide and then the KRaBs contribution guidelines.

Design

KRaBs's overall architecture is described in the design document and the specification document.

Features

  1. Supports legacy BIOS.
  2. Supported media are HDD and SSD which have GPT.
  3. Supports 32bit protected mode and 64bit long mode.
  4. Supports OS kernel formatted in ELF32/ELF64.
  5. Supports minimal x86/x86_64 linux boot protocol.
  6. KRaBs interprets the FAT32 file system.
  7. KRaBs's boot optuon is configureset by CONFIG.TXT on the FAT32 file system.
  8. KRaBs can load modules such as initramsfs/initrd according to linux boot protocol.
  9. KRaBs can transmit kernel command line to the kernel according to linux boot protocol.

ToDO

  1. support gziped kernel.
  2. support recovery mode.

License

This project is licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Serde by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Contact

You can get in touch with me in the following ways:

Note: I'm on a Japan time zone.

When communicating within the Krabs community, please mind our code of conduct.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].