[][src]Crate sunrise_loader

Userspace Loader

This binary is responsible for all the steps involved in starting an application, creating the kernel process, loading the binary, passing the arguments, and finally starting it.

Under HOS/NX, processes are started through pm:shell's LaunchTitle, which will ask ldr:pm's CreateProcess to do the actual process creation. The loader will then use fsp-ldr's OpenCodeFileSystem to find the binary and signature, validate all the signatures and whatnot, and create + load the binary in a new process. The boot sysmodule is responsible for starting the initial process, by asking PM:shell to start them.

We will handle things slightly differently: PM and Loader will both live together under the same loader binary. Instead of using fsp-ldr, we will look for binaries in the filesystem's /bin, using the following hierarchy:

Modules

elf_loader

Loads Elfs.

Structs

BOOT_FROM_FS

The filesystem to boot titles from.

LoaderIface

Struct implementing the ldr:shel service.

PROCESSES
PROCESS_STATE_CHANGED

Public ReadableEvent that gets signaled when a process state changes. Other processes can get it by using the get_process_state_changed_event command.

Constants

MAX_ELF_SIZE

Max size of an ELF before we issue a warning. Loader needs to keep its memory usage fairly low to avoid trouble, so we bail upon trying to load a file bigger than 128MiB.

Statics

CAPABILITIES
HEADER

Functions

boot

Start the given titleid by loading its content from the provided filesystem.

main