2 * Copyright (C) 2006 - 2011 The AROS Development Team. All rights reserved.
6 #ifndef BOOTSTRAP_ELFLOADER_H_
7 #define BOOTSTRAP_ELFLOADER_H_
11 /* The loader operates with a single-linked list of these structures */
20 /* Some forward declarations */
23 struct ELF_ModuleInfo
;
25 /* This is the calling convention for kickstart entry point */
26 typedef int (*kernel_entry_fun_t
)(struct TagItem
*, unsigned int);
28 /* Two main functions you will use */
29 int GetKernelSize(struct ELFNode
*FirstELF
, unsigned long *ro_size
, unsigned long *rw_size
, unsigned long *bss_size
);
30 int LoadKernel(struct ELFNode
*FirstELF
, void *ptr_ro
, void *ptr_rw
, char *bss_tracker
, uintptr_t DefSysBase
,
31 void **kick_end
, kernel_entry_fun_t
*kernel_entry
, struct ELF_ModuleInfo
**kernel_debug
);
34 * These functions are used to access files by the loader.
35 * They need to be provided by your bootstrap implementation.
37 void *open_file(struct ELFNode
*n
, unsigned int *err
);
38 void close_file(void *file
);
39 int read_block(void *file
, unsigned long offset
, void *dest
, unsigned long length
);
40 void *load_block(void *file
, unsigned long offset
, unsigned long length
, unsigned int *err
);
41 void free_block(void *addr
);