Chameleon

Chameleon Svn Source Tree

Root/branches/meklort/i386/boot2/modules.h

Source at commit 341 created 13 years 8 months ago.
By meklort, Updates module code, dependencies now work correctly. Added KernelPatcher module (currently doesn't hook in anywhere). I need to fix the module loader so that the kernel patcher module loads / starts correctly.
1/*
2 * Module Loading functionality
3 * Copyright 2009 Evan Lojewski. All rights reserved.
4 *
5 */
6
7#include <mach-o/loader.h>
8#include <mach-o/nlist.h>
9
10#ifndef __BOOT_MODULES_H
11#define __BOOT_MODULES_H
12
13
14typedef struct symbolList_t{
15char* symbol;
16unsigned int addr;
17struct symbolList_t* next;
18} symbolList_t;
19
20typedef struct moduleList_t{
21char* module;
22unsigned int version;
23unsigned int compat;
24struct moduleList_t* next;
25} moduleList_t;
26
27
28#define SYMBOLS_MODULE "Symbols"
29
30#define SYMBOL_DYLD_STUB_BINDER"dyld_stub_binder"
31#define STUB_ENTRY_SIZE6
32
33#define SECT_NON_LAZY_SYMBOL_PTR"__nl_symbol_ptr"
34#define SECT_SYMBOL_STUBS"__symbol_stub"
35
36#define SUCCESS1
37#defineERROR0
38
39int load_module(const char* module);
40int is_module_laoded(const char* name);
41void module_loaded(char* name, UInt32 version, UInt32 compat);
42
43void add_symbol(char* symbol, void* addr);
44void* parse_mach(void* binary);
45
46unsigned int handle_symtable(UInt32 base, struct symtab_command* symtabCommand, char* symbolStub, char* nonlazy);
47
48unsigned int lookup_all_symbols(const char* name);
49
50extern unsigned int (*lookup_symbol)(const char*);
51
52#endif /* __BOOT_MODULES_H */

Archive Download this file

Revision: 341