Chameleon

Chameleon Commit Details

Date:2011-06-05 15:06:46 (8 years 15 days ago)
Author:Azimutz
Commit:962
Parents: 961
Message:Merge trunk (r956 --> 960).
Changes:
M/branches/azimutz/Cleancut/i386/boot2/modules.h
M/branches/azimutz/Cleancut/i386/libsaio/smbios.h
M/branches/azimutz/Cleancut
M/branches/azimutz/Cleancut/i386/modules/Resolution/Makefile
M/branches/azimutz/Cleancut/i386/modules/MakeInc.dir
M/branches/azimutz/Cleancut/i386/boot2/modules.c

File differences

branches/azimutz/Cleancut/i386/boot2/modules.c
1111
1212
1313
14
1415
1516
1617
......
5859
5960
6061
61
62
6263
6364
6465
......
7475
7576
7677
77
78
7879
7980
8081
......
9293
9394
9495
95
96
97
98
99
100
101
96102
97103
98104
99
105
100106
101107
102108
......
171177
172178
173179
174
180
175181
176182
177183
......
231237
232238
233239
234
240
235241
236242
237243
238244
239245
240246
241
242
243
247
248
249
250
251
252
253
254
255
256
257
258
259
260
244261
245262
246263
#include "bootstruct.h"
#include "modules.h"
#include "boot_modules.h"
#include <vers.h>
#if CONFIG_MODULE_DEBUG
if(module_start && module_start != (void*)0xFFFFFFFF)
{
// Notify the system that it was laoded
module_loaded(SYMBOLS_MODULE /*moduleName, moduleVersion, moduleCompat*/);
module_loaded(SYMBOLS_MODULE, SYMBOLS_AUTHOR, SYMBOLS_DESCRIPTION, SYMBOLS_VERSION, SYMBOLS_COMPAT);
(*module_start)();// Start the module. This will point to load_all_modules due to the way the dylib was constructed.
execute_hook("ModulesLoaded", NULL, NULL, NULL, NULL);
if(module_start && module_start != (void*)0xFFFFFFFF)
{
// Notify the system that it was laoded
module_loaded(SYMBOLS_MODULE /*moduleName, moduleVersion, moduleCompat*/);
module_loaded(SYMBOLS_MODULE, SYMBOLS_AUTHOR, SYMBOLS_DESCRIPTION, SYMBOLS_VERSION, SYMBOLS_COMPAT);
(*module_start)();// Start the module. This will point to load_all_modules due to the way the dylib was constructed.
execute_hook("ModulesLoaded", NULL, NULL, NULL, NULL);
return retVal;
}
void start_built_in_module(char* name, void(*start_function)(void))
void start_built_in_module(const char* name,
const char* author,
const char* description,
UInt32 version,
UInt32 compat,
void(*start_function)(void))
{
start_function();
// Notify the module system that this module really exists, specificaly, let other module link with it
module_loaded(name /*, moduleName, moduleVersion, moduleCompat*/);
module_loaded(name, author, description, version, compat);
}
if(module_start && module_start != (void*)0xFFFFFFFF)
{
// Notify the system that it was laoded
module_loaded(module/*moduleName, moduleVersion, moduleCompat*/);
module_loaded(module, NULL, NULL, 0, 0 /*moduleName, moduleVersion, moduleCompat*/);
(*module_start)();// Start the module
DBG("Module %s Loaded.\n", module); DBGPAUSE();
}
/*
* print out the information about the loaded module
*/
void module_loaded(const char* name/*, UInt32 version, UInt32 compat*/)
void module_loaded(const char* name, const char* author, const char* description, UInt32 version, UInt32 compat)
{
moduleList_t* new_entry = malloc(sizeof(moduleList_t));
new_entry->next = loadedModules;
loadedModules = new_entry;
new_entry->name = (char*)name;
//new_entry->version = version;
//new_entry->compat = compat;
if(!name) name = "Unknown";
if(!author) author = "Unknown";
if(!description) description = "";
new_entry->name = name;
new_entry->author = author;
new_entry->description = description;
new_entry->version = version;
new_entry->compat = compat;
msglog("Module '%s' by '%s' Loaded.\n", name, author);
msglog("\tDescription: %s\n", description);
msglog("\tVersion: %d\n", version); // todo: sperate to major.minor.bugfix
msglog("\tCompat: %d\n", compat); // todo: ^^^ major.minor.bugfix
}
int is_module_loaded(const char* name)
branches/azimutz/Cleancut/i386/boot2/modules.h
1313
1414
1515
16
1617
18
19
20
21
22
1723
1824
1925
......
4349
4450
4551
46
47
48
52
53
54
55
56
4957
5058
5159
......
5462
5563
5664
57
65
66
67
68
69
70
5871
59
6072
6173
62
74
6375
6476
6577
#define __BOOT_MODULES_H
#define MODULE_PATH"/Extra/modules/"
#define SYMBOLS_MODULE "Symbols.dylib"
#define SYMBOLS_AUTHOR "Chameleon"
#define SYMBOLS_DESCRIPTION "Chameleon symbols for linking"
#define SYMBOLS_VERSION 0
#define SYMBOLS_COMPAT 0
#define VOID_SYMBOL"dyld_void_start"
extern UInt64 textAddress;
extern UInt64 textSection;
typedef struct moduleList_t //Azi: modules or module? see modules/include/modules
{
char*name;
//UInt32version;
//UInt32compat;
const char*name;
const char* author;
const char* description;
UInt32version;
UInt32compat;
struct moduleList_t*next;
} moduleList_t;
int init_module_system();
void load_all_modules();
void start_built_in_module(char* name, void(*start_function)(void));
void start_built_in_module(const char* name,
const char* author,
const char* description,
UInt32 version,
UInt32 compat,
void(*start_function)(void));
int load_module(char* module);
int is_module_loaded(const char* name);
void module_loaded(const char* name/*, UInt32 version, UInt32 compat*/);
void module_loaded(const char* name, const char* author, const char* description, UInt32 version, UInt32 compat);
branches/azimutz/Cleancut/i386/modules/Resolution/Makefile
11
2
3
24
35
46
MODULE_NAME = Resolution
MODULE_AUTHOR = Chameleon
MODULE_DESCRIPTION = This module reads the edid information from the monitor attached to the main display. The module will also patch the vesa modes available in pre intel hd graphics cards to provide proper resolution while booting.
MODULE_VERSION = "1.0.0"
MODULE_COMPAT_VERSION = "1.0.0"
MODULE_START = $(MODULE_NAME)_start
branches/azimutz/Cleancut/i386/modules/MakeInc.dir
165165
166166
167167
168
168
169169
170170
171171
172172
173
173
174174
175175
176
176
177177
178178
179179
.PHONY: $(SRCROOT)/sym/i386/boot_modules.c
$(SRCROOT)/sym/i386/boot_modules.c:
@echo "\tstart_built_in_module(\"$(MODULE_NAME)\", &$(MODULE_START));" >> $@
@echo "\tstart_built_in_module(\"$(MODULE_NAME)\", \"$(MODULE_AUTHOR)\", \"$(MODULE_DESCRIPTION)\", 0, 0, &$(MODULE_START));" >> $@
$(SRCROOT)/sym/i386/boot_modules.h:
@echo "void $(MODULE_START)(); // $(MODULE_NAME)" >> $@
$(OBJROOT)/$(MODULE_NAME).desc: Makefile
$(OBJROOT)/$(MODULE_NAME).author: Makefile
@echo "$(MODULE_AUTHOR)" > $@
$(OBJROOT)/$(MODULE_NAME).author: Makefile
$(OBJROOT)/$(MODULE_NAME).desc: Makefile
@echo "$(MODULE_DESCRIPTION)" > $@
#dependencies

Archive Download the corresponding diff file

Revision: 962