Chameleon

Chameleon Svn Source Tree

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

Source at commit 340 created 13 years 10 months ago.
By azimutz, Ok.. as i mentioned about the "drivers" override key, this stuff is mostly based on the search algo on search_and_get_acpi_fd, acpi_patcher.c; i just added 2+2 and got 5 in return :) No need to check for ramdisk presence anymore, courtesy of Zef, rev 264. Why check the root of the ramdisk (rd) instead of /Extra? Well, rd's can be aliased as bt(0,0) or not, and the behavior is pretty diff in both situations; a "normal" rd can load "single" files and the paths to it start with rd(0,0).
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
11typedef struct symbolList_t{
12char* symbol;
13unsigned int addr;
14struct symbolList_t* next;
15} symbolList_t;
16
17typedef struct moduleList_t{
18char* module;
19unsigned int version;
20unsigned int compat;
21struct moduleList_t* next;
22} moduleList_t;
23
24#ifndef __BOOT_MODULES_H
25#define __BOOT_MODULES_H
26
27#define SYMBOLS_MODULE "Symbols"
28
29#define SYMBOL_DYLD_STUB_BINDER"dyld_stub_binder"
30#define STUB_ENTRY_SIZE6
31
32#define SECT_NON_LAZY_SYMBOL_PTR"__nl_symbol_ptr"
33#define SECT_SYMBOL_STUBS"__symbol_stub"
34
35#define SUCCESS1
36#defineERROR0
37
38int load_module(const char* module);
39int is_module_laoded(const char* name);
40void module_loaded(char* name, UInt32 version, UInt32 compat);
41
42void add_symbol(char* symbol, void* addr);
43void* parse_mach(void* binary);
44
45unsigned int handle_symtable(UInt32 base, struct symtab_command* symtabCommand, char* symbolStub, char* nonlazy);
46
47unsigned int lookup_all_symbols(const char* name);
48
49#endif /* __BOOT_MODULES_H */

Archive Download this file

Revision: 340