Chameleon

Chameleon Svn Source Tree

Root/tags/2.3/i386/util/bdmesg.c

Source at commit 2862 created 7 years 25 days ago.
By ifabio, Tag 2.3 release, bump svn to 2.4
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
15int main(int argc, char *argv[])
16{
17io_registry_entry_t root;
18CFTypeRef bootLog = NULL;
19
20root = IORegistryEntryFromPath(kIOMasterPortDefault, "IOService:/");
21
22if (root)
23{
24bootLog = IORegistryEntryCreateCFProperty(root, CFSTR("boot-log"), kCFAllocatorDefault, 0);
25}
26
27if (!bootLog)
28{
29// Check for Clover boot log
30root = IORegistryEntryFromPath(kIOMasterPortDefault, "IODeviceTree:/efi/platform");
31
32if (root)
33{
34bootLog = IORegistryEntryCreateCFProperty(root, CFSTR("boot-log"), kCFAllocatorDefault, 0);
35}
36}
37
38if (!bootLog)
39{
40printf("\"boot-log\" property not found.\n");
41return 0;
42}
43
44const UInt8 *msglog = CFDataGetBytePtr((CFDataRef)bootLog);
45
46if (msglog)
47{
48printf("%s\n", msglog);
49}
50
51CFRelease(bootLog);
52
53return 0;
54}
55

Archive Download this file

Revision: 2862