[][src]Crate sunrise_bootstrap

Bootstrap stage

This stage is executed right after bootloader, and before we pass control to the kernel. Its main goal is to enable paging with the kernel mapped at the end of address space, and jump to kernel after that.

Virtual memory

What the bootstrap stage does is :

  1. create a set of pages
  2. identity map bootstrap sections
  3. load kernel at the end of address space
  4. copy the multiboot2 info to be page aligned.
  5. Map the multiboot2 info in kernel land.
  6. construct a map of kernel sections that will be passed to kernel
  7. create a kernel stack
  8. jump to kernel

Logging

We implement a really dumb serial logger for the bootstrap stage. We don't use any of the fancy logging interfaces that the kernel has.

Modules

address

Physical and Virtual address wrappers

bootstrap_logging

bootstrap logging on rs232

bootstrap_stack

Bootstrap stack

elf_loader

Loads the kernel in high memory

frame_alloc

A module implementing a physical memory manager that allocates and frees memory frames

gdt

GDT Handler

paging

Paging on i386

Structs

AlignedStack

4 pages, PAGE_SIZE aligned.

EndTag
FramebufferTag
ModuleAlignmentTag
MultiBootHeader

The multiboot header structure of our binary.

Statics

MULTIBOOT_HEADER

The multiboot header of our binary.

STACK

The stack we start on.

Functions

bootstrap_start

The very start.

do_bootstrap

bootstrap stage and call kernel

print_stack

Prints raw hexdump of the stack. Use this if everything went wrong and you're really hopeless.