Git Product home page Git Product logo

handover's Introduction

                   _    _                 _
                  | |  | |               | |
                  | |__| | __ _ _ __   __| | _____   _____ _ __
                  |  __  |/ _` | '_ \ / _` |/ _ \ \ / / _ \ '__|
                  | |  | | (_| | | | | (_| | (_) \ V /  __/ |
                  |_|  |_|\__,_|_| |_|\__,_|\___/ \_/ \___|_|

                     A simple and extensible boot protocol

Design Goals

  • One contiguous area of memory makes it easy to hand it around.
  • Easy to parse using on contiguous array of records.
  • Centered around the memory map
  • No callbacks, no state.

Overview

Handover Request

struct HandoverRequest
{
    uint32_t tag;
    uint32_t flags;
    uint64_t more;
};

Handover Payload

struct HandoverPayload
{
    uint32_t magic, agent, size, count;
    HandoverRecord records[];
};


struct HandoverRecord
{
    uint32_t tag;
    uint32_t flags;
    uint64_t start;
    uint64_t size;
    uint64_t more;
};

Machine State

Except what stated bellow the machine state is undefined.

x86_64

  • rdi: will contain the 0xc001b001 magic number
  • rsi: will contain the address of the handover payload in the kernel space

Paging is enabled and the following ranges are mapped

  • Some LOADER regions are mapped to the same physical memory address for the initial spinup
  • The first 4gio at 0xffffffff80000000 refered as I/O space
  • KERNEL, STACK and SELF regions are mapped at 0xffff800000000000 and are refered as kernel space.

Features

FREE - 0x00000000

Free for general use

SELF - 0xa24f988d

The handover structure

STACK - 0xf65b391b

CPU stack

KERNEL - 0xbfc71b20

Kernel region where the kernel code reside

LOADER - 0xf1f80c26

Memory allocated by the loaded and reclaimable by the kernel.

This might include page-tables so make sure the create your own before freeing this

FILE - 0xcbc36d3b

Loaded file

RSDP - 0x8d3bbb

ACPI RSDP

FDT - 0xb628bbc1

Flatten device tree blob

FB - 0xe2d55685

Framebuffer

CMDLINE - 0x435140c4

Kernel command line

END - 0xffffffff

End marker

Definitions

handover's People

Contributors

sleepy-monax avatar keyboard-slayer avatar d0p1s4m4 avatar

Stargazers

Börcsök Balázs Róbert avatar leap123 avatar Ilmari Vacklin avatar Flawlesscode avatar  avatar  avatar  avatar

Forkers

keyboard-slayer

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.