Root/
Source at commit 1406 created 12 years 10 months ago. By meklort, Revert drivers.c so that kexts are only loaded when OSBundleRequired is set and that value is not safe mode. Added some comments about it too. | |
---|---|
1 | /*␍␊ |
2 | * BooterLog Dump Tool, part of the Chameleon Boot Loader Project␍␊ |
3 | *␍␊ |
4 | * Copyright 2010 by Islam M. Ahmed Zaid. All rights reserved.␍␊ |
5 | *␍␊ |
6 | */␍␊ |
7 | ␍␊ |
8 | #include <stdio.h>␍␊ |
9 | #include <stdint.h>␍␊ |
10 | #include <string.h>␍␊ |
11 | #include <stdlib.h>␍␊ |
12 | ␍␊ |
13 | #include "IOKit/IOKitLib.h"␍␊ |
14 | ␍␊ |
15 | ␍␊ |
16 | int main(int argc, char *argv[])␍␊ |
17 | {␍␊ |
18 | ␉io_registry_entry_t root = IORegistryEntryFromPath(kIOMasterPortDefault, "IOService:/");␍␊ |
19 | ␉if (!root)␍␊ |
20 | ␉{␍␊ |
21 | ␉␉printf("IORegistryEntry \"IOIOService:/\" not found.\n");␍␊ |
22 | ␉␉return 0;␍␊ |
23 | ␉}␍␊ |
24 | ␍␊ |
25 | ␉CFTypeRef bootLog = IORegistryEntryCreateCFProperty(root, CFSTR("boot-log"), kCFAllocatorDefault, 0);␍␊ |
26 | ␉if (!bootLog)␍␊ |
27 | ␉{␍␊ |
28 | ␉␉printf("\"boot-log\" property not found.\n");␍␊ |
29 | ␉␉return 0;␍␊ |
30 | ␉}␍␊ |
31 | ␉//CFShow(bootLog);␍␊ |
32 | ␉const UInt8 *msglog = CFDataGetBytePtr((CFDataRef)bootLog);␍␊ |
33 | ␉if (msglog)␍␊ |
34 | ␉␉printf("%s\n", msglog);␍␊ |
35 | ␍␊ |
36 | ␉return 0;␍␊ |
37 | }␍␊ |
38 | ␍␊ |
39 |