Chameleon

Chameleon Commit Details

Date:2010-11-14 01:19:25 (13 years 5 months ago)
Author:Evan Lojewski
Commit:635
Parents: 634
Message:Add module hooks. Change resume code to use verbose and not printf
Changes:
M/branches/meklort/i386/boot2/graphics.c
M/branches/meklort/i386/boot2/resume.c
M/branches/meklort/i386/boot2/boot.c
M/branches/meklort/i386/boot2/modules.h

File differences

branches/meklort/i386/boot2/resume.c
5151
5252
5353
54
54
5555
5656
5757
......
105105
106106
107107
108
108
109109
110110
111111
......
138138
139139
140140
141
141
142142
143143
144144
u_int32_t lowHalf, highHalf;
u_int32_t sum;
printf("\nWake Kernel!\n");
verbose("\nWake Kernel!\n");
dst = (unsigned long *) (header->restore1CodePage << 12);
count = header->restore1PageCount;
long buffer;
size = ReadFileAtOffset (image_filename, header, 0, sizeof(IOHibernateImageHeader));
printf("header read size %x\n", size);
verbose("header read size %x\n", size);
imageSize = header->image1Size;
codeSize = header->restore1PageCount << 12;
mem_base = getmemorylimit() - allocSize;//TODO: lower this
printf("mem_base %x\n", mem_base);
verbose("mem_base %x\n", mem_base);
// Rek : hibernate fix
if (!((long long)mem_base+allocSize<1024*bootInfo->extmem+0x100000))
{
branches/meklort/i386/boot2/graphics.c
327327
328328
329329
330
330331
331332
332333
// VESA mode.
bootArgs->Video.v_display = GRAPHICS_MODE;
//setVideoMode(GRAPHICS_MODE, 0);
bootArgs->Video.v_width = minfo.XResolution;
bootArgs->Video.v_height = minfo.YResolution;
bootArgs->Video.v_depth = minfo.BitsPerPixel;
branches/meklort/i386/boot2/boot.c
134134
135135
136136
137
137
138138
139139
140140
......
149149
150150
151151
152
153152
154153
155154
156155
156
157
157158
158
159159
160160
161161
......
185185
186186
187187
188
188
189
189190
190191
191192
......
324325
325326
326327
328
329
327330
328331
329332
//==========================================================================
// execKernel - Load the kernel image (mach-o) and jump to its entry point.
static int ExecKernel(void *binary)
int ExecKernel(void *binary)
{
entry_t kernelEntry;
int ret;
if ( ret != 0 )
return ret;
// Reserve space for boot args
reserveKernBootStruct();
// Load boot drivers from the specifed root path.
execute_hook("DecodedKernel", (void*)binary, NULL, NULL, NULL);
setupFakeEfi();
if (!gHaveKernelCache) {
}
#endif
bool dummyVal;
if (getBoolForKey(kWaitForKeypressKey, &dummyVal, &bootInfo->bootConfig) && dummyVal) {
if (getBoolForKey(kWaitForKeypressKey, &dummyVal, &bootInfo->bootConfig) && dummyVal)
{
printf("Press any key to continue...");
getc();
}
load_all_modules();
}
execute_hook("ModulesLoaded", NULL, NULL, NULL, NULL);
#ifndef OPTION_ROM
// Loading preboot ramdisk if exists.
branches/meklort/i386/boot2/modules.h
100100
101101
102102
103
103
104104
105105
int replace_function(const char* symbol, void* newAddress);
extern unsigned int (*lookup_symbol)(const char*);
//extern unsigned int (*lookup_symbol)(const char*);
#endif /* __BOOT_MODULES_H */

Archive Download the corresponding diff file

Revision: 635