Index: trunk/CHANGES =================================================================== --- trunk/CHANGES (revision 383) +++ trunk/CHANGES (revision 384) @@ -1,3 +1,4 @@ +- 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 Index: trunk/i386/util/bdmesg.c =================================================================== --- trunk/i386/util/bdmesg.c (revision 0) +++ trunk/i386/util/bdmesg.c (revision 384) @@ -0,0 +1,38 @@ +/* + * BooterLog Dump Tool, part of the Chameleon Boot Loader Project + * + * Copyright 2010 by Islam M. Ahmed Zaid. All rights reserved. + * + */ + +#include +#include +#include +#include + +#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; +} + Index: trunk/i386/util/Makefile =================================================================== --- trunk/i386/util/Makefile (revision 383) +++ trunk/i386/util/Makefile (revision 384) @@ -18,7 +18,7 @@ CFILES = machOconv.c ALLSRC = $(CFILES) $(MFILES) $(HFILES) $(EXPORT_HFILES) -PROGRAMS = machOconv +PROGRAMS = machOconv bdmesg OUTFILES = $(PROGRAMS) @@ -29,6 +29,9 @@ 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