Root/
Source at commit 406 created 13 years 10 months ago. By azimutz, Consolidating this position: while testing the new theme and boot-log function, i realized that when it comes to verbose boot, using the -v flag on Boot.plist (or typed at boot prompt) and using the Menu (Boot Verbose), doesn't produce the exact same output; using the Menu displays all the messages, while typing -v causes some of the first messages to disappear. So, moving this to an early stage isn't anymore a question of what is printed to screen or not! Tests also showed another diff: when using -v flag typed, the Boot Banner is cleared and messages start to print right away, while using Boot Verbose on the Menu, keeps the Banner, prints the first 2 or 3 messages right below it and the rest are only printed, when this code runs and does it's thing. Moving the code to this position fixes this glitch. | |
---|---|
1 | /*␊ |
2 | * Copyright (c) 2009 Evan Lojewski. All rights reserved.␊ |
3 | *␊ |
4 | */␊ |
5 | ␊ |
6 | #include <mach-o/loader.h>␊ |
7 | #include <mach-o/nlist.h>␊ |
8 | ␊ |
9 | #ifndef __BOOT2_KERNEL_PATCHER_H␊ |
10 | #define __BOOT2_KERNEL_PATCHER_H␊ |
11 | ␊ |
12 | #define CPUID_MODEL_ANY␉␉0x00␊ |
13 | #define CPUID_MODEL_UNKNOWN␉0x01␊ |
14 | ␊ |
15 | #define CPUID_MODEL_YONAH␉14␊ |
16 | #define CPUID_MODEL_MEROM␉15␊ |
17 | #define CPUID_MODEL_PENRYN␉23␊ |
18 | #define CPUID_MODEL_NEHALEM␉26␊ |
19 | #define CPUID_MODEL_ATOM␉28␊ |
20 | #define CPUID_MODEL_FIELDS␉30␉/* Lynnfield, Clarksfield, Jasper */␊ |
21 | #define CPUID_MODEL_DALES␉31␉/* Havendale, Auburndale */␊ |
22 | #define CPUID_MODEL_NEHALEM_EX␉46␊ |
23 | ␊ |
24 | #define KERNEL_ANY␉0x00␊ |
25 | #define KERNEL_64␉0x01␊ |
26 | #define KERNEL_32␉0x02␊ |
27 | ␊ |
28 | ␊ |
29 | typedef struct patchRoutine_t␊ |
30 | {␊ |
31 | ␉void* patchRoutine;␊ |
32 | ␉int validArchs;␊ |
33 | ␉int validCpu;␊ |
34 | ␉struct patchRoutine_t* next;␊ |
35 | } patchRoutine_t;␊ |
36 | ␊ |
37 | ␊ |
38 | typedef struct kernSymbols_t␊ |
39 | {␊ |
40 | ␉char* symbol;␊ |
41 | ␉void* symbolAddress;␊ |
42 | ␉struct kernSymbols_t* next;␊ |
43 | } kernSymbols_t;␊ |
44 | ␊ |
45 | void* lookup_kernel_symbol(const char* name);␊ |
46 | ␊ |
47 | void patch_kernel(void* kernelData);␊ |
48 | void register_kernel_patch(void* patch, int arch, int cpus);␊ |
49 | ␊ |
50 | int locate_symbols(void* kernelData);␊ |
51 | ␊ |
52 | void patch_kernel_32(void* kernelData);␊ |
53 | ␊ |
54 | ␊ |
55 | ␊ |
56 | void patch_cpuid_set_info(void* kernelData, UInt32 impersonateFamily, UInt8 inpersonateModel);␊ |
57 | void patch_pmCPUExitHaltToOff(void* kernelData);␊ |
58 | void patch_lapic_init(void* kernelData);␊ |
59 | void patch_commpage_stuff_routine(void* kernelData);␊ |
60 | #endif /* !__BOOT2_KERNEL_PATCHER_H */␊ |
61 |