Rewrote crt0, init, and chainloading code

start.s, init.c, linker.ld and linker.specs are meant
to be re-used by user applications, should they remove the defines
from init.c and the .chainloader* sections from the linker script
This commit is contained in:
TuxSH
2018-05-07 23:32:45 +02:00
parent 699ddfc043
commit e8306361f0
29 changed files with 848 additions and 185 deletions

View File

@@ -2,11 +2,10 @@
#define FUSEE_LOADER_H
#include "utils.h"
typedef void (*entrypoint_t)(int argc, void **argv);
#include "chainloader.h"
typedef struct {
char path[0x300];
char path[0x100];
const char *key;
uintptr_t load_address;
size_t load_size;
@@ -14,12 +13,15 @@ typedef struct {
typedef struct {
const char *bct0;
entrypoint_t chainload_entrypoint;
uintptr_t chainload_entrypoint;
size_t file_id_of_entrypoint;
size_t nb_files;
load_file_t package2_loadfile;
load_file_t exosphere_loadfile;
load_file_t tsecfw_loadfile;
load_file_t warmboot_loadfile;
char custom_splash_path[0x300];
char custom_splash_path[0x100];
char file_paths[CHAINLOADER_MAX_ENTRIES][0x100];
} loader_ctx_t;
#define LOADER_ENTRYPOINT_KEY "entrypoint"
@@ -32,10 +34,10 @@ typedef struct {
#define LOADER_WARMBOOT_KEY "warmboot"
/* TODO: Should we allow files bigger than 16 MB? */
#define LOADER_FILESIZE_MAX 0x01000000
//#define LOADER_FILESIZE_MAX 0x01000000
loader_ctx_t *get_loader_ctx(void);
void load_payload(const char *bct0);
#endif
#endif