Chameleon

Chameleon Commit Details

Date:2010-05-07 09:57:34 (9 years 3 months ago)
Author:Evan Lojewski
Commit:145
Parents: 144
Message:Kernel patcher works now (patched the kernel too late before)
Changes:
M/branches/meklort/i386/boot2/boot.c
M/branches/meklort/i386/boot2/gui.c
M/branches/meklort/i386/boot2/kernel_patcher.c
M/branches/meklort/i386/libsaio/fake_efi.c
M/branches/meklort/i386/boot2/kernel_patcher.h
M/branches/meklort/i386/boot2/options.c
M/branches/meklort/i386/boot2/drivers.c

File differences

branches/meklort/i386/libsaio/fake_efi.c
315315
316316
317317
318
318
319319
320320
321321
......
518518
519519
520520
521
521
522522
523
524
523
524
525525
526526
527527
static const char const FIRMWARE_REVISION_PROP[] = "firmware-revision";
static const char const FIRMWARE_ABI_PROP[] = "firmware-abi";
static const char const FIRMWARE_VENDOR_PROP[] = "firmware-vendor";
static const char const FIRMWARE_ABI_PROP_VALUE[] = "EFI64";
static const char const FIRMWARE_ABI_PROP_VALUE[] = "EFI32";
static const char const SYSTEM_ID_PROP[] = "system-id";
static const char const SYSTEM_SERIAL_PROP[] = "SystemSerialNumber";
static const char const SYSTEM_TYPE_PROP[] = "system-type";
setupSmbiosConfigFile();
// Generate efi device strings
setupEfiDevices();
setupEfiDevices();
// Initialize the base table
setupEfiTables();
// Initialize the base table
setupEfiTables();
// Initialize the device tree
setupEfiDeviceTree();
branches/meklort/i386/boot2/boot.c
192192
193193
194194
195
196195
197196
198197
finalizeBootStruct();
// Jump to kernel's entry point. There's no going back now.
startprog( kernelEntry, bootArgs );
// Not reached
branches/meklort/i386/boot2/drivers.c
807807
808808
809809
810
811
810812
811813
812814
......
815817
816818
817819
818
819820
820821
821822
ret = ThinFatFile(&binary, &len);
}
patch_kernel(binary);
ret = DecodeMachO(binary, rentry, raddr, rsize);
if (ret<0 && archCpuType==CPU_TYPE_X86_64)
ret = DecodeMachO(binary, rentry, raddr, rsize);
}
patch_kernel();
return ret;
}
branches/meklort/i386/boot2/gui.c
17161716
17171717
17181718
1719
1720
1719
1720
1721
1722
17211723
17221724
17231725
// find best matching vesa mode for our requested width & height
getGraphicModeParams(screen_params);
setVideoMode(GRAPHICS_MODE, 0);
if (bootArgs->Video.v_display == VGA_TEXT_MODE) {
setVideoMode(GRAPHICS_MODE, 0);
}
if (getValueForKey("-checkers", &dummyVal, &length, &bootInfo->bootConfig)) {
drawCheckerBoard();
} else {
branches/meklort/i386/boot2/kernel_patcher.c
3636
3737
3838
39
39
4040
41
41
4242
43
43
4444
4545
4646
4747
48
48
4949
5050
5151
extern unsigned long gBinaryAddress;
void patch_kernel()
void patch_kernel(void* kernelData)
{
switch (locate_symbols((void*)gBinaryAddress)) {
switch (locate_symbols((void*)kernelData)) {
case KERNEL_32:
patch_kernel_32((void*)gBinaryAddress);
patch_kernel_32((void*)kernelData);
break;
case KERNEL_64:
default:
patch_kernel_64((void*)gBinaryAddress);
patch_kernel_64((void*)kernelData);
break;
}
}
branches/meklort/i386/boot2/kernel_patcher.h
99
1010
1111
12
12
1313
1414
1515
1616
1717
1818
19
2019
2120
2221
#ifndef __BOOT2_KERNEL_PATCHER_H
#define __BOOT2_KERNEL_PATCHER_H
void patch_kernel();
void patch_kernel(void* kernelData);
#define KERNEL_641
#define KERNEL_322
int locate_symbols(void* kernelData);
void patch_kernel_32(void* kernelData);
void patch_kernel_64(void* kernelData);
branches/meklort/i386/boot2/options.c
721721
722722
723723
724
724
725
725726
726727
727728
// If the user is holding down a modifier key, enter safe mode.
if ((readKeyboardShiftFlags() & 0x0F) != 0) {
gBootMode |= kBootModeSafe;
//gBootMode |= kBootModeSafe;
}
// If user typed F8, abort quiet mode, and display the menu.

Archive Download the corresponding diff file

Revision: 145