Code Monkey home page Code Monkey logo

tomatboot-uefi's Introduction

TomatBoot for UEFI

TomatBoot is a simple kernel loader for 64bit UEFI based systems.

The idea of TomatBoot is to provide a simple interface for kernel developers to load their kernel into a 64bit environment (unlike most bootloaders which load you to 32bit). The reason for using a loader and not implementing UEFI directly is so you won't have to mix UEFI and your kernel code.

Main Menu

Setup Menu

Boot Menu

Features

  • Boot menu
    • change the framebuffer settings
    • change default entry and delay
  • Support for linux boot
  • Custom boot protocol
    • Support for static ELF64 kernels
      • the kernel entry must be sysv abi
    • Passing boot information to the kernel
      • Command line
      • Framebuffer
      • ACPI table
      • Memory Map (to be changed)
      • TSC frequency (ticks per second)
      • Boot modules (additional files to load)

Future plans

  • allow for modifying the command line on the fly
  • support loading to another efi module
  • pass boot device path

Boot Protocol

TomatBoot (TBOOT)

This is the main boot protocol, the protocol is designed to be very simple and is aimed at hobby osdev.

Give it a 64bit elf binary, we load it as a static binary, and call it with two parameters, one being a magic, and the other being the boot info struct.

For the header file with more definitions you can click here.

Linux Boot (LINUX)

With linux boot you can give TomatBoot a vmlinuz and initrd images and it will load it according to the linux boot protocol.

Right now there is an example configuration for TinyCore64, simply put the corepure64.gz + vmlinuz64 and it should load you into a console, of course it is a very minimal setup (unlike a normal live boot there is no actual filesystem which can contain all the programs... just the ramfs)

How to

Building

Being a loader it needs to be used in conjunction with another loader. For a project using TomatBoot you can see TomatOS.

Before anything we need to actually build the bootloader. To do so simply run the following:

git clone [email protected]:TomatOrg/TomatBoot-UEFI.git
cd TomatBoot-UEFI
make

This will make the efi executable which will be found under bin/BOOTX64.EFI. in the final image you would want to place it under EFI/BOOT/BOOTX64.EFI. Of course you will need to make sure the image is GPT partitioned and has a EFI partition (in that partition you want to place the binary).

Example file structure inside the UEFI partition:

.
├── EFI
│   └── BOOT
│       └── BOOTX64.EFI
├── tomatboot.cfg
└── tomatos.elf

Other than the binary, you will also need to provide a configuration file. For an example you can see the example config. The config file needs to be placed at the root of the efi partition with the name tomatboot.cfg

Config format

The configuration format is straight forward, it is a list of entries where each entry has the format:

:<name>
PATH=<path to elf executeable>
PROTOCOL={TBOOT,LINUX}
CMDLINE=<optional command line options>
MODULE=<tag 1>,<path 1>
MODULE=<tag 2>,<path 2>
...

little clarification on the module option, it can be found as many times as you want, the first part will be the tag to assign that module, and the path is what file to load.

UEFI Library

The uefi library consists mainly of headers and source files taken directly from EDK2. The reason for that is to cut on development time and use existing headers, but not using EDK2 build system.

tomatboot-uefi's People

Contributors

itay2805 avatar matt8898 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.