Chameleon

Chameleon Commit Details

Date:2013-06-23 10:26:08 (10 years 8 months ago)
Author:JrCs
Commit:2251
Parents: 2250
Message:Update bdmesg to display Clover boot-log
Changes:
M/trunk/i386/util/bdmesg.c

File differences

trunk/i386/util/bdmesg.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* BooterLog Dump Tool, part of the Chameleon Boot Loader Project
*
* Copyright 2010 by Islam M. Ahmed Zaid. All rights reserved.
*
*/
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "IOKit/IOKitLib.h"
int main(int argc, char *argv[])
{
io_registry_entry_t root = IORegistryEntryFromPath(kIOMasterPortDefault, "IOService:/");
if (!root)
{
printf("IORegistryEntry \"IOIOService:/\" not found.\n");
return 0;
}
CFTypeRef bootLog = IORegistryEntryCreateCFProperty(root, CFSTR("boot-log"), kCFAllocatorDefault, 0);
if (!bootLog)
{
printf("\"boot-log\" property not found.\n");
return 0;
}
//CFShow(bootLog);
const UInt8 *msglog = CFDataGetBytePtr((CFDataRef)bootLog);
if (msglog)
printf("%s\n", msglog);
return 0;
}
/*
* BooterLog Dump Tool, part of the Chameleon Boot Loader Project
*
* Copyright 2010 by Islam M. Ahmed Zaid. All rights reserved.
*
*/
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "IOKit/IOKitLib.h"
int main(int argc, char *argv[])
{
io_registry_entry_t root;
CFTypeRef bootLog = NULL;
root = IORegistryEntryFromPath(kIOMasterPortDefault, "IOService:/");
if (root)
bootLog = IORegistryEntryCreateCFProperty(root, CFSTR("boot-log"), kCFAllocatorDefault, 0);
if (!bootLog)
{
// Check for Clover boot log
root = IORegistryEntryFromPath(kIOMasterPortDefault, "IODeviceTree:/efi/platform");
if (root)
bootLog = IORegistryEntryCreateCFProperty(root, CFSTR("boot-log"), kCFAllocatorDefault, 0);
}
if (!bootLog)
{
printf("\"boot-log\" property not found.\n");
return 0;
}
const UInt8 *msglog = CFDataGetBytePtr((CFDataRef)bootLog);
if (msglog)
printf("%s\n", msglog);
return 0;
}

Archive Download the corresponding diff file

Revision: 2251