[−][src]Module sunrise_kernel::elf_loader
Loads Kernel Built-ins.
Loads the initial kernel binaries. The end-game goal is to have 5 kernel built-ins:
- sm: The Service Manager. Plays a pivotal role for permission checking.
- pm: The Process Manager.
- loader: Loads ELFs into an address space.
- fs: Provides access to the FileSystem.
- boot: Controls the boot chain. Asks PM to start user services. Akin to the init.
Because the 'normal' ELF loader lives in userspace in the Loader executable, kernel built-ins require their own loading mechanism. On i386, we use GRUB modules to send the built-ins to the kernel, and load them with a primitive ELF loader. This loader does not do any dynamic loading or provide ASLR (though that is up for change)
Structs
MappedGrubModule | Represents a grub module once mapped in kernel memory |
Functions
get_kacs | Gets the desired kernel access controls for a process based on the .kernel_caps section in its elf |
get_kip_header | Gets the KIP Header of the provided module, found in the .kip_header section of the ELF. |
load_builtin | Loads the given kernel built-in into the given page table. Returns address of entry point |
load_segment | Loads an elf segment by coping file_size bytes to the right address, and filling remaining with 0s. This is used by NOBITS sections (.bss), this way we initialize them to 0. |
map_grub_module | Maps a grub module, which already lives in reserved physical memory, into the KernelLand. |