Changes

519 bytes added ,  01:55, 27 June 2015
Document beginning of __LoaderStart()
Line 1: Line 1:  
The Cafe OS loader is responsible for loading RPL-formatted libraries and executables into memory. It is a standard ELF executable named loader.elf. It includes a statically linked copy of zlib, probably for decompressing sections of RPL files. Each userspace process has the loader mapped into its address space, and the loader is initially ran on process creation, loading coreinit.rpl, the application's dependencies, and the application RPX itself. After control passes to the application, the loader continues to be available through a special loader call interface, used by the OSDynLoad functions in coreinit.
 
The Cafe OS loader is responsible for loading RPL-formatted libraries and executables into memory. It is a standard ELF executable named loader.elf. It includes a statically linked copy of zlib, probably for decompressing sections of RPL files. Each userspace process has the loader mapped into its address space, and the loader is initially ran on process creation, loading coreinit.rpl, the application's dependencies, and the application RPX itself. After control passes to the application, the loader continues to be available through a special loader call interface, used by the OSDynLoad functions in coreinit.
 +
 +
==Functions==
 +
===__LoaderStart()===
 +
__LoaderStart() is the entry point of loader.elf, the first function called by both the kernel on process startup and loader calls from OSDynLoad. It takes a caller argument from the kernel in r3, which is 0 if called on process startup and 1 if called from OSDynLoad. There is also a loader call buffer passed in r4. If the function has been called from OSDynLoad, it goes to LOADER_Entry() and processes the loader call. Otherwise, it continues and sets up the app address space.
203

edits