Crate realjump

Source
Expand description

Tiny no_std crate that loads and boots Real Mode code from an x86-64 kernel.

§Example Usage

Before calling realjump, you need to do the following in your kernel:

  • Disable interrupts
  • Identity map the lowest 1MiB memory as executable
  • Halt all other processors
let mbr = {
    // Load your MBR from somewhere
    let mut bin = [0xf4; 512];
    bin[510] = 0x55;
    bin[511] = 0xaa;
    bin
};

unsafe {
    realjump::boot_mbr(&mbr).unwrap();
}

Enums§

Error
An error.

Constants§

BOOTSTRAP_CODE_SIZE
Size of the bootstrap code.
MAX_PAYLOAD_SIZE
The maximum payload size.

Functions§

boot
Copy a payload to a destination, then jump to it.
boot_grub2
Boot a GRUB2 core image.
boot_mbr
Boot an MBR.
boot_offset
Copy a payload to a destination, then jump to an offset.