Chameleon

Chameleon Svn Source Tree

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

Source at commit 333 created 13 years 8 months ago.
By meklort, Initial version of the module system. Basic at the moment, needs a lot of work. Modules (should) be able to link with any function or global variable exported by chameleon. Modules currently *cannot* lonk with each other, if you try to, bad things might happen. Lots fo verbose / debugging information is int modules.c. If you write a module that doesn't load properly, upload a copy of the module, the source, and the issues you are having to the issue tracker and I'll try to fix the bug.
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
11#ifndef __BOOT_MODULES_H
12#define __BOOT_MODULES_H
13
14#define SYMBOLS_MODULE "Symbols"
15#define SYMBOL_DYLD_STUB_BINDER"dyld_stub_binder"
16#define STUB_ENTRY_SIZE6
17
18#define SUCCESS1
19#defineERROR0
20
21
22
23int jump_pointer(int (*pointer)());
24
25int load_module(const char* module);
26void module_loaded(const char* name, UInt32 version, UInt32 compat);
27void add_symbol(const char* symbol, void* addr);
28void* parse_mach(void* binary);
29
30#endif /* __BOOT_MODULES_H */

Archive Download this file

Revision: 333