22 |
#include "string.h" |
#include "string.h" |
23 |
#include "output.h" |
#include "output.h" |
24 |
#include "shutdown.h" |
#include "shutdown.h" |
25 |
|
#include "loader.h" |
26 |
|
|
27 |
|
|
28 |
#define PROGRAM_NAME "laden" |
/* The program name. */ |
29 |
|
extern char *program_name; |
30 |
|
|
31 |
#define BUG_ADDRESS "<bug-hurd@gnu.org>" |
#define BUG_ADDRESS "<bug-hurd@gnu.org>" |
32 |
|
|
33 |
|
|
52 |
/* The memory map to be provided to the kernel. */ |
/* The memory map to be provided to the kernel. */ |
53 |
#define MEMORY_MAP_MAX 200 |
#define MEMORY_MAP_MAX 200 |
54 |
extern struct l4_memory_desc memory_map[MEMORY_MAP_MAX]; |
extern struct l4_memory_desc memory_map[MEMORY_MAP_MAX]; |
55 |
extern int memory_map_size; |
extern l4_word_t memory_map_size; |
56 |
|
|
57 |
#define add_memory_map(start,end,mtype,msubtype) \ |
#define add_memory_map(start,end,mtype,msubtype) \ |
58 |
({ \ |
({ \ |
80 |
|
|
81 |
/* The generic code defines these functions. */ |
/* The generic code defines these functions. */ |
82 |
|
|
|
/* Print an error message and fail. */ |
|
|
#define panic(...) \ |
|
|
({ \ |
|
|
printf (PROGRAM_NAME ": error: "); \ |
|
|
printf (__VA_ARGS__); \ |
|
|
putchar ('\n'); \ |
|
|
shutdown (); \ |
|
|
}) |
|
|
|
|
|
/* True if debug mode is enabled. */ |
|
|
extern int debug; |
|
|
|
|
|
/* Print a debug message. */ |
|
|
#define debug(...) do { if (debug) printf (__VA_ARGS__); } while (0) |
|
|
|
|
|
/* Add the region with the name NAME from START to END to the table of |
|
|
regions to check against. Before doing that, check for overlaps |
|
|
with existing regions. */ |
|
|
void loader_add_region (char *name, l4_word_t start, l4_word_t end); |
|
|
|
|
|
|
|
|
/* Load the ELF images of the kernel and the initial servers into |
|
|
memory, checking for overlaps. Update the start and end |
|
|
information with the information from the ELF program, and fill in |
|
|
the entry points. */ |
|
|
void load_components (void); |
|
|
|
|
83 |
void kip_fixup (void); |
void kip_fixup (void); |
84 |
|
|
85 |
int main (int argc, char *argv[]); |
int main (int argc, char *argv[]); |