Chameleon

Chameleon Commit Details

Date:2010-08-18 12:20:27 (13 years 7 months ago)
Author:Kabyl
Commit:384
Parents: 383
Message:Added Booter Log Dump Tool
Changes:
A/trunk/i386/util/bdmesg.c
M/trunk/i386/util/Makefile
M/trunk/CHANGES

File differences

trunk/CHANGES
1
12
23
34
- Added Booter Log Dump Tool
- Added Booter message Logging (":/boot-log" ioreg property)
- Removed obsolete -f option, use -x instead
- Removed -x32 option, use arch=i386 instead
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
/*
* 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;
}
trunk/i386/util/Makefile
1818
1919
2020
21
21
2222
2323
2424
......
2929
3030
3131
32
33
34
3235
3336
3437
CFILES = machOconv.c
ALLSRC = $(CFILES) $(MFILES) $(HFILES) $(EXPORT_HFILES)
PROGRAMS = machOconv
PROGRAMS = machOconv bdmesg
OUTFILES = $(PROGRAMS)
machOconv: machOconv.o
$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $(SYMROOT)/$(@F) machOconv.o
bdmesg: bdmesg.o
$(CC) $(CFLAGS) $(LDFLAGS) -framework IOKit -framework CoreFoundation -o $(SYMROOT)/$(@F) bdmesg.o
include ../MakeInc.dir
#dependencies

Archive Download the corresponding diff file

Revision: 384