Chameleon

Chameleon Svn Source Tree

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

Source at commit 360 created 13 years 11 months ago.
By azimutz, End "search algo" related stuff. Check Mac OS X version on processBootOptions() so we can override Boot.plist from OS specific folders. This check doesn't print to screen so, we still check Mac OS X version on boot.c as before. Initializing gMacOSVersion on options.c instead of boot.c. Also "Draw background, turn off any GUI elements and update VRAM" a bit early (as early as possible) on common_boot, so we can catch verbose from loadOverrideConfig. If i didn't forgot something, this concludes the search algo as is atm :)
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, UInt32 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: 360