[−][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 :
- create a set of pages
- identity map bootstrap sections
- load kernel at the end of address space
- copy the multiboot2 info to be page aligned.
- Map the multiboot2 info in kernel land.
- construct a map of kernel sections that will be passed to kernel
- create a kernel stack
- 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. |