gootloader

package module
v0.0.0-...-143dac0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2019 License: MIT Imports: 4 Imported by: 0

README

alt text

Gootloader

Create bootloaders with Go.

Getting Started

Start with creating a Bootloader with your config :


bl := Bootloader{
    Name:     "myBootloader",
    Arch:     1,      // Bootloader Architecture
    ModeBit:  16,     // Bootloader Bit Mode
    Loaddest: 0x7C00, // Destination of loading of bootloader in Memory
}
  

Maybe Print a Message :


message := "Dear BIOS, Load me into ram and give the control flow to me please"
bl.print(message)

Create Your Bootloader :

This generates bl.name.asm file


bl.create();//AKA final file for bootloader

Hello World Example

in main.go file :


package main

import (
	gootloader "github.com/mohammadhb/gootloader"
)

func main() {

	bl := gootloader.Bootloader{
		Name: "MyFirstBootloader",
	}

	bl.Print("Hello World!")
	bl.Create()

}

run go run main.gp

Emulate and Testings the Bootloader

After you create your bootloader using .create() You can use

nasm boot.asm -f bin -o boot.bin && qemu-system-i386 -fda boot.bin

Caution : You must install nasm and qemu in your device to be able to emulate your bootloader (qemu-system-i386 is x86 arch in this example)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bootloader

type Bootloader struct {
	Name         string
	Arch         int // Architecture 32 or 64
	ModeBit      int // Workspace mode in bits 16 or 32
	Instructions []string
	Loaddest     int
}

Bootloader data structure

func (*Bootloader) Create

func (r *Bootloader) Create() int

func (*Bootloader) Print

func (r *Bootloader) Print(message string) int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL