From b78bfd9ad51e1bb2d1641fcc7766ac57d8043c55 Mon Sep 17 00:00:00 2001 From: Dave Griffin Date: Thu, 25 Oct 2012 10:33:24 +0100 Subject: [PATCH 001/136] Finished option to customise Processor Tray serial in MacPro --- i386/config/settings-template.h | 4 ++++ i386/libsaio/smbios/dynamic_data.h | 11 ++++++++--- i386/libsaio/smbios/getters.h | 9 +++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/i386/config/settings-template.h b/i386/config/settings-template.h index 263eba5..0732192 100644 --- a/i386/config/settings-template.h +++ b/i386/config/settings-template.h @@ -331,6 +331,10 @@ #undef USE_STATIC_CPU_DATA // Prevent boot failures due to wrong settings (until I figured out what we are missing). #endif +#if TARGET_MODEL & MACPRO + #define STATIC_SMBOARDSERIAL "SOMEBOARDNMBR" // Example only! +#endif + #define OVERRIDE_DYNAMIC_MEMORY_DETECTION 0 // Set to 0 by default. Change this to 0 only when your SMBIOS data (type 17) is correct, or when // you want/need to override some/all of the SMBIOS data. // diff --git a/i386/libsaio/smbios/dynamic_data.h b/i386/libsaio/smbios/dynamic_data.h index 99f62fe..91f25d6 100755 --- a/i386/libsaio/smbios/dynamic_data.h +++ b/i386/libsaio/smbios/dynamic_data.h @@ -54,9 +54,9 @@ struct SMBStructure requiredStructures[] = { { kSMBTypeBIOSInformation /* 0 */ , 0, 5, false, 0 }, { kSMBTypeSystemInformation /* 1 */ , 6, 10, false, 0 }, - { kSMBTypeBaseBoard /* 2 */ , 11, 12, false, 0 }, + { kSMBTypeBaseBoard /* 2 */ , 11, 14, false, 0 }, { kSMBUnused /* 3 */ , 0, 0, false, 0 }, - { kSMBTypeProcessorInformation /* 4 */ , 13, 14, true, 0 }, + { kSMBTypeProcessorInformation /* 4 */ , 15, 16, true, 0 }, { kSMBUnused /* 5 */ , 0, 0, false, 0 }, { kSMBUnused /* 6 */ , 0, 0, false, 0 }, { kSMBUnused /* 7 */ , 0, 0, false, 0 }, @@ -69,7 +69,7 @@ struct SMBStructure requiredStructures[] = { kSMBUnused /* 14 */ , 0, 0, false, 0 }, { kSMBUnused /* 15 */ , 0, 0, false, 0 }, { kSMBUnused /* 16 */ , 0, 0, false, 0 }, - { kSMBTypeMemoryDevice /* 17 */ , 15, 19, true, 0 } + { kSMBTypeMemoryDevice /* 17 */ , 17, 21, true, 0 } }; @@ -130,6 +130,11 @@ struct SMBProperty SMBProperties[] = { kSMBTypeBaseBoard, 0x04, kSMBString, .plainData = APPLE_INC }, { kSMBTypeBaseBoard, 0x05, kSMBString, .plainData = SMB_BOARD_PRODUCT }, + +#if TARGET_MODEL & MACPRO + { kSMBTypeBaseBoard, 0x07, kSMBString, .plainData = STATIC_SMBOARDSERIAL }, + { kSMBTypeBaseBoard, 0x0d, kSMBByte, .getSMBByte = getBoardType }, +#endif //------------------------------------------------------------------------------------------------ diff --git a/i386/libsaio/smbios/getters.h b/i386/libsaio/smbios/getters.h index 9c9b100..54aade3 100755 --- a/i386/libsaio/smbios/getters.h +++ b/i386/libsaio/smbios/getters.h @@ -346,3 +346,12 @@ static SMBDWord getBIOSFeaturesEX(void) { return (0x010002c1); } + +//============================================================================== + +#if TARGET_MODEL & MACPRO +static SMBByte getBoardType(void) +{ + return 0x0b; // Some logic here or just return 11/0x0b. +} +#endif From 946bd41ae3c6880cfdd6903b8191a29c30ccf00d Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 11:03:56 +0300 Subject: [PATCH 002/136] Update for RevoBoot v1.5.10/v1.5.20 --- Makefile | 185 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 124 insertions(+), 61 deletions(-) diff --git a/Makefile b/Makefile index 8216a1e..40a2c4c 100644 --- a/Makefile +++ b/Makefile @@ -1,27 +1,30 @@ # -# Makefile for RevoBoot +# File: RevoBoot/Makefile +# +# Updates: +# +# - Major cleanup (PikerAlpha, October 2012). +# - Output improvements (PikerAlpha, October 2012). +# - Default build target is now Mountain Lion (PikerAlpha, October 2012). +# - PRODUCT_MODEL_TARGET for target build model added (PikerAlpha, October 2012). +# - Creates RevoBoot/config/SETTINGS when missing (PikerAlpha, October 2012). +# - Copies settings-template.h to SETTINGS/ModelnameNN.h when missing (PikerAlpha, October 2012). +# - Automatic ACPI/EFI/SMBIOS data selection (PikerAlpha, October 2012). +# + +# +# Include Apple makefile definitions. # export USE_APPLE_PB_SUPPORT = all -# CFLAGS = -O $(MORECPP) -arch i386 -g -DEFINES= -CONFIG = hd LIBDIR = libsa INC = -I. -I$(LIBDIR) -ifneq "" "$(wildcard /bin/mkdirs)" - MKDIRS = /bin/mkdirs -else - MKDIRS = /bin/mkdir -p -endif -AS = as -LD = ld + PAX = /bin/pax OBJROOT = `pwd`/obj SYMROOT = `pwd`/sym -DSTROOT = `pwd`/dst -SRCROOT = /tmp # # Export version number (picked up by i386/libsaio/Makefile) @@ -31,69 +34,129 @@ export PRODUCT_VERSION_NUMBER = `cat ../../VERSION` EXCLUDE = --exclude=.DS_Store --exclude=sym --exclude=obj --exclude=*.sh -ARCHLESS_RC_CFLAGS=`echo $(RC_CFLAGS) | sed 's/-arch [a-z0-9]*//g'` +# +# Search paths. +# VPATH = $(OBJROOT):$(SYMROOT) -GENERIC_SUBDIRS = - # -# Export target OS type (picked up by i386/libsaio/Makefile) +# Check if OS build target is specified (example: make mountain-lion). # -ifeq ($(MAKECMDGOALS), mountain-lion) +ifeq ($(MAKECMDGOALS),) + # + # No OS build target given. Build for Mountain Lion (default). + # MAKE_TARGET_OS = 6; + MAKEGOAL = mountain-lion else - ifeq ($(MAKECMDGOALS), lion) - MAKE_TARGET_OS = 2; + # + # Setting MAKE_TARGET_OS and MAKEGOAL based on OS build target. + # + ifeq ($(MAKECMDGOALS), mountain-lion) + MAKE_TARGET_OS = 6; + MAKEGOAL = mountain-lion else - MAKE_TARGET_OS = 1; + ifeq ($(MAKECMDGOALS), lion) + MAKE_TARGET_OS = 2; + MAKEGOAL = lion + else ifeq ($(MAKECMDGOALS), legacy) + MAKE_TARGET_OS = 1; + MAKEGOAL = legacy + endif endif endif +# +# Export our make goal i.e. mountain-lion, lion or legacy (snow-leopard or leopard). +# + +export MAKEGOAL + +# +# Export OS build target (picked up by: i386/libsaio/Makefile). +# + export PRODUCT_OS_TARGET = `echo $(MAKE_TARGET_OS)` -lion: all -mountain-lion: all - -all: $(SYMROOT) $(OBJROOT) - @if [ -z "$(RC_ARCHS)" ]; then \ - RC_ARCHS="i386"; \ - fi; \ - SUBDIRS="$(GENERIC_SUBDIRS) $$RC_ARCHS"; \ - for i in $$SUBDIRS; \ - do \ - if [ -d $$i ]; then \ - echo ================= make $@ for $$i =================; \ - ( OBJROOT=$(OBJROOT)/$${i}; \ - SYMROOT=$(SYMROOT)/$${i}; \ - DSTROOT=$(DSTROOT); \ - XCFLAGS=$(ARCHLESS_RC_CFLAGS); \ - GENSUBDIRS="$(GENERIC_SUBDIRS)"; \ - for x in $$GENSUBDIRS; \ - do \ - if [ "$$x" == "$$i" ]; then \ - XCFLAGS="$(RC_CFLAGS)"; \ - break; \ - fi \ - done; \ - echo "$$OBJROOT $$SYMROOT $$DSTROOT"; \ - cd $$i; ${MAKE} \ - "OBJROOT=$$OBJROOT" \ - "SYMROOT=$$SYMROOT" \ - "DSTROOT=$$DSTROOT" \ - "SRCROOT=$$SRCROOT" \ - "RC_ARCHS=$$RC_ARCHS" \ - "TARGET=$$i" \ - "RC_CFLAGS=$$XCFLAGS" $@ \ - ) || exit $$?; \ - else \ - echo "========= Nothing to build for $$i ========="; \ - fi; \ - done +# +# Check if a target model was specified (example: make MODEL=16 mountain-lion). +# + +ifdef MODEL + # + # MODEL=[MacModelNN] specified, export target model as PRODUCT_MODEL_TARGET. + # + ifneq ($(MODEL),) + export MAKE_TARGET_MODEL = $(MODEL) + # + # Include static ACPI/EFI/SMBIOS data file per model identifier. + # + DATA_FILE = $(MODEL) + else + export MAKE_TARGET_MODEL = default + # + # Include default/empty static data file (no model identifier specified). + # + DATA_FILE = data.h + endif +else + # + # Include default settings template (no model identifier specified). + # + export MAKE_TARGET_MODEL = default + # + # Include default/empty static data file (no model identifier specified). + # + DATA_FILE = data.h +endif + +# +# Export target filenames for static ACPI, EFI and SMBIOS data. +# + +export MAKE_ACPI_DATA_FILE = ACPI/$(DATA_FILE) +export MAKE_EFI_DATA_FILE = EFI/$(DATA_FILE) +export MAKE_SMBIOS_DATA_FILE = SMBIOS/$(DATA_FILE) + +# +# Our one and only build target directory. +# + +ARCH_DIR=i386 + +CONFIG_DIR=$(ARCH_DIR)/config + +SETTINGS_DIR=$(CONFIG_DIR)/SETTINGS +SETTINGS_FILE=$(SETTINGS_DIR)/$(MAKE_TARGET_MODEL).h + +$(MAKEGOAL): $(SYMROOT) $(OBJROOT) + @if [ ! -d $(SETTINGS_DIR) ]; then \ + /bin/mkdir -p $(SETTINGS_DIR); \ + fi; + + @if [ ! -f $(SETTINGS_FILE) ]; then \ + cp -n $(CONFIG_DIR)/settings-template.h $(SETTINGS_FILE); \ + fi; + + @if [ -d $(ARCH_DIR) ]; then \ + echo ================= make MODEL=$(MAKE_TARGET_MODEL) $@ for: RevoBoot/$(ARCH_DIR) =================; \ + ( OBJROOT=$(OBJROOT)/$(ARCH_DIR); \ + SYMROOT=$(SYMROOT)/$(ARCH_DIR); \ + XCFLAGS="$(RC_CFLAGS)"; \ + echo "$$OBJROOT $$SYMROOT"; \ + cd $(ARCH_DIR); ${MAKE} \ + "OBJROOT=$$OBJROOT" \ + "SYMROOT=$$SYMROOT" \ + "RC_ARCHS=$(ARCH_DIR)" \ + "TARGET=$(ARCH_DIR)" \ + "RC_CFLAGS=$$XCFLAGS" $@ \ + ) || exit $$?; \ + fi; clean: rm -rf sym obj dst out.log -$(SYMROOT) $(OBJROOT) $(DSTROOT): - @$(MKDIRS) $@ +$(SYMROOT) $(OBJROOT): + @/bin/mkdir -p $@ From 190e0962dc46f1482e21943648a00592422e7943 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 11:05:00 +0300 Subject: [PATCH 003/136] Updating version info for RevoBoot v1.5.20 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 4ada1d8..a7ccabd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.00 +1.5.20 From a094b2215235ac7fa6f63dc6f28306d8572d7c6e Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 11:06:14 +0300 Subject: [PATCH 004/136] Now cleanly defaults to Mountain Lion --- r | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r b/r index ce7791e..74d7e5c 100755 --- a/r +++ b/r @@ -1,4 +1,4 @@ make clean clear -make mountain-lion > out.log +make > out.log From e5804efb7942ef5e8428bc14666a4fb98d65237c Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 11:08:14 +0300 Subject: [PATCH 005/136] Update for RevoBoot v1.5.10/v1.5.20 --- i386/MakeInc.dir | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/i386/MakeInc.dir b/i386/MakeInc.dir index 77611ac..ddb327c 100755 --- a/i386/MakeInc.dir +++ b/i386/MakeInc.dir @@ -1,16 +1,11 @@ # -# Common makefile targets. +# File: RevoBoot/i386/MakeInc.dir # -# Define these variables (if desired) in directory makefiles: -# DIRS_NEEDED -# INSTALLDIR -# SRCROOT +# Updates: # -ifneq "" "$(wildcard /bin/mkdirs)" - MKDIRS = /bin/mkdirs -else - MKDIRS = /bin/mkdir -p -endif +# - Major cleanup (PikerAlpha, October 2012). +# + # # Use /usr/bin/gcc instead of /usr/bin/cc (symbolic link to clang in Xcode 4.3.2 and greater). @@ -26,22 +21,6 @@ CC = gcc #OMIT_FRAME_POINTER_CFLAG=-fomit-frame-pointer OMIT_FRAME_POINTER_CFLAG= -installsrc:: $(SRCROOT) - cp $(ALLSRC) $(SRCROOT) - cd $(SRCROOT); chmod a-w $(ALLSRC) - -install:: installhdrs - @if [ -z "$(RC_ARCHS)" -o -n "$(RC_i386)" ]; then \ - $(MAKE) install_i386 OBJROOT=${OBJROOT} \ - SYMROOT=${SYMROOT} DSTROOT=${DSTROOT} \ - SRCROOT=${SRCROOT}; \ - else \ - echo i386 not selected - null build.; \ - fi - -install_i386:: all - -installhdrs:: .SUFFIXES: .s .i .c .o @@ -69,5 +48,5 @@ boot2.o: $(OBJROOT)/%.o: %.s $(CC) $(CPPFLAGS) -c $(INC) -arch i386 -o $(OBJROOT)/$(@F) $< -$(DIRS_NEEDED) $(INSTALLDIR) $(SRCROOT): - $(MKDIRS) $@ +$(DIRS_NEEDED): # $(INSTALLDIR) $(SRCROOT): + @/bin/mkdir -p $@ From ce6b5d0381a77da925174705427b894791e9190e Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 11:08:48 +0300 Subject: [PATCH 006/136] Update for RevoBoot v1.5.10/v1.5.20 --- i386/MakePaths.dir | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/i386/MakePaths.dir b/i386/MakePaths.dir index 978ddf4..b4b04c5 100755 --- a/i386/MakePaths.dir +++ b/i386/MakePaths.dir @@ -1,9 +1,15 @@ +# +# File: RevoBoot/i386/MakePaths.dir +# +# Updates: +# +# - Major cleanup (PikerAlpha, October 2012). +# + + # # Default paths for subdirectories. # OBJROOT=../../obj/i386/$(DIR) SYMROOT=../../sym/i386 -DSTROOT=../../dst/i386 -SRCROOT=/tmp - From 28be76c2098a74c8b21f90f7065a14b8a6a9f93b Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 11:09:46 +0300 Subject: [PATCH 007/136] Update for RevoBoot v1.5.10/v1.5.20 --- i386/Makefile | 49 ++++++++++++++++++------------------------------- 1 file changed, 18 insertions(+), 31 deletions(-) diff --git a/i386/Makefile b/i386/Makefile index 7d96cf6..a7ee5b7 100644 --- a/i386/Makefile +++ b/i386/Makefile @@ -1,49 +1,36 @@ # -# Makefile for RevoBoot +# File: RevoBoot/i386/Makefile +# +# Updates: +# +# - Major cleanup (PikerAlpha, October 2012). +# - Output improvements (PikerAlpha, October 2012). # - -CFLAGS = -O $(MORECPP) -arch i386 -g -static -CONFIG = hd -LIBDIR = libsa -INC = -I. -I$(LIBDIR) -ifneq "" "$(wildcard /bin/mkdirs)" - MKDIRS = /bin/mkdirs -else - MKDIRS = /bin/mkdir -p -endif -AS = as -LD = ld # # These paths are only valid in subdirectories of this directory. # -OBJROOT=`pwd`/../../obj/i386 -SYMROOT=`pwd`/../../sym/i386 -DSTROOT=`pwd`/../../dst/i386 -SRCROOT=/tmp +OBJROOT=../i386/obj/i386 +SYMROOT=../i386/sym/i386 -VPATH = $(OBJROOT):$(SYMROOT) +# VPATH = $(OBJROOT):$(SYMROOT) # -# The build over here is important. +# The build order here is important. # SUBDIRS = util libsa libsaio boot2 -lion: all -mountain-lion: all -all: +$(MAKEGOAL): @for i in ${SUBDIRS}; \ do \ - echo ================= make $@ for $$i =================; \ - ( cd $$i; ${MAKE} \ - "OBJROOT=$(OBJROOT)/$$i" \ - "SYMROOT=$(SYMROOT)" \ - "DSTROOT=$(DSTROOT)" \ - "SRCROOT=$(SRCROOT)" \ - "RC_ARCHS=$(RC_ARCHS)" \ - "RC_CFLAGS=$(RC_CFLAGS)" $@ \ - ) || exit $$?; \ + echo ================= make MODEL=$(PRODUCT_MODEL_TARGET) $@ for: RevoBoot/i386/$$i =================; \ + ( cd $$i; ${MAKE} \ + "OBJROOT=$(OBJROOT)/$$i" \ + "SYMROOT=$(SYMROOT)" \ + "RC_ARCHS=$(RC_ARCHS)" \ + "RC_CFLAGS=$(RC_CFLAGS)" $@ \ + ) || exit $$?; \ done From 4530f8ff11223e5aacfdfb50f24defb70daef659 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 11:10:47 +0300 Subject: [PATCH 008/136] Update for RevoBoot v1.5.10/v1.5.20 --- i386/libsaio/Makefile | 46 +++++++++++++++---------------------------- 1 file changed, 16 insertions(+), 30 deletions(-) diff --git a/i386/libsaio/Makefile b/i386/libsaio/Makefile index 12e36a9..0bff17d 100644 --- a/i386/libsaio/Makefile +++ b/i386/libsaio/Makefile @@ -1,10 +1,18 @@ -DIR = libsaio +# +# File: RevoBoot/i386/libsaio/Makefile +# +# Updates: +# +# - Major cleanup (PikerAlpha, October 2012). +# - DMAKE_TARGET_MODEL added (PikerAlpha, October 2012). +# - Static data selectors added (PikerAlpha, October 2012). +# + + include ../MakePaths.dir UTILDIR = ../util LIBSADIR = ../libsa -INSTALLDIR = $(DSTROOT)/System/Library/Frameworks/System.framework/Versions/B/PrivateHeaders/standalone -#SYMROOT= OPTIM = -Os -Oz DEBUG = -DNOTHING @@ -14,23 +22,15 @@ CFLAGS = $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost \ -DRCZ_COMPRESSED_FILE_SUPPORT $(DEBUG) \ -DREVOBOOT_VERSION_INFO=\"RevoBoot\ v$(PRODUCT_VERSION_NUMBER)\" \ -DMAKE_TARGET_OS=$(PRODUCT_OS_TARGET) \ + -DSETTINGS_FILE=SETTINGS/$(MAKE_TARGET_MODEL).h \ + -DACPI_DATA_FILE=$(MAKE_ACPI_DATA_FILE) \ + -DEFI_DATA_FILE=$(MAKE_EFI_DATA_FILE) \ + -DSMBIOS_DATA_FILE=$(MAKE_SMBIOS_DATA_FILE) \ -fno-builtin -static $(OMIT_FRAME_POINTER_CFLAG) \ -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ -march=pentium4 -msse2 -mfpmath=sse -msoft-float - -DEFINES= -CONFIG = hd INC = -I. -I$(SYMROOT) -I$(UTILDIR) -I$(LIBSADIR) -ifneq "" "$(wildcard /bin/mkdirs)" - MKDIRS = /bin/mkdirs -else - MKDIRS = /bin/mkdir -p -endif -AS = as -LD = ld -# LIBS= -lc_static -LIBS= VPATH = $(OBJROOT):$(SYMROOT) @@ -44,21 +44,10 @@ SAIO_OBJS = table.o asm.o bios.o biosfn.o \ SAIO_EXTERN_OBJS = console.o -SFILES = -CFILES = -HFILES = -EXPORTED_HFILES = -INSTALLED_HFILES = -OTHERFILES = Makefile -ALLSRC = $(SFILES) $(CFILES) \ - $(HFILES) $(OTHERFILES) LIBS = libsaio.a DIRS_NEEDED = $(OBJROOT) $(SYMROOT) -lion: all -mountain-lion: all - -all: $(DIRS_NEEDED) libsaio.h $(LIBS) +$(MAKEGOAL): $(DIRS_NEEDED) libsaio.h $(LIBS) libsaio.a: $(SAIO_EXTERN_OBJS) $(SAIO_OBJS) rm -f $(SYMROOT)/$(@F) @@ -66,6 +55,3 @@ libsaio.a: $(SAIO_EXTERN_OBJS) $(SAIO_OBJS) ranlib $(SYMROOT)/$(@F) include ../MakeInc.dir - -# dependencies --include $(OBJROOT)/Makedep From 5a382902e0908bc4ef422d6968d076878fe10181 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 11:12:15 +0300 Subject: [PATCH 009/136] Update for RevoBoot v1.5.10/v1.5.20 --- i386/libsa/Makefile | 62 +++++++++++---------------------------------- 1 file changed, 15 insertions(+), 47 deletions(-) diff --git a/i386/libsa/Makefile b/i386/libsa/Makefile index 633e3b3..773acac 100644 --- a/i386/libsa/Makefile +++ b/i386/libsa/Makefile @@ -1,70 +1,38 @@ -DIR = libsa +# +# File: RevoBoot/i386/libsa/Makefile +# +# Updates: +# +# - Major cleanup (PikerAlpha, October 2012). +# + + include ../MakePaths.dir UTILDIR = ../util LIBSAIODIR = ../libsaio -INSTALL_SA_DIR = $(DSTROOT)/System/Library/Frameworks/System.framework/Versions/B/PrivateHeaders/standalone -INSTALL_MD_DIR = $(DSTROOT)/System/Library/Frameworks/System.framework/Versions/B/PrivateHeaders/machdep/i386 OPTIM = -Os -Oz CFLAGS = $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost -Werror \ - -fno-builtin -static $(OMIT_FRAME_POINTER_CFLAG) \ - -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ - -march=pentium4 -msse2 -mfpmath=sse -msoft-float + -fno-builtin -static $(OMIT_FRAME_POINTER_CFLAG) \ + -DSETTINGS_FILE=SETTINGS/$(MAKE_TARGET_MODEL).h \ + -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ + -march=pentium4 -msse2 -mfpmath=sse -msoft-float INC = -I. -I$(SYMROOT) -I$(UTILDIR) -I$(LIBSAIODIR) -ifneq "" "$(wildcard /bin/mkdirs)" - MKDIRS = /bin/mkdirs -else - MKDIRS = /bin/mkdir -p -endif -AS = as -LD = ld -# LIBS= -lc_static -LIBS= VPATH = $(OBJROOT):$(SYMROOT) -#SA_OBJS = prf.o printf.o zalloc.o \ -# string.o strtol.o error.o \ -# setjmp.o qsort.o efi_tables.o -SA_OBJS = prf.o printf.o zalloc.o \ - string.o strtol.o \ - setjmp.o efi_tables.o +SA_OBJS = prf.o printf.o zalloc.o string.o strtol.o setjmp.o efi_tables.o -SFILES = setjmp.s -#CFILES = prf.c printf.c zalloc.c \ -# string.c strtol.c error.c \ -# qsort.c efi_tables.c -CFILES = prf.c printf.c zalloc.c \ - string.c strtol.c \ - efi_tables.c - -HFILES = allocate.h -EXPORTED_HFILES = libsa.h allocate.h -INSTALLED_SA_HFILES = libsa.h -OTHERFILES = Makefile -ALLSRC = $(SFILES) $(CFILES) $(HFILES) $(OTHERFILES) LIBS = libsa.a DIRS_NEEDED = $(OBJROOT) $(SYMROOT) -lion: all -mountain-lion: all - -all: $(DIRS_NEEDED) $(LIBS) +$(MAKEGOAL): $(DIRS_NEEDED) $(LIBS) libsa.a: $(SA_OBJS) rm -f $(SYMROOT)/$(@F) ar q $(SYMROOT)/$(@F) $^ ranlib $(SYMROOT)/$(@F) -$(INSTALL_SA_DIR) $(INSTALL_MD_DIR): - $(MKDIRS) $@ - -installhdrs:: $(INSTALL_SA_DIR) $(INSTALL_MD_DIR) - cp $(INSTALLED_SA_HFILES) $(INSTALL_SA_DIR) - include ../MakeInc.dir - -# dependencies --include $(OBJROOT)/Makedep From e6f1d0c38775b33ac74fe517a47693d4d7e8c615 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 11:13:03 +0300 Subject: [PATCH 010/136] Update for RevoBoot v1.5.10/v1.5.20 --- i386/boot2/Makefile | 63 +++++++++++++++++---------------------------- 1 file changed, 23 insertions(+), 40 deletions(-) diff --git a/i386/boot2/Makefile b/i386/boot2/Makefile index 0c368d7..7c0970d 100644 --- a/i386/boot2/Makefile +++ b/i386/boot2/Makefile @@ -1,37 +1,31 @@ -# Makefile for i386 boot program -# define FLOPPY and SMALL using DEFINES macro as necessary +# +# File: RevoBoot/i386/boot2/Makefile +# +# Updates: +# +# - Support for self compiled libcc_kext.a added (PikerAlpha, October 2012). +# - Major cleanup (PikerAlpha, October 2012). +# -DIR = boot2 include ../MakePaths.dir OPTIM = -Os -Oz CFLAGS = $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost -Werror \ -fno-builtin -DSAIO_INTERNAL_USER -static $(OMIT_FRAME_POINTER_CFLAG) \ -DMAKE_TARGET_OS=$(PRODUCT_OS_TARGET) \ + -DSETTINGS_FILE=SETTINGS/$(MAKE_TARGET_MODEL).h \ -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ -march=pentium4 -msse2 -mfpmath=sse -msoft-float -DEFINES= -CONFIG = hd -SYMDIR = $(SYMROOT) LIBSADIR = ../libsa LIBSAIODIR = ../libsaio UTILDIR = ../util -INC = -I. -I.. -I$(SYMDIR) -I$(LIBSADIR) -I$(LIBSAIODIR) -I$(UTILDIR) - -ifneq "" "$(wildcard /bin/mkdirs)" - MKDIRS = /bin/mkdirs -else - MKDIRS = /bin/mkdir -p -endif - -AS = as -LD = gcc +INC = -I. -I.. -I$(SYMROOT) -I$(LIBSADIR) -I$(LIBSAIODIR) -I$(UTILDIR) -LIBS= -L$(SYMDIR) -lsaio -lsa -LIBDEP= $(SYMDIR)/libsaio.a $(SYMDIR)/libsa.a +LIBS = -L$(SYMROOT) -lsaio -lsa +LIBDEP = $(SYMROOT)/libsaio.a $(SYMROOT)/libsa.a # # build_gcc no longer builds libgcc.a and libcc_kext.a with 'all' target @@ -51,48 +45,37 @@ ifeq ($(wildcard $(LIBCC)),) LIBCC= `find /usr/llvm-gcc-*/lib/gcc/*/*/ -name \libcc_kext.a` endif -OTHER_FILES = -INSTALLDIR = $(DSTROOT)/usr/standalone/i386 VPATH = $(OBJROOT):$(SYMROOT) # -# The ordering is important; +# The order of object filenames below is important; # OBJS = boot2.o boot.o bootlogo.o graphics.o drivers.o options.o lzss.o -UTILDIR = ../util -SFILES = boot2.s -CFILES = boot.c bootlogo.c graphics.c drivers.c options.c -HFILES = boot.h bootlogo.h - -OTHERFILES = Makefile -ALLSRC = $(FOREIGNSRC) $(FOREIGNBIN) $(SFILES) $(CFILES) $(HFILES) $(OTHERFILES) DIRS_NEEDED = $(OBJROOT) $(SYMROOT) BOOT2ADDR = 20200 -MAXBOOTSIZE = 392704 -lion: all -mountain-lion: all +# +# Set maximum size of the booter to 128KB (should be more than sufficient). +# +MAXBOOTSIZE = 131072 -all: $(DIRS_NEEDED) boot +$(MAKEGOAL): $(DIRS_NEEDED) boot boot: machOconv $(OBJS) $(LIBDEP) $(UTILDIR)/ld_classic -static -preload -segaddr __INIT $(BOOT2ADDR) \ - -arch i386 -segalign 20 \ + -arch i386 -segalign 20 \ -o $(SYMROOT)/boot.sys $(filter %.o,$^) $(LIBS) $(LIBCC) machOconv $(SYMROOT)/boot.sys $(SYMROOT)/boot size $(SYMROOT)/boot.sys ls -l $(SYMROOT)/boot @( size=`ls -l $(SYMROOT)/boot | awk '{ print $$5}'` ; \ - if expr "$$size" ">" "$(MAXBOOTSIZE)" > /dev/null ;\ + if expr "$$size" ">" "$(MAXBOOTSIZE)" > /dev/null ; \ then \ - echo "Booter executable larger than $(MAXBOOTSIZE) bytes" ;\ - rm $(SYMROOT)/boot ;\ - exit 1;\ + echo "Error: Booter executable larger than $(MAXBOOTSIZE) bytes" ; \ + rm $(SYMROOT)/boot ; \ + exit 1 ; \ fi) include ../MakeInc.dir - -#dependencies --include $(OBJROOT)/Makedep From 2aced469506a483bc6a392f6709bae655394a390 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 11:14:00 +0300 Subject: [PATCH 011/136] Update for RevoBoot v1.5.10/v1.5.20 --- i386/config/data.h | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/i386/config/data.h b/i386/config/data.h index c3a566c..bd56edc 100755 --- a/i386/config/data.h +++ b/i386/config/data.h @@ -1,19 +1,31 @@ /* * Copyright (c) 2009 Master Chief. - * Refactored by DHP in 2010-2011. + * + * This file, included by acpi.c, efi.c and smbios.c includes data files + * for the target build model (based on MODEL=MacModelNN) or default.h + * + * Updates: + * + * - Refactored by DHP in 2010-2011. + * - Automatic model data selection (PikerAlpha, October 2012). + * */ -#if PATCH_ACPI_TABLE_DATA && INCLUDE_ACPI_DATA +#if (PATCH_ACPI_TABLE_DATA && INCLUDE_ACPI_DATA) #undef INCLUDE_ACPI_DATA - #include "acpi/data.h" -#elif INJECT_EFI_DEVICE_PROPERTIES && INCLUDE_EFI_DATA + #include STRING(ACPI_DATA_FILE) +#endif + +#if (INJECT_EFI_DEVICE_PROPERTIES && INCLUDE_EFI_DATA) #undef INCLUDE_EFI_DATA - #include "efi/data.h" -#elif USE_STATIC_SMBIOS_DATA && INCLUDE_SMBIOS_DATA + #include STRING(EFI_DATA_FILE) +#endif + +#if (USE_STATIC_SMBIOS_DATA && INCLUDE_SMBIOS_DATA) #undef INCLUDE_SMBIOS_DATA - #include "smbios/data.h" + #include STRING(SMBIOS_DATA_FILE) #endif From fea70a66c944ce5f27854cb20d1e6bbed1108492 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 11:15:15 +0300 Subject: [PATCH 012/136] Update for RevoBoot v1.5.10/v1.5.20 --- i386/config/settings.h | 386 +---------------------------------------- 1 file changed, 6 insertions(+), 380 deletions(-) diff --git a/i386/config/settings.h b/i386/config/settings.h index 263eba5..ae4c0f9 100644 --- a/i386/config/settings.h +++ b/i386/config/settings.h @@ -1,387 +1,13 @@ /* - * Copyright (c) 2009 Master Chief. All rights reserved. - * - * Note: This is an essential part of the build process for RevoBoot v1.5.00 and greater. + * Copyright (c) 2009 Master Chief. * * Updates: * - * - Latest cleanups and additional directives added by DHP in 2011. - * - Static CPU data simplified by DHP in Juni 2011 (thanks to MC and flAked for the idea). - * - Automatic creation / injection of SSDT_PR.aml added by DHP in June 2011. - * - New compiler directive (BOOT_TURBO_BOOST_RATIO) added by Jeroen (June 2011). - * - SMBIOS data logic moved to preprocessor code (PikerAlpha, October 2012). - * - STATIC_MODEL_NAME moved to libsaio/i386/SMBIOS/model_data.h (PikerAlpha, October 2012). - * - STATIC_MAC_PRODUCT_NAME moved to libsaio/i386/SMBIOS/model_data.h (PikerAlpha, October 2012). - * - STATIC_SMBIOS_MODEL_ID rrenamed to TARGET_MODEL (PikerAlpha, October 2012). - * - OVERRIDE_DYNAMIC_PRODUCT_DETECTION removed/no longer supported (PikerAlpha, October 2012). - * - INTEL_CORE_TECHNOLOGY per default set to 1 (PikerAlpha, October 2012). - * + * - Read settings file based on given model identifier (PikerAlpha, October 2012). */ +#define TO_STRING_DO(a) #a +#define STRING(a) TO_STRING_DO(a) +#define INCLUDE_FILE STRING(SETTINGS_FILE) -//--------------------------------------------------------------- ACPI.C ------------------------------------------------------------------- - - -#define ACPI_10_SUPPORT 0 // Set to 0 by Default. Set to 1 for ACPI 1.0 compliant BIOS versions. - // - // Note: Must go first (before acpi/essentials) since it is used there, - // and requires you to set PATCH_ACPI_TABLE_DATA to 1. - - -#define PATCH_ACPI_TABLE_DATA 1 // Set to 1 by default (enabling patching). Use 0 to keep the original - // unmodified ACPI tables, but please note (very well) that this is - // only supported by very few motherboards / BIOS'es. You may also - // need a kext like OSXRestart.kext to be able to restart your system, - // this due to a possibly broken FACP table in your BIOS! - // - // Note: Requires one of the following STATIC_* and/or LOAD_* settings: - - -#define USE_STATIC_ACPI_BASE_ADDRESS 0 // Set to 0 by default. Use 1 only after gathering the base address! - // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1. - - -#if USE_STATIC_ACPI_BASE_ADDRESS - #define STATIC_ACPI_BASE_ADDRESS 0x000f0450 // Set DEBUG_ACPI to 1 to get this address. -#endif - - -#define STATIC_APIC_TABLE_INJECTION 0 // Set to 0 by default. Use 1 when you want to inject a modified copy - // with say stripped out unused CPU's or other required modifications. - // - // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1. - - -#define STATIC_APIC2_TABLE_INJECTION 0 // Set to 0 by default. Use 1 when you want to inject a second APIC - // (ACPI-1) table data for additional CPU core support. - // - // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1. - - -#define STATIC_DSDT_TABLE_INJECTION 0 // Set to 0 by default. Use 1 when you want to inject static DSDT data. - - -#define STATIC_ECDT_TABLE_INJECTION 0 // Set to 0 by default. Use 1 when want to inject a custom ECDT table. - // - // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1. - - -#define STATIC_FACS_TABLE_INJECTION 0 // Set to 0 by default. Use 1 when want to inject a custom FACS table. - // - // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1. - - -#define STATIC_HPET_TABLE_INJECTION 0 // Set to 0 by default. Use 1 when you want to inject a static copy - // of a custom HPET table. - // - // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1. - - -#define STATIC_SSDT_TABLE_INJECTION 0 // Set to 0 by default. Use 1 when you want to inject modifications - // that can / should be done from this ACPI table. - // - // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1. - - -#define STATIC_SSDT_GPU_TABLE_INJECTION 0 // Set to 0 by default. Use 1 when you want to inject modifications - // for your graphics card (like I do for my ATI PCI-E card). - // - // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1. - - -#define STATIC_SSDT_PR_TABLE_INJECTION 0 // Set to 0 by default. Use 1 when you want to inject your Intel - // SpeedStep related modifications (like I do). - // - // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1. - - -#define STATIC_SSDT_SATA_TABLE_INJECTION 0 // Set to 0 by default. Use 1 when want to inject SATA related modifications. - // - // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1. - - -#define STATIC_SSDT_USB_TABLE_INJECTION 0 // Set to 0 by default. Use 1 when want to inject USB related modifications. - // - // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1. - - -#define LOAD_DSDT_TABLE_FROM_EXTRA_ACPI 1 // Set to 0 by default. Use 1 when your setup requires a modified DSDT table - // and you want to load: /Extra/ACPI/dsdt.aml instead of injecting a static - // DSDT table from: RevoBoot/i386/config/ACPI/data.h - // - // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1. - - -#define LOAD_SSDT_TABLE_FROM_EXTRA_ACPI 0 // Set to 1 by default. Use 0 only after you've converted your SSDT into - // STATIC_SSDT_TABLE_INJECTION in: RevoBoot/i386/config/ACPI/data.h - // or when you don't want/need to load /Extra/ACPI/SSDT.aml - // - // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1. - - -#define LOAD_EXTRA_ACPI_TABLES (LOAD_DSDT_TABLE_FROM_EXTRA_ACPI || LOAD_SSDT_TABLE_FROM_EXTRA_ACPI) - - -#define AUTOMATIC_SSDT_PR_CREATION 1 // Set to 0 by default (support for Sandy Bridge only). - // - // This injects a custom SSDT (in configure mode) with: - // - // Use 1 to inject: P/C-State definition blocks. - // Use 2 to inject: Processor (CPUn, 0x0n, 0x00000410, 0x06) {...} declaration blocks. - // Use 3 to inject: Both of the above. - // Use 4 to inject: Device (SBUS) {...} which is required for Power Management. - // Use 5 to inject: P/C-State definition blocks plus the former (Device SBUS). - // Use 7 to inject: All of the above. - // - // Notes: Device SBUS can only be injected when it isn't part of other ACPI tables! - // This feature should only be used once, to extract the SSDT_PR from ioreg - // and use it as STATIC_SSDT_PR_TABLE_DATA in RevoBoot/i386/config/ACPI/data.h - - -#if AUTOMATIC_SSDT_PR_CREATION && STATIC_SSDT_PR_TABLE_INJECTION == 0 - #define MAX_NUMBER_OF_P_STATES 22 // The i5-2500K need 18 for the base-range (1600-3300) plus 4 for the Turbo modes. - // The i7-2600K need 19 for the base-range (1600-3400) plus 4 for the Turbo modes. - // The i7-2700K need 20 for the base-range (1600-3500) plus 4 for the Turbo modes. - // The i7-3770K need 20 for the base-range (1600-3500) plus 4 for the Turbo modes. - // Low power (mobility) processors might need an extended range! - // - // Note: AICPUPM wants a P-State for each 100 MHz bank or it will fail (see note below). - -#define DROP_FACTORY_SSDT_TABLES 1 // Set to 1 by default (this setting is required). - // - // Note: Do not change this setting (must drop SSDT tables). - -#define NUMBER_OF_TURBO_STATES 4 // Set to 4 by default. - // - // Note: Make sure to add a full range, one P-State for each 100 MHz when OC'ing - // or AICPIPM will fail with: "P-State Stepper Error 18 at step N on CPU N" - -#define OVERRIDE_ACPI_METHODS 0 // Set to 0 by default (do nothing). - // Use 1 to override Method _PTS in a static SSDT or Extra/ACPI/SSDT.aml - // Use 2 to override Method _WAK in a static SSDT or Extra/ACPI/SSDT.aml - // Use 3 to override both _PTS and _WAK. - // - // Note: This changes the underscore of _PTS and/or _WAK into a "Z" which - // allows you to inject a customized copy from /Extra/ACPI/SSDT.aml -#else - #define OVERRIDE_ACPI_METHODS 0 // Set to 0 by default (do nothing). - - #define DROP_FACTORY_SSDT_TABLES 0 // Set to 0 by default. Use 1 with caution (might disable SpeedStep). -#endif - -#define REPLACE_EXISTING_SSDT_TABLES 0 // Set to 0 by default. Use 1 with caution (might disable SpeedStep). - // - // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1. - -#define APPLE_STYLE_ACPI 0 // Set to 0 by default. Use 1 to change the OEMID's to Mac likes. - // - // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1 and keep in mind that this can - // only change the headers of injected/replaced tables. Not the factory tables. - - -#define DEBUG_ACPI 0 // Set to 0 by default. Use 1 when things don't seem to work for you. - - -//--------------------------------------------------------------- BOOT.C ------------------------------------------------------------------- - - -#define PRE_LINKED_KERNEL_SUPPORT 1 // Set to 1 by default. Change this to 0 to disable the use of pre-linked kernels. - -#define MUST_ENABLE_A20 0 // Set to 0 by default. Change this to 1 when your hardware requires it. - -#define SAFE_MALLOC 0 // Set to 0 by default. Change this to 1 when booting halts with a memory allocation error. - -#define DEBUG_BOOT 0 // Set to 0 by default. Change this to 1 when things don't seem to work for you. - - -//---------------------------------------------------------------- CPU.C ------------------------------------------------------------------- - - -#define USE_STATIC_CPU_DATA 1 // Set to 0 by default (dynamic data collection). Change this to 1 to use static data. - -#define CPU_VENDOR_ID CPU_VENDOR_INTEL // CPU_VENDOR_AMD is not supported. - -#define INTEL_CORE_TECHNOLOGY 1 // Set to 1 by default. Use 0 for older non Intel Core CPU's (removes unused code). - // - // Warning: Do not use 0 on Core Technology CPU's or sysctl's machdep.tsc.frequency will be - // initialized with the wrong value (various things, like the spinner will go mad). - -#define OC_BUSRATIO_CORRECTION 0 // Set to 0 by default. Change this to busratio-100 (OC'ed systems with a changed busratio). - -#define BOOT_TURBO_RATIO 0 // Set to 0 by default. Change this to the desired (and supported) max turbo multiplier. - // - // Example: 0x2800 for 4.0 GHz on a i7-2600. - -#define DEBUG_CPU 0 // Set to 0 by default. Change this to 1 when things don't seem to work for you. - // Note: CPU info data will not be displayed when USE_STATIC_CPU_DATA is set to 1 - -#if DEBUG_CPU -#define DEBUG_CPU_TURBO_RATIOS 0 // Set to 0 by default. Change this to 1 when you want to check the core ratio. - -#define DEBUG_CST_SUPPORT 0 // Set to 0 by default. Change this to 1 to check the in BIOS enabled C-States. - -#define DEBUG_TSS_SUPPORT 0 // Set to 0 by default. Change this to 1 to check the T-State Clock Modulation. - -#define DEBUG_CPU_TDP 0 // Set to 0 by default. Change this to 1 when you want to check the TDP. -#endif - -//---------------------------------------------------------- CPU/STATIC_DATA.C ------------------------------------------------------------- - - -#if USE_STATIC_CPU_DATA - #define STATIC_CPU_Type 0x602 // kSMBTypeOemProcessorType - used in: libsaio/SMBIOS/dynamic_data.h - - #define STATIC_CPU_NumThreads 4 // Used in: i386/libsaio/ACPI/ssdt_pr_generator.h - - #define STATIC_CPU_FSBFrequency 100000000ULL // 9 digits + ULL - used in: i386/libsaio/efi.c - - #define STATIC_CPU_QPISpeed 0 // kSMBTypeOemProcessorBusSpeed (0 for Sandy Bridge / Jaketown). -#endif - -#define STATIC_CPU_NumCores 4 // Set to 4 by default. Must be set to the number of cores for your processor! - // - // Note: Used in i386/libsaio/ACPI/ssdt_pr_generator.h, cpu.c and platform.c - // for both static and dynamic CPU data. - -//--------------------------------------------------------------- DISK.C ------------------------------------------------------------------- - - -#define EFI_SYSTEM_PARTITION_SUPPORT 0 // Set to 0 by default. Set this to 1 when your system boots from the hidden EFI partition. - -#define LEGACY_BIOS_READ_SUPPORT 0 // Set to 0 by default. Change this to 1 for crappy old BIOSes. - -#define LION_FILEVAULT_SUPPORT 0 // Set to 0 by default. Setting this to 1 will make RevoBoot skip encrypted boot partitions - // and boot from the Recovery HD partition instead (when available). - -#define APPLE_RAID_SUPPORT 0 // Set to 0 by default. Change this to 1 for Apple Software RAID support. - -#define DEBUG_DISK 0 // Set to 0 by default. Change it to 1 when things don't seem to work for you. - - -//------------------------------------------------------------- DRIVERS.C ------------------------------------------------------------------- - - -#define DEBUG_DRIVERS 0 // Set to 0 by default. Change it to 1 when things don't seem to work for you. - - -//---------------------------------------------------------------- EFI.C ------------------------------------------------------------------- - - -#define APPLE_STYLE_EFI 1 // Set to 1 by default. Change this to 1 to add additional 'Mac-like' properties. - -#define INJECT_EFI_DEVICE_PROPERTIES 0 // Set to 0 by default. Change this to 1 when you need to inject 'device-properties'. - // - // Note: Required when not setting device-properties from your DSDT/SSDT. - -#define EFI_64_BIT 1 // Set to 1 by default for EFI64 on 64-bit platforms. Supporting both - // 32 and 64-bit boot modes (using arch=i386/x86_64 under Kernel Flags). - // - // Change this to 0 for 32-bit only platforms (think Intel Atom CPU) - // or when you want to boot with EFI32 (for testing) on a 64-bit - // platform, but then you must make a small change in platform.c (see comment in file). - // - // Note: Do not change this setting, unless you know what you are doing. - -#define STATIC_SMSERIALNUMBER "SOMESRLNUMBR" // Example only! - -#define STATIC_SYSTEM_SERIAL_NUMBER { 'S', 'O', 'M', 'E', 'S', 'R', 'L', 'N', 'U', 'M', 'B', 'R' } // Example only! - -#define STATIC_SYSTEM_ID { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F } // Example only! - -#define DEBUG_EFI 0 // Set to 0 by default. Change this to 1 when things don't seem to work for you. - -#define EFI_DEBUG_MODE 0 // Set to 0 by default (for OS X 10.7 LION only). - - -//------------------------------------------------------------- GRAPHICS.C ----------------------------------------------------------------- - -#define USE_STATIC_DISPLAY_RESOLUTION 1 // Set to 0 by default. Use 1 when you need to override the resolution detection features - // in RevoBoot, which may not be supported by your BIOS and/or display (monitor). - -#define STATIC_SCREEN_WIDTH 1900 // Used (in RevoBoot v1.0.35 and greater) when USE_STATIC_DISPLAY_RESOLUTION is 1 and when - // USE_STATIC_DISPLAY_RESOLUTION is 0 but getResolutionFromEDID() isn't supported (failed). - -#define STATIC_SCREEN_HEIGHT 1200 // Used (in RevoBoot v1.0.35 and greater) when USE_STATIC_DISPLAY_RESOLUTION is 1 and when - // USE_STATIC_DISPLAY_RESOLUTION is 0 but getResolutionFromEDID() isn't supported (failed). - -#define DEBUG_BOOT_GRAPHICS 0 // Set to 0 by default. Use 1 when to see debug info. - - -//------------------------------------------------------------ STRINGDATA.H ---------------------------------------------------------------- - -#define LION_FILEVAULT_SUPPORT 0 // Set to 0 by default. Setting this to 1 will make RevoBoot skip encrypted boot partitions - // and boot from the Recovery HD partition instead (when available). - -#if LION_FILEVAULT_SUPPORT - #define LION_RECOVERY_SUPPORT 1 // Make RevoBoot search for the Recovery HD partition and boot from it (when available). -#else - #define LION_RECOVERY_SUPPORT 0 // Set to 0 by default. Setting this to 1 will make RevoBoot search for the Recovery HD and - // try to boot from it, when it is properly setup and modified for RevoBoot. -#endif - -#define LION_INSTALL_SUPPORT 0 // Set to 0 by default. Setting this to 1 will make RevoBoot search in specific directories - // for com.apple.Boot.plist – required for Mac like Lion OS X installations. - -//-------------------------------------------------------------- SMBIOS.C ------------------------------------------------------------------ - - -#define USE_STATIC_SMBIOS_DATA 0 // Set to 0 by default (dynamic data collection). Change this to 1 to use static data. - -#if (USE_STATIC_SMBIOS_DATA == 0 && USE_STATIC_CPU_DATA == 1) - #undef USE_STATIC_CPU_DATA // Prevent boot failures due to wrong settings (until I figured out what we are missing). -#endif - -#define OVERRIDE_DYNAMIC_MEMORY_DETECTION 0 // Set to 0 by default. Change this to 0 only when your SMBIOS data (type 17) is correct, or when - // you want/need to override some/all of the SMBIOS data. - // - // Note: Defaults to n MB 1066 DDR3 when set to 0 (to prevent errors in Profile Manager). - - -#define TARGET_MODEL MACMINI // Set to MACMINI by default. Supported models are: - // - // IMAC and IMAC_131, IMAC_122, IMAC_111, IMAC_121 - // MACBOOK and MACBOOK_41 - // MACBOOKAIR and MACBOOKAIR_42, MACBOOKAIR_41 - // MACBOOKPRO and MACBOOKPRO_101, MACBOOKPRO_91, MACBOOKPRO_83, MACBOOKPRO_82, - // MACBOOKPRO_81, MACBOOKPRO_61 - // MACMINI and MACMINI_53, MACMINI_52, MACMINI_51 - // MACPRO and MACPRO_51, MACPRO_41, MACPRO_31 - // - // Note: MACMINI (without _NNN) selects the default model (last one i.e. MACMINI_51). - -#define DEBUG_SMBIOS 0 // Set to 0 by default. Change this to 1 when things don't seem to work for you. - - -//-------------------------------------------------------------- PLATFORM.C ---------------------------------------------------------------- - - -#if USE_STATIC_SMBIOS_DATA - // Do nothing. -#elif OVERRIDE_DYNAMIC_MEMORY_DETECTION - // Setup RAM module info. Please note that you may have to expand this when you have more RAM modules. - #define STATIC_RAM_SLOTS 4 // Number of RAM slots on mainboard. - - #define STATIC_RAM_VENDORS { "Corsair", "N/A", "Corsair", "N/A", 0 } // Use "N/A" for empty RAM banks. - - #define DYNAMIC_RAM_OVERRIDE_TYPE 0 // Set to 0 by default. See libsaio/platform.h for supported values. - - #define DYNAMIC_RAM_OVERRIDE_SIZE 0 // Set to 0 by default. Change this to 1 when you want to use override values (see below). - -#if DYNAMIC_RAM_OVERRIDE_SIZE - #define DYNAMIC_RAM_OVERRIDE_SIZES { SMB_MEM_SIZE_2GB, SMB_MEM_BANK_EMPTY, SMB_MEM_SIZE_2GB, SMB_MEM_BANK_EMPTY, 0 } // See libsaio/platform.h for other values. -#endif - - #define DYNAMIC_RAM_OVERRIDE_FREQUENCY 0 // Set to 0 by default. Change this to the frequency that you want to use as override value. - - #define STATIC_RAM_PART_NUMBERS { "PartNum#0", "N/A", "PartNum#2", "N/A", 0 } // Use "N/A" for empty RAM banks. - - #define STATIC_RAM_SERIAL_NUMBERS { "Serial#0", "N/A", "Serial#2", "N/A", 0 } // Use "N/A" for empty RAM banks. -#endif - -#define INCLUDE_MPS_TABLE 0 // Set to 0 by default. Change this to 1 when you want to include the MP table. - -#define DEBUG_PLATFORM 0 // Set to 0 by default. Change this to 1 when things don't seem to work for you. - - -//================================================================= END ==================================================================== - +#include INCLUDE_FILE From d52f639f9681422e4243aae245c80f9fd68d3d78 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 11:29:46 +0300 Subject: [PATCH 013/136] Build support for optional model identifier (example: Macmini51) --- r | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r b/r index 74d7e5c..d75375a 100755 --- a/r +++ b/r @@ -1,4 +1,4 @@ make clean clear -make > out.log +make MODEL=%1 > out.log From 412daa8e5da88ccad8d50d018f140249db08b516 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 11:31:16 +0300 Subject: [PATCH 014/136] Moving file extensions --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 40a2c4c..76d6f57 100644 --- a/Makefile +++ b/Makefile @@ -99,7 +99,7 @@ ifdef MODEL # # Include default/empty static data file (no model identifier specified). # - DATA_FILE = data.h + DATA_FILE = data endif else # @@ -109,16 +109,16 @@ else # # Include default/empty static data file (no model identifier specified). # - DATA_FILE = data.h + DATA_FILE = data endif # # Export target filenames for static ACPI, EFI and SMBIOS data. # -export MAKE_ACPI_DATA_FILE = ACPI/$(DATA_FILE) -export MAKE_EFI_DATA_FILE = EFI/$(DATA_FILE) -export MAKE_SMBIOS_DATA_FILE = SMBIOS/$(DATA_FILE) +export MAKE_ACPI_DATA_FILE = ACPI/$(DATA_FILE).h +export MAKE_EFI_DATA_FILE = EFI/$(DATA_FILE).h +export MAKE_SMBIOS_DATA_FILE = SMBIOS/$(DATA_FILE).h # # Our one and only build target directory. From 0cd25765d471da68b363a2a781dfb33c786646a6 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 11:33:48 +0300 Subject: [PATCH 015/136] Fix typo --- r | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r b/r index d75375a..1d06cf0 100755 --- a/r +++ b/r @@ -1,4 +1,4 @@ make clean clear -make MODEL=%1 > out.log +make MODEL=$1 > out.log From ef159e73d99d11398fa6be186d83eee1f7da91a6 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 11:48:31 +0300 Subject: [PATCH 016/136] Copy data-template.h for new configurations --- Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Makefile b/Makefile index 76d6f57..bbe91ec 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ # - Creates RevoBoot/config/SETTINGS when missing (PikerAlpha, October 2012). # - Copies settings-template.h to SETTINGS/ModelnameNN.h when missing (PikerAlpha, October 2012). # - Automatic ACPI/EFI/SMBIOS data selection (PikerAlpha, October 2012). +# - Copies ACPI/EFI/SMBIOS/data-template.h for new conigurations (PikerAlpha, October 2012). # # @@ -132,6 +133,18 @@ SETTINGS_DIR=$(CONFIG_DIR)/SETTINGS SETTINGS_FILE=$(SETTINGS_DIR)/$(MAKE_TARGET_MODEL).h $(MAKEGOAL): $(SYMROOT) $(OBJROOT) + @if [ ! -f $(ARCH_DIR)/config/$(MAKE_ACPI_DATA_FILE) ]; then \ + cp -n $(ARCH_DIR)/config/ACPI/data-template.h $(ARCH_DIR)/config/$(MAKE_ACPI_DATA_FILE); \ + fi; + + @if [ ! -f $(ARCH_DIR)/config/$(MAKE_EFI_DATA_FILE) ]; then \ + cp -n $(ARCH_DIR)/config/EFI/data-template.h $(ARCH_DIR)/config/$(MAKE_EFI_DATA_FILE); \ + fi; + + @if [ ! -f $(ARCH_DIR)/config/$(MAKE_SMBIOS_DATA_FILE) ]; then \ + cp -n $(ARCH_DIR)/config/SMBIOS/data-template.h $(ARCH_DIR)/config/$(MAKE_SMBIOS_DATA_FILE); \ + fi; + @if [ ! -d $(SETTINGS_DIR) ]; then \ /bin/mkdir -p $(SETTINGS_DIR); \ fi; From 1826d9262d2060cb5370809d8652ee6f8e4b7730 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 12:00:44 +0300 Subject: [PATCH 017/136] Update for RevoBoot v1.5.10/v1.5.20 --- i386/util/Makefile | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/i386/util/Makefile b/i386/util/Makefile index 87e8d42..8a4883c 100644 --- a/i386/util/Makefile +++ b/i386/util/Makefile @@ -1,34 +1,27 @@ # -# Until I can remove the dependency on the appkit, -# we'll just keep the generated files in this directory -# and install them directly, rather than generating them again. +#File: RevoBoot/i386/util/Makefile # +# Updates: +# +# - Major cleanup (PikerAlpha, October 2012). +# + -DIR = util include ../MakePaths.dir VPATH = $(OBJROOT):$(SYMROOT) -INSTALLDIR = $(DSTROOT)/usr/standalone/i386 -LOCALBIN = $(DSTROOT)/usr/local/bin - OPTIM = -Os -Oz CFLAGS = $(RC_CFLAGS) $(OPTIM) -Wmost -Werror -g + LDFLAGS = -CFILES = md.c machOconv.c -ALLSRC = $(CFILES) $(MFILES) $(HFILES) $(EXPORT_HFILES) +DEFINES= PROGRAMS = md machOconv -OUTFILES = $(PROGRAMS) - DIRS_NEEDED = $(OBJROOT) $(SYMROOT) $(LANGDIR) -lion: all - -mountain-lion: all - -all: $(DIRS_NEEDED) $(PROGRAMS) +$(MAKEGOAL): $(DIRS_NEEDED) $(PROGRAMS) machOconv: machOconv.o $(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $(SYMROOT)/$(@F) machOconv.o @@ -36,7 +29,3 @@ md: $(CC) -mdynamic-no-pic -Wall -dead_strip -arch i386 -mmacosx-version-min=10.5 md.c -o $(SYMROOT)/md include ../MakeInc.dir - -#dependencies --include $(OBJROOT)/Makedep - From a7b40d41e074fdb8633e3a57872394c5c4391247 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 12:09:30 +0300 Subject: [PATCH 018/136] Bug fix, typo and cleanups for RevoBoot v1.5.20 --- i386/config/settings-template.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/i386/config/settings-template.h b/i386/config/settings-template.h index 0732192..82fa634 100644 --- a/i386/config/settings-template.h +++ b/i386/config/settings-template.h @@ -12,9 +12,10 @@ * - SMBIOS data logic moved to preprocessor code (PikerAlpha, October 2012). * - STATIC_MODEL_NAME moved to libsaio/i386/SMBIOS/model_data.h (PikerAlpha, October 2012). * - STATIC_MAC_PRODUCT_NAME moved to libsaio/i386/SMBIOS/model_data.h (PikerAlpha, October 2012). - * - STATIC_SMBIOS_MODEL_ID rrenamed to TARGET_MODEL (PikerAlpha, October 2012). + * - STATIC_SMBIOS_MODEL_ID renamed to TARGET_MODEL (PikerAlpha, October 2012). * - OVERRIDE_DYNAMIC_PRODUCT_DETECTION removed/no longer supported (PikerAlpha, October 2012). * - INTEL_CORE_TECHNOLOGY per default set to 1 (PikerAlpha, October 2012). + * - INJECT_EFI_DEVICE_PROPERTIES per default set to 1 (PikerAlpha, October 2012). * */ @@ -216,13 +217,13 @@ // Note: CPU info data will not be displayed when USE_STATIC_CPU_DATA is set to 1 #if DEBUG_CPU -#define DEBUG_CPU_TURBO_RATIOS 0 // Set to 0 by default. Change this to 1 when you want to check the core ratio. + #define DEBUG_CPU_TURBO_RATIOS 0 // Set to 0 by default. Change this to 1 when you want to check the core ratio. -#define DEBUG_CST_SUPPORT 0 // Set to 0 by default. Change this to 1 to check the in BIOS enabled C-States. + #define DEBUG_CST_SUPPORT 0 // Set to 0 by default. Change this to 1 to check the in BIOS enabled C-States. -#define DEBUG_TSS_SUPPORT 0 // Set to 0 by default. Change this to 1 to check the T-State Clock Modulation. + #define DEBUG_TSS_SUPPORT 0 // Set to 0 by default. Change this to 1 to check the T-State Clock Modulation. -#define DEBUG_CPU_TDP 0 // Set to 0 by default. Change this to 1 when you want to check the TDP. + #define DEBUG_CPU_TDP 0 // Set to 0 by default. Change this to 1 when you want to check the TDP. #endif //---------------------------------------------------------- CPU/STATIC_DATA.C ------------------------------------------------------------- @@ -233,7 +234,7 @@ #define STATIC_CPU_NumThreads 4 // Used in: i386/libsaio/ACPI/ssdt_pr_generator.h - #define STATIC_CPU_FSBFrequency 100000000ULL // 9 digits + ULL - used in: i386/libsaio/efi.c + #define STATIC_CPU_FSBFrequency 100000000ULL // 9 digits + ULL - used in: RevoBoot/i386/libsaio/efi.c #define STATIC_CPU_QPISpeed 0 // kSMBTypeOemProcessorBusSpeed (0 for Sandy Bridge / Jaketown). #endif @@ -331,10 +332,6 @@ #undef USE_STATIC_CPU_DATA // Prevent boot failures due to wrong settings (until I figured out what we are missing). #endif -#if TARGET_MODEL & MACPRO - #define STATIC_SMBOARDSERIAL "SOMEBOARDNMBR" // Example only! -#endif - #define OVERRIDE_DYNAMIC_MEMORY_DETECTION 0 // Set to 0 by default. Change this to 0 only when your SMBIOS data (type 17) is correct, or when // you want/need to override some/all of the SMBIOS data. // @@ -353,6 +350,10 @@ // // Note: MACMINI (without _NNN) selects the default model (last one i.e. MACMINI_51). +#if TARGET_MODEL & MACPRO + #define STATIC_SMBOARDSERIAL "SOMEBOARDNMBR" // Example only! +#endif + #define DEBUG_SMBIOS 0 // Set to 0 by default. Change this to 1 when things don't seem to work for you. From b923535229bebe6ebd290b971ae48dbb6b4b1475 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 12:11:46 +0300 Subject: [PATCH 019/136] New Macmini6 data added for RevoBoot v1.5.21 --- i386/libsaio/smbios/model_data.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/i386/libsaio/smbios/model_data.h b/i386/libsaio/smbios/model_data.h index bf1ce85..92a435c 100644 --- a/i386/libsaio/smbios/model_data.h +++ b/i386/libsaio/smbios/model_data.h @@ -136,7 +136,19 @@ // ------------------------------------------------------------------------------------- #define SMB_FAMILY "Macmini" - #if (TARGET_MODEL == MACMINI_53) + #if (TARGET_MODEL == MACMINI_62) + // Intel Core i7-3615QM @ 2.30 GHz (4 cores - 8 threads) + #define SMB_BIOS_VERSION "MM61.88Z.0106.B00.1208091121" + #define SMB_PRODUCT_NAME "Macmini6,2" + #define SMB_BOARD_PRODUCT "Mac-F65AE981FFA204ED" + #define EFI_MODEL_NAME { 'M', 'a', 'c', 'm', 'i', 'n', 'i', '6', ',', '2' } + #elif (TARGET_MODEL == MACMINI_61) + // Intel Core i5-3210M @ 2.50 GH (2 cores - 4 theeads) + #define SMB_BIOS_VERSION "MM61.88Z.0106.B00.1208091121" + #define SMB_PRODUCT_NAME "Macmini6,1" + #define SMB_BOARD_PRODUCT "Mac-031AEE4D24BFF0B1" + #define EFI_MODEL_NAME { 'M', 'a', 'c', 'm', 'i', 'n', 'i', '6', ',', '1' } + #elif (TARGET_MODEL == MACMINI_53) // Intel Core i7-2635QM @ 2.0GHz (4 cores - 8 threads) #define SMB_BIOS_VERSION "MM51.88Z.0077.B10.1201241549" #define SMB_PRODUCT_NAME "Macmini5,3" From b75feb8d161f5332716f92fa4bc79af287d334c0 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 12:25:20 +0300 Subject: [PATCH 020/136] Update for RevoBoot v.1.5.21 --- CHANGES | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/CHANGES b/CHANGES index e8624a6..39637a7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,30 @@ +RevoBoot v1.5.21 +================ +- Model data for new Macmini6,N added (PikerAlpha, October 2012). +- VERSION updated to v1.5.21 + + +RevoBoot v1.5.20 +================ +- Automatic data selection for ACPI/EFI and SMBIOS data (PikerAlpha, October 2012) +- Copies ACPI/EFI/SMBIOS/data-template.h to [your model.h] for new configurations (PikerAlpha, October 2012) + + +RevoBoot v1.5.10 +================ +- Makefiles cleaned up/optimized (PikerAlpha, October 2012). +- make now defaults to Mountain Lion (PikerAlpha, October 2012). +- MODEL=[your model] argument added to makefiles (PikerAlpha, October 2012). +- MODEL=$1 added to RevoBoot/r for optional model identifier (PikerAlpha, October 2012). +- make now creates RevoBoot/i386/config/SETTINGS when missing (PikerAlpha, October 2012). +- Makefile now copies settings-template.h to SETTINGS/[your model.h] when missing (PikerAlpha, October 2012). + + +RevoBoot v1.5.01 +================ +- MacPro SMBIOS board serial/type added (dgsga, October 2012). + + RevoBoot v1.5.00 ================ - RevoBoot project forked (PikerAlpha, October 2012). From 267063d55f36649f3532c6ea84abc17968703995 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 12:25:46 +0300 Subject: [PATCH 021/136] Updating version info for RevoBoot v1.5.21 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index a7ccabd..07a45d7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.20 +1.5.21 From 989102f4b831fc5d2ff899f560a313103c70410d Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 12:31:16 +0300 Subject: [PATCH 022/136] Typo --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 00f967b..579854f 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -RevoBoot can now be build with Xcode 4.5.1 on Mountain Lion. See change log for instructions. +RevoBoot can now be built with Xcode 4.5.1 on Mountain Lion. See change log for instructions. Please note that RevoBoot must be configured for your hardware so start reading our WiKi. See also: From 9d7ffbd79e6b5c35a656bfde043a5c78ff82c3a7 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 12:41:02 +0300 Subject: [PATCH 023/136] Cleanup/update for RevoBoot v.1.5.20 --- .gitignore | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index f491c27..85c4e54 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,14 @@ .DS_Store -data-hp.h -data-asus.h -settings-hp.h -setting-asus.h + +i386/config/SETTINGS/*.h + +i386/config/ACPI/default.h +i386/config/ACPI/*Mac*.h + +i386/config/EFI/default.h +i386/config/EFI/*Mac*.h + +i386/config/SMBIOS/default.h +i386/config/SMBIOS/*Mac*.h + +i386/util/libcc_kext.a \ No newline at end of file From adbeeb748cb0025b20fed44d413e6993af7567d0 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 12:43:58 +0300 Subject: [PATCH 024/136] No longer used in RevoBoot v1.5.20 --- i386/config/ACPI/data.h | 97 ----------------------------------------- 1 file changed, 97 deletions(-) diff --git a/i386/config/ACPI/data.h b/i386/config/ACPI/data.h index 6a80eac..e69de29 100755 --- a/i386/config/ACPI/data.h +++ b/i386/config/ACPI/data.h @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2009 Master Chief. All rights reserved. - * - * Note: This is an essential part of the build process for Revolution v0.6.43 and greater. - * - * - * Latest cleanups and additional directives added by DHP in 2011 - */ - - -//--------------------------------------------------------- ESSENTIAL ACPI TABLES ------------------------------------------------------------- - - -#if STATIC_APIC_TABLE_INJECTION - #define STATIC_APIC_TABLE_DATA \ - /* 0x0000 */ // Insert your APIC table replacement here (optional). -#endif - - -#if STATIC_ECDT_TABLE_INJECTION - #define STATIC_ECDT_TABLE_DATA \ - /* 0x0000 */ // Insert your ECDT table replacement here (optional). -#endif - - -#if STATIC_HPET_TABLE_INJECTION - #define STATIC_HPET_TABLE_DATA \ - /* 0x0000 */ // Insert your HPET table replacement here (optional). -#endif - - -#if STATIC_MCFG_TABLE_INJECTION - #define STATIC_MCFG_TABLE_DATA \ - /* 0x0000 */ // Insert your MCFG table replacement here (optional). -#endif - - -#if STATIC_SBST_TABLE_INJECTION - #define STATIC_SBST_TABLE_DATA \ - /* 0x0000 */ // Insert your SBST table replacement here (optional). -#endif - - -#if STATIC_SSDT_TABLE_INJECTION - #define STATIC_SSDT_TABLE_DATA \ - /* 0x0000 */ // Insert your SSDT table replacement here (optional). -#endif - - -//--------------------------------------------------------- SECONDARY ACPI TABLES ------------------------------------------------------------- - - -#if STATIC_DSDT_TABLE_INJECTION - #define STATIC_DSDT_TABLE_DATA \ - /* 0x0000 */ // Insert your DSDT table replacement here (optional). -#endif - - -#if STATIC_FACS_TABLE_INJECTION - #define STATIC_FACS_TABLE_DATA \ - /* 0x0000 */ // Insert your FACS table replacement here (optional). -#endif - - -//---------------------------------------------------------- OPTIONAL ACPI TABLES ------------------------------------------------------------- - - -#if STATIC_APIC2_TABLE_INJECTION - #define STATIC_APIC2_TABLE_DATA \ - /* 0x0000 */ // Insert a second APIC table (replacement) here (optional). -#endif - - -#if STATIC_SSDT_GPU_TABLE_INJECTION - #define STATIC_SSDT_GPU_TABLE_DATA \ - /* 0x0000 */ // Insert your SSDT_GPU table replacement here (optional). -#endif - - -#if STATIC_SSDT_PR_TABLE_INJECTION - #define STATIC_SSDT_PR_TABLE_DATA \ - /* 0x0000 */ // Insert your SSDT_PR table replacement here (optional). -#endif - - -#if STATIC_SSDT_SATA_TABLE_INJECTION - #define STATIC_SSDT_SATA_TABLE_DATA \ - /* 0x0000 */ // Insert your SSDT_SATA table replacement here (optional). -#endif - - -#if STATIC_SSDT_USB_TABLE_INJECTION - #define STATIC_SSDT_USB_TABLE_DATA \ - /* 0x0000 */ // Insert your SSDT_USB table replacement here (optional). -#endif - -//================================================================= END ==================================================================== From f3874b7a2803da7581b6957213601bc3c56312f9 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 12:47:09 +0300 Subject: [PATCH 025/136] File no longer used in RevoBoot v1.5.10 (can be removed) --- i386/config/data-template.h | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/i386/config/data-template.h b/i386/config/data-template.h index c3a566c..e69de29 100755 --- a/i386/config/data-template.h +++ b/i386/config/data-template.h @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2009 Master Chief. - * Refactored by DHP in 2010-2011. - */ - - -#if PATCH_ACPI_TABLE_DATA && INCLUDE_ACPI_DATA - #undef INCLUDE_ACPI_DATA - #include "acpi/data.h" - -#elif INJECT_EFI_DEVICE_PROPERTIES && INCLUDE_EFI_DATA - #undef INCLUDE_EFI_DATA - #include "efi/data.h" - -#elif USE_STATIC_SMBIOS_DATA && INCLUDE_SMBIOS_DATA - #undef INCLUDE_SMBIOS_DATA - #include "smbios/data.h" - -#endif From 6ea29185adb673496df515efb86bbf2c775fb39f Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 13:22:50 +0300 Subject: [PATCH 026/136] Quick update for RevoBoot v1.5.10/v1.5.20 --- i386/config/README | 50 +++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/i386/config/README b/i386/config/README index dfacdef..e9dc128 100644 --- a/i386/config/README +++ b/i386/config/README @@ -4,8 +4,9 @@ RevoBoot comes with configuration templates of which some you need to change: ACPI/data-template.h -------------------- -This file is optional. Only required when you want to inject static ACPI table data. -Copy/rename the file to data.h and add your (modified) ACPI tables. +RevoBoot's build process will copy this file for new configurations to the target modelidentifier +and use it, but only when you didn't already do this yourself. Make all required changes in +the new file only or it won't be used at all. Note: We use 'factory tables' for the original ACPI tables in the BIOS and 'modified' for new/modified ACPI tables. @@ -14,8 +15,9 @@ Note: We use 'factory tables' for the original ACPI tables in the BIOS and 'modi EFI/data-template.h ------------------- -This file is optional. Only required when you want/need to inject EFI device properties. -Copy/rename the file to data.h and add your EFI device properties. +RevoBoot's build process will copy this file for new configurations to the target modelidentifier +and use it, but only when you didn't already do this yourself. Make all required changes in +the new file only or it won't be used at all. Note: A simple HOWTO will (hopefully) soon be added to the EFI directory. @@ -23,36 +25,38 @@ Note: A simple HOWTO will (hopefully) soon be added to the EFI directory. SMBIOS/data-template.h ---------------------- -This file is optional. Only required when you want to inject static ACPI table data. -Copy/rename the file to data.h and add your static SMBIOS data. +RevoBoot's build process will copy this file for new configurations to the target modelidentifier +and use it, but only when you didn't already do this yourself. Make all required changes in +the new file only or it won't be used at all. Note: You can extract the SMBIOS table data with: /smbios/tools/smbios2struct2 Make instruction are included in the source code. +settings.h +---------- + +This file selects the target settings file based on the specified model identifier. Using +make MODEL=Macmini51 or use ./r Macmini51 (examples) makes it select RevoBoot/i386/config/SETTINGS/Macmini51.h +All future changes need to be made in this file, or they won't be picked up. + + settings-template.h ------------------- -This is the default configuration template for RevoBoot. Every possible option can be found in it. -You have to either copy or rename this file to settings.h and change it so that it matches your -hardware configuration. +RevoBoot's build process first checks RevoBoot/i386/config/SETTINGS/*.h per target model identifier +(example: Macmini51,h) and use it, or copies RevoBoot/i386/config/settings-template.h to the target model +identifier (when the file is missing) to prevent build errors. +People with working RevoBoot configurations can simply copy their settings.h to SETTINGS/[your model].h +This will allow the RevoBoot build process to compile without errors, but make sure to use the latest +preprocessor options. -data-template.h ---------------- -RevoBoot has one main include file for static data in the ACPI, EFI and SMBIOS directories. -This enables you to add files for different target configurations there. Here's an example -for two setups: - -#include "ACPI/data-hp.h" -#include "EFI/data-hp.h" -#include "SMBIOS/data-hp.h" +ACPI/EFI/SMBIOS/data.h +---------------------- -or (not both): +These are RevoBoot's main data selector files to support (optional) static data. -#include "ACPI/data-asus.h" -#include "EFI/data-asus.h" -#include "SMBIOS/data-asus.h" +Note: Do not change this file! -Note: We plan to add a make option for this. To let it select the files for the target configuration. From fd2c2f589877ae9120de009862c21fb4d64ec022 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 14:44:40 +0300 Subject: [PATCH 027/136] ignore build/log stuff --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 85c4e54..c15d8f4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,9 @@ .DS_Store +out.log +obj/* +sym/* + i386/config/SETTINGS/*.h i386/config/ACPI/default.h From 8f24a5099c6487164e86e367ff7f28390645d63a Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Fri, 26 Oct 2012 14:49:57 +0300 Subject: [PATCH 028/136] Changed usage: ./c USBDRIVE --- c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c b/c index 892a658..1928ec4 100755 --- a/c +++ b/c @@ -1,3 +1,3 @@ -sudo cp sym/i386/boot /Volumes/USBBOOT/ -sudo diskutil unmount /Volumes/USBBOOT +sudo cp sym/i386/boot /Volumes/$1/ +sudo diskutil unmount /Volumes/$1 From 5a3421aab1cdcb5371dcd20f00c35e3234a3b594 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Sat, 27 Oct 2012 01:01:56 +0300 Subject: [PATCH 029/136] New MacBookPro10,2 and Macmini6,[2/1] added --- i386/libsaio/platform.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/i386/libsaio/platform.h b/i386/libsaio/platform.h index 9205b14..9053cd8 100644 --- a/i386/libsaio/platform.h +++ b/i386/libsaio/platform.h @@ -64,6 +64,7 @@ #define MACBOOK_AIR_42 MACBOOK_AIR | (1 << 15) #define MACBOOK_AIR_41 MACBOOK_AIR // Defaults to MacBookAir4,1 +#define MACBOOK_PRO_102 MACBOOK_PRO | (6 << 15) #define MACBOOK_PRO_101 MACBOOK_PRO | (5 << 15) #define MACBOOK_PRO_91 MACBOOK_PRO | (4 << 15) #define MACBOOK_PRO_83 MACBOOK_PRO | (3 << 15) @@ -71,6 +72,8 @@ #define MACBOOK_PRO_81 MACBOOK_PRO | (1 << 15) #define MACBOOK_PRO_61 MACBOOK_PRO // Defaults to MacBookPro8,1 +#define MACMINI_62 (MACMINI | (4 << 15)) +#define MACMINI_61 (MACMINI | (3 << 15)) #define MACMINI_53 (MACMINI | (2 << 15)) #define MACMINI_52 (MACMINI | (1 << 15)) #define MACMINI_51 MACMINI // Defaults to Macmini5,1 From f4e3ef9cb3f050f376f4dddba82c8efbecd19153 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Sat, 27 Oct 2012 01:06:24 +0300 Subject: [PATCH 030/136] MacBookPro10,2 added --- i386/libsaio/smbios/model_data.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/i386/libsaio/smbios/model_data.h b/i386/libsaio/smbios/model_data.h index 92a435c..9039b23 100644 --- a/i386/libsaio/smbios/model_data.h +++ b/i386/libsaio/smbios/model_data.h @@ -20,6 +20,7 @@ * - EFI/SMBIOS data logic moved to preprocessor code (PikerAlpha, October 2012). * - SMB_PRODUCT_NAME renamed/moved over from settings.h (PikerAlpha, October 2012). * - EFI_MODEL_NAME renamed/moved over from settings.h (PikerAlpha, October 2012). + * - Data for new MacBookPro and Macmini added (PikerAlpha, October 2012). * * Credits: * - blackosx, DB1, dgsga, FKA, humph, scrax and STLVNUB (testers). @@ -95,14 +96,20 @@ // ------------------------------------------------------------------------------------- #define SMB_FAMILY "MacBookPro" - #if (TARGET_MODEL == MACBOOK_PRO_101) - // Intel Core i7-3720QM @ 2.60 GHz - 4 cores / 8 threads. + #if (TARGET_MODEL == MACBOOK_PRO_102) + // Intel Core i7-3520QM @ 2.90 GHz - 2 cores / 4 threads. + #define SMB_BIOS_VERSION "MBP102.88Z.00FE.B00.1207181057" + #define SMB_PRODUCT_NAME "MacBookPro10,2" + #define SMB_BOARD_PRODUCT "MMac-AFD8A9D944EA4843" + #define EFI_MODEL_NAME { 'M', 'a', 'c', 'B', 'o', 'o', 'k', 'P', 'r', 'o', '1', '0', ',', '2' } + #elif (TARGET_MODEL == MACBOOK_PRO_101) + // Intel Core i7-3720QM @ 2.60 GHz - 4 cores / 8 threads. #define SMB_BIOS_VERSION "MBP101.88Z.00EE.B00.1205101839" #define SMB_PRODUCT_NAME "MacBookPro10,1" #define SMB_BOARD_PRODUCT "Mac-C3EC7CD22292981F" #define EFI_MODEL_NAME { 'M', 'a', 'c', 'B', 'o', 'o', 'k', 'P', 'r', 'o', '1', '0', ',', '1' } #elif (TARGET_MODEL == MACBOOK_PRO_91) - // Intel Core i7-3820QM @ 2.70 GHz - 4 cores / 8 threads. + // Intel Core i7-3820QM @ 2.70 GHz - 4 cores / 8 threads. #define SMB_BIOS_VERSION "MBP91.88Z.00D3.B00.1203211536" #define SMB_PRODUCT_NAME "MacBookPro9,1" #define SMB_BOARD_PRODUCT "Mac-4B7AC7E43945597E" From b37e401c90bbddce4828cd8529e3097f41436bbc Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Sat, 27 Oct 2012 01:07:55 +0300 Subject: [PATCH 031/136] Typo --- i386/libsaio/smbios/model_data.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i386/libsaio/smbios/model_data.h b/i386/libsaio/smbios/model_data.h index 9039b23..bd8cc19 100644 --- a/i386/libsaio/smbios/model_data.h +++ b/i386/libsaio/smbios/model_data.h @@ -100,7 +100,7 @@ // Intel Core i7-3520QM @ 2.90 GHz - 2 cores / 4 threads. #define SMB_BIOS_VERSION "MBP102.88Z.00FE.B00.1207181057" #define SMB_PRODUCT_NAME "MacBookPro10,2" - #define SMB_BOARD_PRODUCT "MMac-AFD8A9D944EA4843" + #define SMB_BOARD_PRODUCT "Mac-AFD8A9D944EA4843" #define EFI_MODEL_NAME { 'M', 'a', 'c', 'B', 'o', 'o', 'k', 'P', 'r', 'o', '1', '0', ',', '2' } #elif (TARGET_MODEL == MACBOOK_PRO_101) // Intel Core i7-3720QM @ 2.60 GHz - 4 cores / 8 threads. From 7336203d0319753f711abf1e91bc0934e669f986 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Sat, 27 Oct 2012 15:10:54 +0300 Subject: [PATCH 032/136] Use CONFIG_DIR and data-template.h instead of data.h --- Makefile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index bbe91ec..2c101ae 100644 --- a/Makefile +++ b/Makefile @@ -100,7 +100,7 @@ ifdef MODEL # # Include default/empty static data file (no model identifier specified). # - DATA_FILE = data + DATA_FILE = data-template endif else # @@ -110,7 +110,7 @@ else # # Include default/empty static data file (no model identifier specified). # - DATA_FILE = data + DATA_FILE = data-template endif # @@ -133,16 +133,16 @@ SETTINGS_DIR=$(CONFIG_DIR)/SETTINGS SETTINGS_FILE=$(SETTINGS_DIR)/$(MAKE_TARGET_MODEL).h $(MAKEGOAL): $(SYMROOT) $(OBJROOT) - @if [ ! -f $(ARCH_DIR)/config/$(MAKE_ACPI_DATA_FILE) ]; then \ - cp -n $(ARCH_DIR)/config/ACPI/data-template.h $(ARCH_DIR)/config/$(MAKE_ACPI_DATA_FILE); \ + @if [ ! -f $(CONFIG_DIR)/$(MAKE_ACPI_DATA_FILE) ]; then \ + cp -n $(CONFIG_DIR)/ACPI/data-template.h $(CONFIG_DIR)/$(MAKE_ACPI_DATA_FILE); \ fi; - @if [ ! -f $(ARCH_DIR)/config/$(MAKE_EFI_DATA_FILE) ]; then \ - cp -n $(ARCH_DIR)/config/EFI/data-template.h $(ARCH_DIR)/config/$(MAKE_EFI_DATA_FILE); \ + @if [ ! -f $(CONFIG_DIR)/$(MAKE_EFI_DATA_FILE) ]; then \ + cp -n $(CONFIG_DIR)/EFI/data-template.h $(CONFIG_DIR)/$(MAKE_EFI_DATA_FILE); \ fi; - @if [ ! -f $(ARCH_DIR)/config/$(MAKE_SMBIOS_DATA_FILE) ]; then \ - cp -n $(ARCH_DIR)/config/SMBIOS/data-template.h $(ARCH_DIR)/config/$(MAKE_SMBIOS_DATA_FILE); \ + @if [ ! -f $(CONFIG_DIR)/$(MAKE_SMBIOS_DATA_FILE) ]; then \ + cp -n $(CONFIG_DIR)/SMBIOS/data-template.h $(CONFIG_DIR)/$(MAKE_SMBIOS_DATA_FILE); \ fi; @if [ ! -d $(SETTINGS_DIR) ]; then \ From 173260ccb8690810ca19a179bb0ccf536413a7ed Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Sat, 27 Oct 2012 15:13:02 +0300 Subject: [PATCH 033/136] Update for RevoBoot v1.5.22 --- CHANGES | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index 39637a7..3a80320 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,9 @@ +RevoBoot v1.5.22 +================ +- Bug fix in RevoBoot/Makefile (PikerAlpha, October 2012). +- VERSION updated to v1.5.22 + + RevoBoot v1.5.21 ================ - Model data for new Macmini6,N added (PikerAlpha, October 2012). From f9c98adb51040d67671df436f2605efb6fae734c Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Sat, 27 Oct 2012 15:13:41 +0300 Subject: [PATCH 034/136] Updating version info for RevoBoot v1.5.22 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 07a45d7..d532fd9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.21 +1.5.22 From 00012ca3f6b931a25ca9e359c524811d7dba2a6b Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Sat, 27 Oct 2012 20:00:19 +0300 Subject: [PATCH 035/136] STATIC_SMSERIALNUMBER -> SMB_BOARD_SERIAL_NUMBER --- i386/config/settings-template.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/i386/config/settings-template.h b/i386/config/settings-template.h index 82fa634..966bcbc 100644 --- a/i386/config/settings-template.h +++ b/i386/config/settings-template.h @@ -283,8 +283,6 @@ // // Note: Do not change this setting, unless you know what you are doing. -#define STATIC_SMSERIALNUMBER "SOMESRLNUMBR" // Example only! - #define STATIC_SYSTEM_SERIAL_NUMBER { 'S', 'O', 'M', 'E', 'S', 'R', 'L', 'N', 'U', 'M', 'B', 'R' } // Example only! #define STATIC_SYSTEM_ID { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F } // Example only! @@ -350,8 +348,8 @@ // // Note: MACMINI (without _NNN) selects the default model (last one i.e. MACMINI_51). -#if TARGET_MODEL & MACPRO - #define STATIC_SMBOARDSERIAL "SOMEBOARDNMBR" // Example only! +#if (TARGET_MODEL & MACPRO) + #define SMB_BOARD_SERIAL_NUMBER "SOMESRLNUMBR" // Example only! #endif #define DEBUG_SMBIOS 0 // Set to 0 by default. Change this to 1 when things don't seem to work for you. From 0c34f1d57763caf112ad5b0e77fe2540582e8a10 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Sat, 27 Oct 2012 20:05:03 +0300 Subject: [PATCH 036/136] Bug fix and cleanups --- i386/libsaio/smbios/dynamic_data.h | 120 ++++++++++++++++------------- 1 file changed, 66 insertions(+), 54 deletions(-) diff --git a/i386/libsaio/smbios/dynamic_data.h b/i386/libsaio/smbios/dynamic_data.h index 91f25d6..f7c0356 100755 --- a/i386/libsaio/smbios/dynamic_data.h +++ b/i386/libsaio/smbios/dynamic_data.h @@ -11,6 +11,7 @@ * - SMBIOS data logic moved to preprocessor code (PikerAlpha, October 2012). * - SMBProperties changed for speed and simplicity (PikerAlpha, October 2012). * - Calls with SMBProperties.keyString cleaned up (PikerAlpha, October 2012). + * - Fixed requiredStructures.start/stop values (PikerAlpha, October 2012). * * Credits: * - Kabyl (see notes in source code) @@ -36,6 +37,18 @@ #include "smbios.h" #include "model_data.h" +#if (TARGET_MODEL & MACPRO) + /* + * Number of additional properties for MacPro models. + */ + #define PROBOARD 2 +#else + /* + * No additional properties for other Mac models. + */ + #define PROBOARD 0 +#endif + //------------------------------------------------------------------------------ struct SMBStructure @@ -52,24 +65,24 @@ struct SMBStructure struct SMBStructure requiredStructures[] = { - { kSMBTypeBIOSInformation /* 0 */ , 0, 5, false, 0 }, - { kSMBTypeSystemInformation /* 1 */ , 6, 10, false, 0 }, - { kSMBTypeBaseBoard /* 2 */ , 11, 14, false, 0 }, - { kSMBUnused /* 3 */ , 0, 0, false, 0 }, - { kSMBTypeProcessorInformation /* 4 */ , 15, 16, true, 0 }, - { kSMBUnused /* 5 */ , 0, 0, false, 0 }, - { kSMBUnused /* 6 */ , 0, 0, false, 0 }, - { kSMBUnused /* 7 */ , 0, 0, false, 0 }, - { kSMBUnused /* 8 */ , 0, 0, false, 0 }, - { kSMBUnused /* 9 */ , 0, 0, false, 0 }, - { kSMBUnused /* 10 */ , 0, 0, false, 0 }, - { kSMBUnused /* 11 */ , 0, 0, false, 0 }, - { kSMBUnused /* 12 */ , 0, 0, false, 0 }, - { kSMBUnused /* 13 */ , 0, 0, false, 0 }, - { kSMBUnused /* 14 */ , 0, 0, false, 0 }, - { kSMBUnused /* 15 */ , 0, 0, false, 0 }, - { kSMBUnused /* 16 */ , 0, 0, false, 0 }, - { kSMBTypeMemoryDevice /* 17 */ , 17, 21, true, 0 } + { kSMBTypeBIOSInformation /* 0 */ , 0, 5, false, 0 }, + { kSMBTypeSystemInformation /* 1 */ , 6, 10, false, 0 }, + { kSMBTypeBaseBoard /* 2 */ , (11 + PROBOARD), (12 + PROBOARD), false, 0 }, + { kSMBUnused /* 3 */ , 0, 0, false, 0 }, + { kSMBTypeProcessorInformation /* 4 */ , (13 + PROBOARD), (14 + PROBOARD), true, 0 }, + { kSMBUnused /* 5 */ , 0, 0, false, 0 }, + { kSMBUnused /* 6 */ , 0, 0, false, 0 }, + { kSMBUnused /* 7 */ , 0, 0, false, 0 }, + { kSMBUnused /* 8 */ , 0, 0, false, 0 }, + { kSMBUnused /* 9 */ , 0, 0, false, 0 }, + { kSMBUnused /* 10 */ , 0, 0, false, 0 }, + { kSMBUnused /* 11 */ , 0, 0, false, 0 }, + { kSMBUnused /* 12 */ , 0, 0, false, 0 }, + { kSMBUnused /* 13 */ , 0, 0, false, 0 }, + { kSMBUnused /* 14 */ , 0, 0, false, 0 }, + { kSMBUnused /* 15 */ , 0, 0, false, 0 }, + { kSMBUnused /* 16 */ , 0, 0, false, 0 }, + { kSMBTypeMemoryDevice /* 17 */ , (15 + PROBOARD), (19 + PROBOARD), true, 0 } }; @@ -103,64 +116,63 @@ struct SMBProperty }; #define APPLE_INC "Apple Inc." -#define SMB_SYSTEM_VERSION "1.0" //------------------------------------------------------------------------------ struct SMBProperty SMBProperties[] = { - //------------------------------------------------------------------------------------------------ + //---------------------------------------------------------------------------------------------------- - { kSMBTypeBIOSInformation, 0x04, kSMBString, .plainData = APPLE_INC }, - { kSMBTypeBIOSInformation, 0x05, kSMBString, .plainData = SMB_BIOS_VERSION }, - { kSMBTypeBIOSInformation, 0x06, kSMBWord, .getSMBWord = getBIOSLocation }, - { kSMBTypeBIOSInformation, 0x08, kSMBString, .getSMBString = getBIOSDate }, - { kSMBTypeBIOSInformation, 0x0a, kSMBQWord, .getSMBQWord = getBIOSFeatures }, - { kSMBTypeBIOSInformation, 0x12, kSMBDWord, .getSMBDWord = getBIOSFeaturesEX }, - - //------------------------------------------------------------------------------------------------ + { kSMBTypeBIOSInformation, 0x04, kSMBString, .plainData = APPLE_INC }, + { kSMBTypeBIOSInformation, 0x05, kSMBString, .plainData = SMB_BIOS_VERSION }, + { kSMBTypeBIOSInformation, 0x06, kSMBWord, .getSMBWord = getBIOSLocation }, + { kSMBTypeBIOSInformation, 0x08, kSMBString, .getSMBString = getBIOSDate }, + { kSMBTypeBIOSInformation, 0x0a, kSMBQWord, .getSMBQWord = getBIOSFeatures }, + { kSMBTypeBIOSInformation, 0x12, kSMBDWord, .getSMBDWord = getBIOSFeaturesEX }, + + //---------------------------------------------------------------------------------------------------- - { kSMBTypeSystemInformation, 0x04, kSMBString, .plainData = APPLE_INC }, - { kSMBTypeSystemInformation, 0x05, kSMBString, .plainData = SMB_PRODUCT_NAME }, - { kSMBTypeSystemInformation, 0x06, kSMBString, .plainData = SMB_SYSTEM_VERSION }, - { kSMBTypeSystemInformation, 0x07, kSMBString, .plainData = STATIC_SMSERIALNUMBER }, - { kSMBTypeSystemInformation, 0x1a, kSMBString, .plainData = SMB_FAMILY }, + { kSMBTypeSystemInformation, 0x04, kSMBString, .plainData = APPLE_INC }, + { kSMBTypeSystemInformation, 0x05, kSMBString, .plainData = SMB_PRODUCT_NAME }, + { kSMBTypeSystemInformation, 0x06, kSMBString, .plainData = "1.0" }, + { kSMBTypeSystemInformation, 0x07, kSMBString, .plainData = STATIC_SMSERIALNUMBER }, + { kSMBTypeSystemInformation, 0x1a, kSMBString, .plainData = SMB_FAMILY }, - //------------------------------------------------------------------------------------------------ + //---------------------------------------------------------------------------------------------------- - { kSMBTypeBaseBoard, 0x04, kSMBString, .plainData = APPLE_INC }, - { kSMBTypeBaseBoard, 0x05, kSMBString, .plainData = SMB_BOARD_PRODUCT }, - -#if TARGET_MODEL & MACPRO - { kSMBTypeBaseBoard, 0x07, kSMBString, .plainData = STATIC_SMBOARDSERIAL }, - { kSMBTypeBaseBoard, 0x0d, kSMBByte, .getSMBByte = getBoardType }, + { kSMBTypeBaseBoard, 0x04, kSMBString, .plainData = APPLE_INC }, + { kSMBTypeBaseBoard, 0x05, kSMBString, .plainData = SMB_BOARD_PRODUCT }, + +#if (TARGET_MODEL & MACPRO) + { kSMBTypeBaseBoard, 0x07, kSMBString, .plainData = SMB_BOARD_SERIAL_NUMBER }, + { kSMBTypeBaseBoard, 0x0d, kSMBByte, .getSMBByte = getBoardType }, #endif + + //---------------------------------------------------------------------------------------------------- - //------------------------------------------------------------------------------------------------ - - { kSMBTypeProcessorInformation, 0x12, kSMBWord, .getSMBWord = getFSBFrequency }, - { kSMBTypeProcessorInformation, 0x14, kSMBWord, .getSMBWord = getCPUFrequency }, + { kSMBTypeProcessorInformation, 0x12, kSMBWord, .getSMBWord = getFSBFrequency }, + { kSMBTypeProcessorInformation, 0x14, kSMBWord, .getSMBWord = getCPUFrequency }, - //------------------------------------------------------------------------------------------------ + //---------------------------------------------------------------------------------------------------- #if DYNAMIC_RAM_OVERRIDE_SIZE - { kSMBTypeMemoryDevice, 0x0c, kSMBWord, .getSMBWord = getRAMSize }, + { kSMBTypeMemoryDevice, 0x0c, kSMBWord, .getSMBWord = getRAMSize }, #endif - { kSMBTypeMemoryDevice, 0x10, kSMBString, .getSMBString = NULL }, - { kSMBTypeMemoryDevice, 0x11, kSMBString, .getSMBString = NULL }, + { kSMBTypeMemoryDevice, 0x10, kSMBString, .getSMBString = NULL }, + { kSMBTypeMemoryDevice, 0x11, kSMBString, .getSMBString = NULL }, #if DYNAMIC_RAM_OVERRIDE_TYPE - { kSMBTypeMemoryDevice, 0x12, kSMBByte, .getSMBByte = getRAMType }, + { kSMBTypeMemoryDevice, 0x12, kSMBByte, .getSMBByte = getRAMType }, #endif #if DYNAMIC_RAM_OVERRIDE_FREQUENCY - { kSMBTypeMemoryDevice, 0x15, kSMBWord, .getSMBWord = getRAMFrequency }, + { kSMBTypeMemoryDevice, 0x15, kSMBWord, .getSMBWord = getRAMFrequency }, #endif - { kSMBTypeMemoryDevice, 0x17, kSMBString, .getSMBString = getRAMVendor }, - { kSMBTypeMemoryDevice, 0x18, kSMBString, .getSMBString = getRAMSerialNumber }, - { kSMBTypeMemoryDevice, 0x1a, kSMBString, .getSMBString = getRAMPartNumber }, + { kSMBTypeMemoryDevice, 0x17, kSMBString, .getSMBString = getRAMVendor }, + { kSMBTypeMemoryDevice, 0x18, kSMBString, .getSMBString = getRAMSerialNumber }, + { kSMBTypeMemoryDevice, 0x1a, kSMBString, .getSMBString = getRAMPartNumber }, }; @@ -266,7 +278,7 @@ void setupSMBIOS(void) newtablesPtr += 8; } -#if DYNAMIC_RAM_OVERRIDE_SIZE || DYNAMIC_RAM_OVERRIDE_TYPE || DYNAMIC_RAM_OVERRIDE_FREQUENCY +#if (DYNAMIC_RAM_OVERRIDE_SIZE || DYNAMIC_RAM_OVERRIDE_TYPE || DYNAMIC_RAM_OVERRIDE_FREQUENCY) requiredStructures[17].stop = (sizeof(SMBProperties) / sizeof(SMBProperties[0])) -1; #endif From 5658ac96ffe79ce51e89a1fca25d456fc2a3e0db Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Sat, 27 Oct 2012 20:06:05 +0300 Subject: [PATCH 037/136] Updating version info for RevoBoot v1.5.23 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index d532fd9..249319e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.22 +1.5.23 From 5c9837d1f785a5d5d6c5d7c5435443f7f1bd609f Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Sat, 27 Oct 2012 20:07:35 +0300 Subject: [PATCH 038/136] Update for RevoBoot v1.5.23 --- CHANGES | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index 3a80320..4b80611 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,9 @@ +RevoBoot v1.5.23 +================ +- Bug fix and cleanups in RevoBoot/i386/libsaio/SMBIOS/dynamic_data.h (PikerAlpha, October 2012). +- VERSION updated to v1.5.23 + + RevoBoot v1.5.22 ================ - Bug fix in RevoBoot/Makefile (PikerAlpha, October 2012). From 61d2aa501bde305e79a0a711a6006b5f6a07420d Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Sat, 27 Oct 2012 20:17:25 +0300 Subject: [PATCH 039/136] Comment only --- i386/config/data.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i386/config/data.h b/i386/config/data.h index bd56edc..768bafc 100755 --- a/i386/config/data.h +++ b/i386/config/data.h @@ -14,7 +14,7 @@ #if (PATCH_ACPI_TABLE_DATA && INCLUDE_ACPI_DATA) #undef INCLUDE_ACPI_DATA - + // The STRING (macro) is defined in RevoBoot/i386/config/settings.h #include STRING(ACPI_DATA_FILE) #endif From 14d5d57b5a2da605ec6f60b6f10f9135ac58ffdf Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Sat, 27 Oct 2012 20:19:57 +0300 Subject: [PATCH 040/136] Cleanup only --- i386/config/settings.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/i386/config/settings.h b/i386/config/settings.h index ae4c0f9..ad4fcb4 100644 --- a/i386/config/settings.h +++ b/i386/config/settings.h @@ -8,6 +8,5 @@ #define TO_STRING_DO(a) #a #define STRING(a) TO_STRING_DO(a) -#define INCLUDE_FILE STRING(SETTINGS_FILE) -#include INCLUDE_FILE +#include STRING(SETTINGS_FILE) From 3f254d25fbf6a030870af5375ae63950e6496b5a Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Sun, 28 Oct 2012 09:45:35 +0100 Subject: [PATCH 041/136] Updating version info for RevoBoot v1.5.25 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 249319e..32461d5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.23 +1.5.25 From f1fe27b04d94119a73f31918ecb0852e9b7f66ad Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Sun, 28 Oct 2012 09:47:30 +0100 Subject: [PATCH 042/136] New static data paths for RevoBoot v1.5.25 --- i386/libsaio/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/i386/libsaio/Makefile b/i386/libsaio/Makefile index 0bff17d..0c3c64f 100644 --- a/i386/libsaio/Makefile +++ b/i386/libsaio/Makefile @@ -23,9 +23,9 @@ CFLAGS = $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost \ -DREVOBOOT_VERSION_INFO=\"RevoBoot\ v$(PRODUCT_VERSION_NUMBER)\" \ -DMAKE_TARGET_OS=$(PRODUCT_OS_TARGET) \ -DSETTINGS_FILE=SETTINGS/$(MAKE_TARGET_MODEL).h \ - -DACPI_DATA_FILE=$(MAKE_ACPI_DATA_FILE) \ - -DEFI_DATA_FILE=$(MAKE_EFI_DATA_FILE) \ - -DSMBIOS_DATA_FILE=$(MAKE_SMBIOS_DATA_FILE) \ + -DACPI_DATA_FILE=../../config/$(MAKE_ACPI_DATA_FILE) \ + -DEFI_DATA_FILE=../config/$(MAKE_EFI_DATA_FILE) \ + -DSMBIOS_DATA_FILE=../../config/$(MAKE_SMBIOS_DATA_FILE) \ -fno-builtin -static $(OMIT_FRAME_POINTER_CFLAG) \ -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ -march=pentium4 -msse2 -mfpmath=sse -msoft-float From 3bcbf0ceee0bf183666c3111662a310724a949f1 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Sun, 28 Oct 2012 09:50:41 +0100 Subject: [PATCH 043/136] New static data paths for RevoBoot v1.5.25 --- i386/libsaio/smbios/static_data.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/i386/libsaio/smbios/static_data.h b/i386/libsaio/smbios/static_data.h index 5cf2938..eccaefb 100755 --- a/i386/libsaio/smbios/static_data.h +++ b/i386/libsaio/smbios/static_data.h @@ -3,6 +3,7 @@ * * Updates: * - Dynamic and static SMBIOS data gathering added by DHP in 2010. + * - New path for static EFI data (PikerAlpha, October 2012). * * Credits: * - blackosx, DB1, dgsga, FKA, humph, scrax and STLVNUB (testers). @@ -13,8 +14,8 @@ #include "essentials.h" -#define INCLUDE_SMBIOS_DATA 1 -#include "../../config/data.h" +// The STRING (macro) is defined in RevoBoot/i386/config/settings.h +#include STRING(SMBIOS_DATA_FILE) static uint32_t SMBIOS_Table[] = { From f6f699a408cdc55f85871f6538e53a8757ab0adc Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Sun, 28 Oct 2012 09:55:19 +0100 Subject: [PATCH 044/136] Use model identifier as filename for static data --- i386/libsaio/efi.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/i386/libsaio/efi.c b/i386/libsaio/efi.c index d19557b..86e913e 100755 --- a/i386/libsaio/efi.c +++ b/i386/libsaio/efi.c @@ -31,16 +31,13 @@ * - STATIC_MODEL_NAME moved over from settings.h (PikerAlpha, October 2012). * - STATIC_MODEL_NAME renamed to EFI_MODEL_NAME (PikerAlpha, October 2012). * - Now no longer includes platform.h (PikerAlpha, October 2012). + * - Data selector moved over from RevoBoot/i386/config/data.h (PikerAlpha, October 2012). * */ #include "efi/fake_efi.h" -#define INCLUDE_EFI_DATA 1 - -#include "../config/data.h" - //============================================================================== void initEFITree(void) @@ -177,6 +174,8 @@ void initEFITree(void) gPlatform.EFI.Nodes.Chosen = chosenNode; #if INJECT_EFI_DEVICE_PROPERTIES + // The STRING (macro) is defined in RevoBoot/i386/config/settings.h + #include STRING(EFI_DATA_FILE) static EFI_UINT8 const EFI_DEVICE_PROPERTIES[] = { From 355af009c007124c0a44cf4709f62ddbbdfd89bb Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Sun, 28 Oct 2012 09:56:53 +0100 Subject: [PATCH 045/136] Use model identifier as filename for static data --- i386/libsaio/acpi/static_data.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/i386/libsaio/acpi/static_data.h b/i386/libsaio/acpi/static_data.h index 8bf28d2..e9bb4e7 100755 --- a/i386/libsaio/acpi/static_data.h +++ b/i386/libsaio/acpi/static_data.h @@ -1,19 +1,18 @@ /* - * Copyright 2009 by Master Chief. + * Static data overrides for ACPI tables. Copyright 2009 by Master Chief. * - * Refactored (dynamic and static ACPI patching) by DHP in 2010/2011. + * Updates: + * - Refactored (dynamic and static ACPI patching) by DHP in 2010/2011. + * - Data selector moved over from RevoBoot/i386/config/data.h (PikerAlpha, October 2012). */ #ifndef __LIBSAIO_ACPI_STATIC_DATA_H #define __LIBSAIO_ACPI_STATIC_DATA_H -#define INCLUDE_ACPI_DATA 1 +// The STRING (macro) is defined in RevoBoot/i386/config/settings.h +#include STRING(ACPI_DATA_FILE) -#include "../config/data.h" - -// The STATIC_xxx_TABLE_DATA's here will get replaced with the data from private_data.h - -// Static data overrides for essential tables. +// The STATIC_xxx_TABLE_DATA's here will get replaced with the data from RevoBoot/i386/config/ACPI/[default/MacmodelNN].h static uint32_t APIC_Table[] = { From 717befbc7e8904d9e6c62deff22b5f2702d33db7 Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Sun, 28 Oct 2012 09:59:10 +0100 Subject: [PATCH 046/136] No longer included with RevoBoot v1.5.25 --- i386/config/data.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/i386/config/data.h b/i386/config/data.h index 768bafc..40de3d1 100755 --- a/i386/config/data.h +++ b/i386/config/data.h @@ -8,10 +8,15 @@ * * - Refactored by DHP in 2010-2011. * - Automatic model data selection (PikerAlpha, October 2012). - * + * - Static ACPI data selector moved to RevoBoot/i386/libsaio/ACPI/static_data.h (PikerAlpha, October 2012). + * - Static EFI data selector moved to RevoBoot/i386/libsaio/efi.c (PikerAlpha, October 2012). + * - Static SMBIOS data selector moved to RevoBoot/i386/libsaio/SMBIOS/dynamic_data.h (PikerAlpha, October 2012). + * - This file is no longer included with RevoBoot v1.5.25 (PikerAlpha, October 2012). */ +!!__WHEN_YOU_SEE_THIS_STUPID_ERROR_THAN_SOMETHING_IS_WRONG__!! + #if (PATCH_ACPI_TABLE_DATA && INCLUDE_ACPI_DATA) #undef INCLUDE_ACPI_DATA // The STRING (macro) is defined in RevoBoot/i386/config/settings.h From 997d1c68c6adc75ab9a6c3fc363c1f7f6f581d7d Mon Sep 17 00:00:00 2001 From: Piker-Alpha Date: Sun, 28 Oct 2012 10:05:00 +0100 Subject: [PATCH 047/136] Updating version info for RevoBoot v1.5.25 --- CHANGES | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGES b/CHANGES index 4b80611..a9e4902 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,11 @@ +RevoBoot v1.5.25 +================ +- RevoBoot/i386/config/data.h is no longer included with (PikerAlpha, October 2012). +- New static data paths in RevoBoot/i386/libsaio/Makefile (PikerAlpha, October 2012). +- Use model identifier as filename for static data (PikerAlpha, October 2012). +- VERSION updated to v1.5.25 + + RevoBoot v1.5.23 ================ - Bug fix and cleanups in RevoBoot/i386/libsaio/SMBIOS/dynamic_data.h (PikerAlpha, October 2012). From dc979bd5d2294f8f67b64de8894aedcb859e4fb8 Mon Sep 17 00:00:00 2001 From: Pike Date: Tue, 30 Oct 2012 11:48:14 +0100 Subject: [PATCH 048/136] Read/use MacModelNN from RevoBoot/MODEL --- r | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/r b/r index 1d06cf0..73954b6 100755 --- a/r +++ b/r @@ -1,4 +1,28 @@ -make clean clear -make MODEL=$1 > out.log +make clean +# +# Check argument for Mac model. +# +if [[ "$1" =~ [iMac|Mac] ]]; + then + # + # Use specified MacModelNN from argument. + # + make MODEL=$1 > out.log + else + # + # Check RevoBoot/MODEL for default model. + # + if [ -f MODEL ]; then + # + # Get MacModelNN from MODEL (assuming it to be correct). + # + make MODEL=`cat MODEL` > out.log + else + # + # No default model found. + # + make > out.log + fi; +fi From 79b2403bd3afa7d92dfb161a3406fbca9d69fcf6 Mon Sep 17 00:00:00 2001 From: Pike Date: Tue, 30 Oct 2012 11:51:42 +0100 Subject: [PATCH 049/136] Patch for RevoBoot v1.5.30 --- i386/libsaio/acpi/patcher.h | 38 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/i386/libsaio/acpi/patcher.h b/i386/libsaio/acpi/patcher.h index f1617a8..d9eb40c 100644 --- a/i386/libsaio/acpi/patcher.h +++ b/i386/libsaio/acpi/patcher.h @@ -7,6 +7,7 @@ * - Refactorized for Revolution by DHP in 2010. * - A complete new implementation written for RevoBoot by DHP in 2011. * - Automatic SSDT_PR creation added by DHP in June 2011. + * - Call loadBinaryData from loadACPITable (PikerAlpha, October 2012). */ @@ -26,33 +27,32 @@ int loadACPITable(int tableIndex) { _ACPI_DEBUG_DUMP("loadACPITable(%s / ", customTables[tableIndex].name); - char dirspec[32]; - sprintf (dirspec, "/Extra/ACPI/%s.aml", customTables[tableIndex].name); - int fd = open(dirspec, 0); + char dirSpec[32] = ""; + sprintf(dirSpec, "/Extra/ACPI/%s.aml", customTables[tableIndex].name); - if (fd < 0) - { - _ACPI_DEBUG_DUMP("Error: File not found.)\n"); - - return -1; - } + void * tableAddress = (void *)kLoadAddr; - int fileSize = file_size(fd); - void * kernelAddress = malloc(fileSize); + /* + * loadBinaryData calls LoadFile (both in sys.c) to load table data into a + * load buffer at kLoadAddr (defined in memory.h) and copies it into a new + * allocated memory block (kLoadAddr gets overwritten by the next call). + */ + long fileSize = loadBinaryData(dirSpec, &tableAddress); - if (kernelAddress) + if (fileSize) { - read(fd, kernelAddress, fileSize); - } + _ACPI_DEBUG_DUMP("%d bytes).\n", fileSize); - close(fd); + // 'tableAddress' is copied into kernel memory later on (see setupACPI). + customTables[tableIndex].table = tableAddress; + customTables[tableIndex].tableLength = fileSize; - _ACPI_DEBUG_DUMP("%d bytes).\n", fileSize); + return 0; + } - customTables[tableIndex].table = kernelAddress; - customTables[tableIndex].tableLength = fileSize; + _ACPI_DEBUG_DUMP("Error: File not found.)\n"); - return 0; + return -1; } From c943b110603cb703cbf4993e1b792eca2e953401 Mon Sep 17 00:00:00 2001 From: Pike Date: Tue, 30 Oct 2012 11:54:00 +0100 Subject: [PATCH 050/136] Patch for RevoBoot v1.5.30 --- i386/libsaio/load.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/i386/libsaio/load.c b/i386/libsaio/load.c index dad895a..51e8cf1 100755 --- a/i386/libsaio/load.c +++ b/i386/libsaio/load.c @@ -427,3 +427,31 @@ static long DecodeSymbolTable(long cmdBase) return 0; } + + +//============================================================================== +// Public function (RevoBoot v1.5.30 and greater). Called from our ACPI patcher +// which looks in /Extra/ACPI/ for [TableName].aml but it is also used in two +// other places, being libsaio/efi.c and libsaio/SMBIOS/static_data.h This to +// get static (binary) data from /Extra/[EFI/SMBIOS]/[FileName].bin + +long loadBinaryData(char *aFilePath, void **aMemoryAddress) +{ + long fileSize = LoadFile(aFilePath); + + printf("fileSize is: %ld", fileSize); + + if (fileSize > 0) + { + *aMemoryAddress = (void *)malloc(fileSize); + + if (aMemoryAddress) + { + memcpy(*aMemoryAddress, (void *)kLoadAddr, fileSize); + + return fileSize; + } + } + + return 0; +} From 61494d2695e31fe682a4963fcabc39d03def5d82 Mon Sep 17 00:00:00 2001 From: Pike Date: Tue, 30 Oct 2012 11:58:59 +0100 Subject: [PATCH 051/136] Patch for RevoBoot v1.5.30 --- i386/libsaio/efi.c | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/i386/libsaio/efi.c b/i386/libsaio/efi.c index 86e913e..720c054 100755 --- a/i386/libsaio/efi.c +++ b/i386/libsaio/efi.c @@ -32,6 +32,7 @@ * - STATIC_MODEL_NAME renamed to EFI_MODEL_NAME (PikerAlpha, October 2012). * - Now no longer includes platform.h (PikerAlpha, October 2012). * - Data selector moved over from RevoBoot/i386/config/data.h (PikerAlpha, October 2012). + * - Get static EFI data (optional) from /Extra/EFI/[MacModelNN].bin (PikerAlpha, October 2012). * */ @@ -174,17 +175,35 @@ void initEFITree(void) gPlatform.EFI.Nodes.Chosen = chosenNode; #if INJECT_EFI_DEVICE_PROPERTIES - // The STRING (macro) is defined in RevoBoot/i386/config/settings.h - #include STRING(EFI_DATA_FILE) + _EFI_DEBUG_DUMP("Injecting static EFI device-properties [%s]\n", SMB_PRODUCT_NAME); - static EFI_UINT8 const EFI_DEVICE_PROPERTIES[] = - { - STATIC_EFI_DEVICE_PROPERTIES - }; + #if LOAD_STATIC_EFI_DATA_FROM_EXTRA + extern long loadBinaryData(char *aFilePath, void **aMemoryAddress); + + char dirSpec[32] = ""; + sprintf(dirSpec, "/Extra/EFI/%s", STRING(STATIC_DATA_FILENAME)); + + void * staticEFIData = (void *)kLoadAddr; + + _EFI_DEBUG_DUMP("Loading: %s\n", dirSpec); - _EFI_DEBUG_DUMP("Injecting EFI device-properties\n"); + long fileSize = loadBinaryData(dirSpec, &staticEFIData); + + if (fileSize) + { + DT__AddProperty(efiNode, "device-properties", fileSize, (EFI_CHAR8*) staticEFIData); + } + #else + // The STRING (macro) is defined in RevoBoot/i386/config/settings.h + #include STRING(EFI_DATA_FILE) + + static EFI_UINT8 const EFI_DEVICE_PROPERTIES[] = + { + STATIC_EFI_DEVICE_PROPERTIES + }; - DT__AddProperty(efiNode, "device-properties", sizeof(EFI_DEVICE_PROPERTIES), (EFI_CHAR8*) &EFI_DEVICE_PROPERTIES); + DT__AddProperty(efiNode, "device-properties", sizeof(EFI_DEVICE_PROPERTIES), (EFI_CHAR8*) &EFI_DEVICE_PROPERTIES); + #endif #endif _EFI_DEBUG_DUMP("Exiting initEFITree()\n"); From 3870a4a37fda52a1b140ae2d1ebfeb3bf399b3dd Mon Sep 17 00:00:00 2001 From: Pike Date: Tue, 30 Oct 2012 12:07:05 +0100 Subject: [PATCH 052/136] Patch for RevoBoot v1.5.30 --- i386/boot2/boot.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/i386/boot2/boot.c b/i386/boot2/boot.c index 50f3e56..71ccc49 100755 --- a/i386/boot2/boot.c +++ b/i386/boot2/boot.c @@ -204,7 +204,14 @@ void boot(int biosdev) } } +#if (LOAD_STATIC_EFI_DATA_FROM_EXTRA == 0) + /* + * We can only make this call here when static EFI is included from + * RevoBoot/i386/config/EFI/[MacModelNN.h] Not when the data is read + * from: /Extra/ because then: RevoBoot/i386/libsaio/platform.c calls it. + */ initPartitionChain(); +#endif #define loadCABootPlist() loadSystemConfig(&bootInfo->bootConfig) From 7b91930e279385ab3653570c758d6566a789125e Mon Sep 17 00:00:00 2001 From: Pike Date: Tue, 30 Oct 2012 12:09:53 +0100 Subject: [PATCH 053/136] Patch for RevoBoot v1.5.30 --- i386/libsaio/platform.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/i386/libsaio/platform.c b/i386/libsaio/platform.c index 11af0fa..78c4f9d 100644 --- a/i386/libsaio/platform.c +++ b/i386/libsaio/platform.c @@ -276,5 +276,13 @@ void initPlatform(int biosDevice) initKernelBootConfig(); +#if (LOAD_STATIC_EFI_DATA_FROM_EXTRA) + /* + * We need to call this much earlier in the boot process when static EFI data + * is read from: /Extra/EFI[MacModelNN.bin]. Otherwise LoadFile (load.c) fails. + */ + initPartitionChain(); +#endif + initEFITree(); } From 6654d641d5a1225d79e3a6b097d8046d9f018639 Mon Sep 17 00:00:00 2001 From: Pike Date: Tue, 30 Oct 2012 12:14:09 +0100 Subject: [PATCH 054/136] Patch for RevoBoot v1.5.30 --- i386/libsaio/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/i386/libsaio/Makefile b/i386/libsaio/Makefile index 0c3c64f..bc5c4e1 100644 --- a/i386/libsaio/Makefile +++ b/i386/libsaio/Makefile @@ -6,9 +6,9 @@ # - Major cleanup (PikerAlpha, October 2012). # - DMAKE_TARGET_MODEL added (PikerAlpha, October 2012). # - Static data selectors added (PikerAlpha, October 2012). +# - STATIC_DATA_FILENAME added (PikerAlpha, October 2012). # - include ../MakePaths.dir UTILDIR = ../util @@ -23,6 +23,7 @@ CFLAGS = $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost \ -DREVOBOOT_VERSION_INFO=\"RevoBoot\ v$(PRODUCT_VERSION_NUMBER)\" \ -DMAKE_TARGET_OS=$(PRODUCT_OS_TARGET) \ -DSETTINGS_FILE=SETTINGS/$(MAKE_TARGET_MODEL).h \ + -DSTATIC_DATA_FILENAME=$(MAKE_TARGET_MODEL).bin \ -DACPI_DATA_FILE=../../config/$(MAKE_ACPI_DATA_FILE) \ -DEFI_DATA_FILE=../config/$(MAKE_EFI_DATA_FILE) \ -DSMBIOS_DATA_FILE=../../config/$(MAKE_SMBIOS_DATA_FILE) \ From e0fc38e372d5df9d6908c87150c781ae875daca4 Mon Sep 17 00:00:00 2001 From: Pike Date: Tue, 30 Oct 2012 12:18:27 +0100 Subject: [PATCH 055/136] Patch for RevoBoot v1.5.30 --- i386/libsaio/acpi/patcher.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/i386/libsaio/acpi/patcher.h b/i386/libsaio/acpi/patcher.h index d9eb40c..cf760a0 100644 --- a/i386/libsaio/acpi/patcher.h +++ b/i386/libsaio/acpi/patcher.h @@ -20,9 +20,12 @@ extern ACPI_RSDP * getACPIBaseAddress(); #include "ssdt_pr_generator.h" #endif + #if LOAD_EXTRA_ACPI_TABLES && (LOAD_DSDT_TABLE_FROM_EXTRA_ACPI || LOAD_SSDT_TABLE_FROM_EXTRA_ACPI) //============================================================================== +extern long loadBinaryData(char *aFilePath, void **aMemoryAddress); + int loadACPITable(int tableIndex) { _ACPI_DEBUG_DUMP("loadACPITable(%s / ", customTables[tableIndex].name); From 355ce29ceb3ccb2660d6a00574899b3f59207984 Mon Sep 17 00:00:00 2001 From: Pike Date: Tue, 30 Oct 2012 12:21:23 +0100 Subject: [PATCH 056/136] Limit debug output (patch for RevoBoot v1.5.30) --- i386/libsaio/device_tree.c | 47 ++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/i386/libsaio/device_tree.c b/i386/libsaio/device_tree.c index d80dd3e..9949fc2 100755 --- a/i386/libsaio/device_tree.c +++ b/i386/libsaio/device_tree.c @@ -79,14 +79,18 @@ Property * DT__AddProperty(Node *node, const char *name, uint32_t length, void * { Property *prop; - _EFI_DEBUG_DUMP("DT__AddProperty([Node '%s'], '%s', %d, 0x%x)\n", DT__GetName(node), name, length, value); +#if (DEBUG_EFI & 2) + _EFI_DEBUG_DUMP("DT__AddProperty([Node '%s'], '%s', %d, 0x%x)\n", DT__GetName(node), name, length, value); +#endif if (freeProperties == NULL) { void *buf = malloc(kAllocSize); int i; + #if (DEBUG_EFI & 2) _EFI_DEBUG_DUMP("Allocating more free properties\n"); + #endif if (buf == 0) { @@ -129,7 +133,9 @@ Property * DT__AddProperty(Node *node, const char *name, uint32_t length, void * node->last_prop = prop; prop->next = 0; - // _EFI_DEBUG_DUMP("Done [0x%x]\n", prop); +#if (DEBUG_EFI & 8) + _EFI_DEBUG_DUMP("Done [0x%x]\n", prop); +#endif DTInfo.numProperties++; DTInfo.totalPropertySize += RoundToLong(length); @@ -155,7 +161,9 @@ Node * DT__AddChild(Node *parent, const char *name) int i; +#if (DEBUG_EFI & 2) _EFI_DEBUG_DUMP("Allocating more free nodes\n"); +#endif bzero(buf, kAllocSize); node = (Node *)buf; @@ -174,13 +182,17 @@ Node * DT__AddChild(Node *parent, const char *name) } } +#if (DEBUG_EFI & 2) _EFI_DEBUG_DUMP("DT__AddChild(0x%x, '%s')\n", parent, name); +#endif node = freeNodes; freeNodes = node->next; +#if (DEBUG_EFI & 2) _EFI_DEBUG_DUMP("Got free node 0x%x\n", node); _EFI_DEBUG_DUMP("prop = 0x%x, children = 0x%x, next = 0x%x\n", node->properties, node->children, node->next); +#endif if (parent == NULL) { @@ -252,7 +264,9 @@ void DT__Finalize(void) Node *node; Property *prop; - // _EFI_DEBUG_DUMP("DT__Finalize\n"); +#if (DEBUG_EFI & 8) + _EFI_DEBUG_DUMP("DT__Finalize\n"); +#endif for (prop = allocedProperties; prop != NULL; prop = prop->next) { @@ -332,7 +346,9 @@ void DT__FlattenDeviceTree(void **buffer_p, uint32_t *length) uint32_t totalSize; void * buf; +#if (DEBUG_EFI & 2) _EFI_DEBUG_DUMP("DT__FlattenDeviceTree(0x%x, 0x%x)\n", buffer_p, length); +#endif #if (DEBUG_EFI & 4) if (buffer_p) @@ -345,7 +361,9 @@ void DT__FlattenDeviceTree(void **buffer_p, uint32_t *length) DTInfo.numProperties * sizeof(DeviceTreeNodeProperty) + DTInfo.totalPropertySize; +#if (DEBUG_EFI & 2) _EFI_DEBUG_DUMP("Total size 0x%x\n", totalSize); +#endif if (buffer_p != 0) { @@ -385,11 +403,16 @@ char * DT__GetName(Node *node) { Property *prop; - //_EFI_DEBUG_DUMP("DT__GetName(0x%x)\n", node); - //_EFI_DEBUG_DUMP("Node properties = 0x%x\n", node->properties); +#if (DEBUG_EFI & 8) + _EFI_DEBUG_DUMP("DT__GetName(0x%x)\n", node); + _EFI_DEBUG_DUMP("Node properties = 0x%x\n", node->properties); +#endif + for (prop = node->properties; prop; prop = prop->next) { - //_EFI_DEBUG_DUMP("Prop '%s'\n", prop->name); +#if (DEBUG_EFI & 8) + _EFI_DEBUG_DUMP("Prop '%s'\n", prop->name); +#endif if (strcmp(prop->name, "name") == 0) { return prop->value; @@ -410,8 +433,10 @@ Node * DT__FindNode(const char *path, bool createIfMissing) char *bp; int i; +#if (DEBUG_EFI & 2) _EFI_DEBUG_DUMP("DT__FindNode('%s', %d)\n", path, createIfMissing); - +#endif + // Start at root node = gPlatform.DT.RootNode; @@ -436,13 +461,15 @@ Node * DT__FindNode(const char *path, bool createIfMissing) { break; // last path entry } - +#if (DEBUG_EFI & 2) _EFI_DEBUG_DUMP("Node '%s'\n", nameBuf); +#endif for (child = node->children; child != 0; child = child->next) { +#if (DEBUG_EFI & 2) _EFI_DEBUG_DUMP("Child 0x%x\n", child); - +#endif if (strcmp(DT__GetName(child), nameBuf) == 0) { break; @@ -451,7 +478,9 @@ Node * DT__FindNode(const char *path, bool createIfMissing) if (child == 0 && createIfMissing) { +#if (DEBUG_EFI & 2) _EFI_DEBUG_DUMP("Creating node\n"); +#endif char *str = malloc(strlen(nameBuf) + 1); // XXX this will leak From 40bb5656888e616ac44043a846437c3884c0d004 Mon Sep 17 00:00:00 2001 From: Pike Date: Tue, 30 Oct 2012 12:31:54 +0100 Subject: [PATCH 057/136] Patch for RevoBoot v1.5.30 --- i386/libsaio/acpi/patcher.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/i386/libsaio/acpi/patcher.h b/i386/libsaio/acpi/patcher.h index cf760a0..50f6113 100644 --- a/i386/libsaio/acpi/patcher.h +++ b/i386/libsaio/acpi/patcher.h @@ -13,7 +13,6 @@ extern ACPI_RSDP * getACPIBaseAddress(); - #if PATCH_ACPI_TABLE_DATA #if AUTOMATIC_SSDT_PR_CREATION @@ -21,7 +20,7 @@ extern ACPI_RSDP * getACPIBaseAddress(); #endif -#if LOAD_EXTRA_ACPI_TABLES && (LOAD_DSDT_TABLE_FROM_EXTRA_ACPI || LOAD_SSDT_TABLE_FROM_EXTRA_ACPI) +#if (LOAD_EXTRA_ACPI_TABLES && (LOAD_DSDT_TABLE_FROM_EXTRA_ACPI || LOAD_SSDT_TABLE_FROM_EXTRA_ACPI)) //============================================================================== extern long loadBinaryData(char *aFilePath, void **aMemoryAddress); From c55291cd9741f67e297ddf80236fff80f2da77fd Mon Sep 17 00:00:00 2001 From: Pike Date: Tue, 30 Oct 2012 12:33:17 +0100 Subject: [PATCH 058/136] Patch for RevoBoot v1.5.30 --- i386/libsaio/efi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/i386/libsaio/efi.c b/i386/libsaio/efi.c index 720c054..109511d 100755 --- a/i386/libsaio/efi.c +++ b/i386/libsaio/efi.c @@ -39,6 +39,7 @@ #include "efi/fake_efi.h" + //============================================================================== void initEFITree(void) @@ -47,7 +48,7 @@ void initEFITree(void) static char ACPI[] = "ACPI"; - // The required information should be added to private_data.h + // The information from RevoBoot/i386/libsaio/SMBIOS/model_data.h is used here. static EFI_CHAR16 const MODEL_NAME[] = EFI_MODEL_NAME; static EFI_CHAR16 const SYSTEM_SERIAL_NUMBER[] = STATIC_SYSTEM_SERIAL_NUMBER; From 19e721fa9d974a5ca348aa2cbf2cf30d4b71317c Mon Sep 17 00:00:00 2001 From: Pike Date: Tue, 30 Oct 2012 12:38:45 +0100 Subject: [PATCH 059/136] Preparations for RevoBoot v1.5.30 --- CHANGES | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGES b/CHANGES index a9e4902..7c1ce7b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,12 @@ +RevoBoot v1.5.30 +================ +- Move/update /Extra/ data reading to RevoBoot/i386/libsaio/load.c (PikerAlpha, October 2012). +- Option to read /Extra/EFI/[MacModelNN.bin] when static EFI data is used (PikerAlpha, October 2012). +- Option to read /Extra/EFI/[MacModelNN.bin] when static SMBIOS data is used (PikerAlpha, October 2012). +- Makefile changes for above features(PikerAlpha, October 2012). +- VERSION updated to v1.5.30 (SMBIOS changes = WORK IN PROGRESS) + + RevoBoot v1.5.25 ================ - RevoBoot/i386/config/data.h is no longer included with (PikerAlpha, October 2012). From 590d71b9cd5d7b5b257b3d6884ecf699560aa70d Mon Sep 17 00:00:00 2001 From: Pike Date: Tue, 30 Oct 2012 13:21:44 +0100 Subject: [PATCH 060/136] Patch for RevoBoot v1.5.30 --- i386/libsaio/smbios.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/i386/libsaio/smbios.c b/i386/libsaio/smbios.c index 4b9b051..d99bb64 100755 --- a/i386/libsaio/smbios.c +++ b/i386/libsaio/smbios.c @@ -1,16 +1,16 @@ /* * Copyright (c) 2009 by Master Chief. - * Dynamic and static SMBIOS data gathering added by DHP in 2010. - * Refactorized by DHP in 2011. + * + * Updates: + * + * - Dynamic and static SMBIOS data gathering added by DHP in 2010. + * - Refactorized by DHP in 2011. + * - Get static EFI data (optional) from /Extra/EFI/[MacModelNN].bin (PikerAlpha, October 2012). */ #include "platform.h" #if USE_STATIC_SMBIOS_DATA - -#include "smbios/static_data.h" - - //============================================================================== void setupSMBIOS(void) @@ -19,15 +19,13 @@ void setupSMBIOS(void) // Allocate 1 page of kernel memory (sufficient for a stripped SMBIOS table). void * kernelMemory = (void *)AllocateKernelMemory(4096); - + // Setup a new Entry Point Structure at the beginning of the newly allocated memory page. struct SMBEntryPoint * newEPS = (struct SMBEntryPoint *) kernelMemory; - int tableLength = sizeof(SMBIOS_Table); + // Include additional/conditional code snippet. + #include "smbios/static_data.h" - // Copy the static SMBIOS data into the newly allocated memory page. Right after the new EPS. - memcpy((kernelMemory + sizeof(* newEPS)), SMBIOS_Table, tableLength); - newEPS->anchor[0] = 0x5f; // _ newEPS->anchor[1] = 0x53; // S newEPS->anchor[2] = 0x4d; // M @@ -69,9 +67,8 @@ void setupSMBIOS(void) _SMBIOS_DEBUG_DUMP("New SMBIOS replacement setup.\n"); _SMBIOS_DEBUG_SLEEP(5); } - #else #include "smbios/dynamic_data.h" -#endif \ No newline at end of file +#endif // #if USE_STATIC_SMBIOS_DATA From ba22e0241e8e073777604ae908265129e43401aa Mon Sep 17 00:00:00 2001 From: Pike Date: Tue, 30 Oct 2012 13:23:10 +0100 Subject: [PATCH 061/136] Patch for RevoBoot v1.5.30 --- i386/libsaio/smbios/static_data.h | 40 ++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/i386/libsaio/smbios/static_data.h b/i386/libsaio/smbios/static_data.h index eccaefb..9d10db0 100755 --- a/i386/libsaio/smbios/static_data.h +++ b/i386/libsaio/smbios/static_data.h @@ -4,6 +4,7 @@ * Updates: * - Dynamic and static SMBIOS data gathering added by DHP in 2010. * - New path for static EFI data (PikerAlpha, October 2012). + * - Optionally check /Extra/SMBIOS/[MacModelNN.bin] for static SMBIOS data (PikerAlpha, October 2012). * * Credits: * - blackosx, DB1, dgsga, FKA, humph, scrax and STLVNUB (testers). @@ -14,12 +15,39 @@ #include "essentials.h" -// The STRING (macro) is defined in RevoBoot/i386/config/settings.h -#include STRING(SMBIOS_DATA_FILE) +#if LOAD_STATIC_SMBIOS_DATA_FROM_EXTRA -static uint32_t SMBIOS_Table[] = -{ - STATIC_SMBIOS_DATA // Will get replaced with the data from: config/smbios/data.h -}; + #define STATIC_SMBIOS_DMI_STRUCTURE_COUNT 0 + #define STATIC_SMBIOS_SM_MAX_STRUCTURE_SIZE 0 + + extern long loadBinaryData(char *aFilePath, void **aMemoryAddress); + + int tableLength = 0; + char dirSpec[32] = ""; + sprintf(dirSpec, "/Extra/SMBIOS/%s", STRING(STATIC_DATA_FILENAME)); + + void * staticSMBIOSData = (void *)kLoadAddr; + + _SMBIOS_DEBUG_DUMP("Loading: %s\n", dirSpec); + + long fileSize = loadBinaryData(dirSpec, &staticSMBIOSData); + + if (fileSize) + { + tableLength = (int)fileSize; + + memcpy((kernelMemory + sizeof(* newEPS)), staticSMBIOSData, tableLength); + } +#else + // The STRING (macro) is defined in RevoBoot/i386/config/settings.h + #include STRING(SMBIOS_DATA_FILE) + + static uint32_t SMBIOS_Table[] = + { + STATIC_SMBIOS_DATA // Replaced with data from: RevoBoot/i386/config/SMBIOS/[default/MacModelNN].h + }; + + int tableLength = sizeof(SMBIOS_Table); +#endif #endif /* !__LIBSAIO_SMBIOS_STATIC_DATA_H */ From 8d7298e401d3f0a96c616b6f1b467365c60fe25f Mon Sep 17 00:00:00 2001 From: Pike Date: Tue, 30 Oct 2012 13:23:37 +0100 Subject: [PATCH 062/136] Updating version info for RevoBoot v1.5.30 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 32461d5..4578c8a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.25 +1.5.30 From 356b34d788edcd4e835d51f49b26b7cf4df6c73a Mon Sep 17 00:00:00 2001 From: Pike Date: Tue, 30 Oct 2012 13:24:59 +0100 Subject: [PATCH 063/136] Updating version info for RevoBoot v1.5.30 --- CHANGES | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 7c1ce7b..3894662 100644 --- a/CHANGES +++ b/CHANGES @@ -2,9 +2,9 @@ RevoBoot v1.5.30 ================ - Move/update /Extra/ data reading to RevoBoot/i386/libsaio/load.c (PikerAlpha, October 2012). - Option to read /Extra/EFI/[MacModelNN.bin] when static EFI data is used (PikerAlpha, October 2012). -- Option to read /Extra/EFI/[MacModelNN.bin] when static SMBIOS data is used (PikerAlpha, October 2012). +- Option to read /Extra/SMBIOS/[MacModelNN.bin] when static SMBIOS data is used (PikerAlpha, October 2012). - Makefile changes for above features(PikerAlpha, October 2012). -- VERSION updated to v1.5.30 (SMBIOS changes = WORK IN PROGRESS) +- VERSION updated to v1.5.30 RevoBoot v1.5.25 From 84fe56a40e16afa7b70aeccb3011c4c6d694a64d Mon Sep 17 00:00:00 2001 From: Pike Date: Tue, 30 Oct 2012 13:29:11 +0100 Subject: [PATCH 064/136] Patch for RevoBoot v1.5.30 --- i386/config/settings-template.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/i386/config/settings-template.h b/i386/config/settings-template.h index 966bcbc..7fab6ba 100644 --- a/i386/config/settings-template.h +++ b/i386/config/settings-template.h @@ -16,6 +16,8 @@ * - OVERRIDE_DYNAMIC_PRODUCT_DETECTION removed/no longer supported (PikerAlpha, October 2012). * - INTEL_CORE_TECHNOLOGY per default set to 1 (PikerAlpha, October 2012). * - INJECT_EFI_DEVICE_PROPERTIES per default set to 1 (PikerAlpha, October 2012). + * - USE_STATIC_EFI_DATA added (PikerAlpha, October 2012). + * - USE_STATIC_SMBIOS_DATA added (PikerAlpha, October 2012). * */ @@ -273,6 +275,9 @@ #define INJECT_EFI_DEVICE_PROPERTIES 0 // Set to 0 by default. Change this to 1 when you need to inject 'device-properties'. // // Note: Required when not setting device-properties from your DSDT/SSDT. +#if INJECT_EFI_DEVICE_PROPERTIES + #define LOAD_STATIC_EFI_DATA_FROM_EXTRA 1 // Set to 0 by default. Change this to 1 to load: /Extra/EFI/[MacModelNN].bin +#endif #define EFI_64_BIT 1 // Set to 1 by default for EFI64 on 64-bit platforms. Supporting both // 32 and 64-bit boot modes (using arch=i386/x86_64 under Kernel Flags). @@ -330,6 +335,10 @@ #undef USE_STATIC_CPU_DATA // Prevent boot failures due to wrong settings (until I figured out what we are missing). #endif +#if USE_STATIC_SMBIOS_DATA + #define LOAD_STATIC_SMBIOS_DATA_FROM_EXTRA 0 // Set to 0 by default. Change this to 1 to load: /Extra/SMBIOS/[MacModelNN].bin +#endif + #define OVERRIDE_DYNAMIC_MEMORY_DETECTION 0 // Set to 0 by default. Change this to 0 only when your SMBIOS data (type 17) is correct, or when // you want/need to override some/all of the SMBIOS data. // From 0b0aad850b93a80771c57f14a3e84fd13f57a948 Mon Sep 17 00:00:00 2001 From: Pike Date: Tue, 30 Oct 2012 23:38:49 +0100 Subject: [PATCH 065/136] Updating version info for RevoBoot v1.5.31 --- CHANGES | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGES b/CHANGES index 3894662..8310316 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,11 @@ +RevoBoot v1.5.31 +================ +- STATIC_SYSTEM_SERIAL_NUMBER renamed to EFI_SYSTEM_SERIAL_NUMBER (PikerAlpha, October 2012). +- Restored lost STATIC_SMSERIALNUMBER in setings-template.h (PikerAlpha, October 2012). +- STATIC_SMSERIALNUMBER renamed to SMB_SYSTEM_SERIAL_NUMBER (PikerAlpha, October 2012). +- VERSION updated to v1.5.31 + + RevoBoot v1.5.30 ================ - Move/update /Extra/ data reading to RevoBoot/i386/libsaio/load.c (PikerAlpha, October 2012). From 29daa6f798d8aedfe0f10259eae275af71caea13 Mon Sep 17 00:00:00 2001 From: Pike Date: Tue, 30 Oct 2012 23:39:24 +0100 Subject: [PATCH 066/136] Updating version info for RevoBoot v1.5.31 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 4578c8a..3b2f552 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.30 +1.5.31 From 823b7524452489d0993bd7e551afcfb459a33aa2 Mon Sep 17 00:00:00 2001 From: Pike Date: Tue, 30 Oct 2012 23:42:33 +0100 Subject: [PATCH 067/136] Bug fix for RevoBoot v1.5.31 --- i386/config/settings-template.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/i386/config/settings-template.h b/i386/config/settings-template.h index 7fab6ba..a94e8a8 100644 --- a/i386/config/settings-template.h +++ b/i386/config/settings-template.h @@ -18,6 +18,9 @@ * - INJECT_EFI_DEVICE_PROPERTIES per default set to 1 (PikerAlpha, October 2012). * - USE_STATIC_EFI_DATA added (PikerAlpha, October 2012). * - USE_STATIC_SMBIOS_DATA added (PikerAlpha, October 2012). + * - STATIC_SYSTEM_SERIAL_NUMBER renamed to EFI_SYSTEM_SERIAL_NUMBER (PikerAlpha, October 2012). + * - Restored lost STATIC_SMSERIALNUMBER (PikerAlpha, October 2012). + * - STATIC_SMSERIALNUMBER renamed to SMB_SYSTEM_SERIAL_NUMBER (PikerAlpha, October 2012). * */ @@ -288,7 +291,7 @@ // // Note: Do not change this setting, unless you know what you are doing. -#define STATIC_SYSTEM_SERIAL_NUMBER { 'S', 'O', 'M', 'E', 'S', 'R', 'L', 'N', 'U', 'M', 'B', 'R' } // Example only! +#define EFI_SYSTEM_SERIAL_NUMBER { 'S', 'O', 'M', 'E', 'S', 'R', 'L', 'N', 'U', 'M', 'B', 'R' } // Example only! #define STATIC_SYSTEM_ID { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F } // Example only! @@ -357,6 +360,9 @@ // // Note: MACMINI (without _NNN) selects the default model (last one i.e. MACMINI_51). +#define SMB_SYSTEM_SERIAL_NUMBER "SOMESRLNUMBR" // Example only! + // Note: Match this with EFI_SYSTEM_SERIAL_NUMBER + #if (TARGET_MODEL & MACPRO) #define SMB_BOARD_SERIAL_NUMBER "SOMESRLNUMBR" // Example only! #endif From d94c42eb4a51a68d840a2bc45d2c44f9fb674a01 Mon Sep 17 00:00:00 2001 From: Pike Date: Tue, 30 Oct 2012 23:44:49 +0100 Subject: [PATCH 068/136] Bug fix for RevoBoot v1.5.31 --- i386/libsaio/efi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/i386/libsaio/efi.c b/i386/libsaio/efi.c index 109511d..561e7ab 100755 --- a/i386/libsaio/efi.c +++ b/i386/libsaio/efi.c @@ -33,6 +33,7 @@ * - Now no longer includes platform.h (PikerAlpha, October 2012). * - Data selector moved over from RevoBoot/i386/config/data.h (PikerAlpha, October 2012). * - Get static EFI data (optional) from /Extra/EFI/[MacModelNN].bin (PikerAlpha, October 2012). + * - STATIC_SYSTEM_SERIAL_NUMBER renamed to EFI_SYSTEM_SERIAL_NUMBER (PikerAlpha, October 2012). * */ @@ -50,7 +51,7 @@ void initEFITree(void) // The information from RevoBoot/i386/libsaio/SMBIOS/model_data.h is used here. static EFI_CHAR16 const MODEL_NAME[] = EFI_MODEL_NAME; - static EFI_CHAR16 const SYSTEM_SERIAL_NUMBER[] = STATIC_SYSTEM_SERIAL_NUMBER; + static EFI_CHAR16 const SYSTEM_SERIAL_NUMBER[] = EFI_SYSTEM_SERIAL_NUMBER; DT__Initialize(); // Add and initialize gPlatform.DT.RootNode From e73a4953db6e465801bda7dc82a8443c456b3c52 Mon Sep 17 00:00:00 2001 From: Pike Date: Tue, 30 Oct 2012 23:47:30 +0100 Subject: [PATCH 069/136] Bug fix for RevoBoot v1.5.31 --- i386/libsaio/smbios/dynamic_data.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/i386/libsaio/smbios/dynamic_data.h b/i386/libsaio/smbios/dynamic_data.h index f7c0356..cc92cb1 100755 --- a/i386/libsaio/smbios/dynamic_data.h +++ b/i386/libsaio/smbios/dynamic_data.h @@ -12,6 +12,7 @@ * - SMBProperties changed for speed and simplicity (PikerAlpha, October 2012). * - Calls with SMBProperties.keyString cleaned up (PikerAlpha, October 2012). * - Fixed requiredStructures.start/stop values (PikerAlpha, October 2012). + * - STATIC_SMSERIALNUMBER renamed to SMB_SYSTEM_SERIAL_NUMBER(PikerAlpha, October 2012). * * Credits: * - Kabyl (see notes in source code) @@ -135,7 +136,7 @@ struct SMBProperty SMBProperties[] = { kSMBTypeSystemInformation, 0x04, kSMBString, .plainData = APPLE_INC }, { kSMBTypeSystemInformation, 0x05, kSMBString, .plainData = SMB_PRODUCT_NAME }, { kSMBTypeSystemInformation, 0x06, kSMBString, .plainData = "1.0" }, - { kSMBTypeSystemInformation, 0x07, kSMBString, .plainData = STATIC_SMSERIALNUMBER }, + { kSMBTypeSystemInformation, 0x07, kSMBString, .plainData = SMB_SYSTEM_SERIAL_NUMBER }, { kSMBTypeSystemInformation, 0x1a, kSMBString, .plainData = SMB_FAMILY }, //---------------------------------------------------------------------------------------------------- From 9e2382b61a3e676912edc957244eee78d2240d25 Mon Sep 17 00:00:00 2001 From: Pike Date: Wed, 31 Oct 2012 00:25:35 +0100 Subject: [PATCH 070/136] Changed LOAD_STATIC_EFI_DATA_FROM_EXTRA to the default setting --- i386/config/settings-template.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i386/config/settings-template.h b/i386/config/settings-template.h index a94e8a8..3a1c125 100644 --- a/i386/config/settings-template.h +++ b/i386/config/settings-template.h @@ -279,7 +279,7 @@ // // Note: Required when not setting device-properties from your DSDT/SSDT. #if INJECT_EFI_DEVICE_PROPERTIES - #define LOAD_STATIC_EFI_DATA_FROM_EXTRA 1 // Set to 0 by default. Change this to 1 to load: /Extra/EFI/[MacModelNN].bin + #define LOAD_STATIC_EFI_DATA_FROM_EXTRA 0 // Set to 0 by default. Change this to 1 to load: /Extra/EFI/[MacModelNN].bin #endif #define EFI_64_BIT 1 // Set to 1 by default for EFI64 on 64-bit platforms. Supporting both From 42f885b2ae6eb8d7bf8716ea824b83abe519f224 Mon Sep 17 00:00:00 2001 From: Dave Griffin Date: Wed, 31 Oct 2012 20:44:29 +0000 Subject: [PATCH 071/136] Fix settings-template.h for when #define TARGET_MODEL = MACPRO --- i386/config/settings-template.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/i386/config/settings-template.h b/i386/config/settings-template.h index 3a1c125..bfa3555 100644 --- a/i386/config/settings-template.h +++ b/i386/config/settings-template.h @@ -363,9 +363,7 @@ #define SMB_SYSTEM_SERIAL_NUMBER "SOMESRLNUMBR" // Example only! // Note: Match this with EFI_SYSTEM_SERIAL_NUMBER -#if (TARGET_MODEL & MACPRO) - #define SMB_BOARD_SERIAL_NUMBER "SOMESRLNUMBR" // Example only! -#endif +#define SMB_BOARD_SERIAL_NUMBER "SOMESRLNUMBR" // Example only! #define DEBUG_SMBIOS 0 // Set to 0 by default. Change this to 1 when things don't seem to work for you. From ffb2f80ab83dd1d64c4af587f64f11b106eeab0e Mon Sep 17 00:00:00 2001 From: Pike Date: Thu, 1 Nov 2012 12:21:15 +0100 Subject: [PATCH 072/136] Bla bla bla --- README | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/README b/README index 579854f..283faec 100644 --- a/README +++ b/README @@ -1,5 +1,28 @@ -RevoBoot can now be built with Xcode 4.5.1 on Mountain Lion. See change log for instructions. +About this project: +This Open Source hobby project is maintained by Pike and dgsga. Two long time supporters of the RevoBoot project. +Note that we do not tolerate/share any (links to) copyrighted material. We only use purchased software and +we won't share any of it. Just get your copy of OS X in the Apple store. Should be affordable for everyone. + + +Mountain Lion Server: +RevoBoot has been confirmed to work with the Server app for Mountain Lion (12C60). + + +Fusion Drive Support: +Apple's new Fusion Drive* is a software implementation to speedup the load process +for frequently used applications, without limiting the storage capacity in a bad way. +See also: http://support.apple.com/kb/HT5446 + +RevoBoot has not yet been confirmed to work with a Fusion Drive. We however expect it to work flawlessly. + + +Xcode Support for Mountain Lion: +RevoBoot can be build on Snow Leopard, Lion and Mountain Lion. The latter requires +Xcode 4.5.1 and a libcc_kext.a from an older version of Xcode. See change log for instructions. + + +Configuration: Please note that RevoBoot must be configured for your hardware so start reading our WiKi. See also: https://github.com/blackosx/RevoBuilder/wiki/Using-RevoBuilder @@ -11,3 +34,5 @@ https://github.com/RevoGirl/RevoBoot/blob/master/i386/config/README There's also RevoBuilder (a great tool for first starters) over at: https://github.com/blackosx/RevoBuilder/wiki/Using-RevoBuilder + +Note: RevoBuilder is most likeky broken for RevoBoot v.1.5.00 and greater! From 22050d70b2c92892c52163cd1a7ae7165631ca44 Mon Sep 17 00:00:00 2001 From: Pike Date: Fri, 2 Nov 2012 23:45:11 +0100 Subject: [PATCH 073/136] Fusion Drive note updated --- README | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/README b/README index 283faec..1f6ac8c 100644 --- a/README +++ b/README @@ -1,25 +1,22 @@ About this project: This Open Source hobby project is maintained by Pike and dgsga. Two long time supporters of the RevoBoot project. -Note that we do not tolerate/share any (links to) copyrighted material. We only use purchased software and -we won't share any of it. Just get your copy of OS X in the Apple store. Should be affordable for everyone. - +Note that we do not tolerate/share any (links to) copyrighted material. We only use purchased software and we won't share any of it. Just get your copy of OS X in the Apple store. Should be affordable for everyone. Mountain Lion Server: RevoBoot has been confirmed to work with the Server app for Mountain Lion (12C60). - Fusion Drive Support: -Apple's new Fusion Drive* is a software implementation to speedup the load process -for frequently used applications, without limiting the storage capacity in a bad way. +Apple's new Fusion Drive* is a software implementation to speedup the boot and load process for frequently used applications, without limiting the storage capacity in a bad way. See also: http://support.apple.com/kb/HT5446 -RevoBoot has not yet been confirmed to work with a Fusion Drive. We however expect it to work flawlessly. +The new Mac's that come with a Fusion Drive boot from the third (Recovery HD like) partition on the SSD. This partition in 134.2 MB in size and is called "Boot OS X". +The Recovery HD partition can be found as third partition on the HDD. Setting up a Fusion Drive on a Mac needs to be done with Internet Recovery. +RevoBoot detects CoreStorage partitions and will boot from the boot helper partition on the SDD. Xcode Support for Mountain Lion: -RevoBoot can be build on Snow Leopard, Lion and Mountain Lion. The latter requires -Xcode 4.5.1 and a libcc_kext.a from an older version of Xcode. See change log for instructions. +RevoBoot can be build on Snow Leopard, Lion and Mountain Lion. The latter requires Xcode 4.5.1 and a libcc_kext.a from an older version of Xcode. See change log for instructions. Configuration: From 652aca3c12db62c9fc17abad74f9d8e785d14c80 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 12:31:34 +0100 Subject: [PATCH 074/136] Typo --- README | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README b/README index 1f6ac8c..9da40cd 100644 --- a/README +++ b/README @@ -7,11 +7,10 @@ Mountain Lion Server: RevoBoot has been confirmed to work with the Server app for Mountain Lion (12C60). Fusion Drive Support: -Apple's new Fusion Drive* is a software implementation to speedup the boot and load process for frequently used applications, without limiting the storage capacity in a bad way. -See also: http://support.apple.com/kb/HT5446 +Apple's new Fusion Drive* is a software implementation to speedup the boot and load process for frequently used applications, without limiting the storage capacity in a bad way. See also: http://support.apple.com/kb/HT5446 -The new Mac's that come with a Fusion Drive boot from the third (Recovery HD like) partition on the SSD. This partition in 134.2 MB in size and is called "Boot OS X". -The Recovery HD partition can be found as third partition on the HDD. Setting up a Fusion Drive on a Mac needs to be done with Internet Recovery. +The new Mac's that come with a Fusion Drive boot from the third (Recovery HD like) partition on the SSD. This partition is 134.2 MB in size and is called "Boot OS X". +The Recovery HD partition can be found as third partition on the HDD. Setting up a Fusion Drive on a Mac need to be done with Internet Recovery. RevoBoot detects CoreStorage partitions and will boot from the boot helper partition on the SDD. From 6839bf37b5013cc0e72535c6a573d8a5b42c5af9 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 12:51:15 +0100 Subject: [PATCH 075/136] Fusion Drive cleanups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change was originally scheduled for RevoBoot v1.5.50 but is now pushed forward and already part of v1.5.32, simply because people are starting to experiment with Apple's Fusion Drive. --- i386/libsaio/disk.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/i386/libsaio/disk.c b/i386/libsaio/disk.c index 8ba0d5c..4ab3e3e 100644 --- a/i386/libsaio/disk.c +++ b/i386/libsaio/disk.c @@ -49,9 +49,13 @@ GPT support added by David Elliott. Based on IOGUIDPartitionScheme.cpp. */ -/*** - * Cleanups and refactoring by DHP in 2010 and 2011. - */ +/* + * Updates: + * - Cleanups and refactoring by DHP in 2010 and 2011. + * - Renamed LION_RECOVERY_SUPPORT to CORE_STARAGE_SUPPORT (PikerAlpha, November 2012). + * - Renamed LION_FILEVAULT_SUPPORT to CORE_STARAGE_SUPPORT (PikerAlpha, November 2012). + * - Renamed encryptedBootPartition to coreStoragePartition (PikerAlpha, November 2012). + */ #include "bootstruct.h" @@ -117,7 +121,7 @@ static struct disk_blk0 * gBootSector = NULL; // Apple_HFS EFI_GUID const GPT_HFS_GUID = { 0x48465300, 0x0000, 0x11AA, { 0xAA, 0x11, 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC } }; -#if LION_RECOVERY_SUPPORT || APPLE_RAID_SUPPORT +#if CORE_STORAGE_SUPPORT || APPLE_RAID_SUPPORT // Apple_Boot (RAID helper partition and the 650 MB 'Recovery HD' partition). EFI_GUID const GPT_BOOT_GUID = { 0x426F6F74, 0x0000, 0x11AA, { 0xAA, 0x11, 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC } }; #endif @@ -140,8 +144,8 @@ EFI_GUID const GPT_HFS_GUID = { 0x48465300, 0x0000, 0x11AA, { 0xAA, 0x11, 0x EFI_GUID const GPT_EFISYS_GUID = { 0xC12A7328, 0xF81F, 0x11D2, { 0xBA, 0x4B, 0x00, 0xA0, 0xC9, 0x3E, 0xC9, 0x3B } }; #endif -#if LION_FILEVAULT_SUPPORT - // Apple_CoreStorage (FileVault 2) +#if CORE_STORAGE_SUPPORT + // Apple_CoreStorage (FileVault 2 and Fusion Drive) EFI_GUID const GPT_CORESTORAGE_GUID = { 0x53746F72, 0x6167, 0x11AA, { 0xAA, 0x11, 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC } }; #endif @@ -560,8 +564,8 @@ BVRef diskScanGPTBootVolumes(int biosdev, int * countPtr) map->next = gDiskBVMap; gDiskBVMap = map; -#if LION_FILEVAULT_SUPPORT - bool encryptedBootPartition = false; +#if CORE_STORAGE_SUPPORT + bool codeStoragePartition = false; #endif for (; gptID <= gptCount; gptID++) @@ -615,16 +619,16 @@ BVRef diskScanGPTBootVolumes(int biosdev, int * countPtr) else #endif -#if LION_FILEVAULT_SUPPORT // Is this an encrypted boot partition? +#if CORE_STORAGE_SUPPORT // Is this a CoreStorage partition? if (efi_guid_compare(&GPT_CORESTORAGE_GUID, (EFI_GUID const *)gptMap->ent_type) == 0) { _DISK_DEBUG_DUMP("Matched: CoreStorage GUID\n"); - encryptedBootPartition = true; + coreStoragePartition = true; continue; // Start searching for the Recovery HD partition. } - else if (!encryptedBootPartition && + else if (!coreStoragePartition && #else // Check for HFS+ partitions. if ( @@ -644,7 +648,7 @@ BVRef diskScanGPTBootVolumes(int biosdev, int * countPtr) } #endif -#if LION_RECOVERY_SUPPORT || APPLE_RAID_SUPPORT +#if CORE_STORAGE_SUPPORT || APPLE_RAID_SUPPORT else if (efi_guid_compare(&GPT_BOOT_GUID, (EFI_GUID const *)gptMap->ent_type) == 0) { _DISK_DEBUG_DUMP("Matched: GPT_BOOT_GUID\n"); From 5271e5f03914f740d1e4a3b9594287e20b465d1a Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 13:30:12 +0100 Subject: [PATCH 076/136] Fusion Drive cleanups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change was originally scheduled for RevoBoot v1.5.50 but is now  pushed forward and already part of v1.5.32, simply because people are  starting to experiment with Apple's Fusion Drive --- i386/boot2/boot.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/i386/boot2/boot.c b/i386/boot2/boot.c index 71ccc49..90302c4 100755 --- a/i386/boot2/boot.c +++ b/i386/boot2/boot.c @@ -47,7 +47,9 @@ */ /* - * Refactorized by DHP in 2010 and 2011. + * Updates: + * - Refactorized by DHP in 2010 and 2011. + * - Optionally include Recovery HD support code (PikerAlpha, November 2012). */ @@ -193,6 +195,7 @@ void boot(int biosdev) showBootLogo(); #endif +#if LION_RECOVERY_SUPPORT // A bit ugly maybe, but this will be changed sometime soon. while (readKeyboardStatus()) { @@ -203,6 +206,7 @@ void boot(int biosdev) gPlatform.BootRecoveryHD = true; } } +#endif #if (LOAD_STATIC_EFI_DATA_FROM_EXTRA == 0) /* From 59326fb922dd10d56b5593e857bcab8091efe27f Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 13:30:48 +0100 Subject: [PATCH 077/136] Updating version info for RevoBoot v1.5.32 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 3b2f552..6062bd9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.31 +1.5.32 From 08a77be51bc446de73b6a7e7dba5d742dad64154 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 13:36:24 +0100 Subject: [PATCH 078/136] Updating for RevoBoot v1.5.32 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Parts of this change was originally scheduled for RevoBoot v1.5.50 but is now  pushed forward and already part of v1.5.32, simply because people are  starting to experiment with Apple's Fusion Drive --- CHANGES | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGES b/CHANGES index 8310316..914769c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,13 @@ +RevoBoot v1.5.32 +================ +- Optionally include Recovery HD support code in boot.c (PikerAlpha, October 2012). +- Renamed LION_RECOVERY_SUPPORT to CORE_STARAGE_SUPPORT in disk.c (PikerAlpha, October 2012). +- Renamed LION_FILEVAULT_SUPPORT to CORE_STARAGE_SUPPORT in disk.c (PikerAlpha, November 2012). +- Renamed encryptedBootPartition to coreStoragePartition in disk.c (PikerAlpha, October 2012). +- Cleaned up settings-template.h (PikerAlpha, October 2012). +- VERSION updated to v1.5.32 + + RevoBoot v1.5.31 ================ - STATIC_SYSTEM_SERIAL_NUMBER renamed to EFI_SYSTEM_SERIAL_NUMBER (PikerAlpha, October 2012). From 9b0e500a7717cc1b7a538b1d930b398e5a994975 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 13:41:17 +0100 Subject: [PATCH 079/136] Cleanups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change was originally scheduled for RevoBoot v1.5.50 but is now  pushed forward and already part of v1.5.32, simply because people are  starting to experiment with Apple's Fusion Drive --- i386/config/settings-template.h | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/i386/config/settings-template.h b/i386/config/settings-template.h index bfa3555..114bfb8 100644 --- a/i386/config/settings-template.h +++ b/i386/config/settings-template.h @@ -197,6 +197,9 @@ #define SAFE_MALLOC 0 // Set to 0 by default. Change this to 1 when booting halts with a memory allocation error. +#define LION_RECOVERY_SUPPORT 0 // Set to 0 by default. Change this to 1 to make RevoBoot search for the 'Recovery HD' + // partition and, when available, boot from it. + #define DEBUG_BOOT 0 // Set to 0 by default. Change this to 1 when things don't seem to work for you. @@ -256,8 +259,13 @@ #define LEGACY_BIOS_READ_SUPPORT 0 // Set to 0 by default. Change this to 1 for crappy old BIOSes. -#define LION_FILEVAULT_SUPPORT 0 // Set to 0 by default. Setting this to 1 will make RevoBoot skip encrypted boot partitions - // and boot from the Recovery HD partition instead (when available). +#if LION_RECOVERY_SUPPORT + #define CORE_STORAGE_SUPPORT 1 // Set to 0 by default since booting from a 'Recovery HD' partition may requires us to skip + // (encrypted) CoreStorage partitions. +#else + #define CORE_STORAGE_SUPPORT 0 // Set to 0 by default. Change this to 1 when you want RevoBoot to boot from the 'Boot OS X' + // (usually the third) partition on a Fusion Drive (requires Mountain Lion 10.8.2). +#endif #define APPLE_RAID_SUPPORT 0 // Set to 0 by default. Change this to 1 for Apple Software RAID support. @@ -314,17 +322,7 @@ #define DEBUG_BOOT_GRAPHICS 0 // Set to 0 by default. Use 1 when to see debug info. -//------------------------------------------------------------ STRINGDATA.H ---------------------------------------------------------------- - -#define LION_FILEVAULT_SUPPORT 0 // Set to 0 by default. Setting this to 1 will make RevoBoot skip encrypted boot partitions - // and boot from the Recovery HD partition instead (when available). - -#if LION_FILEVAULT_SUPPORT - #define LION_RECOVERY_SUPPORT 1 // Make RevoBoot search for the Recovery HD partition and boot from it (when available). -#else - #define LION_RECOVERY_SUPPORT 0 // Set to 0 by default. Setting this to 1 will make RevoBoot search for the Recovery HD and - // try to boot from it, when it is properly setup and modified for RevoBoot. -#endif +//------------------------------------------------------------ STRINGTABLE.H ---------------------------------------------------------------- #define LION_INSTALL_SUPPORT 0 // Set to 0 by default. Setting this to 1 will make RevoBoot search in specific directories // for com.apple.Boot.plist – required for Mac like Lion OS X installations. From f43a90d9b94f22c72d3d206e2805de6be761c836 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 14:11:50 +0100 Subject: [PATCH 080/136] Fix compilation error for plain ./r --- r | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/r b/r index 73954b6..530f117 100755 --- a/r +++ b/r @@ -20,9 +20,9 @@ if [[ "$1" =~ [iMac|Mac] ]]; make MODEL=`cat MODEL` > out.log else # - # No default model found. + # No default model found. Use the default (matches settings-template.h) # - make > out.log + make MODEL=Macmini > out.log fi; fi From d4827d6d871ec7c9dfab408a00814e56437211f4 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 14:30:43 +0100 Subject: [PATCH 081/136] Typos --- i386/libsaio/disk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/i386/libsaio/disk.c b/i386/libsaio/disk.c index 4ab3e3e..585774c 100644 --- a/i386/libsaio/disk.c +++ b/i386/libsaio/disk.c @@ -565,7 +565,7 @@ BVRef diskScanGPTBootVolumes(int biosdev, int * countPtr) gDiskBVMap = map; #if CORE_STORAGE_SUPPORT - bool codeStoragePartition = false; + bool coreStoragePartition = false; #endif for (; gptID <= gptCount; gptID++) @@ -619,14 +619,14 @@ BVRef diskScanGPTBootVolumes(int biosdev, int * countPtr) else #endif -#if CORE_STORAGE_SUPPORT // Is this a CoreStorage partition? +#if CORE_STORAGE_SUPPORT // Is this a CoreStorage partition? if (efi_guid_compare(&GPT_CORESTORAGE_GUID, (EFI_GUID const *)gptMap->ent_type) == 0) { _DISK_DEBUG_DUMP("Matched: CoreStorage GUID\n"); coreStoragePartition = true; - continue; // Start searching for the Recovery HD partition. + continue; // Start searching for the Recovery HD/Boot OS X partition. } else if (!coreStoragePartition && #else From e15243ed2643ca9968f000e11fb814cf057bc936 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 14:40:30 +0100 Subject: [PATCH 082/136] Removed a debug printf() --- i386/libsaio/load.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/i386/libsaio/load.c b/i386/libsaio/load.c index 51e8cf1..2b89f0e 100755 --- a/i386/libsaio/load.c +++ b/i386/libsaio/load.c @@ -439,8 +439,6 @@ long loadBinaryData(char *aFilePath, void **aMemoryAddress) { long fileSize = LoadFile(aFilePath); - printf("fileSize is: %ld", fileSize); - if (fileSize > 0) { *aMemoryAddress = (void *)malloc(fileSize); From 9863ee6f6ab4912ffc439cb2b1778346bb024ac2 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 16:02:26 +0100 Subject: [PATCH 083/136] Fix for static SMBIOS bug for RevoBoot v1.5.33 --- i386/libsaio/smbios/static_data.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/i386/libsaio/smbios/static_data.h b/i386/libsaio/smbios/static_data.h index 9d10db0..a26a48b 100755 --- a/i386/libsaio/smbios/static_data.h +++ b/i386/libsaio/smbios/static_data.h @@ -5,6 +5,7 @@ * - Dynamic and static SMBIOS data gathering added by DHP in 2010. * - New path for static EFI data (PikerAlpha, October 2012). * - Optionally check /Extra/SMBIOS/[MacModelNN.bin] for static SMBIOS data (PikerAlpha, October 2012). + * - Oops. Restoring lost lines (PikerAlpha, November 2012). * * Credits: * - blackosx, DB1, dgsga, FKA, humph, scrax and STLVNUB (testers). @@ -48,6 +49,9 @@ }; int tableLength = sizeof(SMBIOS_Table); + + // Copy the static SMBIOS data into the newly allocated memory page. Right after the new EPS. + memcpy((kernelMemory + sizeof(* newEPS)), SMBIOS_Table, tableLength); #endif #endif /* !__LIBSAIO_SMBIOS_STATIC_DATA_H */ From b0785fde486443ff3f53c47b340e583f4bd4f541 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 16:03:12 +0100 Subject: [PATCH 084/136] Updating version info for RevoBoot v1.5.33 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 6062bd9..a26e0a8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.32 +1.5.33 From 31fe24fe3c9a0107d0b00e41ac0955d78b4a3850 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 16:05:07 +0100 Subject: [PATCH 085/136] Update to RevoBoot v1.5.33 --- CHANGES | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 914769c..008d1cf 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +RevoBoot v1.5.33 +================ +- Restored lost lines in RevoBoot/i386/libsaio/SMBIOS/static_data.h (PikerAlpha, November 2012). + + RevoBoot v1.5.32 ================ - Optionally include Recovery HD support code in boot.c (PikerAlpha, October 2012). From bb4c68fdb6256ac9d8a63c90f4729e1366e0a5d3 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 18:49:04 +0100 Subject: [PATCH 086/136] Patch for RevoBoot v1.5.34 --- i386/boot2/boot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/i386/boot2/boot.c b/i386/boot2/boot.c index 90302c4..47d7524 100755 --- a/i386/boot2/boot.c +++ b/i386/boot2/boot.c @@ -46,7 +46,7 @@ * Reworked again by Curtis Galloway (galloway@NeXT.com) */ -/* +/* * Updates: * - Refactorized by DHP in 2010 and 2011. * - Optionally include Recovery HD support code (PikerAlpha, November 2012). @@ -208,7 +208,7 @@ void boot(int biosdev) } #endif -#if (LOAD_STATIC_EFI_DATA_FROM_EXTRA == 0) +#if (LOAD_MODEL_SPECIFIC_EFI_DATA == 0) /* * We can only make this call here when static EFI is included from * RevoBoot/i386/config/EFI/[MacModelNN.h] Not when the data is read From 1f9ac1685c75b709f6f4d85dc7a4a089e5ebbe9a Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 18:50:31 +0100 Subject: [PATCH 087/136] Patch for RevoBoot v1.5.34 --- i386/libsa/libsa.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/i386/libsa/libsa.h b/i386/libsa/libsa.h index 14d3ef8..7cba5a5 100755 --- a/i386/libsa/libsa.h +++ b/i386/libsa/libsa.h @@ -73,16 +73,8 @@ extern char * strdup(const char *s1); extern int strncasecmp(const char * s1, const char * s2, size_t n); #endif -extern uint8_t checksum8( void * start, unsigned int length ); - -#if CHAMELEON - /* - * error.c - */ - - extern int errno; - extern char * strerror(int errnum); -#endif +extern uint8_t checksum8( void * start, unsigned int length); +char * removeChar(char *aSourceString, char aTargetChar); /* * strtol.c From 3280cf8e482fe21f18054e487c449756bb725771 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 18:51:38 +0100 Subject: [PATCH 088/136] Patch for RevoBoot v1.5.34 --- i386/libsa/string.c | 88 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 86 insertions(+), 2 deletions(-) diff --git a/i386/libsa/string.c b/i386/libsa/string.c index 6919fe9..2e58d88 100755 --- a/i386/libsa/string.c +++ b/i386/libsa/string.c @@ -25,6 +25,9 @@ #include "libsa.h" + +//========================================================================== + void * memset(void * dst, int val, size_t len) { asm volatile ( "rep; stosb" @@ -36,6 +39,8 @@ void * memset(void * dst, int val, size_t len) } #if 0 +//========================================================================== + void * memcpy(void * dst, const void * src, size_t len) { asm volatile ( "rep; movsb" @@ -46,17 +51,25 @@ void * memcpy(void * dst, const void * src, size_t len) return dst; } + +//========================================================================== + void bcopy(const void * src, void * dst, size_t len) { memcpy(dst, src, len); } + +//========================================================================== + void bzero(void * dst, size_t len) { memset(dst, 0, len); } #else +//========================================================================== + void * memcpy(void * dst, const void * src, size_t len) { asm volatile ( "cld \n\t" @@ -73,6 +86,9 @@ void * memcpy(void * dst, const void * src, size_t len) return dst; } + +//========================================================================== + void bcopy(const void * src, void * dst, size_t len) { asm volatile ( "cld \n\t" @@ -87,6 +103,9 @@ void bcopy(const void * src, void * dst, size_t len) : "memory", "%edx" ); } + +//========================================================================== + void bzero(void * dst, size_t len) { asm volatile ( "xorl %%eax, %%eax \n\t" @@ -104,20 +123,23 @@ void bzero(void * dst, size_t len) #endif /* #if DONT_USE_GCC_BUILT_IN_STRLEN */ - #define tolower(c) ((int)((c) & ~0x20)) #define toupper(c) ((int)((c) | 0x20)) +//========================================================================== + int strlen(const char * s) { int n = 0; while (*s++) n++; return(n); } - /*#endif*/ + +//========================================================================== /* NOTE: Moved from ntfs.c */ + int memcmp(const void *p1, const void *p2, int len) { while (len--) { @@ -127,6 +149,9 @@ int memcmp(const void *p1, const void *p2, int len) return 0; } + +//========================================================================== + int strcmp(const char * s1, const char * s2) { while (*s1 && (*s1 == *s2)) { @@ -136,6 +161,9 @@ int strcmp(const char * s1, const char * s2) return (*s1 - *s2); } + +//========================================================================== + int strncmp(const char * s1, const char * s2, size_t len) { register int n = len; @@ -145,6 +173,9 @@ int strncmp(const char * s1, const char * s2, size_t len) return(n<0 ? 0 : *s1 - *--s2); } + +//========================================================================== + char * strcpy(char * s1, const char * s2) { register char *ret = s1; @@ -153,6 +184,9 @@ char * strcpy(char * s1, const char * s2) return ret; } + +//========================================================================== + char * strncpy(char * s1, const char * s2, size_t n) { register char *ret = s1; @@ -161,6 +195,9 @@ char * strncpy(char * s1, const char * s2, size_t n) return ret; } + +//========================================================================== + char * strlcpy(char * s1, const char * s2, size_t n) { register char *ret = s1; @@ -170,6 +207,9 @@ char * strlcpy(char * s1, const char * s2, size_t n) return ret; } + +//========================================================================== + char * strstr(const char *in, const char *str) { char c; @@ -193,6 +233,9 @@ char * strstr(const char *in, const char *str) return (char *) (in - 1); } + +//========================================================================== + int ptol(const char *str) { register int c = *str; @@ -205,6 +248,9 @@ int ptol(const char *str) return c; } + +//========================================================================== + int atoi(const char *str) { register int sum = 0; @@ -217,6 +263,9 @@ int atoi(const char *str) return sum; } + +//========================================================================== + char *strncat(char *s1, const char *s2, size_t n) { register char *ret = s1; @@ -228,17 +277,25 @@ char *strncat(char *s1, const char *s2, size_t n) return ret; } + +//========================================================================== + char *strcat(char *s1, const char *s2) { return(strncat(s1, s2, strlen(s2))); } + +//========================================================================== + char *strdup(const char *s1) { return strcpy(malloc(strlen(s1) + 1), s1); } + #if STRNCASECMP +//========================================================================== int strncasecmp(const char *s1, const char *s2, size_t len) { register int n = len; @@ -249,7 +306,10 @@ int strncasecmp(const char *s1, const char *s2, size_t len) } #endif + +//========================================================================== /* COPYRIGHT NOTICE: checksum8 from AppleSMBIOS */ + uint8_t checksum8( void * start, unsigned int length ) { uint8_t csum = 0; @@ -262,3 +322,27 @@ uint8_t checksum8( void * start, unsigned int length ) return csum; } + +#if LOAD_MODEL_SPECIFIC_STATIC_DATA +//========================================================================== + +char * removeChar(char *aSourceString, char aTargetChar) +{ + char *source = aSourceString; + char *destination = aSourceString; + + for (; *source != '\0'; source++) + { + *destination = *source; + + if (*destination != aTargetChar) + { + destination++; + } + } + + *destination = '\0'; + + return (aSourceString); +} +#endif From bdbc525c8d995919cf176cc76f63b96461f1072d Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 18:53:06 +0100 Subject: [PATCH 089/136] Patch for RevoBoot v1.5.34 --- i386/libsaio/disk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i386/libsaio/disk.c b/i386/libsaio/disk.c index 585774c..6335e14 100644 --- a/i386/libsaio/disk.c +++ b/i386/libsaio/disk.c @@ -619,7 +619,7 @@ BVRef diskScanGPTBootVolumes(int biosdev, int * countPtr) else #endif -#if CORE_STORAGE_SUPPORT // Is this a CoreStorage partition? +#if CORE_STORAGE_SUPPORT // Is this a CoreStorage partition? if (efi_guid_compare(&GPT_CORESTORAGE_GUID, (EFI_GUID const *)gptMap->ent_type) == 0) { _DISK_DEBUG_DUMP("Matched: CoreStorage GUID\n"); From a80f048ea80ae4cc187a78bbc2e2865c2ecc8466 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 18:54:21 +0100 Subject: [PATCH 090/136] Patch for RevoBoot v1.5.34 --- i386/libsaio/efi.c | 57 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 45 insertions(+), 12 deletions(-) diff --git a/i386/libsaio/efi.c b/i386/libsaio/efi.c index 561e7ab..77f7df7 100755 --- a/i386/libsaio/efi.c +++ b/i386/libsaio/efi.c @@ -33,7 +33,7 @@ * - Now no longer includes platform.h (PikerAlpha, October 2012). * - Data selector moved over from RevoBoot/i386/config/data.h (PikerAlpha, October 2012). * - Get static EFI data (optional) from /Extra/EFI/[MacModelNN].bin (PikerAlpha, October 2012). - * - STATIC_SYSTEM_SERIAL_NUMBER renamed to EFI_SYSTEM_SERIAL_NUMBER (PikerAlpha, October 2012). + * - STATIC_SYSTEM_SERIAL_NUMBER renamed to EFI_SYSTEM_SERIAL_NUMBER (PikerAlpha, October 2012). * */ @@ -41,6 +41,26 @@ #include "efi/fake_efi.h" +/* #if LOAD_MODEL_SPECIFIC_EFI_DATA +//============================================================================== + +void useStaticEFIProperties(Node * aEFINode) +{ + // The STRING (macro) is defined in RevoBoot/i386/config/settings.h + #include STRING(EFI_DATA_FILE) + + static EFI_UINT8 const EFI_DEVICE_PROPERTIES[] = + { + // Replaced with data from: RevoBoot/i386/config/EFI/[data-template/MacModelNN].h + STATIC_EFI_DEVICE_PROPERTIES + }; + + DT__AddProperty(aEFINode, "device-properties", sizeof(EFI_DEVICE_PROPERTIES), (EFI_CHAR8*) &EFI_DEVICE_PROPERTIES); + + // _EFI_DEBUG_DUMP("Using statically linked EFI device-properties\n"); +} +#endif */ + //============================================================================== void initEFITree(void) @@ -177,33 +197,46 @@ void initEFITree(void) gPlatform.EFI.Nodes.Chosen = chosenNode; #if INJECT_EFI_DEVICE_PROPERTIES - _EFI_DEBUG_DUMP("Injecting static EFI device-properties [%s]\n", SMB_PRODUCT_NAME); + _EFI_DEBUG_DUMP("Injecting static EFI device-properties\n"); - #if LOAD_STATIC_EFI_DATA_FROM_EXTRA - extern long loadBinaryData(char *aFilePath, void **aMemoryAddress); - + #if LOAD_MODEL_SPECIFIC_EFI_DATA char dirSpec[32] = ""; - sprintf(dirSpec, "/Extra/EFI/%s", STRING(STATIC_DATA_FILENAME)); - - void * staticEFIData = (void *)kLoadAddr; + sprintf(dirSpec, "/Extra/EFI/%s.bin", gPlatform.CommaLessModelID); _EFI_DEBUG_DUMP("Loading: %s\n", dirSpec); + void * staticEFIData = (void *)kLoadAddr; + long fileSize = loadBinaryData(dirSpec, &staticEFIData); - - if (fileSize) + + if (fileSize > 0) { DT__AddProperty(efiNode, "device-properties", fileSize, (EFI_CHAR8*) staticEFIData); } + else // No model specific data found. Use static EFI data from RevoBoot/i386/config/EFI + { + // useStaticEFIProperties(efiNode); + // The STRING (macro) is defined in RevoBoot/i386/config/settings.h + #include STRING(EFI_DATA_FILE) + + static EFI_UINT8 const EFI_DEVICE_PROPERTIES[] = + { + // Replaced with data from: RevoBoot/i386/config/EFI/[data-template/MacModelNN].h + STATIC_EFI_DEVICE_PROPERTIES + }; + + DT__AddProperty(efiNode, "device-properties", sizeof(EFI_DEVICE_PROPERTIES), (EFI_CHAR8*) &EFI_DEVICE_PROPERTIES); + } #else // The STRING (macro) is defined in RevoBoot/i386/config/settings.h #include STRING(EFI_DATA_FILE) - + static EFI_UINT8 const EFI_DEVICE_PROPERTIES[] = { + // Replaced with data from: RevoBoot/i386/config/EFI/[data-template/MacModelNN].h STATIC_EFI_DEVICE_PROPERTIES }; - + DT__AddProperty(efiNode, "device-properties", sizeof(EFI_DEVICE_PROPERTIES), (EFI_CHAR8*) &EFI_DEVICE_PROPERTIES); #endif #endif From d00b7b84b93759d89c7e75f519ecb83fcc3f191d Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 18:55:24 +0100 Subject: [PATCH 091/136] Patch for RevoBoot v1.5.34 --- i386/libsaio/acpi.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/i386/libsaio/acpi.c b/i386/libsaio/acpi.c index 3b97a80..baaa8fd 100755 --- a/i386/libsaio/acpi.c +++ b/i386/libsaio/acpi.c @@ -26,6 +26,9 @@ * EFI implementation for Revolution Copyright (c) 2010 by DHP. * All rights reserved. * + * Updates: + * + * - Moved #include to end of file, eliminating need of extern in patcher.h (PikerAlpha, October 2012). */ @@ -72,29 +75,19 @@ void updateACPITableData(struct acpi_2_rsdp * rsdp, struct acpi_2_xsdt * xsdt, i #if APPLE_STYLE_ACPI - //------------------------- Used in acpi/patcher.h ------------------------- - #define _ACPI_SET(target, str, len) strncpy(target, str, len) #define _ACPI_SET_APPLE_OEMID(target) _ACPI_SET((target)->OEMID, "Apple ", 6) #define _ACPI_SET_APPLE_OEMTargetID(target) _ACPI_SET((target)->OEMTableID, "Apple00", 8) - //-------------------------------------------------------------------------- - #else - //--------------------------- Void replacements ---------------------------- - #define _ACPI_SET(target, str, len) #define _ACPI_SET_APPLE_OEMID(target) #define _ACPI_SET_APPLE_OEMTargetID(target) - //-------------------------------------------------------------------------- - #endif -#include "acpi/patcher.h" // Macro's in this include file must be live now. - //============================================================================== // Original version written by macerintel (?). Rewrite by Master Chief in 2009. @@ -136,4 +129,4 @@ struct acpi_2_rsdp * getACPIBaseAddress() #endif } - +#include "acpi/patcher.h" // Macro's in this include file must be live now. From 8c7f7b31629a5db1fd31da86760812a17d293af3 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 18:56:29 +0100 Subject: [PATCH 092/136] Patch for RevoBoot v1.5.34 --- i386/libsaio/acpi/essentials.h | 53 +++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/i386/libsaio/acpi/essentials.h b/i386/libsaio/acpi/essentials.h index 5d1486b..0b66f09 100644 --- a/i386/libsaio/acpi/essentials.h +++ b/i386/libsaio/acpi/essentials.h @@ -53,30 +53,55 @@ typedef struct static_acpi_2_table int tableLength; bool loaded; void * tableAddress; +#if LOAD_MODEL_SPECIFIC_ACPI_DATA + char fileName[32]; +#endif } __attribute__((packed)) ACPITable; static ACPITable customTables[] = { +#if LOAD_MODEL_SPECIFIC_ACPI_DATA // Essential tables. - { "APIC", APIC_Table, sizeof(APIC_Table), false, 0 }, - { "ECDT", ECDT_Table, sizeof(ECDT_Table), false, 0 }, - { "HPET", HPET_Table, sizeof(HPET_Table), false, 0 }, - { "MCFG", MCFG_Table, sizeof(MCFG_Table), false, 0 }, - { "SBST", SBST_Table, sizeof(SBST_Table), false, 0 }, - { "SSDT", SSDT_Table, sizeof(SSDT_Table), false, 0 }, + { "APIC", APIC_Table, sizeof(APIC_Table), false, 0, "" }, + { "ECDT", ECDT_Table, sizeof(ECDT_Table), false, 0, "" }, + { "HPET", HPET_Table, sizeof(HPET_Table), false, 0, "" }, + { "MCFG", MCFG_Table, sizeof(MCFG_Table), false, 0, "" }, + { "SBST", SBST_Table, sizeof(SBST_Table), false, 0, "" }, + { "SSDT", SSDT_Table, sizeof(SSDT_Table), false, 0, "" }, // Special essential tables. - { "DSDT", DSDT_Table, sizeof(DSDT_Table), false, 0 }, - { "FACS", FACS_Table, sizeof(FACS_Table), false, 0 }, + { "DSDT", DSDT_Table, sizeof(DSDT_Table), false, 0, "" }, + { "FACS", FACS_Table, sizeof(FACS_Table), false, 0, "" }, // Optional tables. - { "APIC-1", APIC2_Table, sizeof(APIC2_Table), false, 0 }, - { "SSDT_GPU", SSDT_GPU_Table, sizeof(SSDT_GPU_Table), false, 0 }, - { "SSDT_PR", SSDT_PR_Table, sizeof(SSDT_PR_Table), false, 0 }, - { "SSDT_SATA", SSDT_SATA_Table, sizeof(SSDT_SATA_Table), false, 0 }, - { "SSDT_USB", SSDT_USB_Table, sizeof(SSDT_USB_Table), false, 0 }, - { "", 0, 0, false, 0 } + { "APIC-1", APIC2_Table, sizeof(APIC2_Table), false, 0, "" }, + { "SSDT_GPU", SSDT_GPU_Table, sizeof(SSDT_GPU_Table), false, 0, "" }, + { "SSDT_PR", SSDT_PR_Table, sizeof(SSDT_PR_Table), false, 0, "" }, + { "SSDT_SATA", SSDT_SATA_Table, sizeof(SSDT_SATA_Table), false, 0, "" }, + { "SSDT_USB", SSDT_USB_Table, sizeof(SSDT_USB_Table), false, 0, "" }, + { "", 0, 0, false, 0, "" } +#else + // Essential tables. + { "APIC", APIC_Table, sizeof(APIC_Table), false, 0 }, + { "ECDT", ECDT_Table, sizeof(ECDT_Table), false, 0 }, + { "HPET", HPET_Table, sizeof(HPET_Table), false, 0 }, + { "MCFG", MCFG_Table, sizeof(MCFG_Table), false, 0 }, + { "SBST", SBST_Table, sizeof(SBST_Table), false, 0 }, + { "SSDT", SSDT_Table, sizeof(SSDT_Table), false, 0 }, + + // Special essential tables. + { "DSDT", DSDT_Table, sizeof(DSDT_Table), false, 0 }, + { "FACS", FACS_Table, sizeof(FACS_Table), false, 0 }, + + // Optional tables. + { "APIC-1", APIC2_Table, sizeof(APIC2_Table), false, 0 }, + { "SSDT_GPU", SSDT_GPU_Table, sizeof(SSDT_GPU_Table), false, 0 }, + { "SSDT_PR", SSDT_PR_Table, sizeof(SSDT_PR_Table), false, 0 }, + { "SSDT_SATA", SSDT_SATA_Table, sizeof(SSDT_SATA_Table), false, 0 }, + { "SSDT_USB", SSDT_USB_Table, sizeof(SSDT_USB_Table), false, 0 }, + { "", 0, 0, false, 0 } +#endif }; From 47fd41815feedc99f22e9ee99636803627403066 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 18:57:27 +0100 Subject: [PATCH 093/136] Patch for RevoBoot v1.5.34 --- i386/libsaio/platform.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/i386/libsaio/platform.c b/i386/libsaio/platform.c index 78c4f9d..5de5caa 100644 --- a/i386/libsaio/platform.c +++ b/i386/libsaio/platform.c @@ -177,8 +177,14 @@ void initPlatform(int biosDevice) gPlatform.MPS.Guid = (EFI_GUID) EFI_MPS_TABLE_GUID; #endif // INCLUDE_MP_TABLE - // Used in boot.c to verify the checksum (adler32) of a pre-linked kernel. - gPlatform.ModelID = SMB_PRODUCT_NAME; + // Used in boot.c to verify the checksum (adler32) of pre-linked kernels. + gPlatform.ModelID = strdup(SMB_PRODUCT_NAME); + +#if LOAD_MODEL_SPECIFIC_STATIC_DATA + // Used in RevoBoot/i386/libsaio/ACPI/patcher.h, RevoBoot/i386/libsaio/efi.c + // and RevoBoot/i386/libsaio/SMBIOS/static_data.h + gPlatform.CommaLessModelID = removeChar(strdup(gPlatform.ModelID), ','); +#endif // Determine system type based on product name. Used in // acpi/patcher.h to update FADT->Preferred_PM_Profile @@ -276,7 +282,7 @@ void initPlatform(int biosDevice) initKernelBootConfig(); -#if (LOAD_STATIC_EFI_DATA_FROM_EXTRA) +#if (LOAD_MODEL_SPECIFIC_EFI_DATA) /* * We need to call this much earlier in the boot process when static EFI data * is read from: /Extra/EFI[MacModelNN.bin]. Otherwise LoadFile (load.c) fails. From a56f855b5d9a993af0887252e1203cdc93180b2c Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 18:57:57 +0100 Subject: [PATCH 094/136] Patch for RevoBoot v1.5.34 --- i386/libsaio/platform.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/i386/libsaio/platform.h b/i386/libsaio/platform.h index 9053cd8..e2dca81 100644 --- a/i386/libsaio/platform.h +++ b/i386/libsaio/platform.h @@ -82,6 +82,10 @@ #define MACPRO_41 MACPRO | (1 << 15) #define MACPRO_31 MACPRO // Defaults to MacPro3,1 +//------------------------------------------------------------------------------ + +// #define LOAD_MODEL_SPECIFIC_STATIC_DATA (LOAD_MODEL_SPECIFIC_ACPI_DATA || LOAD_MODEL_SPECIFIC_EFI_DATA || LOAD_MODEL_SPECIFIC_SMBIOS_DATA) + #include "smbios/model_data.h" //------------------------------------------------------------------------------ @@ -146,7 +150,10 @@ typedef struct _PlatformInfo_t // later updated in boot.c with the actual version info. char * ModelID; // Initialized in platform.c and used in boot.c - +#if LOAD_MODEL_SPECIFIC_STATIC_DATA + char * CommaLessModelID; // Initialized in platform.c and used in i386/libsaio/ACPI/patcher.h, +#endif // i386/libsaio/efi.c and i386/libsaio/SMBIOS/static_data.h + char * KextFileName; // Initialized and used in drivers.c char * KextFileSpec; // Initialized and used in drivers.c char * KextPlistSpec; // Initialized and used in drivers.c @@ -300,7 +307,6 @@ typedef struct _PlatformInfo_t } PlatformInfo_t; - //------------------------------------------------------------------------------ /* cpu/static_data.h & cpu/dynamic_data.h */ From ffe8613938dba7d4934883d73ee4b88092937fa7 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 18:59:01 +0100 Subject: [PATCH 095/136] Patch for RevoBoot v1.5.34 --- i386/libsaio/saio_internal.h | 219 ++++++++++++++++++----------------- 1 file changed, 112 insertions(+), 107 deletions(-) diff --git a/i386/libsaio/saio_internal.h b/i386/libsaio/saio_internal.h index d4da384..c806216 100755 --- a/i386/libsaio/saio_internal.h +++ b/i386/libsaio/saio_internal.h @@ -20,6 +20,12 @@ * under the License. * * @APPLE_LICENSE_HEADER_END@ + * + * Updates: + * + * - loadBinaryData(load.c) and toLowerCase(string.c) added (PikerAlpha, October 2012). + * - Tidied up (spaces -> tabs) (PikerAlpha, October 2012). + * */ #ifndef __LIBSAIO_SAIO_INTERNAL_H @@ -28,71 +34,70 @@ #include "saio_types.h" /* asm.s */ -extern void real_to_prot(void); -extern void prot_to_real(void); -extern void halt(void); -extern void startMachKernel(unsigned int address, void *arg); +extern void real_to_prot(void); +extern void prot_to_real(void); +extern void halt(void); +extern void startMachKernel(unsigned int address, void *arg); -// extern void loader(UInt32 code, UInt32 cmdptr); /* bios.s */ -extern void bios(biosBuf_t *bb); +extern void bios(biosBuf_t *bb); -extern int bgetc(void); -extern int biosread(int dev, int cyl, int head, int sec, int num); -extern int ebiosread(int dev, unsigned long long sec, int count); -extern int get_drive_info(int drive, struct driveInfo *dp); -extern void putc(int ch); -extern void putca(int ch, int attr, int repeat); -extern int getc(void); -extern int readKeyboardStatus(void); +extern int bgetc(void); +extern int biosread(int dev, int cyl, int head, int sec, int num); +extern int ebiosread(int dev, unsigned long long sec, int count); +extern int get_drive_info(int drive, struct driveInfo *dp); +extern void putc(int ch); +extern void putca(int ch, int attr, int repeat); +extern int getc(void); +extern int readKeyboardStatus(void); extern unsigned int time18(void); -extern void delay(int ms); +extern void delay(int ms); extern unsigned int get_diskinfo(int dev); -extern int memsize(int i); -extern void video_mode(int mode); -extern void setCursorPosition(int x, int y, int page); -extern void setCursorType(int type); -extern void getCursorPositionAndType(int *x, int *y, int *type); -extern void scollPage(int x1, int y1, int x2, int y2, int attr, int rows, int dir); -extern void clearScreenRows(int y1, int y2); -extern void setActiveDisplayPage( int page ); +extern int memsize(int i); +extern void video_mode(int mode); +extern void setCursorPosition(int x, int y, int page); +extern void setCursorType(int type); +extern void getCursorPositionAndType(int *x, int *y, int *type); +extern void scollPage(int x1, int y1, int x2, int y2, int attr, int rows, int dir); +extern void clearScreenRows(int y1, int y2); +extern void setActiveDisplayPage(int page); extern unsigned long getMemoryMap(struct MemoryRange * rangeArray, unsigned long maxRangeCount, unsigned long * conMemSizePtr, unsigned long * extMemSizePtr); extern unsigned long getExtendedMemorySize(); extern unsigned long getConventionalMemorySize(); -extern void sleep(int n); +extern void sleep(int n); /* efi.c */ -extern void initEFITree(void); -extern void updateEFITree(char *rootUUID); -extern void finalizeEFITree(void); +extern void initEFITree(void); +extern void updateEFITree(char *rootUUID); +extern void finalizeEFITree(void); /* bootstruct.c */ -extern void initKernelBootConfig(void); -extern void finalizeKernelBootConfig(void); -extern void moveKernelBootArgs(void); +extern void initKernelBootConfig(void); +extern void finalizeKernelBootConfig(void); +extern void moveKernelBootArgs(void); /* cache.c */ -extern void CacheReset(); -extern void CacheInit(CICell ih, long blockSize); -extern long CacheRead(CICell ih, char *buffer, long long offset, long length, long cache); +extern void CacheReset(); +extern void CacheInit(CICell ih, long blockSize); +extern long CacheRead(CICell ih, char *buffer, long long offset, long length, long cache); /* console.c */ -extern bool gVerboseMode; -extern bool gErrors; -extern void putchar(int ch); -extern int getchar(void); -extern int printf(const char *format, ...); -extern int error(const char *format, ...); -extern int verbose(const char *format, ...); -extern void stop(const char *format, ...); +extern bool gVerboseMode; +extern bool gErrors; +extern void putchar(int ch); +extern int getchar(void); +extern int printf(const char *format, ...); +extern int error(const char *format, ...); +extern int verbose(const char *format, ...); +extern void stop(const char *format, ...); /* disk.c */ -extern int testBiosread( int biosdev, unsigned long long secno); +extern int testBiosread(int biosdev, unsigned long long secno); extern BVRef diskScanBootVolumes(int biosdev, int *count); extern BVRef diskScanGPTBootVolumes(int biosdev, int *count); extern void diskSeek(BVRef bvr, long long position); @@ -100,94 +105,94 @@ extern int diskRead(BVRef bvr, long addr, long length); extern bool hasBootEFI(BVRef bvr); extern void initPartitionChain(void); -extern BVRef getBVChainForBIOSDev(int biosdev); -extern BVRef newFilteredBVChain(int minBIOSDev, int maxBIOSDev, unsigned int allowFlags, unsigned int denyFlags, int *count); -extern int freeFilteredBVChain(const BVRef chain); -extern int rawDiskRead(BVRef bvr, unsigned int secno, void *buffer, unsigned int len); -extern int rawDiskWrite(BVRef bvr, unsigned int secno, void *buffer, unsigned int len); -extern int readBootSector(int biosdev, unsigned int secno, void *buffer); -extern void turnOffFloppy(void); -extern int testFAT32EFIBootSector( int biosdev, unsigned int secno, void * buffer ); +extern BVRef getBVChainForBIOSDev(int biosdev); +extern BVRef newFilteredBVChain(int minBIOSDev, int maxBIOSDev, unsigned int allowFlags, unsigned int denyFlags, int *count); +extern int freeFilteredBVChain(const BVRef chain); +extern int rawDiskRead(BVRef bvr, unsigned int secno, void *buffer, unsigned int len); +extern int rawDiskWrite(BVRef bvr, unsigned int secno, void *buffer, unsigned int len); +extern int readBootSector(int biosdev, unsigned int secno, void *buffer); +extern void turnOffFloppy(void); +extern int testFAT32EFIBootSector(int biosdev, unsigned int secno, void * buffer); /* hfs_compare.c */ -extern int32_t FastUnicodeCompare(u_int16_t *uniStr1, u_int32_t len1, u_int16_t *uniStr2, u_int32_t len2, int byte_order); -extern void utf_encodestr( const u_int16_t * ucsp, int ucslen, u_int8_t * utf8p, u_int32_t bufsize, int byte_order ); -extern void utf_decodestr(const u_int8_t *utf8p, u_int16_t *ucsp, u_int16_t *ucslen, u_int32_t bufsize, int byte_order ); +extern int32_t FastUnicodeCompare(u_int16_t *uniStr1, u_int32_t len1, u_int16_t *uniStr2, u_int32_t len2, int byte_order); +extern void utf_encodestr(const u_int16_t * ucsp, int ucslen, u_int8_t * utf8p, u_int32_t bufsize, int byte_order); +extern void utf_decodestr(const u_int8_t *utf8p, u_int16_t *ucsp, u_int16_t *ucslen, u_int32_t bufsize, int byte_order); /* load.c */ -extern bool gLoadKernelDrivers; -extern long ThinFatFile(void **binary, unsigned long *length); -extern long DecodeMachO(void *binary, entry_t *rentry, char **raddr, int *rsize); +extern bool gLoadKernelDrivers; +extern long ThinFatFile(void **binary, unsigned long *length); +extern long DecodeMachO(void *binary, entry_t *rentry, char **raddr, int *rsize); +extern long loadBinaryData(char *aFilePath, void **aMemoryAddress); /* memory.c */ -long AllocateKernelMemory( long inSize ); -long AllocateMemoryRange(char * rangeName, long start, long length, long type); +long AllocateKernelMemory(long inSize); +long AllocateMemoryRange(char * rangeName, long start, long length, long type); /* platform.c */ -extern void enableA20(void); +extern void enableA20(void); /* stringTable.c */ -extern bool getValueForConfigTableKey(config_file_t *config, const char *key, const char **val, int *size); -extern char * newStringForKey(char *key, config_file_t *configBuff); -extern bool getValueForBootKey(const char *line, const char *match, const char **matchval, int *len); -extern bool getValueForKey(const char *key, const char **val, int *size, config_file_t *configBuff); -extern bool getBoolForKey(const char *key, bool *val, config_file_t *configBuff); -extern bool getIntForKey(const char *key, int *val, config_file_t *configBuff); - -extern int loadConfigFile(const char *configFile, config_file_t *configBuff); - -extern int loadSystemConfig(config_file_t *configBuff); - - -extern int loadHelperConfig(config_file_t *configBuff); -extern int loadOverrideConfig(config_file_t *configBuff); - -extern char * newString(const char *oldString); -extern char * getNextArg(char ** ptr, char * val); -extern long ParseXMLFile( char * buffer, TagPtr * dict ); +extern bool getValueForConfigTableKey(config_file_t *config, const char *key, const char **val, int *size); +extern char * newStringForKey(char *key, config_file_t *configBuff); +extern bool getValueForBootKey(const char *line, const char *match, const char **matchval, int *len); +extern bool getValueForKey(const char *key, const char **val, int *size, config_file_t *configBuff); +extern bool getBoolForKey(const char *key, bool *val, config_file_t *configBuff); +extern bool getIntForKey(const char *key, int *val, config_file_t *configBuff); +extern int loadConfigFile(const char *configFile, config_file_t *configBuff); +extern int loadSystemConfig(config_file_t *configBuff); +extern int loadHelperConfig(config_file_t *configBuff); +extern int loadOverrideConfig(config_file_t *configBuff); +extern char * newString(const char *oldString); +extern char * getNextArg(char ** ptr, char * val); +extern long ParseXMLFile(char * buffer, TagPtr * dict); /* sys.c */ -extern BVRef getBootVolumeRef( const char * path, const char ** outPath ); -extern long LoadVolumeFile(BVRef bvr, const char *fileSpec); -extern long LoadFile(const char *fileSpec); -extern long ReadFileAtOffset(const char * fileSpec, void *buffer, uint64_t offset, uint64_t length); -extern long LoadThinFatFile(const char *fileSpec, void **binary); -extern long GetDirEntry(const char *dirSpec, long *dirIndex, const char **name, long *flags, long *time); -extern long GetFileInfo(const char *dirSpec, const char *name,long *flags, long *time); -extern long GetFileBlock(const char *fileSpec, unsigned long long *firstBlock); -extern long GetFSUUID(char *spec, char *uuidStr); -extern long CreateUUIDString(uint8_t uubytes[], int nbytes, char *uuidStr); -extern int openmem(char *buf, int len); -extern int open(const char *str, int how); -extern int close(int fdesc); -extern int file_size(int fdesc); -extern int read(int fdesc, char *buf, int count); -extern int b_lseek(int fdesc, int addr, int ptr); -extern int tell(int fdesc); +extern BVRef getBootVolumeRef(const char * path, const char ** outPath); +extern long LoadVolumeFile(BVRef bvr, const char *fileSpec); +extern long LoadFile(const char *fileSpec); +extern long ReadFileAtOffset(const char * fileSpec, void *buffer, uint64_t offset, uint64_t length); +extern long LoadThinFatFile(const char *fileSpec, void **binary); +extern long GetDirEntry(const char *dirSpec, long *dirIndex, const char **name, long *flags, long *time); +extern long GetFileInfo(const char *dirSpec, const char *name,long *flags, long *time); +extern long GetFileBlock(const char *fileSpec, unsigned long long *firstBlock); +extern long GetFSUUID(char *spec, char *uuidStr); +extern long CreateUUIDString(uint8_t uubytes[], int nbytes, char *uuidStr); +extern int openmem(char *buf, int len); +extern int open(const char *str, int how); +extern int close(int fdesc); +extern int file_size(int fdesc); +extern int read(int fdesc, char *buf, int count); +extern int b_lseek(int fdesc, int addr, int ptr); +extern int tell(int fdesc); extern const char * systemConfigDir(void); -extern struct dirstuff * opendir(const char *path); -extern struct dirstuff * vol_opendir(BVRef bvr, const char *path); -extern int closedir(struct dirstuff *dirp); -extern int readdir(struct dirstuff *dirp, const char **name, long *flags, long *time); -extern int readdir_ext(struct dirstuff * dirp, const char ** name, long * flags, long * time, FinderInfo *finderInfo, long *infoValid); -extern void flushdev(void); -extern void scanBootVolumes(int biosdev, int *count); +extern struct dirstuff * opendir(const char *path); +extern struct dirstuff * vol_opendir(BVRef bvr, const char *path); +extern int closedir(struct dirstuff *dirp); +extern int readdir(struct dirstuff *dirp, const char **name, long *flags, long *time); +extern int readdir_ext(struct dirstuff * dirp, const char ** name, long * flags, long * time, FinderInfo *finderInfo, long *infoValid); +extern void flushdev(void); +extern void scanBootVolumes(int biosdev, int *count); -extern BVRef getBootVolume(BVRef chain, int targetDevice); -extern BVRef getTargetRootVolume(char *rootUUID); -extern BVRef selectBootVolume(BVRef chain); +extern BVRef getBootVolume(BVRef chain, int targetDevice); +extern BVRef getTargetRootVolume(char *rootUUID); +extern BVRef selectBootVolume(BVRef chain); -extern void getBootVolumeDescription(BVRef bvr, char *str, long strMaxLen, bool verbose); +extern void getBootVolumeDescription(BVRef bvr, char *str, long strMaxLen, bool verbose); // Function pointer to be filled in if ramdisks are available -extern int (*p_get_ramdisk_info)(int biosdev, struct driveInfo *dip); -extern int (*p_ramdiskReadBytes)( int biosdev, unsigned int blkno, unsigned int byteoff, unsigned int byteCount, void * buffer ); +extern int (*p_get_ramdisk_info)(int biosdev, struct driveInfo *dip); +extern int (*p_ramdiskReadBytes)(int biosdev, unsigned int blkno, unsigned int byteoff, unsigned int byteCount, void * buffer); + + +/* string.h */ +extern char * toLowerCase(char *aSourceString); #endif /* !__LIBSAIO_SAIO_INTERNAL_H */ From 0b82d821d6e7b0ed688764a5b0df2ba3ba1388ef Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 19:00:05 +0100 Subject: [PATCH 096/136] Patch for RevoBoot v1.5.34 --- i386/libsaio/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i386/libsaio/Makefile b/i386/libsaio/Makefile index bc5c4e1..63262be 100644 --- a/i386/libsaio/Makefile +++ b/i386/libsaio/Makefile @@ -26,7 +26,7 @@ CFLAGS = $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost \ -DSTATIC_DATA_FILENAME=$(MAKE_TARGET_MODEL).bin \ -DACPI_DATA_FILE=../../config/$(MAKE_ACPI_DATA_FILE) \ -DEFI_DATA_FILE=../config/$(MAKE_EFI_DATA_FILE) \ - -DSMBIOS_DATA_FILE=../../config/$(MAKE_SMBIOS_DATA_FILE) \ + -DSMBIOS_DATA_FILE=../config/$(MAKE_SMBIOS_DATA_FILE) \ -fno-builtin -static $(OMIT_FRAME_POINTER_CFLAG) \ -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ -march=pentium4 -msse2 -mfpmath=sse -msoft-float From aa11394eb40c936efb2aa8ee5c92c408e1bfb443 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 19:01:47 +0100 Subject: [PATCH 097/136] Patch for RevoBoot v1.5.34 --- i386/libsaio/smbios/dynamic_data.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/i386/libsaio/smbios/dynamic_data.h b/i386/libsaio/smbios/dynamic_data.h index cc92cb1..25fa300 100755 --- a/i386/libsaio/smbios/dynamic_data.h +++ b/i386/libsaio/smbios/dynamic_data.h @@ -136,7 +136,7 @@ struct SMBProperty SMBProperties[] = { kSMBTypeSystemInformation, 0x04, kSMBString, .plainData = APPLE_INC }, { kSMBTypeSystemInformation, 0x05, kSMBString, .plainData = SMB_PRODUCT_NAME }, { kSMBTypeSystemInformation, 0x06, kSMBString, .plainData = "1.0" }, - { kSMBTypeSystemInformation, 0x07, kSMBString, .plainData = SMB_SYSTEM_SERIAL_NUMBER }, + { kSMBTypeSystemInformation, 0x07, kSMBString, .plainData = SMB_SYSTEM_SERIAL_NUMBER }, { kSMBTypeSystemInformation, 0x1a, kSMBString, .plainData = SMB_FAMILY }, //---------------------------------------------------------------------------------------------------- @@ -498,4 +498,3 @@ void setupSMBIOS(void) #endif /* !__LIBSAIO_SMBIOS_PATCHER_H */ - From d99c78ef92975ba6f3f49b79751d13e0216ac393 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 19:04:24 +0100 Subject: [PATCH 098/136] Patch for RevoBoot v1.5.34 --- i386/libsaio/acpi/patcher.h | 46 ++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/i386/libsaio/acpi/patcher.h b/i386/libsaio/acpi/patcher.h index 50f6113..acc9233 100644 --- a/i386/libsaio/acpi/patcher.h +++ b/i386/libsaio/acpi/patcher.h @@ -8,11 +8,12 @@ * - A complete new implementation written for RevoBoot by DHP in 2011. * - Automatic SSDT_PR creation added by DHP in June 2011. * - Call loadBinaryData from loadACPITable (PikerAlpha, October 2012). + * - Moved extern declarations to saio_internal.h (PikerAlpha, October 2012). + * - Now using gPlatform.CommaLessModelID instead of gPlatform.ModelID (PikerAlpha, October 2012). + * - Fall back to non-model specific file when model specific file is unavailable (PikerAlpha, October 2012). */ -extern ACPI_RSDP * getACPIBaseAddress(); - #if PATCH_ACPI_TABLE_DATA #if AUTOMATIC_SSDT_PR_CREATION @@ -23,36 +24,53 @@ extern ACPI_RSDP * getACPIBaseAddress(); #if (LOAD_EXTRA_ACPI_TABLES && (LOAD_DSDT_TABLE_FROM_EXTRA_ACPI || LOAD_SSDT_TABLE_FROM_EXTRA_ACPI)) //============================================================================== -extern long loadBinaryData(char *aFilePath, void **aMemoryAddress); - int loadACPITable(int tableIndex) { - _ACPI_DEBUG_DUMP("loadACPITable(%s / ", customTables[tableIndex].name); - - char dirSpec[32] = ""; - sprintf(dirSpec, "/Extra/ACPI/%s.aml", customTables[tableIndex].name); - + char dirSpec[48] = ""; + long fileSize = 0; void * tableAddress = (void *)kLoadAddr; +#if LOAD_MODEL_SPECIFIC_ACPI_DATA + // Example: /Extra/ACPI/DSDT-MacBookPro101.aml + // 0123456789 0123456789 0123456789 1 + sprintf(dirSpec, "/Extra/ACPI/%s-%s.aml", customTables[tableIndex].name, gPlatform.CommaLessModelID); + /* * loadBinaryData calls LoadFile (both in sys.c) to load table data into a * load buffer at kLoadAddr (defined in memory.h) and copies it into a new * allocated memory block (kLoadAddr gets overwritten by the next call). */ - long fileSize = loadBinaryData(dirSpec, &tableAddress); + fileSize = loadBinaryData(dirSpec, &tableAddress); - if (fileSize) + if (fileSize == -1) { - _ACPI_DEBUG_DUMP("%d bytes).\n", fileSize); +#endif + // File: /Extra/ACPI/DSDT-MacBookPro101.aml not found. Try: /Extra/ACPI/dsdt.aml + sprintf(dirSpec, "/Extra/ACPI/%s.aml", customTables[tableIndex].name); + fileSize = loadBinaryData(dirSpec, &tableAddress); +#if LOAD_MODEL_SPECIFIC_ACPI_DATA + } +#endif + + if (fileSize > 0) + { + _ACPI_DEBUG_DUMP("Loading: %s (%d bytes).\n", dirSpec, fileSize); + _ACPI_DEBUG_SLEEP(1); // 'tableAddress' is copied into kernel memory later on (see setupACPI). customTables[tableIndex].table = tableAddress; customTables[tableIndex].tableLength = fileSize; +#if (DEBUG_ACPI && LOAD_MODEL_SPECIFIC_ACPI_DATA) + // Update table name from DSDT.aml to DSDT-Macmini51.aml (DSDT example). + sprintf(customTables[tableIndex].fileName, gPlatform.CommaLessModelID); +#endif + return 0; } - _ACPI_DEBUG_DUMP("Error: File not found.)\n"); + _ACPI_DEBUG_DUMP("Error: File %s not found.)\n", dirSpec); + _ACPI_DEBUG_SLEEP(5); return -1; } @@ -246,7 +264,7 @@ bool patchFACPTable(ENTRIES * xsdtEntries, int tableIndex, int dropOffset) #if STATIC_DSDT_TABLE_INJECTION _ACPI_DEBUG_DUMP("static DSDT data"); #else // STATIC_DSDT_TABLE_INJECTION - _ACPI_DEBUG_DUMP("loaded DSDT.aml"); + _ACPI_DEBUG_DUMP("%s", customTables[DSDT].fileName); #endif // STATIC_DSDT_TABLE_INJECTION _ACPI_DEBUG_DUMP(" @ 0x%x\n", customTables[DSDT].tableAddress); From 4f25936b85881de0c84240c90f50b9c40a5b2675 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 19:06:10 +0100 Subject: [PATCH 099/136] Whitespace fix only --- i386/libsaio/saio_internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/i386/libsaio/saio_internal.h b/i386/libsaio/saio_internal.h index c806216..1bc2fa0 100755 --- a/i386/libsaio/saio_internal.h +++ b/i386/libsaio/saio_internal.h @@ -23,8 +23,8 @@ * * Updates: * - * - loadBinaryData(load.c) and toLowerCase(string.c) added (PikerAlpha, October 2012). - * - Tidied up (spaces -> tabs) (PikerAlpha, October 2012). + * - loadBinaryData(load.c) and toLowerCase(string.c) added (PikerAlpha, October 2012). + * - Tidied up (spaces -> tabs) (PikerAlpha, October 2012). * */ From 4165da1720242ae387aafff7058a1cbd2571ec79 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 19:07:21 +0100 Subject: [PATCH 100/136] Patch for RevoBoot v1.5.34 --- i386/libsaio/smbios.c | 49 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/i386/libsaio/smbios.c b/i386/libsaio/smbios.c index d99bb64..267a0c6 100755 --- a/i386/libsaio/smbios.c +++ b/i386/libsaio/smbios.c @@ -10,7 +10,34 @@ #include "platform.h" + #if USE_STATIC_SMBIOS_DATA + +#if LOAD_MODEL_SPECIFIC_SMBIOS_DATA +//============================================================================== + +int useStaticSMBIOSData(void * aMemoryAddress) +{ + // The STRING (macro) is defined in RevoBoot/i386/config/settings.h + #include STRING(SMBIOS_DATA_FILE) + + static uint32_t SMBIOS_Table[] = + { + // Replaced with data from: RevoBoot/i386/config/SMBIOS/[data-template/MacModelNN].h + STATIC_SMBIOS_DATA + }; + + _SMBIOS_DEBUG_DUMP("Using statically linked SMBIOS data\n"); + + int tableLength = sizeof(SMBIOS_Table); + + // Copy the static SMBIOS data into the newly allocated memory page. Right after the new EPS. + memcpy(aMemoryAddress, SMBIOS_Table, tableLength); + + return tableLength; +} +#endif /* #if INJECT_EFI_DEVICE_PROPERTIES */ + //============================================================================== void setupSMBIOS(void) @@ -34,7 +61,7 @@ void setupSMBIOS(void) newEPS->entryPointLength = 0x1f; // sizeof(* newEPS) newEPS->majorVersion = 2; newEPS->minorVersion = 4; - newEPS->maxStructureSize = STATIC_SMBIOS_SM_MAX_STRUCTURE_SIZE; // Defined in: config/smbios/data.h + newEPS->maxStructureSize = STATIC_SMBIOS_SM_MAX_STRUCTURE_SIZE; // Defined in RevoBoot/i386/config/SMBIOS/data-template.h newEPS->entryPointRevision = 0; newEPS->formattedArea[0] = 0; @@ -51,9 +78,25 @@ void setupSMBIOS(void) newEPS->dmi.checksum = 0; newEPS->dmi.tableLength = tableLength; newEPS->dmi.tableAddress = (uint32_t) (kernelMemory + sizeof(struct SMBEntryPoint)); - newEPS->dmi.structureCount = STATIC_SMBIOS_DMI_STRUCTURE_COUNT; // Defined in: config/smbios/data.h newEPS->dmi.bcdRevision = 0x24; - + newEPS->dmi.structureCount = STATIC_SMBIOS_DMI_STRUCTURE_COUNT; // Defined in RevoBoot/i386/config/SMBIOS/data-template.h + +#if LOAD_MODEL_SPECIFIC_SMBIOS_DATA + /* + * This is nothing more than a mere stop gap solution, since using the factory values here, instead of walking over + * staticSMBIOSData to get them, may hang the kernel at boot time (will be fixed in a next update of RevoBoot). + */ + if (fileSize > 0) + { + newEPS->maxStructureSize = factoryEPS->maxStructureSize; // Defined in RevoBoot/i386/libsaio/SMBIOS/static_data.h + newEPS->dmi.structureCount = factoryEPS->dmi.structureCount; // Defined in RevoBoot/i386/libsaio/SMBIOS/static_data.h + + _SMBIOS_DEBUG_DUMP("factoryEPS->maxStructureSize : %d\n", factoryEPS->maxStructureSize); + _SMBIOS_DEBUG_DUMP("factoryEPS->dmi.structureCount: %d\n", factoryEPS->dmi.structureCount); + _SMBIOS_DEBUG_SLEEP(1); + } +#endif + // Take care of possible checksum errors newEPS->dmi.checksum = 256 - checksum8(&newEPS->dmi, sizeof(newEPS->dmi)); newEPS->checksum = 256 - checksum8(newEPS, sizeof(* newEPS)); From 1c40333cdbdcc9ba109f861f5ccd8641dd13f0de Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 19:08:37 +0100 Subject: [PATCH 101/136] Patch for RevoBoot v1.5.34 --- i386/libsaio/smbios/static_data.h | 77 +++++++++++++++++++++---------- 1 file changed, 53 insertions(+), 24 deletions(-) diff --git a/i386/libsaio/smbios/static_data.h b/i386/libsaio/smbios/static_data.h index a26a48b..efe7645 100755 --- a/i386/libsaio/smbios/static_data.h +++ b/i386/libsaio/smbios/static_data.h @@ -5,7 +5,7 @@ * - Dynamic and static SMBIOS data gathering added by DHP in 2010. * - New path for static EFI data (PikerAlpha, October 2012). * - Optionally check /Extra/SMBIOS/[MacModelNN.bin] for static SMBIOS data (PikerAlpha, October 2012). - * - Oops. Restoring lost lines (PikerAlpha, November 2012). + * - Get maxStructureSize/structureCount from factory EPS (PikerAlpha, October 2012). * * Credits: * - blackosx, DB1, dgsga, FKA, humph, scrax and STLVNUB (testers). @@ -16,42 +16,71 @@ #include "essentials.h" -#if LOAD_STATIC_SMBIOS_DATA_FROM_EXTRA +int tableLength = 0; - #define STATIC_SMBIOS_DMI_STRUCTURE_COUNT 0 - #define STATIC_SMBIOS_SM_MAX_STRUCTURE_SIZE 0 +#if LOAD_MODEL_SPECIFIC_SMBIOS_DATA - extern long loadBinaryData(char *aFilePath, void **aMemoryAddress); + #define SMBIOS_SEARCH_BASE 0x000F0000 + #define SMBIOS_SEARCH_END 0x000FFFFF + #define SMBIOS_ANCHOR 0x5f4d535f // '_SM_' in Little Endian. + #define SMBIOS_MPS_ANCHOR 0x5f504d5f // '_MP_' in Little Endian. + + _SMBIOS_DEBUG_DUMP("in getEPSAddress()\n"); + + void *baseAddress = (void *)SMBIOS_SEARCH_BASE; + + for(; baseAddress <= (void *)SMBIOS_SEARCH_END; baseAddress += 16) + { + if (*(uint32_t *)baseAddress == SMBIOS_ANCHOR) // _SM_ + { + if (checksum8(baseAddress, sizeof(struct SMBEntryPoint)) == 0) + { + #if INCLUDE_MP_TABLE + // SMBIOS table located. Use this address as starting point. + void * mpsAddress = baseAddress; + + // Now search for the Multi Processor table. + for(; mpsAddress <= (void *)SMBIOS_SEARCH_END; mpsAddress += 16) + { + if (*(uint32_t *)mpsAddress == SMBIOS_MPS_ANCHOR) + { + gPlatform.MP.BaseAddress = (uint32_t)mpsAddress; + break; + } + } + #endif // INCLUDE_MP_TABLE + + break; + + _SMBIOS_DEBUG_DUMP("SMBIOS baseAddress: 0x%08x\n", baseAddress); + } + } + } - int tableLength = 0; char dirSpec[32] = ""; - sprintf(dirSpec, "/Extra/SMBIOS/%s", STRING(STATIC_DATA_FILENAME)); void * staticSMBIOSData = (void *)kLoadAddr; + struct SMBEntryPoint *factoryEPS; + + sprintf(dirSpec, "/Extra/SMBIOS/%s.bin", COMMA_STRIPPED_MODEL_ID); + _SMBIOS_DEBUG_DUMP("Loading: %s\n", dirSpec); long fileSize = loadBinaryData(dirSpec, &staticSMBIOSData); - if (fileSize) + if (fileSize > 0) { - tableLength = (int)fileSize; - - memcpy((kernelMemory + sizeof(* newEPS)), staticSMBIOSData, tableLength); - } -#else - // The STRING (macro) is defined in RevoBoot/i386/config/settings.h - #include STRING(SMBIOS_DATA_FILE) + memcpy((kernelMemory + sizeof(* newEPS)), staticSMBIOSData, fileSize); - static uint32_t SMBIOS_Table[] = + factoryEPS = (struct SMBEntryPoint *) baseAddress; + } + else // File not found. Use static data defined in RevoBoot/i386/config/SMBIOS/ { - STATIC_SMBIOS_DATA // Replaced with data from: RevoBoot/i386/config/SMBIOS/[default/MacModelNN].h - }; - - int tableLength = sizeof(SMBIOS_Table); - - // Copy the static SMBIOS data into the newly allocated memory page. Right after the new EPS. - memcpy((kernelMemory + sizeof(* newEPS)), SMBIOS_Table, tableLength); -#endif + tableLength = useStaticSMBIOSData((kernelMemory + sizeof(* newEPS))); + } +#else + tableLength = useStaticSMBIOSData((kernelMemory + sizeof(* newEPS))); +#endif /* LOAD_MODEL_SPECIFIC_SMBIOS_DATA */ #endif /* !__LIBSAIO_SMBIOS_STATIC_DATA_H */ From ee1791f86f14cffd8d16c762b61f660f7e3a5f64 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 19:23:35 +0100 Subject: [PATCH 102/136] Patch for RevoBoot v1.5.34 --- i386/config/settings-template.h | 230 +++++++++++++++++--------------- 1 file changed, 120 insertions(+), 110 deletions(-) diff --git a/i386/config/settings-template.h b/i386/config/settings-template.h index 114bfb8..8f553c8 100644 --- a/i386/config/settings-template.h +++ b/i386/config/settings-template.h @@ -1,7 +1,7 @@ /* * Copyright (c) 2009 Master Chief. All rights reserved. * - * Note: This is an essential part of the build process for RevoBoot v1.5.00 and greater. + * Note: This is an essential part of the build process for RevoBoot v1.5.32 and greater. * * Updates: * @@ -15,13 +15,17 @@ * - STATIC_SMBIOS_MODEL_ID renamed to TARGET_MODEL (PikerAlpha, October 2012). * - OVERRIDE_DYNAMIC_PRODUCT_DETECTION removed/no longer supported (PikerAlpha, October 2012). * - INTEL_CORE_TECHNOLOGY per default set to 1 (PikerAlpha, October 2012). - * - INJECT_EFI_DEVICE_PROPERTIES per default set to 1 (PikerAlpha, October 2012). - * - USE_STATIC_EFI_DATA added (PikerAlpha, October 2012). - * - USE_STATIC_SMBIOS_DATA added (PikerAlpha, October 2012). + * - INJECT_EFI_DEVICE_PROPERTIES per default set to 1 (PikerAlpha, October 2012). + * - SMBIOS base board serial# (SMB_BOARD_SERIAL_NUMBER) feature added (dgsga, October 2012). + * - LOAD_STATIC_EFI_DATA_FROM_EXTRA feature added (PikerAlpha, October 2012). + * - LOAD_STATIC_SMBIOS_DATA_FROM_EXTRA feature added (PikerAlpha, October 2012). * - STATIC_SYSTEM_SERIAL_NUMBER renamed to EFI_SYSTEM_SERIAL_NUMBER (PikerAlpha, October 2012). * - Restored lost STATIC_SMSERIALNUMBER (PikerAlpha, October 2012). * - STATIC_SMSERIALNUMBER renamed to SMB_SYSTEM_SERIAL_NUMBER (PikerAlpha, October 2012). - * + * - LOAD_STATIC_ACPI_DATA_FROM_EXTRA added (PikerAlpha, October 2012). + * - LOAD_STATIC_EFI_DATA_FROM_EXTRA renamed to LOAD_MODEL_SPECIFIC_EFI_DATA (PikerAlpha, October 2012). + * - LOAD_STATIC_SMBIOS_DATA_FROM_EXTRA renamed to LOAD_MODEL_SPECIFIC_SMBIOS_DATA (PikerAlpha, October 2012). + * - LOAD_MODEL_SPECIFIC_STATIC_DATA added (PikerAlpha, October 2012). */ @@ -34,10 +38,10 @@ // and requires you to set PATCH_ACPI_TABLE_DATA to 1. -#define PATCH_ACPI_TABLE_DATA 1 // Set to 1 by default (enabling patching). Use 0 to keep the original - // unmodified ACPI tables, but please note (very well) that this is - // only supported by very few motherboards / BIOS'es. You may also - // need a kext like OSXRestart.kext to be able to restart your system, +#define PATCH_ACPI_TABLE_DATA 1 // Set to 1 by default (enabling patching). Use 0 to keep the original + // unmodified ACPI tables, but please note (very well) that this is + // only supported by very few motherboards / BIOS'es. You may also + // need a kext like OSXRestart.kext to be able to restart your system, // this due to a possibly broken FACP table in your BIOS! // // Note: Requires one of the following STATIC_* and/or LOAD_* settings: @@ -52,13 +56,13 @@ #endif -#define STATIC_APIC_TABLE_INJECTION 0 // Set to 0 by default. Use 1 when you want to inject a modified copy +#define STATIC_APIC_TABLE_INJECTION 0 // Set to 0 by default. Use 1 when you want to inject a modified copy // with say stripped out unused CPU's or other required modifications. // // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1. -#define STATIC_APIC2_TABLE_INJECTION 0 // Set to 0 by default. Use 1 when you want to inject a second APIC +#define STATIC_APIC2_TABLE_INJECTION 0 // Set to 0 by default. Use 1 when you want to inject a second APIC // (ACPI-1) table data for additional CPU core support. // // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1. @@ -77,7 +81,7 @@ // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1. -#define STATIC_HPET_TABLE_INJECTION 0 // Set to 0 by default. Use 1 when you want to inject a static copy +#define STATIC_HPET_TABLE_INJECTION 0 // Set to 0 by default. Use 1 when you want to inject a static copy // of a custom HPET table. // // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1. @@ -95,7 +99,7 @@ // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1. -#define STATIC_SSDT_PR_TABLE_INJECTION 0 // Set to 0 by default. Use 1 when you want to inject your Intel +#define STATIC_SSDT_PR_TABLE_INJECTION 0 // Set to 0 by default. Use 1 when you want to inject your Intel // SpeedStep related modifications (like I do). // // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1. @@ -111,15 +115,15 @@ // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1. -#define LOAD_DSDT_TABLE_FROM_EXTRA_ACPI 1 // Set to 0 by default. Use 1 when your setup requires a modified DSDT table - // and you want to load: /Extra/ACPI/dsdt.aml instead of injecting a static - // DSDT table from: RevoBoot/i386/config/ACPI/data.h +#define LOAD_DSDT_TABLE_FROM_EXTRA_ACPI 0 // Set to 0 by default. Use 1 when your setup requires a modified DSDT table + // and you want to load: /Extra/ACPI/dsdt.aml instead of injecting a static + // DSDT table from: RevoBoot/i386/config/ACPI/data.h // // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1. -#define LOAD_SSDT_TABLE_FROM_EXTRA_ACPI 0 // Set to 1 by default. Use 0 only after you've converted your SSDT into - // STATIC_SSDT_TABLE_INJECTION in: RevoBoot/i386/config/ACPI/data.h +#define LOAD_SSDT_TABLE_FROM_EXTRA_ACPI 1 // Set to 1 by default. Use 0 only after you've converted your SSDT into + // STATIC_SSDT_TABLE_INJECTION in: RevoBoot/i386/config/ACPI/data.h // or when you don't want/need to load /Extra/ACPI/SSDT.aml // // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1. @@ -127,8 +131,12 @@ #define LOAD_EXTRA_ACPI_TABLES (LOAD_DSDT_TABLE_FROM_EXTRA_ACPI || LOAD_SSDT_TABLE_FROM_EXTRA_ACPI) +#if LOAD_EXTRA_ACPI_TABLES + #define LOAD_MODEL_SPECIFIC_ACPI_DATA 0 // Set to 0 by default. Use 1 to read: /Extra/ACPI/[XXXX-MacModelNN].aml and + // falls back to: /Extra/ACPI/[XXXX].aml when model specific data is not available. +#endif -#define AUTOMATIC_SSDT_PR_CREATION 1 // Set to 0 by default (support for Sandy Bridge only). +#define AUTOMATIC_SSDT_PR_CREATION 1 // Set to 1 by default (support for Sandy Bridge only). // // This injects a custom SSDT (in configure mode) with: // @@ -138,7 +146,7 @@ // Use 4 to inject: Device (SBUS) {...} which is required for Power Management. // Use 5 to inject: P/C-State definition blocks plus the former (Device SBUS). // Use 7 to inject: All of the above. - // + // // Notes: Device SBUS can only be injected when it isn't part of other ACPI tables! // This feature should only be used once, to extract the SSDT_PR from ioreg // and use it as STATIC_SSDT_PR_TABLE_DATA in RevoBoot/i386/config/ACPI/data.h @@ -153,16 +161,16 @@ // // Note: AICPUPM wants a P-State for each 100 MHz bank or it will fail (see note below). -#define DROP_FACTORY_SSDT_TABLES 1 // Set to 1 by default (this setting is required). + #define DROP_FACTORY_SSDT_TABLES 1 // Set to 1 by default (this setting is required). // // Note: Do not change this setting (must drop SSDT tables). -#define NUMBER_OF_TURBO_STATES 4 // Set to 4 by default. + #define NUMBER_OF_TURBO_STATES 4 // Set to 4 by default. // // Note: Make sure to add a full range, one P-State for each 100 MHz when OC'ing // or AICPIPM will fail with: "P-State Stepper Error 18 at step N on CPU N" -#define OVERRIDE_ACPI_METHODS 0 // Set to 0 by default (do nothing). + #define OVERRIDE_ACPI_METHODS 0 // Set to 0 by default (do nothing). // Use 1 to override Method _PTS in a static SSDT or Extra/ACPI/SSDT.aml // Use 2 to override Method _WAK in a static SSDT or Extra/ACPI/SSDT.aml // Use 3 to override both _PTS and _WAK. @@ -181,7 +189,7 @@ #define APPLE_STYLE_ACPI 0 // Set to 0 by default. Use 1 to change the OEMID's to Mac likes. // - // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1 and keep in mind that this can + // Note: Don't forget to set PATCH_ACPI_TABLE_DATA to 1 and keep in mind that this can // only change the headers of injected/replaced tables. Not the factory tables. @@ -191,142 +199,143 @@ //--------------------------------------------------------------- BOOT.C ------------------------------------------------------------------- -#define PRE_LINKED_KERNEL_SUPPORT 1 // Set to 1 by default. Change this to 0 to disable the use of pre-linked kernels. +#define PRE_LINKED_KERNEL_SUPPORT 1 // Set to 1 by default. Change this to 0 to disable the use of pre-linked kernels. -#define MUST_ENABLE_A20 0 // Set to 0 by default. Change this to 1 when your hardware requires it. +#define MUST_ENABLE_A20 0 // Set to 0 by default. Change this to 1 when your hardware requires it. -#define SAFE_MALLOC 0 // Set to 0 by default. Change this to 1 when booting halts with a memory allocation error. +#define SAFE_MALLOC 0 // Set to 0 by default. Change this to 1 when booting halts with a memory allocation error. -#define LION_RECOVERY_SUPPORT 0 // Set to 0 by default. Change this to 1 to make RevoBoot search for the 'Recovery HD' - // partition and, when available, boot from it. +#define LION_RECOVERY_SUPPORT 0 // Set to 0 by default. Change this to 1 to make RevoBoot search for the 'Recovery HD' + // partition and, when available, boot from it. -#define DEBUG_BOOT 0 // Set to 0 by default. Change this to 1 when things don't seem to work for you. +#define DEBUG_BOOT 0 // Set to 0 by default. Change this to 1 when things don't seem to work for you. //---------------------------------------------------------------- CPU.C ------------------------------------------------------------------- -#define USE_STATIC_CPU_DATA 1 // Set to 0 by default (dynamic data collection). Change this to 1 to use static data. +#define USE_STATIC_CPU_DATA 0 // Set to 0 by default (dynamic data collection). Change this to 1 to use static data. -#define CPU_VENDOR_ID CPU_VENDOR_INTEL // CPU_VENDOR_AMD is not supported. +#define CPU_VENDOR_ID CPU_VENDOR_INTEL // CPU_VENDOR_AMD is not supported. -#define INTEL_CORE_TECHNOLOGY 1 // Set to 1 by default. Use 0 for older non Intel Core CPU's (removes unused code). - // - // Warning: Do not use 0 on Core Technology CPU's or sysctl's machdep.tsc.frequency will be - // initialized with the wrong value (various things, like the spinner will go mad). +#define INTEL_CORE_TECHNOLOGY 1 // Set to 1 by default. Use 0 for older non Intel Core CPU's (removes unused code). + // + // Warning: Do not use 0 on Core Technology CPU's or sysctl's machdep.tsc.frequency will be + // initialized with the wrong value (various things, like the spinner will go mad). -#define OC_BUSRATIO_CORRECTION 0 // Set to 0 by default. Change this to busratio-100 (OC'ed systems with a changed busratio). +#define OC_BUSRATIO_CORRECTION 0 // Set to 0 by default. Change this to busratio-100 (OC'ed systems with a changed busratio). -#define BOOT_TURBO_RATIO 0 // Set to 0 by default. Change this to the desired (and supported) max turbo multiplier. - // - // Example: 0x2800 for 4.0 GHz on a i7-2600. +#define BOOT_TURBO_RATIO 0 // Set to 0 by default. Change this to the desired (and supported) max turbo multiplier. + // + // Example: 0x2800 for 4.0 GHz on a i7-2600. -#define DEBUG_CPU 0 // Set to 0 by default. Change this to 1 when things don't seem to work for you. - // Note: CPU info data will not be displayed when USE_STATIC_CPU_DATA is set to 1 +#define DEBUG_CPU 0 // Set to 0 by default. Change this to 1 when things don't seem to work for you. + // Note: CPU info data will not be displayed when USE_STATIC_CPU_DATA is set to 1 #if DEBUG_CPU - #define DEBUG_CPU_TURBO_RATIOS 0 // Set to 0 by default. Change this to 1 when you want to check the core ratio. + #define DEBUG_CPU_TURBO_RATIOS 0 // Set to 0 by default. Change this to 1 when you want to check the core ratio. - #define DEBUG_CST_SUPPORT 0 // Set to 0 by default. Change this to 1 to check the in BIOS enabled C-States. + #define DEBUG_CST_SUPPORT 0 // Set to 0 by default. Change this to 1 to check the in BIOS enabled C-States. - #define DEBUG_TSS_SUPPORT 0 // Set to 0 by default. Change this to 1 to check the T-State Clock Modulation. + #define DEBUG_TSS_SUPPORT 0 // Set to 0 by default. Change this to 1 to check the T-State Clock Modulation. - #define DEBUG_CPU_TDP 0 // Set to 0 by default. Change this to 1 when you want to check the TDP. + #define DEBUG_CPU_TDP 0 // Set to 0 by default. Change this to 1 when you want to check the TDP. #endif //---------------------------------------------------------- CPU/STATIC_DATA.C ------------------------------------------------------------- #if USE_STATIC_CPU_DATA - #define STATIC_CPU_Type 0x602 // kSMBTypeOemProcessorType - used in: libsaio/SMBIOS/dynamic_data.h + #define STATIC_CPU_Type 0x602 // kSMBTypeOemProcessorType - used in: libsaio/SMBIOS/dynamic_data.h - #define STATIC_CPU_NumThreads 4 // Used in: i386/libsaio/ACPI/ssdt_pr_generator.h + #define STATIC_CPU_NumThreads 4 // Used in: i386/libsaio/ACPI/ssdt_pr_generator.h - #define STATIC_CPU_FSBFrequency 100000000ULL // 9 digits + ULL - used in: RevoBoot/i386/libsaio/efi.c + #define STATIC_CPU_FSBFrequency 100000000ULL // 9 digits + ULL - used in: i386/libsaio/efi.c - #define STATIC_CPU_QPISpeed 0 // kSMBTypeOemProcessorBusSpeed (0 for Sandy Bridge / Jaketown). + #define STATIC_CPU_QPISpeed 0 // kSMBTypeOemProcessorBusSpeed (0 for Sandy Bridge / Jaketown). #endif -#define STATIC_CPU_NumCores 4 // Set to 4 by default. Must be set to the number of cores for your processor! - // - // Note: Used in i386/libsaio/ACPI/ssdt_pr_generator.h, cpu.c and platform.c - // for both static and dynamic CPU data. +#define STATIC_CPU_NumCores 4 // Set to 4 by default. Must be set to the number of cores for your processor! + // + // Note: Used in i386/libsaio/ACPI/ssdt_pr_generator.h, cpu.c and platform.c + // for both static and dynamic CPU data. //--------------------------------------------------------------- DISK.C ------------------------------------------------------------------- -#define EFI_SYSTEM_PARTITION_SUPPORT 0 // Set to 0 by default. Set this to 1 when your system boots from the hidden EFI partition. +#define EFI_SYSTEM_PARTITION_SUPPORT 0 // Set to 0 by default. Set this to 1 when your system boots from the hidden EFI partition. -#define LEGACY_BIOS_READ_SUPPORT 0 // Set to 0 by default. Change this to 1 for crappy old BIOSes. +#define LEGACY_BIOS_READ_SUPPORT 0 // Set to 0 by default. Change this to 1 for crappy old BIOSes. #if LION_RECOVERY_SUPPORT - #define CORE_STORAGE_SUPPORT 1 // Set to 0 by default since booting from a 'Recovery HD' partition may requires us to skip - // (encrypted) CoreStorage partitions. + #define CORE_STORAGE_SUPPORT 1 // Set to 1 by default since booting from a 'Recovery HD' partition may requires us to skip + // (encrypted) CoreStorage partitions. #else - #define CORE_STORAGE_SUPPORT 0 // Set to 0 by default. Change this to 1 when you want RevoBoot to boot from the 'Boot OS X' - // (usually the third) partition on a Fusion Drive (requires Mountain Lion 10.8.2). + #define CORE_STORAGE_SUPPORT 0 // Set to 0 by default. Change this to 1 when you want RevoBoot to boot from the 'Boot OS X' + // (usually the third) partition on a Fusion Drive (requires Mountain Lion 10.8.2). #endif -#define APPLE_RAID_SUPPORT 0 // Set to 0 by default. Change this to 1 for Apple Software RAID support. +#define APPLE_RAID_SUPPORT 0 // Set to 0 by default. Change this to 1 for Apple Software RAID support. -#define DEBUG_DISK 0 // Set to 0 by default. Change it to 1 when things don't seem to work for you. +#define DEBUG_DISK 0 // Set to 0 by default. Change it to 1 when things don't seem to work for you. //------------------------------------------------------------- DRIVERS.C ------------------------------------------------------------------- -#define DEBUG_DRIVERS 0 // Set to 0 by default. Change it to 1 when things don't seem to work for you. +#define DEBUG_DRIVERS 0 // Set to 0 by default. Change it to 1 when things don't seem to work for you. //---------------------------------------------------------------- EFI.C ------------------------------------------------------------------- -#define APPLE_STYLE_EFI 1 // Set to 1 by default. Change this to 1 to add additional 'Mac-like' properties. +#define APPLE_STYLE_EFI 1 // Set to 1 by default. Change this to 1 to add additional 'Mac-like' properties. + +#define INJECT_EFI_DEVICE_PROPERTIES 0 // Set to 0 by default. Change this to 1 when you need to inject 'device-properties'. + // + // Note: Required when not setting device-properties from your DSDT/SSDT. -#define INJECT_EFI_DEVICE_PROPERTIES 0 // Set to 0 by default. Change this to 1 when you need to inject 'device-properties'. - // - // Note: Required when not setting device-properties from your DSDT/SSDT. #if INJECT_EFI_DEVICE_PROPERTIES - #define LOAD_STATIC_EFI_DATA_FROM_EXTRA 0 // Set to 0 by default. Change this to 1 to load: /Extra/EFI/[MacModelNN].bin + #define LOAD_MODEL_SPECIFIC_EFI_DATA 0 // Set to 0 by default. Use 1 to read: /Extra/EFI/[-MacModelNN].bin #endif -#define EFI_64_BIT 1 // Set to 1 by default for EFI64 on 64-bit platforms. Supporting both - // 32 and 64-bit boot modes (using arch=i386/x86_64 under Kernel Flags). - // - // Change this to 0 for 32-bit only platforms (think Intel Atom CPU) - // or when you want to boot with EFI32 (for testing) on a 64-bit - // platform, but then you must make a small change in platform.c (see comment in file). - // - // Note: Do not change this setting, unless you know what you are doing. +#define EFI_64_BIT 1 // Set to 1 by default for EFI64 on 64-bit platforms. Supporting both + // 32 and 64-bit boot modes (using arch=i386/x86_64 under Kernel Flags). + // + // Change this to 0 for 32-bit only platforms (think Intel Atom CPU) + // or when you want to boot with EFI32 (for testing) on a 64-bit + // platform, but then you must make a small change in platform.c (see comment in file). + // + // Note: Do not change this setting, unless you know what you are doing. -#define EFI_SYSTEM_SERIAL_NUMBER { 'S', 'O', 'M', 'E', 'S', 'R', 'L', 'N', 'U', 'M', 'B', 'R' } // Example only! +#define EFI_SYSTEM_SERIAL_NUMBER { 'S', 'O', 'M', 'E', 'S', 'R', 'L', 'N', 'U', 'M', 'B', 'R' } -#define STATIC_SYSTEM_ID { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F } // Example only! +#define STATIC_SYSTEM_ID { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F } // Example only! -#define DEBUG_EFI 0 // Set to 0 by default. Change this to 1 when things don't seem to work for you. +#define DEBUG_EFI 0 // Set to 0 by default. Change this to 1 when things don't seem to work for you. -#define EFI_DEBUG_MODE 0 // Set to 0 by default (for OS X 10.7 LION only). +#define EFI_DEBUG_MODE 0 // Set to 0 by default (for OS X 10.7 LION and greater). //------------------------------------------------------------- GRAPHICS.C ----------------------------------------------------------------- -#define USE_STATIC_DISPLAY_RESOLUTION 1 // Set to 0 by default. Use 1 when you need to override the resolution detection features - // in RevoBoot, which may not be supported by your BIOS and/or display (monitor). +#define USE_STATIC_DISPLAY_RESOLUTION 1 // Set to 0 by default. Use 1 when you need to override the resolution detection features + // in RevoBoot, which may not be supported by your BIOS and/or display (monitor). -#define STATIC_SCREEN_WIDTH 1900 // Used (in RevoBoot v1.0.35 and greater) when USE_STATIC_DISPLAY_RESOLUTION is 1 and when - // USE_STATIC_DISPLAY_RESOLUTION is 0 but getResolutionFromEDID() isn't supported (failed). +#define STATIC_SCREEN_WIDTH 1900 // Used (in RevoBoot v1.0.35 and greater) when USE_STATIC_DISPLAY_RESOLUTION is 1 and when + // USE_STATIC_DISPLAY_RESOLUTION is 0 but getResolutionFromEDID() isn't supported (failed). -#define STATIC_SCREEN_HEIGHT 1200 // Used (in RevoBoot v1.0.35 and greater) when USE_STATIC_DISPLAY_RESOLUTION is 1 and when - // USE_STATIC_DISPLAY_RESOLUTION is 0 but getResolutionFromEDID() isn't supported (failed). +#define STATIC_SCREEN_HEIGHT 1200 // Used (in RevoBoot v1.0.35 and greater) when USE_STATIC_DISPLAY_RESOLUTION is 1 and when + // USE_STATIC_DISPLAY_RESOLUTION is 0 but getResolutionFromEDID() isn't supported (failed). -#define DEBUG_BOOT_GRAPHICS 0 // Set to 0 by default. Use 1 when to see debug info. +#define DEBUG_BOOT_GRAPHICS 0 // Set to 0 by default. Use 1 when to see debug info. //------------------------------------------------------------ STRINGTABLE.H ---------------------------------------------------------------- -#define LION_INSTALL_SUPPORT 0 // Set to 0 by default. Setting this to 1 will make RevoBoot search in specific directories - // for com.apple.Boot.plist – required for Mac like Lion OS X installations. - +#define LION_INSTALL_SUPPORT 0 // Set to 0 by default. Setting this to 1 will make RevoBoot search in specific directories + // for com.apple.Boot.plist – required for Mac like Lion OS X installations. + //-------------------------------------------------------------- SMBIOS.C ------------------------------------------------------------------ @@ -337,7 +346,7 @@ #endif #if USE_STATIC_SMBIOS_DATA - #define LOAD_STATIC_SMBIOS_DATA_FROM_EXTRA 0 // Set to 0 by default. Change this to 1 to load: /Extra/SMBIOS/[MacModelNN].bin + #define LOAD_MODEL_SPECIFIC_SMBIOS_DATA 0 // Set to 0 by default. Change this to 1 to load: /Extra/SMBIOS/[MacModelNN].bin #endif #define OVERRIDE_DYNAMIC_MEMORY_DETECTION 0 // Set to 0 by default. Change this to 0 only when your SMBIOS data (type 17) is correct, or when @@ -346,22 +355,23 @@ // Note: Defaults to n MB 1066 DDR3 when set to 0 (to prevent errors in Profile Manager). -#define TARGET_MODEL MACMINI // Set to MACMINI by default. Supported models are: - // - // IMAC and IMAC_131, IMAC_122, IMAC_111, IMAC_121 - // MACBOOK and MACBOOK_41 - // MACBOOKAIR and MACBOOKAIR_42, MACBOOKAIR_41 - // MACBOOKPRO and MACBOOKPRO_101, MACBOOKPRO_91, MACBOOKPRO_83, MACBOOKPRO_82, - // MACBOOKPRO_81, MACBOOKPRO_61 - // MACMINI and MACMINI_53, MACMINI_52, MACMINI_51 - // MACPRO and MACPRO_51, MACPRO_41, MACPRO_31 - // - // Note: MACMINI (without _NNN) selects the default model (last one i.e. MACMINI_51). +#define TARGET_MODEL MACMINI // Set to MACMINI by default. Supported models are: + // + // IMAC and IMAC_131, IMAC_122, IMAC_111, IMAC_121 + // MACBOOK and MACBOOK_41 + // MACBOOKAIR and MACBOOKAIR_42, MACBOOKAIR_41 + // MACBOOKPRO and MACBOOKPRO_101, MACBOOKPRO_91, MACBOOKPRO_83, MACBOOKPRO_82, + // MACBOOKPRO_81, MACBOOKPRO_61 + // MACMINI and MACMINI_53, MACMINI_52, MACMINI_51 + // MACPRO and MACPRO_51, MACPRO_41, MACPRO_31 + // + // Note: MACMINI (without _NNN) selects the default model (last one i.e. MACMINI_51). #define SMB_SYSTEM_SERIAL_NUMBER "SOMESRLNUMBR" // Example only! - // Note: Match this with EFI_SYSTEM_SERIAL_NUMBER -#define SMB_BOARD_SERIAL_NUMBER "SOMESRLNUMBR" // Example only! +#if (TARGET_MODEL & MACPRO) + #define SMB_BOARD_SERIAL_NUMBER "SOMESRLNUMBR" // Example only! +#endif #define DEBUG_SMBIOS 0 // Set to 0 by default. Change this to 1 when things don't seem to work for you. @@ -370,7 +380,7 @@ #if USE_STATIC_SMBIOS_DATA - // Do nothing. + // Do nothing. #elif OVERRIDE_DYNAMIC_MEMORY_DETECTION // Setup RAM module info. Please note that you may have to expand this when you have more RAM modules. #define STATIC_RAM_SLOTS 4 // Number of RAM slots on mainboard. @@ -382,20 +392,20 @@ #define DYNAMIC_RAM_OVERRIDE_SIZE 0 // Set to 0 by default. Change this to 1 when you want to use override values (see below). #if DYNAMIC_RAM_OVERRIDE_SIZE - #define DYNAMIC_RAM_OVERRIDE_SIZES { SMB_MEM_SIZE_2GB, SMB_MEM_BANK_EMPTY, SMB_MEM_SIZE_2GB, SMB_MEM_BANK_EMPTY, 0 } // See libsaio/platform.h for other values. + #define DYNAMIC_RAM_OVERRIDE_SIZES { SMB_MEM_SIZE_2GB, SMB_MEM_BANK_EMPTY, SMB_MEM_SIZE_2GB, SMB_MEM_BANK_EMPTY, 0 } // See libsaio/platform.h for other values. #endif #define DYNAMIC_RAM_OVERRIDE_FREQUENCY 0 // Set to 0 by default. Change this to the frequency that you want to use as override value. - #define STATIC_RAM_PART_NUMBERS { "PartNum#0", "N/A", "PartNum#2", "N/A", 0 } // Use "N/A" for empty RAM banks. + #define STATIC_RAM_PART_NUMBERS { "PartNum#0", "N/A", "PartNum#1", "N/A", 0 } // Use "N/A" for empty RAM banks. - #define STATIC_RAM_SERIAL_NUMBERS { "Serial#0", "N/A", "Serial#2", "N/A", 0 } // Use "N/A" for empty RAM banks. + #define STATIC_RAM_SERIAL_NUMBERS { "Serial#0", "N/A", "Serial#2", "N/A", 0 } // Use "N/A" for empty RAM banks. #endif #define INCLUDE_MPS_TABLE 0 // Set to 0 by default. Change this to 1 when you want to include the MP table. -#define DEBUG_PLATFORM 0 // Set to 0 by default. Change this to 1 when things don't seem to work for you. +#define LOAD_MODEL_SPECIFIC_STATIC_DATA (LOAD_MODEL_SPECIFIC_ACPI_DATA || LOAD_MODEL_SPECIFIC_EFI_DATA || LOAD_MODEL_SPECIFIC_SMBIOS_DATA) +#define DEBUG_PLATFORM 0 // Set to 0 by default. Change this to 1 when things don't seem to work for you. //================================================================= END ==================================================================== - From 0fa8bfae4bf33d5e3cc1c179bdcf23c361038803 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 19:33:03 +0100 Subject: [PATCH 103/136] Patch for RevoBoot v1.5.34 --- i386/config/settings.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/i386/config/settings.h b/i386/config/settings.h index ad4fcb4..09da11a 100644 --- a/i386/config/settings.h +++ b/i386/config/settings.h @@ -3,10 +3,17 @@ * * Updates: * - * - Read settings file based on given model identifier (PikerAlpha, October 2012). + * - Read settings file based on given model identifier (PikerAlpha, October 2012). + * - COMMA_STRIPPED_MODEL_ID added (PikerAlpha, November 2012). */ -#define TO_STRING_DO(a) #a -#define STRING(a) TO_STRING_DO(a) +#define TO_STRING_DO(a) #a +#define STRING(a) TO_STRING_DO(a) #include STRING(SETTINGS_FILE) + +/* + * gPlatform.ModelID is a char * initialized by a call to strdup(SMB_PRODUCT_NAME) in + * platform.c and we use strdup once more here so that gPlatform.ModelID is untouched. + */ +#define COMMA_STRIPPED_MODEL_ID removeChar(strdup(gPlatform.ModelID), ',') From b42ff7d63c6eb053e78819cf140172047d4d30c9 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 19:35:54 +0100 Subject: [PATCH 104/136] Patch for RevoBoot v1.5.34 --- i386/libsaio/smbios.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/i386/libsaio/smbios.c b/i386/libsaio/smbios.c index 267a0c6..eb8507a 100755 --- a/i386/libsaio/smbios.c +++ b/i386/libsaio/smbios.c @@ -13,7 +13,6 @@ #if USE_STATIC_SMBIOS_DATA -#if LOAD_MODEL_SPECIFIC_SMBIOS_DATA //============================================================================== int useStaticSMBIOSData(void * aMemoryAddress) @@ -36,7 +35,7 @@ int useStaticSMBIOSData(void * aMemoryAddress) return tableLength; } -#endif /* #if INJECT_EFI_DEVICE_PROPERTIES */ + //============================================================================== From 27d81d300c035ea8a40ceb35d929dc8b7bea8e2f Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 22:46:29 +0100 Subject: [PATCH 105/136] Updating version info for RevoBoot v1.5.34 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index a26e0a8..e201dd3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.33 +1.5.34 From 344e6e25ebe2cfa6f484f76426f32fcee3cde6bc Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 23:05:26 +0100 Subject: [PATCH 106/136] Update to RevoBoot v1.5.34 --- CHANGES | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGES b/CHANGES index 008d1cf..3eab64a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,17 @@ +RevoBoot v1.5.34 +================ +- LOAD_STATIC_EFI_DATA_FROM_EXTRA in settings-template.h renamed to LOAD_MODEL_SPECIFIC_EFI_DATA (PikerAlpha, October 2012). +- LOAD_STATIC_SMBIOS_DATA_FROM_EXTRA in settings-template.h renamed to LOAD_MODEL_SPECIFIC_SMBIOS_DATA (PikerAlpha, October 2012). +- New LOAD_MODEL_SPECIFIC_ACPI_DATA setting in settings-template.h (PikerAlpha, October 2012). +- New LOAD_MODEL_SPECIFIC_STATIC_DATA setting in settings-template.h (PikerAlpha, October 2012). + +Notes: + +Static EFI/SMBIOS data will be used when RevoBoot can't find model specific data: /Extra/[EFI/SMBIOS]/MacModelNN.bin +DSDT.aml will be loaded when RevoBoot can't find: /Extra/ACPI/DSDT-MacModelNN.aml (example). +You must use the latest version of RevoBoot/i386/config/settings-template.h or things won't work. + + RevoBoot v1.5.33 ================ - Restored lost lines in RevoBoot/i386/libsaio/SMBIOS/static_data.h (PikerAlpha, November 2012). From 5975a026b0f54ca7579590d23f319f4172ba8ac7 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 23:05:53 +0100 Subject: [PATCH 107/136] Fix version number --- i386/config/settings-template.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i386/config/settings-template.h b/i386/config/settings-template.h index 8f553c8..65cbbbc 100644 --- a/i386/config/settings-template.h +++ b/i386/config/settings-template.h @@ -1,7 +1,7 @@ /* * Copyright (c) 2009 Master Chief. All rights reserved. * - * Note: This is an essential part of the build process for RevoBoot v1.5.32 and greater. + * Note: This is an essential part of the build process for RevoBoot v1.5.34 and greater. * * Updates: * From 187236880cdb39fb8926973da0b89267fce020b2 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 3 Nov 2012 23:22:58 +0100 Subject: [PATCH 108/136] Typo, note about NetBoot/NetInstall and cleanups --- README | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README b/README index 9da40cd..f0a28a3 100644 --- a/README +++ b/README @@ -1,12 +1,15 @@ About this project: +------------------- This Open Source hobby project is maintained by Pike and dgsga. Two long time supporters of the RevoBoot project. Note that we do not tolerate/share any (links to) copyrighted material. We only use purchased software and we won't share any of it. Just get your copy of OS X in the Apple store. Should be affordable for everyone. Mountain Lion Server: +--------------------- RevoBoot has been confirmed to work with the Server app for Mountain Lion (12C60). Fusion Drive Support: +--------------------- Apple's new Fusion Drive* is a software implementation to speedup the boot and load process for frequently used applications, without limiting the storage capacity in a bad way. See also: http://support.apple.com/kb/HT5446 The new Mac's that come with a Fusion Drive boot from the third (Recovery HD like) partition on the SSD. This partition is 134.2 MB in size and is called "Boot OS X". @@ -14,11 +17,19 @@ The Recovery HD partition can be found as third partition on the HDD. Setting up RevoBoot detects CoreStorage partitions and will boot from the boot helper partition on the SDD. +NetBoot/NetInstall: +------------------- +People who have Mountain Lion Server setup and like to install their hack from it... sorry that won't work. The source +code snippets for it have been stripped out (by Master Chief in 2009) but we will fix this in a next update of RevoBoot. + Xcode Support for Mountain Lion: -RevoBoot can be build on Snow Leopard, Lion and Mountain Lion. The latter requires Xcode 4.5.1 and a libcc_kext.a from an older version of Xcode. See change log for instructions. +-------------------------------- +RevoBoot can be built on Snow Leopard, Lion and Mountain Lion. The latter requires Xcode 4.5.1 (and greater) and libcc_kext.a from an older version of Xcode. See change log for instructions. +Note: The latest release of Xcode (4.5.2) also works with fine with an older copy libcc_kext.a. Configuration: +-------------- Please note that RevoBoot must be configured for your hardware so start reading our WiKi. See also: https://github.com/blackosx/RevoBuilder/wiki/Using-RevoBuilder From ddaeb064be69154d71fd86a3457f74fa5c082561 Mon Sep 17 00:00:00 2001 From: Pike Date: Mon, 5 Nov 2012 20:00:24 +0100 Subject: [PATCH 109/136] Cleanups for RevoBoot v1.5.35 --- i386/libsaio/allocate.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/i386/libsaio/allocate.c b/i386/libsaio/allocate.c index f986219..fdd5849 100755 --- a/i386/libsaio/allocate.c +++ b/i386/libsaio/allocate.c @@ -36,10 +36,7 @@ long AllocateMemoryRange(char * rangeName, long start, long length, long type) { - char *nameBuf; - uint32_t *buffer; - - nameBuf = malloc(strlen(rangeName) + 1); + char *nameBuf = malloc(strlen(rangeName) + 1); if (nameBuf == 0) { @@ -48,10 +45,12 @@ long AllocateMemoryRange(char * rangeName, long start, long length, long type) strcpy(nameBuf, rangeName); - buffer = malloc(2 * sizeof(uint32_t)); + uint32_t *buffer = malloc(2 * sizeof(uint32_t)); if (buffer == 0) { + free(nameBuf); + return -1; } From b7e97101d56ad8f2b81e320009fdd8f4d4121a20 Mon Sep 17 00:00:00 2001 From: Pike Date: Mon, 5 Nov 2012 20:01:04 +0100 Subject: [PATCH 110/136] Cleanups for RevoBoot v1.5.35 --- i386/libsaio/bios.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/i386/libsaio/bios.h b/i386/libsaio/bios.h index 0a0c927..7391450 100755 --- a/i386/libsaio/bios.h +++ b/i386/libsaio/bios.h @@ -32,7 +32,7 @@ typedef union { - unsigned int rx; + unsigned int rx; unsigned short rr; struct @@ -87,13 +87,13 @@ typedef struct #define EBIOS_LOCKING_ACCESS 0x02 #define EBIOS_ENHANCED_DRIVE_INFO 0x04 -#define BASE_HD_DRIVE 0x80 +#define BASE_HD_DRIVE 0x80 /* * Used in saio_types.h and in StringTable.c (function loadSystemConfig). */ -#define IO_CONFIG_DATA_SIZE 4096 +#define IO_CONFIG_DATA_SIZE 4096 /* From 585650095e8c66ba2f11ec4671da6bf09cdc85ea Mon Sep 17 00:00:00 2001 From: Pike Date: Mon, 5 Nov 2012 20:01:37 +0100 Subject: [PATCH 111/136] Cleanups for RevoBoot v1.5.35 --- i386/libsaio/biosfn.c | 82 ++++++++++++++++++++++++++----------------- 1 file changed, 50 insertions(+), 32 deletions(-) diff --git a/i386/libsaio/biosfn.c b/i386/libsaio/biosfn.c index 32a5c82..61f09c5 100755 --- a/i386/libsaio/biosfn.c +++ b/i386/libsaio/biosfn.c @@ -51,8 +51,8 @@ static biosBuf_t bb; int fastEnableA20(void) { - bb.intno = 0x15; - bb.eax.rx = 0x2401; + bb.intno = 0x15; + bb.eax.rx = 0x2401; bios(&bb); // If successful: CF clear, AH = 00h. On error: CF set, AH = status @@ -72,8 +72,8 @@ int bgetc(void) */ while(!readKeyboardStatus()); - bb.intno = 0x16; - bb.eax.r.h = 0x00; + bb.intno = 0x16; + bb.eax.r.h = 0x00; bios(&bb); return bb.eax.rr; @@ -150,7 +150,9 @@ unsigned long getMemoryMap(MemoryRange * rangeArray, unsigned long maxRangeCount // printf("Get memory map 0x%x, %d\n", rangeArray); // getchar(); if (maxRangeCount > (BIOS_LEN / sizeof(MemoryRange))) + { maxRangeCount = (BIOS_LEN / sizeof(MemoryRange)); + } bb.ebx.rx = 0; // Initial continuation value must be zero. @@ -160,14 +162,13 @@ unsigned long getMemoryMap(MemoryRange * rangeArray, unsigned long maxRangeCount bb.eax.rx = 0xe820; bb.ecx.rx = kDescriptorSizeMin; bb.edx.rx = kMemoryMapSignature; - bb.edi.rr = NORMALIZED_OFFSET( (unsigned long) range ); - bb.es = NORMALIZED_SEGMENT( (unsigned long) range ); + bb.edi.rr = NORMALIZED_OFFSET( (unsigned long) range); + bb.es = NORMALIZED_SEGMENT( (unsigned long) range); bios(&bb); // Check for errors. - if ( bb.flags.cf || bb.eax.rx != kMemoryMapSignature - || bb.ecx.rx != kDescriptorSizeMin ) + if (bb.flags.cf || bb.eax.rx != kMemoryMapSignature || bb.ecx.rx != kDescriptorSizeMin) { //printf("Got an error %x %x %x\n", bb.flags.cf, // bb.eax.rx, bb.ecx.rx); @@ -176,16 +177,19 @@ unsigned long getMemoryMap(MemoryRange * rangeArray, unsigned long maxRangeCount // Tally up the conventional/extended memory sizes. - if (range->type == kMemoryRangeUsable || range->type == kMemoryRangeACPI || - range->type == kMemoryRangeNVS ) + if (range->type == kMemoryRangeUsable || range->type == kMemoryRangeACPI || range->type == kMemoryRangeNVS) { // Tally the conventional memory ranges. if (range->base + range->length <= 0xa0000) + { conMemSize += range->length; + } // Record the top of extended memory. if (range->base >= EXTENDED_ADDR) + { extMemSize += range->length; + } } range++; @@ -193,13 +197,15 @@ unsigned long getMemoryMap(MemoryRange * rangeArray, unsigned long maxRangeCount // Is this the last address range? - if ( bb.ebx.rx == 0 ) { + if (bb.ebx.rx == 0) + { //printf("last range\n"); break; } } - *conMemSizePtr = conMemSize / 1024; // size in KB - *extMemSizePtr = extMemSize / 1024; // size in KB + + *conMemSizePtr = (conMemSize / 1024); // size in KB + *extMemSizePtr = (extMemSize / 1024); // size in KB // Copy out data bcopy((char *)BIOS_ADDR, rangeArray, ((char *)range - (char *)BIOS_ADDR)); @@ -339,7 +345,7 @@ int biosread(int dev, int cyl, int head, int sec, int num) bb.intno = 0x13; sec += 1; // sector numbers start at 1. - for (i=0;;) + for (i = 0; ;) { bb.ecx.r.h = cyl; bb.ecx.r.l = ((cyl & 0x300) >> 2) | (sec & 0x3F); @@ -430,11 +436,11 @@ int ebiosread(int dev, unsigned long long sec, int count) void putc(int ch) { - bb.intno = 0x10; - bb.ebx.r.h = 0x00; /* background black */ - bb.ebx.r.l = 0x0F; /* foreground white */ - bb.eax.r.h = 0x0e; - bb.eax.r.l = ch; + bb.intno = 0x10; + bb.ebx.r.h = 0x00; /* background black */ + bb.ebx.r.l = 0x0F; /* foreground white */ + bb.eax.r.h = 0x0e; + bb.eax.r.l = ch; bios(&bb); } @@ -516,9 +522,10 @@ int is_no_emulation(int drive) int get_drive_info(int drive, struct driveInfo *dp) { - boot_drive_info_t *di = &dp->di; int ret = 0; + boot_drive_info_t *di = &dp->di; + #if UNUSED if (maxhd == 0) { @@ -528,11 +535,15 @@ int get_drive_info(int drive, struct driveInfo *dp) bios(&bb); if (bb.flags.cf == 0) + { maxhd = 0x7f + bb.edx.r.l; + } }; if (drive > maxhd) + { return 0; + } #endif bzero(dp, sizeof(struct driveInfo)); @@ -549,18 +560,21 @@ int get_drive_info(int drive, struct driveInfo *dp) bios(&bb); if ((bb.ebx.rr == 0xaa55) && (bb.flags.cf == 0)) + { dp->uses_ebios = bb.ecx.r.l; // Get flags for supported operations. + } if (dp->uses_ebios & (EBIOS_ENHANCED_DRIVE_INFO | EBIOS_LOCKING_ACCESS | EBIOS_FIXED_DISK_ACCESS)) { // Get EBIOS drive info. static struct drive_params params; params.buf_size = sizeof(params); - bb.intno = 0x13; - bb.eax.r.h = 0x48; - bb.edx.r.l = drive; - bb.esi.rr = NORMALIZED_OFFSET((unsigned)¶ms); - bb.ds = NORMALIZED_SEGMENT((unsigned)¶ms); + + bb.intno = 0x13; + bb.eax.r.h = 0x48; + bb.edx.r.l = drive; + bb.esi.rr = NORMALIZED_OFFSET((unsigned)¶ms); + bb.ds = NORMALIZED_SEGMENT((unsigned)¶ms); bios(&bb); if (bb.flags.cf != 0 /* || params.phys_sectors < 2097152 */) @@ -600,7 +614,9 @@ int get_drive_info(int drive, struct driveInfo *dp) #endif if (ret == 0) + { dp->valid = 1; + } return ret; } @@ -610,8 +626,11 @@ int get_drive_info(int drive, struct driveInfo *dp) void sleep(int n) { - unsigned int endtime = (time18() + 18*n); - while (time18() < endtime); + if (n < 60) + { + unsigned int endtime = (time18() + (18*n)); + while (time18() < endtime); + } } @@ -619,10 +638,9 @@ void sleep(int n) void delay(int ms) { - bb.intno = 0x15; - bb.eax.r.h = 0x86; - bb.ecx.rr = ms >> 16; - bb.edx.rr = ms & 0xFFFF; + bb.intno = 0x15; + bb.eax.r.h = 0x86; + bb.ecx.rr = ms >> 16; + bb.edx.rr = ms & 0xFFFF; bios(&bb); } - From e7ed8ffac7f26d3c0b9f82142d3c3e444711c6ef Mon Sep 17 00:00:00 2001 From: Pike Date: Mon, 5 Nov 2012 20:02:22 +0100 Subject: [PATCH 112/136] Cleanups for RevoBoot v1.5.35 --- i386/libsaio/efi.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/i386/libsaio/efi.c b/i386/libsaio/efi.c index 77f7df7..4b35f18 100755 --- a/i386/libsaio/efi.c +++ b/i386/libsaio/efi.c @@ -253,9 +253,9 @@ void *convertHexStr2Binary(const char *hexStr, int *outLength) { int len; char hexNibble; - char hexByte[2]; + char hexByte[2] = ""; uint8_t binChar; - uint8_t *binStr; + uint8_t *binStr = NULL; int hexStrIdx, binStrIdx, hexNibbleIdx; len = strlen(hexStr); @@ -331,22 +331,31 @@ static EFI_UINT32* getUUIDFromString(const char * givenUUID) // Patch by: rekurs char szUUID[37]; // 0-35 (36) + 1 char *p = szUUID; - while (*givenUUID) { + while (*givenUUID) + { if (*givenUUID != '-') + { *p++ = *givenUUID++; + } else + { givenUUID++; + } } *p = '\0'; void* binaryString = convertHexStr2Binary(szUUID, &size); if (binaryString && size == 16) + { return (EFI_UINT32*) binaryString; + } verbose("%swrong format maybe?\n", errStr); } else + { verbose("%slength should be 36.\n", errStr); + } } return (EFI_UINT32*) 0; } From 896c00258686fbfb6bce2bf974ed04e8f48265ef Mon Sep 17 00:00:00 2001 From: Pike Date: Mon, 5 Nov 2012 20:03:02 +0100 Subject: [PATCH 113/136] Cleanups for RevoBoot v1.5.35 --- i386/libsaio/hfs_compare.c | 340 ++++++++++++++++++++++++------------- 1 file changed, 221 insertions(+), 119 deletions(-) diff --git a/i386/libsaio/hfs_compare.c b/i386/libsaio/hfs_compare.c index 405a571..8b86b60 100755 --- a/i386/libsaio/hfs_compare.c +++ b/i386/libsaio/hfs_compare.c @@ -31,45 +31,60 @@ #include "hfs_CaseTables.h" #if ! UNCOMPRESSED +//============================================================================== static unsigned short * UncompressStructure(struct compressed_block *bp, int count, int size) { - unsigned short *out = malloc(size); - unsigned short *op = out; - unsigned short data; - int i, j; - - for (i=0; icount) - { - stop("HFS+ Unicode tables are malformed\n"); - } - data = bp->data; - for (j=0; jcount; j++) { - *op++ = data; - if (bp->type == kTypeAscending) data++; - else if (bp->type == kTypeAscending256) data += 256; - } - } - return out; + int i, j; + + unsigned short *out = malloc(size); + unsigned short *op = out; + unsigned short data; + + for (i = 0; i < count; i++, bp++) + { + // If this happens (it shouldn't) please fix size and/or double check that count really is + // the number of elements in the array. + // This was a very hard bug to find, so please leave this code here. + if (out + size <= op + bp->count) + { + stop("HFS+ Unicode tables are malformed\n"); + } + + data = bp->data; + + for (j = 0; j count; j++) + { + *op++ = data; + + if (bp->type == kTypeAscending) + { + data++; + } + else if (bp->type == kTypeAscending256) + { + data += 256; + } + } + } + + return out; } + +//============================================================================== + static void InitCompareTables(void) { - if (gCompareTable == 0) { - gCompareTable = UncompressStructure(gCompareTableCompressed, - kCompareTableNBlocks, kCompareTableDataSize); - gLowerCaseTable = UncompressStructure(gLowerCaseTableCompressed, - kLowerCaseTableNBlocks, kLowerCaseTableDataSize); - } + if (gCompareTable == 0) + { + gCompareTable = UncompressStructure(gCompareTableCompressed, kCompareTableNBlocks, kCompareTableDataSize); + gLowerCaseTable = UncompressStructure(gLowerCaseTableCompressed, kLowerCaseTableNBlocks, kLowerCaseTableDataSize); + } } - #endif /* ! UNCOMPRESSED */ -//_______________________________________________________________________ +//============================================================================== // // Routine: FastRelString // @@ -77,7 +92,7 @@ static void InitCompareTables(void) // returns 1 if str1 > str2 // return 0 if equal // -//_______________________________________________________________________ +//============================================================================== int32_t FastRelString(u_int8_t * str1, u_int8_t * str2) { @@ -85,16 +100,20 @@ int32_t FastRelString(u_int8_t * str1, u_int8_t * str2) u_int8_t length, length2; #if ! UNCOMPRESED - InitCompareTables(); + InitCompareTables(); #endif length = *(str1++); length2 = *(str2++); if (length == length2) + { bestGuess = 0; + } else if (length < length2) + { bestGuess = -1; + } else { bestGuess = 1; @@ -116,12 +135,16 @@ int32_t FastRelString(u_int8_t * str1, u_int8_t * str2) bSortWord = gCompareTable[bChar]; if (aSortWord > bSortWord) + { return 1; + } if (aSortWord < bSortWord) + { return -1; + } } - + /* * If characters match exactly, then go on to next character * immediately without doing any extra work. @@ -133,6 +156,7 @@ int32_t FastRelString(u_int8_t * str1, u_int8_t * str2) } +//============================================================================== // // FastUnicodeCompare - Compare two Unicode strings; produce a relative ordering // @@ -190,91 +214,125 @@ int32_t FastRelString(u_int8_t * str1, u_int8_t * str2) // return 1; // -int32_t FastUnicodeCompare( u_int16_t * str1, register u_int32_t length1, - u_int16_t * str2, register u_int32_t length2, int byte_order ) +int32_t FastUnicodeCompare(u_int16_t * str1, register u_int32_t length1, + u_int16_t * str2, register u_int32_t length2, int byte_order) { - register u_int16_t c1,c2; + register u_int16_t c1, c2; register u_int16_t temp; #if ! UNCOMPRESSED - InitCompareTables(); + InitCompareTables(); #endif - while (1) { + while (1) + { /* Set default values for c1, c2 in case there are no more valid chars */ c1 = 0; c2 = 0; /* Find next non-ignorable char from str1, or zero if no more */ - while (length1 && c1 == 0) { + while (length1 && c1 == 0) + { if (byte_order == OSBigEndian) + { c1 = SWAP_BE16(*(str1++)); + } else + { c1 = SWAP_LE16(*(str1++)); + } + --length1; + if ((temp = gLowerCaseTable[c1>>8]) != 0) // is there a subtable for this upper byte? + { c1 = gLowerCaseTable[temp + (c1 & 0x00FF)]; // yes, so fold the char + } } /* Find next non-ignorable char from str2, or zero if no more */ - while (length2 && c2 == 0) { + while (length2 && c2 == 0) + { if (byte_order == OSBigEndian) + { c2 = SWAP_BE16(*(str2++)); + } else + { c2 = SWAP_LE16(*(str2++)); + } + --length2; + if ((temp = gLowerCaseTable[c2>>8]) != 0) // is there a subtable for this upper byte? + { c2 = gLowerCaseTable[temp + (c2 & 0x00FF)]; // yes, so fold the char + } } if (c1 != c2) /* found a difference, so stop looping */ + { break; + } if (c1 == 0) /* did we reach the end of both strings at the same time? */ + { return 0; /* yes, so strings are equal */ + } } if (c1 < c2) + { return -1; - else - return 1; + } + + return 1; } +//============================================================================== // // BinaryUnicodeCompare - Compare two Unicode strings; produce a relative ordering // Compared using a 16-bit binary comparison (no case folding) -// -int32_t BinaryUnicodeCompare (u_int16_t * str1, u_int32_t length1, - u_int16_t * str2, u_int32_t length2) + +int32_t BinaryUnicodeCompare(u_int16_t * str1, u_int32_t length1, u_int16_t * str2, u_int32_t length2) { - register u_int16_t c1, c2; - int32_t bestGuess; - u_int32_t length; - - bestGuess = 0; - - if (length1 < length2) { - length = length1; - --bestGuess; - } else if (length1 > length2) { - length = length2; - ++bestGuess; - } else { - length = length1; - } - - while (length--) { - c1 = *(str1++); - c2 = *(str2++); - - if (c1 > c2) - return (1); - if (c1 < c2) - return (-1); - } - - return (bestGuess); + register u_int16_t c1, c2; + int32_t bestGuess = 0; + u_int32_t length; + + if (length1 < length2) + { + length = length1; + --bestGuess; + } + else if (length1 > length2) + { + length = length2; + ++bestGuess; + } + else + { + length = length1; + } + + while (length--) + { + c1 = *(str1++); + c2 = *(str2++); + + if (c1 > c2) + { + return (1); + } + + if (c1 < c2) + { + return (-1); + } + } + + return (bestGuess); } @@ -304,36 +362,57 @@ int32_t BinaryUnicodeCompare (u_int16_t * str1, u_int32_t length1, * ucslen is the number of UCS-2 input characters (not bytes) * bufsize is the size of the output buffer in bytes */ -void utf_encodestr( const u_int16_t * ucsp, int ucslen, - u_int8_t * utf8p, u_int32_t bufsize, int byte_order ) + +void utf_encodestr(const u_int16_t * ucsp, int ucslen, u_int8_t * utf8p, u_int32_t bufsize, int byte_order) { u_int8_t *bufend; u_int16_t ucs_ch; bufend = utf8p + bufsize; - while (ucslen-- > 0) { - if (byte_order == OSBigEndian) - ucs_ch = SWAP_BE16(*ucsp++); - else - ucs_ch = SWAP_LE16(*ucsp++); + while (ucslen-- > 0) + { + if (byte_order == OSBigEndian) + { + ucs_ch = SWAP_BE16(*ucsp++); + } + else + { + ucs_ch = SWAP_LE16(*ucsp++); + } - if (ucs_ch < 0x0080) { + if (ucs_ch < 0x0080) + { if (utf8p >= bufend) + { break; + } + if (ucs_ch == '\0') + { continue; /* skip over embedded NULLs */ + } + *utf8p++ = ucs_ch; - } else if (ucs_ch < 0x800) { + } + else if (ucs_ch < 0x800) + { if ((utf8p + 1) >= bufend) + { break; + } + *utf8p++ = (ucs_ch >> 6) | 0xc0; *utf8p++ = (ucs_ch & 0x3f) | 0x80; - - } else { + } + else + { if ((utf8p + 2) >= bufend) + { break; + } + *utf8p++ = (ucs_ch >> 12) | 0xe0; *utf8p++ = ((ucs_ch >> 6) & 0x3f) | 0x80; *utf8p++ = ((ucs_ch) & 0x3f) | 0x80; @@ -351,6 +430,7 @@ void utf_encodestr( const u_int16_t * ucsp, int ucslen, * ucslen is the number of UCS-2 output characters (not bytes) * bufsize is the size of the output buffer in bytes */ + void utf_decodestr(const u_int8_t * utf8p, u_int16_t * ucsp, u_int16_t * ucslen, u_int32_t bufsize, int byte_order) { u_int16_t *bufstart; @@ -361,58 +441,80 @@ void utf_decodestr(const u_int8_t * utf8p, u_int16_t * ucsp, u_int16_t * ucslen, bufstart = ucsp; bufend = (u_int16_t *)((u_int8_t *)ucsp + bufsize); - while ((byte = *utf8p++) != '\0') { + while ((byte = *utf8p++) != '\0') + { if (ucsp >= bufend) + { break; + } /* check for ascii */ - if (byte < 0x80) { + if (byte < 0x80) + { ucs_ch = byte; - if (byte_order == OSBigEndian) - *ucsp++ = SWAP_BE16(ucs_ch); - else - *ucsp++ = SWAP_LE16(ucs_ch); - + if (byte_order == OSBigEndian) + { + *ucsp++ = SWAP_BE16(ucs_ch); + } + else + { + *ucsp++ = SWAP_LE16(ucs_ch); + } + continue; } - switch (byte & 0xf0) { - /* 2 byte sequence*/ - case 0xc0: - case 0xd0: - /* extract bits 6 - 10 from first byte */ - ucs_ch = (byte & 0x1F) << 6; - break; - /* 3 byte sequence*/ - case 0xe0: - /* extract bits 12 - 15 from first byte */ - ucs_ch = (byte & 0x0F) << 6; - - /* extract bits 6 - 11 from second byte */ - if (((byte = *utf8p++) & 0xc0) != 0x80) - goto stop; - - ucs_ch += (byte & 0x3F); - ucs_ch <<= 6; - break; - default: - goto stop; + switch (byte & 0xf0) + { + /* 2 byte sequence*/ + case 0xc0: + case 0xd0: /* extract bits 6 - 10 from first byte */ + ucs_ch = (byte & 0x1F) << 6; + break; + /* 3 byte sequence*/ + case 0xe0: + /* extract bits 12 - 15 from first byte */ + ucs_ch = (byte & 0x0F) << 6; + + /* extract bits 6 - 11 from second byte */ + if (((byte = *utf8p++) & 0xc0) != 0x80) + { + goto stop; + } + + ucs_ch += (byte & 0x3F); + ucs_ch <<= 6; + break; + default: + goto stop; } /* extract bits 0 - 5 from final byte */ if (((byte = *utf8p++) & 0xc0) != 0x80) + { goto stop; - ucs_ch += (byte & 0x3F); + } + + ucs_ch += (byte & 0x3F); - if (byte_order == OSBigEndian) - *ucsp++ = SWAP_BE16(ucs_ch); - else - *ucsp++ = SWAP_LE16(ucs_ch); + if (byte_order == OSBigEndian) + { + *ucsp++ = SWAP_BE16(ucs_ch); + } + else + { + *ucsp++ = SWAP_LE16(ucs_ch); + } } + stop: - if (byte_order == OSBigEndian) - *ucslen = SWAP_BE16(ucsp - bufstart); - else - *ucslen = SWAP_LE16(ucsp - bufstart); + if (byte_order == OSBigEndian) + { + *ucslen = SWAP_BE16(ucsp - bufstart); + } + else + { + *ucslen = SWAP_LE16(ucsp - bufstart); + } } From d2ae81d752ad1fb3d65675e2ce96a5ad7d3cb5f8 Mon Sep 17 00:00:00 2001 From: Pike Date: Mon, 5 Nov 2012 20:04:20 +0100 Subject: [PATCH 114/136] Feature enhancements for RevoBoot v1.5.35 --- i386/libsaio/smbios.c | 110 ++++++++++++++++++++++++++---------------- 1 file changed, 68 insertions(+), 42 deletions(-) diff --git a/i386/libsaio/smbios.c b/i386/libsaio/smbios.c index eb8507a..deb8ae0 100755 --- a/i386/libsaio/smbios.c +++ b/i386/libsaio/smbios.c @@ -6,37 +6,16 @@ * - Dynamic and static SMBIOS data gathering added by DHP in 2010. * - Refactorized by DHP in 2011. * - Get static EFI data (optional) from /Extra/EFI/[MacModelNN].bin (PikerAlpha, October 2012). + * - Set newEPS->dmi.tableLength to fileSize when model specific data is loaded (PikerAlpha, November 2012). + * - Get number of table structures from loaded model specific SMBIOS data (PikerAlpha, November 2012). + * - Set newEPS->maxStructureSize when SET_MAX_STRUCTURE_LENGTH is set (PikerAlpha, November 2012). + * - Check/correct errors in RevoBoot/i386/config/SMBIOS/[data-template/MacModelNN].h (PikerAlpha, November 2012). */ #include "platform.h" #if USE_STATIC_SMBIOS_DATA - -//============================================================================== - -int useStaticSMBIOSData(void * aMemoryAddress) -{ - // The STRING (macro) is defined in RevoBoot/i386/config/settings.h - #include STRING(SMBIOS_DATA_FILE) - - static uint32_t SMBIOS_Table[] = - { - // Replaced with data from: RevoBoot/i386/config/SMBIOS/[data-template/MacModelNN].h - STATIC_SMBIOS_DATA - }; - - _SMBIOS_DEBUG_DUMP("Using statically linked SMBIOS data\n"); - - int tableLength = sizeof(SMBIOS_Table); - - // Copy the static SMBIOS data into the newly allocated memory page. Right after the new EPS. - memcpy(aMemoryAddress, SMBIOS_Table, tableLength); - - return tableLength; -} - - //============================================================================== void setupSMBIOS(void) @@ -75,41 +54,88 @@ void setupSMBIOS(void) newEPS->dmi.anchor[3] = 0x49; // I newEPS->dmi.anchor[4] = 0x5f; // _ newEPS->dmi.checksum = 0; - newEPS->dmi.tableLength = tableLength; + newEPS->dmi.tableLength = tableLength; newEPS->dmi.tableAddress = (uint32_t) (kernelMemory + sizeof(struct SMBEntryPoint)); newEPS->dmi.bcdRevision = 0x24; - newEPS->dmi.structureCount = STATIC_SMBIOS_DMI_STRUCTURE_COUNT; // Defined in RevoBoot/i386/config/SMBIOS/data-template.h + newEPS->dmi.structureCount = STATIC_SMBIOS_DMI_STRUCTURE_COUNT; // Defined in RevoBoot/i386/config/SMBIOS/[data-template/MacModelNN].h -#if LOAD_MODEL_SPECIFIC_SMBIOS_DATA + // Safety measure to protect people from doing something that breaks the boot process. + // #define FORCED_CHECK ((STATIC_SMBIOS_DMI_STRUCTURE_COUNT == 0) || (SET_MAX_STRUCTURE_LENGTH && (STATIC_SMBIOS_SM_MAX_STRUCTURE_SIZE == 0))) + #define FORCED_CHECK ((STATIC_SMBIOS_DMI_STRUCTURE_COUNT == 0) || SET_MAX_STRUCTURE_LENGTH) + +#if (LOAD_MODEL_SPECIFIC_SMBIOS_DATA || FORCED_CHECK) /* - * This is nothing more than a mere stop gap solution, since using the factory values here, instead of walking over - * staticSMBIOSData to get them, may hang the kernel at boot time (will be fixed in a next update of RevoBoot). + * Get number of SMBIOS table structures from the loaded model specific SMBIOS data, or + * when we have 0 values in: RevoBoot/i386/config/SMBIOS/[data-template/MacModelNN].bin */ - if (fileSize > 0) + if ((fileSize > 0) || FORCED_CHECK) { - newEPS->maxStructureSize = factoryEPS->maxStructureSize; // Defined in RevoBoot/i386/libsaio/SMBIOS/static_data.h - newEPS->dmi.structureCount = factoryEPS->dmi.structureCount; // Defined in RevoBoot/i386/libsaio/SMBIOS/static_data.h - - _SMBIOS_DEBUG_DUMP("factoryEPS->maxStructureSize : %d\n", factoryEPS->maxStructureSize); - _SMBIOS_DEBUG_DUMP("factoryEPS->dmi.structureCount: %d\n", factoryEPS->dmi.structureCount); - _SMBIOS_DEBUG_SLEEP(1); - } + UInt16 structureCount = 0; + + char * structurePtr = (char *)newEPS->dmi.tableAddress; + char * structureEnd = (structurePtr + newEPS->dmi.tableLength); + + while (structureEnd > (structurePtr + sizeof(SMBStructHeader))) + { + struct SMBStructHeader * header = (struct SMBStructHeader *) structurePtr; + +#if SET_MAX_STRUCTURE_LENGTH + char * stringsPtr = structurePtr; + #if DEBUG_SMBIOS + SMBByte currentStructureType = header->type; + #endif #endif + // Skip the formatted area of the structure. + structurePtr += header->length; + + /* + * Skip the unformatted structure area at the end (strings). + * Using word comparison instead of checking two bytes (thanks to Kabyl). + */ + for (; ((uint16_t *)structurePtr)[0] != 0; structurePtr++); + + // Adjust pointer after locating the double 0 terminator. + structurePtr += 2; + + // Update structure counter. + structureCount++; + + _SMBIOS_DEBUG_DUMP("structureCount: %d\n", structureCount); + +#if SET_MAX_STRUCTURE_LENGTH + UInt16 maxStructureSize = (structurePtr - stringsPtr); + + if (newEPS->maxStructureSize < maxStructureSize) + { + newEPS->maxStructureSize = maxStructureSize; + } + + _SMBIOS_DEBUG_DUMP("Structure (%d) length: %3d bytes.\n", currentStructureType, maxStructureSize); + _SMBIOS_DEBUG_SLEEP(1); +#endif // #if SET_MAX_STRUCTURE_LENGTH + } + // Uodate number of structures (boot hang without the correct value). + newEPS->dmi.structureCount = structureCount; + } +#endif // #if (LOAD_MODEL_SPECIFIC_SMBIOS_DATA || FORCED_CHECK) + /* + * newEPS->dmi.tableLength represents the length of the static data, or the size + * of the model specific SMBIOS data file from: /Extra/SMBIOS/MacModelNN.bin + */ + _SMBIOS_DEBUG_DUMP("newEPS->dmi.structureCount: %d\nnewEPS.dmi.tableLength: %d\n", newEPS->dmi.structureCount, newEPS->dmi.tableLength); // Take care of possible checksum errors newEPS->dmi.checksum = 256 - checksum8(&newEPS->dmi, sizeof(newEPS->dmi)); newEPS->checksum = 256 - checksum8(newEPS, sizeof(* newEPS)); - _SMBIOS_DEBUG_DUMP("newEPS->dmi.structureCount: %d - tableLength: %d\n", newEPS->dmi.structureCount, newEPS->dmi.tableLength); - - // Used to update the EFI Configuration Table (in efi.c) which is + // Used to update the EFI Configuration Table (in efi.c) which is // what AppleSMBIOS.kext reads to setup the SMBIOS table for OS X. gPlatform.SMBIOS.BaseAddress = (uint32_t) newEPS; _SMBIOS_DEBUG_DUMP("New SMBIOS replacement setup.\n"); _SMBIOS_DEBUG_SLEEP(5); } -#else +#else // #if USE_STATIC_SMBIOS_DATA #include "smbios/dynamic_data.h" From 43ba53217f12e8466c2baced2dd5974cda44deee Mon Sep 17 00:00:00 2001 From: Pike Date: Mon, 5 Nov 2012 20:05:06 +0100 Subject: [PATCH 115/136] Adding SMBStructHeader for RevoBoot v1.5.35 --- i386/libsaio/smbios/essentials.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/i386/libsaio/smbios/essentials.h b/i386/libsaio/smbios/essentials.h index dc2ad54..9b4a970 100755 --- a/i386/libsaio/smbios/essentials.h +++ b/i386/libsaio/smbios/essentials.h @@ -58,4 +58,11 @@ struct SMBEntryPoint struct DMIEntryPoint dmi; } __attribute__((packed)); -#endif /* !__LIBSAIO_SMBIOS_ESSENTIALS_H */ \ No newline at end of file +typedef struct SMBStructHeader +{ + SMBByte type; + SMBByte length; + SMBWord handle; +} __attribute__((packed)) SMBStructHeader; + +#endif /* !__LIBSAIO_SMBIOS_ESSENTIALS_H */ From 00894237c7aebbcdedc1c7e5ac7990bc30ee2f6d Mon Sep 17 00:00:00 2001 From: Pike Date: Mon, 5 Nov 2012 20:06:24 +0100 Subject: [PATCH 116/136] Feature enhancements for RevoBoot v1.5.35 --- i386/libsaio/smbios/static_data.h | 102 ++++++++++++++---------------- 1 file changed, 47 insertions(+), 55 deletions(-) diff --git a/i386/libsaio/smbios/static_data.h b/i386/libsaio/smbios/static_data.h index efe7645..dc4f429 100755 --- a/i386/libsaio/smbios/static_data.h +++ b/i386/libsaio/smbios/static_data.h @@ -14,73 +14,65 @@ #ifndef __LIBSAIO_SMBIOS_STATIC_DATA_H #define __LIBSAIO_SMBIOS_STATIC_DATA_H -#include "essentials.h" + #include "essentials.h" -int tableLength = 0; + int tableLength = 0; + long fileSize = 0; -#if LOAD_MODEL_SPECIFIC_SMBIOS_DATA + #if LOAD_MODEL_SPECIFIC_SMBIOS_DATA + char dirSpec[32] = ""; + void * staticSMBIOSData = (void *)kLoadAddr; - #define SMBIOS_SEARCH_BASE 0x000F0000 - #define SMBIOS_SEARCH_END 0x000FFFFF - #define SMBIOS_ANCHOR 0x5f4d535f // '_SM_' in Little Endian. - #define SMBIOS_MPS_ANCHOR 0x5f504d5f // '_MP_' in Little Endian. + sprintf(dirSpec, "/Extra/SMBIOS/%s.bin", COMMA_STRIPPED_MODEL_ID); - _SMBIOS_DEBUG_DUMP("in getEPSAddress()\n"); + _SMBIOS_DEBUG_DUMP("Loading: %s", dirSpec); - void *baseAddress = (void *)SMBIOS_SEARCH_BASE; + fileSize = loadBinaryData(dirSpec, &staticSMBIOSData); - for(; baseAddress <= (void *)SMBIOS_SEARCH_END; baseAddress += 16) - { - if (*(uint32_t *)baseAddress == SMBIOS_ANCHOR) // _SM_ + if (fileSize > 0) { - if (checksum8(baseAddress, sizeof(struct SMBEntryPoint)) == 0) - { - #if INCLUDE_MP_TABLE - // SMBIOS table located. Use this address as starting point. - void * mpsAddress = baseAddress; - - // Now search for the Multi Processor table. - for(; mpsAddress <= (void *)SMBIOS_SEARCH_END; mpsAddress += 16) - { - if (*(uint32_t *)mpsAddress == SMBIOS_MPS_ANCHOR) - { - gPlatform.MP.BaseAddress = (uint32_t)mpsAddress; - break; - } - } - #endif // INCLUDE_MP_TABLE + memcpy((kernelMemory + sizeof(* newEPS)), staticSMBIOSData, fileSize); - break; + // factoryEPS = (struct SMBEntryPoint *) baseAddress; + + tableLength = fileSize; - _SMBIOS_DEBUG_DUMP("SMBIOS baseAddress: 0x%08x\n", baseAddress); - } + _SMBIOS_DEBUG_DUMP("\n"); } - } - - char dirSpec[32] = ""; - - void * staticSMBIOSData = (void *)kLoadAddr; - - struct SMBEntryPoint *factoryEPS; - - sprintf(dirSpec, "/Extra/SMBIOS/%s.bin", COMMA_STRIPPED_MODEL_ID); - - _SMBIOS_DEBUG_DUMP("Loading: %s\n", dirSpec); + else // File not found. Use static data defined in RevoBoot/i386/config/SMBIOS/ + { + // The STRING (macro) is defined in RevoBoot/i386/config/settings.h + #include STRING(SMBIOS_DATA_FILE) + + static uint32_t SMBIOS_Table[] = + { + // Replaced with data from: RevoBoot/i386/config/SMBIOS/[data-template/MacModelNN].h + STATIC_SMBIOS_DATA + }; - long fileSize = loadBinaryData(dirSpec, &staticSMBIOSData); + tableLength = sizeof(SMBIOS_Table); - if (fileSize > 0) - { - memcpy((kernelMemory + sizeof(* newEPS)), staticSMBIOSData, fileSize); + _SMBIOS_DEBUG_DUMP("Error: File not found!\nNow trying statically linked SMBIOS data: %d bytes\n", tableLength); - factoryEPS = (struct SMBEntryPoint *) baseAddress; - } - else // File not found. Use static data defined in RevoBoot/i386/config/SMBIOS/ - { - tableLength = useStaticSMBIOSData((kernelMemory + sizeof(* newEPS))); - } -#else - tableLength = useStaticSMBIOSData((kernelMemory + sizeof(* newEPS))); -#endif /* LOAD_MODEL_SPECIFIC_SMBIOS_DATA */ + // Copy the static SMBIOS data into the newly allocated memory page. Right after the new EPS. + memcpy((kernelMemory + sizeof(* newEPS)), SMBIOS_Table, tableLength); + } + #else + // The STRING (macro) is defined in RevoBoot/i386/config/settings.h + #include STRING(SMBIOS_DATA_FILE) + + static uint32_t SMBIOS_Table[] = + { + // Replaced with data from: RevoBoot/i386/config/SMBIOS/[data-template/MacModelNN].h + STATIC_SMBIOS_DATA + }; + + _SMBIOS_DEBUG_DUMP("Using statically linked SMBIOS data\n"); + + tableLength = sizeof(SMBIOS_Table); + + // Copy the static SMBIOS data into the newly allocated memory page. Right after the new EPS. + memcpy((kernelMemory + sizeof(* newEPS)), SMBIOS_Table, tableLength); + #endif /* LOAD_MODEL_SPECIFIC_SMBIOS_DATA */ #endif /* !__LIBSAIO_SMBIOS_STATIC_DATA_H */ From e18e79c9399f0435c5b7c50dcca58c1417a5d6a4 Mon Sep 17 00:00:00 2001 From: Pike Date: Mon, 5 Nov 2012 20:06:57 +0100 Subject: [PATCH 117/136] Feature enhancements for RevoBoot v1.5.35 --- i386/libsaio/smbios/dynamic_data.h | 101 +++++++++++++++-------------- 1 file changed, 53 insertions(+), 48 deletions(-) diff --git a/i386/libsaio/smbios/dynamic_data.h b/i386/libsaio/smbios/dynamic_data.h index 25fa300..9f9bff6 100755 --- a/i386/libsaio/smbios/dynamic_data.h +++ b/i386/libsaio/smbios/dynamic_data.h @@ -12,7 +12,10 @@ * - SMBProperties changed for speed and simplicity (PikerAlpha, October 2012). * - Calls with SMBProperties.keyString cleaned up (PikerAlpha, October 2012). * - Fixed requiredStructures.start/stop values (PikerAlpha, October 2012). - * - STATIC_SMSERIALNUMBER renamed to SMB_SYSTEM_SERIAL_NUMBER(PikerAlpha, October 2012). + * - STATIC_SMSERIALNUMBER renamed to SMB_SYSTEM_SERIAL_NUMBER (PikerAlpha, October 2012). + * - Removed some unused experimental code snippets (PikerAlpha, November 2012). + * - Option SET_MAX_STRUCTURE_LENGTH to verify/fix newEPS->maxStructureSize (PikerAlpha, November 2012). + * - Allow DEBUG_SMBIOS = 2 to filter out some of the output (PikerAlpha, November 2012). * * Credits: * - Kabyl (see notes in source code) @@ -21,7 +24,7 @@ * Tip: The idea is to use dynamic SMBIOS generation in RevoBoot only to * let it strip your factory table, after which you should do this: * - * 1.) Extract the new OS X compatible SMBIOS table with: tools/smbios2struct + * 1.) Extract the new OS X compatible SMBIOS table with: tools/smbios2struct3 * 2.) Add the data structure to: RevoBoot/i386/config/SMBIOS/data.h * 3.) Recompile RevoBoot, and be happy with your quicker boot time. * @@ -203,15 +206,15 @@ void setupSMBIOS(void) // Clear the first K bytes (new table will be even shorter). bzero(kernelMemory, 1024); - newEPS->anchor[0] = 0x5f; // _ - newEPS->anchor[1] = 0x53; // S - newEPS->anchor[2] = 0x4d; // M - newEPS->anchor[3] = 0x5f; // _ - newEPS->checksum = 0; // Updated at the end of this run. - newEPS->entryPointLength = 0x1f; // sizeof(* newEPS) - newEPS->majorVersion = 2; // SMBIOS version 2.4 + newEPS->anchor[0] = 0x5f; // _ + newEPS->anchor[1] = 0x53; // S + newEPS->anchor[2] = 0x4d; // M + newEPS->anchor[3] = 0x5f; // _ + newEPS->checksum = 0; // Updated at the end of this run. + newEPS->entryPointLength = 0x1f; // sizeof(* newEPS) + newEPS->majorVersion = 2; // SMBIOS version 2.4 newEPS->minorVersion = 4; - newEPS->maxStructureSize = 0; // Updated during this run. + newEPS->maxStructureSize = factoryEPS->maxStructureSize; // Optionally checked and updated later on. newEPS->entryPointRevision = 0; newEPS->formattedArea[0] = 0; @@ -220,25 +223,23 @@ void setupSMBIOS(void) newEPS->formattedArea[3] = 0; newEPS->formattedArea[4] = 0; - newEPS->dmi.anchor[0] = 0x5f; // _ - newEPS->dmi.anchor[1] = 0x44; // D - newEPS->dmi.anchor[2] = 0x4d; // M - newEPS->dmi.anchor[3] = 0x49; // I - newEPS->dmi.anchor[4] = 0x5f; // _ - newEPS->dmi.checksum = 0; // Updated at the end of this run. - newEPS->dmi.tableLength = 0; // Updated at the end of this run. + newEPS->dmi.anchor[0] = 0x5f; // _ + newEPS->dmi.anchor[1] = 0x44; // D + newEPS->dmi.anchor[2] = 0x4d; // M + newEPS->dmi.anchor[3] = 0x49; // I + newEPS->dmi.anchor[4] = 0x5f; // _ + newEPS->dmi.checksum = 0; // Updated at the end of this run. + newEPS->dmi.tableLength = 0; // Updated at the end of this run. newEPS->dmi.tableAddress = (uint32_t) (kernelMemory + sizeof(struct SMBEntryPoint)); - newEPS->dmi.structureCount = 0; // Updated during this run. - newEPS->dmi.bcdRevision = 0x24; // SMBIOS version 2.4 + newEPS->dmi.structureCount = 0; // Updated during this run. + newEPS->dmi.bcdRevision = 0x24; // SMBIOS version 2.4 char * stringsPtr = NULL; char * newtablesPtr = (char *)newEPS->dmi.tableAddress; char * structurePtr = (char *)factoryEPS->dmi.tableAddress; - char * structureStartPtr = NULL; - int i, j; - int numberOfStrings = 0; - int structureCount = factoryEPS->dmi.structureCount; + int i, j, numberOfStrings = 0; + int structureCount = factoryEPS->dmi.structureCount; SMBWord handle = 1; @@ -305,13 +306,13 @@ void setupSMBIOS(void) // Adjust pointer after locating the double 0 terminator. structurePtr += 2; -#if DEBUG_SMBIOS - // printf("currentStructureType: %d (length: %d)\n", currentStructureType, factoryHeader->length); - // sleep(1); // Silent sleep (for debug only). +#if (DEBUG_SMBIOS & 2) + _SMBIOS_DEBUG_DUMP("currentStructureType: %d (length: %d)\n", currentStructureType, factoryHeader->length); + _SMBIOS_DEBUG_SLEEP(1); #endif continue; } - + newHeader = (struct SMBStructHeader *) newtablesPtr; // Copy structure data from factory table to new table (not the strings). @@ -323,8 +324,6 @@ void setupSMBIOS(void) // Update structure counter. newEPS->dmi.structureCount++; - structureStartPtr = newtablesPtr; - // Update pointers (pointing to the end of the formatted area). structurePtr += factoryHeader->length; stringsPtr = structurePtr; @@ -352,7 +351,30 @@ void setupSMBIOS(void) } structurePtr += 2; - + +#if SET_MAX_STRUCTURE_LENGTH + /* + * Size of the longest factory SMBIOS structure, in bytes, encompasses the structure’s formatted area + * and text strings. In our case a kSMBTypeProcessorInformation structure, because we strip out all + * unwanted data. And safe to check it at this point, because we don't add anything this long ourself. + * + * Note: The maximum structure length is only checked when SET_MAX_STRUCTURE_LENGTH is set to 1 but + * is not required, because it is only available since RevoBoot v1.5.35. Never checked before. + */ + + UInt16 maxStructureSize = (structurePtr - (stringsPtr - factoryHeader->length)); + + if (newEPS->maxStructureSize < maxStructureSize) + { + newEPS->maxStructureSize = maxStructureSize; + } + + #if (DEBUG_SMBIOS & 2) + _SMBIOS_DEBUG_DUMP("Structure (%d) length: %3d bytes.\n", currentStructureType, maxStructureSize); + _SMBIOS_DEBUG_SLEEP(1); + #endif +#endif // if SET_MAX_STRUCTURE_LENGTH + // Do we need to copy the string data? if (requiredStructures[currentStructureType].copyStrings) { @@ -364,23 +386,6 @@ void setupSMBIOS(void) // Point to the next possible position for a string (deducting the second 0 char at the end). newtablesPtr += stringDataLength; - - /* ---------------------------------------------------------------------- - // Start of experimental code. - - if (currentStructureType == kSMBTypeProcessorInformation) - { - int c = 0; - - for (; c < 3; c++) - { - memcpy(newtablesPtr + 1, structureStartPtr, factoryHeader->length + stringDataLength + 2); - newtablesPtr += factoryHeader->length + stringDataLength + 2; - } - } - - //---------------------------------------------------------------------- - // End of experimental code. */ } else { @@ -403,7 +408,7 @@ void setupSMBIOS(void) { const char * str = ""; -#if DEBUG_SMBIOS +#if (DEBUG_SMBIOS & 2) if (SMBProperties[j].type != currentStructureType) { printf("SMBIOS Patcher Error: Turbo Index [%d != %d] Mismatch!\n", SMBProperties[j].type, currentStructureType); From 7046f8130fe574047a51b7bb239c734af6b43d21 Mon Sep 17 00:00:00 2001 From: Pike Date: Mon, 5 Nov 2012 20:09:05 +0100 Subject: [PATCH 118/136] Update to RevoBoot v1.5.35 --- CHANGES | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGES b/CHANGES index 3eab64a..c96a333 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,16 @@ +RevoBoot v1.5.35 +================ +- SMBIOS related enhancements for RevoBoot v1.5.35 (PikerAlpha, November 2012). +- VERSION updated to v1.5.35 + + RevoBoot v1.5.34 ================ - LOAD_STATIC_EFI_DATA_FROM_EXTRA in settings-template.h renamed to LOAD_MODEL_SPECIFIC_EFI_DATA (PikerAlpha, October 2012). - LOAD_STATIC_SMBIOS_DATA_FROM_EXTRA in settings-template.h renamed to LOAD_MODEL_SPECIFIC_SMBIOS_DATA (PikerAlpha, October 2012). - New LOAD_MODEL_SPECIFIC_ACPI_DATA setting in settings-template.h (PikerAlpha, October 2012). - New LOAD_MODEL_SPECIFIC_STATIC_DATA setting in settings-template.h (PikerAlpha, October 2012). +- VERSION updated to v1.5.34 Notes: @@ -15,6 +22,7 @@ You must use the latest version of RevoBoot/i386/config/settings-template RevoBoot v1.5.33 ================ - Restored lost lines in RevoBoot/i386/libsaio/SMBIOS/static_data.h (PikerAlpha, November 2012). +- VERSION updated to v1.5.33 RevoBoot v1.5.32 From eb1ec001eb5b794738d5cce2dc8d94553f4a1209 Mon Sep 17 00:00:00 2001 From: Pike Date: Mon, 5 Nov 2012 20:09:45 +0100 Subject: [PATCH 119/136] Updating version info for RevoBoot v1.5.35 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index e201dd3..ff4e38d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.34 +1.5.35 From e13aa261b52e9655f663bd54949aa00939e250f6 Mon Sep 17 00:00:00 2001 From: Pike Date: Mon, 5 Nov 2012 20:16:35 +0100 Subject: [PATCH 120/136] New setting SET_MAX_STRUCTURE_LENGTH for RevoBoot v1.5.35 --- i386/config/settings-template.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/i386/config/settings-template.h b/i386/config/settings-template.h index 65cbbbc..1136591 100644 --- a/i386/config/settings-template.h +++ b/i386/config/settings-template.h @@ -1,7 +1,7 @@ /* * Copyright (c) 2009 Master Chief. All rights reserved. * - * Note: This is an essential part of the build process for RevoBoot v1.5.34 and greater. + * Note: This is an essential part of the build process for RevoBoot v1.5.35 and greater. * * Updates: * @@ -26,6 +26,7 @@ * - LOAD_STATIC_EFI_DATA_FROM_EXTRA renamed to LOAD_MODEL_SPECIFIC_EFI_DATA (PikerAlpha, October 2012). * - LOAD_STATIC_SMBIOS_DATA_FROM_EXTRA renamed to LOAD_MODEL_SPECIFIC_SMBIOS_DATA (PikerAlpha, October 2012). * - LOAD_MODEL_SPECIFIC_STATIC_DATA added (PikerAlpha, October 2012). + * - Option SET_MAX_STRUCTURE_LENGTH added (PikerAlpha, November 2012). */ @@ -373,6 +374,10 @@ #define SMB_BOARD_SERIAL_NUMBER "SOMESRLNUMBR" // Example only! #endif +#define SET_MAX_STRUCTURE_LENGTH 0 // Set to 0 by default. Only change this to 1 when boot hangs without it. + // + // Note: Safe to keep at 0 since it is only available since RevoBoot v1.5.35 + #define DEBUG_SMBIOS 0 // Set to 0 by default. Change this to 1 when things don't seem to work for you. From a8d21c2c9f3ae94c10476428db268cccdd437356 Mon Sep 17 00:00:00 2001 From: Pike Date: Mon, 5 Nov 2012 20:25:44 +0100 Subject: [PATCH 121/136] Last minute patch for RevoBoot v1.5.35 --- i386/config/SMBIOS/data-template.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/i386/config/SMBIOS/data-template.h b/i386/config/SMBIOS/data-template.h index 0d0cb7a..d388f10 100755 --- a/i386/config/SMBIOS/data-template.h +++ b/i386/config/SMBIOS/data-template.h @@ -21,9 +21,9 @@ //--------------------------------------------------------------- SMBIOS ------------------------------------------------------------------- -#define STATIC_SMBIOS_SM_MAX_STRUCTURE_SIZE NNN +#define STATIC_SMBIOS_SM_MAX_STRUCTURE_SIZE 0 -#define STATIC_SMBIOS_DMI_STRUCTURE_COUNT NN +#define STATIC_SMBIOS_DMI_STRUCTURE_COUNT 0 #define STATIC_SMBIOS_DATA \ /* 0x0000 */ // Insert your SMBIOS data here. From 820379939ca26ed98f4f0862ac7f39087c71b3f1 Mon Sep 17 00:00:00 2001 From: Pike Date: Wed, 7 Nov 2012 17:34:39 +0100 Subject: [PATCH 122/136] Interim solution for writing to /Extra/MacModelNN.bin --- i386/libsaio/smbios/tools/smbios2struct3.c | 112 +++++++++++++++++---- 1 file changed, 91 insertions(+), 21 deletions(-) diff --git a/i386/libsaio/smbios/tools/smbios2struct3.c b/i386/libsaio/smbios/tools/smbios2struct3.c index 85fc38c..d6c3872 100755 --- a/i386/libsaio/smbios/tools/smbios2struct3.c +++ b/i386/libsaio/smbios/tools/smbios2struct3.c @@ -1,26 +1,34 @@ -/*** - * - * Name : smbios2struct3 (pipe output to file) - * Version : 1.0.5 - * Type : Command line tool - * Description : SMBIOS extractor / converter (resulting in a smaller and more Apple like table). - * - * Copyright : DutchHockeyPro (c) 2011 - * - * Compile with: cc -I . smbios2struct3.c -o smbios2struct3 -Wall -framework IOKit -framework CoreFoundation - * - */ +/* + * + * Name : smbios2struct4 + * Version : 1.1.0 + * Type : Command line tool + * Copyright : Sam aka RevoGirl (c) 2011 + * Description : SMBIOS extractor / converter (resulting in a smaller and more Apple like table). + * + * Usage : sudo ./smbios2struct4 (output to terminal window) + * : sudo ./smbios2struct4 > ../../../config/SMBIOS/MacModelNN.h (writes to [path]MacModelNN.h) + * : sudo ./smbios2struct4 MacModelNN (writes to: /Extra/SMBIOS/MacModel.bin) + * + * Compile with : cc smbios2struct4.c -o smbios2struct4 -Wall -framework IOKit -framework CoreFoundation + * + * Updates : Interim solution for writing stripped SMBIOS table data to MacModelNN.bin (PikerAlpha, November 2012) + * : Check root priveledges for writing to: /Extra/SMBIOS/MacModelNN.bin (PikerAlpha, November 2012) + * + */ #include #include +#include +#include #include #include -#include "SMBIOS.h" +#include "../smbios.h" #define DEBUG 0 // Set to 1 for additional (debug) output -#define VERBOSE 1 +#define VERBOSE 0 #if VERBOSE #define VERBOSE_DUMP(x...) printf(x) @@ -102,12 +110,12 @@ void dumpStaticTableData(const UInt8 * tableBuffer, int maxStructureSize, int st { int index = 0; - printf("\n\t#define STATIC_SMBIOS_SM_MAX_STRUCTURE_SIZE\t%d\n", maxStructureSize); - printf("\n\t#define STATIC_SMBIOS_DMI_STRUCTURE_COUNT\t%d\n", structureCount); + printf("\n#define STATIC_SMBIOS_SM_MAX_STRUCTURE_SIZE\t%d\n", maxStructureSize); + printf("\n#define STATIC_SMBIOS_DMI_STRUCTURE_COUNT\t%d\n", structureCount); printf("\n"); - printf("\t#define STATIC_SMBIOS_DATA \\\n"); - printf("\t/* SMBIOS data (0x%04x / %d bytes) converted with smbios2struct2 into little endian format. */ \\\n", tableLength, tableLength); - printf("\t/* 0x0000 */\t"); + printf("#define STATIC_SMBIOS_DATA \\\n"); + printf("/* SMBIOS data (0x%04x / %d bytes) converted with smbios2struct2 into little endian format. */ \\\n", tableLength, tableLength); + printf("/* 0x0000 */\t"); UInt16 length = round2(tableLength, 4); UInt32 * newTableData = malloc(tableLength); @@ -123,7 +131,7 @@ void dumpStaticTableData(const UInt8 * tableBuffer, int maxStructureSize, int st if ((index % 8) == 0) { - printf("\\\n\t/* 0x%04x */\t", (index * 4)); + printf("\\\n/* 0x%04x */\t", (index * 4)); } } } while((index * 4) <= length); @@ -138,6 +146,23 @@ void dumpStaticTableData(const UInt8 * tableBuffer, int maxStructureSize, int st int main(int argc, char * argv[]) { + if (argc == 2) + { + uid_t real_uid = getuid(); + uid_t euid = geteuid(); + +#if DEBUG + printf("UID: %u EUID: %u\n", real_uid, euid); +#endif + // Under sudo, getuid and geteuid return 0. + if (real_uid != 0 || euid != 0) + { + printf("Error: Not root. Use sudo ./smbios2struct4 [filename without extension]\n"); + + exit (-1); + } + } + mach_port_t masterPort; io_service_t service = MACH_PORT_NULL; CFDataRef dataRef; @@ -321,7 +346,52 @@ int main(int argc, char * argv[]) VERBOSE_DUMP("\nDropped tables: %2d.\n", droppedTables); - dumpStaticTableData(tableBuffer, maxStructureSize, newStructureCount, newTableLength); + if (argc == 2) // Write to file? + { + struct stat my_sb; + // Sanity check for required directory. + if (stat("/Extra", &my_sb) != 0) + { + mkdir("/Extra", (S_IRWXU | S_IRWXG | S_IRWXO)); + } + // Sanity check for required directory. + if (stat("/Extra/SMBIOS", &my_sb) != 0) + { + mkdir("/Extra/SMBIOS", (S_IRWXU | S_IRWXG | S_IRWXO)); + } + + char dirspec[128]; + sprintf (dirspec, "/Extra/SMBIOS/%s.bin", argv[1]); + int filedesc = open(dirspec, O_WRONLY|O_CREAT|O_TRUNC, 0644); + + if (filedesc == -1) + { + printf("Error: Unable to open file!\n"); + } + else + { + newTableLength = round2((newTableLength + 2), 4); + + VERBOSE_DUMP("newTableLength: %d\n", newTableLength); + + int status = write(filedesc, tableBuffer, newTableLength); + + if (status != newTableLength) + { + printf("status %d, saved %d bytes\n", status, newTableLength); + } + else + { + printf("%d bytes written to: %s\n", newTableLength, dirspec); + } + } + + close (filedesc); + } + else + { + dumpStaticTableData(tableBuffer, maxStructureSize, newStructureCount, newTableLength); + } free((void *)tableBuffer); From 5e0d33721cd7f463fa33e5a68ec867345cfc0556 Mon Sep 17 00:00:00 2001 From: Pike Date: Thu, 8 Nov 2012 08:07:10 +0100 Subject: [PATCH 123/136] Also write properties from efi/device-properties Command line utility output: sudo ./smbios2struct5 Macmini51 722 bytes written to: /Extra/EFI/Macmini51.bin 812 bytes written to: /Extra/SMBIOS/Macmini51.bin --- i386/libsaio/smbios/tools/smbios2struct3.c | 103 +++++++++++++++++---- 1 file changed, 83 insertions(+), 20 deletions(-) diff --git a/i386/libsaio/smbios/tools/smbios2struct3.c b/i386/libsaio/smbios/tools/smbios2struct3.c index d6c3872..297be55 100755 --- a/i386/libsaio/smbios/tools/smbios2struct3.c +++ b/i386/libsaio/smbios/tools/smbios2struct3.c @@ -1,7 +1,7 @@ /* * * Name : smbios2struct4 - * Version : 1.1.0 + * Version : 1.1.1 * Type : Command line tool * Copyright : Sam aka RevoGirl (c) 2011 * Description : SMBIOS extractor / converter (resulting in a smaller and more Apple like table). @@ -14,6 +14,7 @@ * * Updates : Interim solution for writing stripped SMBIOS table data to MacModelNN.bin (PikerAlpha, November 2012) * : Check root priveledges for writing to: /Extra/SMBIOS/MacModelNN.bin (PikerAlpha, November 2012) + * : Now also saves /EFI-device-properties (PikerAlpha, November 2012) * */ @@ -146,6 +147,10 @@ void dumpStaticTableData(const UInt8 * tableBuffer, int maxStructureSize, int st int main(int argc, char * argv[]) { + char dirspec[128]; + int filedesc = 0; + struct stat my_sb; + if (argc == 2) { uid_t real_uid = getuid(); @@ -171,20 +176,88 @@ int main(int argc, char * argv[]) UInt16 tableLength = 0, droppedTables = 0; UInt16 newTableLength = 0; - // UInt32 * shadowTableData = NULL; - IOMasterPort(MACH_PORT_NULL, &masterPort); + + //================================================================================== + + io_registry_entry_t efi = IORegistryEntryFromPath(kIOMasterPortDefault, kIODeviceTreePlane ":/efi"); + + if (efi == IO_OBJECT_NULL) + { +#if DEBUG + printf("FAILURE: Unable to locate EFI registry entry.\n"); +#endif + exit(-1); + } + else + { +#if DEBUG + printf("OK\n"); +#endif + dataRef = (CFDataRef) IORegistryEntryCreateCFProperty(efi, CFSTR("device-properties"), kCFAllocatorDefault, kNilOptions); + + if (dataRef) + { + UInt32 * deviceProperties = (UInt32 *) CFDataGetBytePtr(dataRef); + UInt16 devicePropertiesBytes = (int) CFDataGetLength(dataRef); +#if DEBUG + printf("Property 'device-properties' %d bytes found.", numBytes); +#endif + if ((argc == 2) && (devicePropertiesBytes)) // Write to file? + { + // Sanity check for required directory. + if (stat("/Extra", &my_sb) != 0) + { + mkdir("/Extra", (S_IRWXU | S_IRWXG | S_IRWXO)); + } + // Sanity check for required directory. + if (stat("/Extra/EFI", &my_sb) != 0) + { + mkdir("/Extra/EFI", (S_IRWXU | S_IRWXG | S_IRWXO)); + } + + sprintf (dirspec, "/Extra/EFI/%s.bin", argv[1]); + filedesc = open(dirspec, O_WRONLY|O_CREAT|O_TRUNC, 0644); + + if (filedesc == -1) + { + printf("Error: Unable to open file!\n"); + } + else + { + int status = write(filedesc, deviceProperties, devicePropertiesBytes); + + if (status != devicePropertiesBytes) + { + printf("status %d, saved %d bytes\n", status, devicePropertiesBytes); + } + else + { + printf("%d bytes written to: %s\n", devicePropertiesBytes, dirspec); + } + } + + close (filedesc); + } + } +#if DEBUG + else + { + printf("FAILURE: Unable to locate ':/efi/device-properties'\n"); + } +#endif + } + + //================================================================================== + service = IOServiceGetMatchingService(masterPort, IOServiceMatching("AppleSMBIOS")); if (service) { #if DEBUG - printf("\nHave AppleSMBIOS\n"); + printf("\nAppleSMBIOS found\n"); #endif - dataRef = (CFDataRef) IORegistryEntryCreateCFProperty(service, - CFSTR("SMBIOS-EPS"), - kCFAllocatorDefault, - kNilOptions); + dataRef = (CFDataRef) IORegistryEntryCreateCFProperty(service, CFSTR("SMBIOS-EPS"), kCFAllocatorDefault, kNilOptions); if (dataRef) { @@ -233,10 +306,7 @@ int main(int argc, char * argv[]) printf("\n"); #endif - dataRef = (CFDataRef) IORegistryEntryCreateCFProperty(service, - CFSTR("SMBIOS"), - kCFAllocatorDefault, - kNilOptions); + dataRef = (CFDataRef) IORegistryEntryCreateCFProperty(service, CFSTR("SMBIOS"), kCFAllocatorDefault, kNilOptions); if (dataRef) { @@ -348,21 +418,14 @@ int main(int argc, char * argv[]) if (argc == 2) // Write to file? { - struct stat my_sb; - // Sanity check for required directory. - if (stat("/Extra", &my_sb) != 0) - { - mkdir("/Extra", (S_IRWXU | S_IRWXG | S_IRWXO)); - } // Sanity check for required directory. if (stat("/Extra/SMBIOS", &my_sb) != 0) { mkdir("/Extra/SMBIOS", (S_IRWXU | S_IRWXG | S_IRWXO)); } - char dirspec[128]; sprintf (dirspec, "/Extra/SMBIOS/%s.bin", argv[1]); - int filedesc = open(dirspec, O_WRONLY|O_CREAT|O_TRUNC, 0644); + filedesc = open(dirspec, O_WRONLY|O_CREAT|O_TRUNC, 0644); if (filedesc == -1) { From 67318fde619046eff0169853632da67baa0d445f Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 10 Nov 2012 15:45:33 +0100 Subject: [PATCH 124/136] Added feedback/output --- Makefile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Makefile b/Makefile index 2c101ae..2a7a5f8 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,8 @@ # - Copies settings-template.h to SETTINGS/ModelnameNN.h when missing (PikerAlpha, October 2012). # - Automatic ACPI/EFI/SMBIOS data selection (PikerAlpha, October 2012). # - Copies ACPI/EFI/SMBIOS/data-template.h for new conigurations (PikerAlpha, October 2012). +# - Output added for cp/mkdir/rm actions (PikerAlpha, November 2012). +# - New build target 'help' added (PikerAlpha, November 2012). # # @@ -134,22 +136,27 @@ SETTINGS_FILE=$(SETTINGS_DIR)/$(MAKE_TARGET_MODEL).h $(MAKEGOAL): $(SYMROOT) $(OBJROOT) @if [ ! -f $(CONFIG_DIR)/$(MAKE_ACPI_DATA_FILE) ]; then \ + echo "\t[CP] $(CONFIG_DIR)/ACPI/data-template.h $(CONFIG_DIR)/$(MAKE_ACPI_DATA_FILE)"; \ cp -n $(CONFIG_DIR)/ACPI/data-template.h $(CONFIG_DIR)/$(MAKE_ACPI_DATA_FILE); \ fi; @if [ ! -f $(CONFIG_DIR)/$(MAKE_EFI_DATA_FILE) ]; then \ + echo "\t[CP] $(CONFIG_DIR)/EFI/data-template.h $(CONFIG_DIR)/$(MAKE_EFI_DATA_FILE)"; \ cp -n $(CONFIG_DIR)/EFI/data-template.h $(CONFIG_DIR)/$(MAKE_EFI_DATA_FILE); \ fi; @if [ ! -f $(CONFIG_DIR)/$(MAKE_SMBIOS_DATA_FILE) ]; then \ + echo "\t[CP] $(CONFIG_DIR)/SMBIOS/data-template.h $(CONFIG_DIR)/$(MAKE_SMBIOS_DATA_FILE)"; \ cp -n $(CONFIG_DIR)/SMBIOS/data-template.h $(CONFIG_DIR)/$(MAKE_SMBIOS_DATA_FILE); \ fi; @if [ ! -d $(SETTINGS_DIR) ]; then \ + echo "\t[MKDIR] $(SETTINGS_DIR)"; \ /bin/mkdir -p $(SETTINGS_DIR); \ fi; @if [ ! -f $(SETTINGS_FILE) ]; then \ + echo "\t[CP] $(CONFIG_DIR)/settings-template.h $(SETTINGS_FILE)"; \ cp -n $(CONFIG_DIR)/settings-template.h $(SETTINGS_FILE); \ fi; @@ -169,7 +176,17 @@ $(MAKEGOAL): $(SYMROOT) $(OBJROOT) fi; clean: + @if [ -d "$(OBJROOT)" ];then echo "\t[RMDIR] $(OBJROOT)"; fi + @if [ -d "$(SYMROOT)" ];then echo "\t[RMDIR] $(SYMROOT)"; fi rm -rf sym obj dst out.log +help: + @echo + @echo 'Build targets:' + @echo ' - Build all targets [DEFAULT]' + @echo + @echo 'Cleaning targets:' + @echo ' clean - Remove generated files' + $(SYMROOT) $(OBJROOT): @/bin/mkdir -p $@ From 5b6712f8489384379ee63d769ac08b7b1107da63 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 10 Nov 2012 15:50:31 +0100 Subject: [PATCH 125/136] Added feedback/output --- i386/libsa/Makefile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/i386/libsa/Makefile b/i386/libsa/Makefile index 773acac..2b0069d 100644 --- a/i386/libsa/Makefile +++ b/i386/libsa/Makefile @@ -4,6 +4,7 @@ # Updates: # # - Major cleanup (PikerAlpha, October 2012). +# - Output added for rm/ar/ranlib actions (PikerAlpha, November 2012). # @@ -26,13 +27,17 @@ VPATH = $(OBJROOT):$(SYMROOT) SA_OBJS = prf.o printf.o zalloc.o string.o strtol.o setjmp.o efi_tables.o LIBS = libsa.a + DIRS_NEEDED = $(OBJROOT) $(SYMROOT) $(MAKEGOAL): $(DIRS_NEEDED) $(LIBS) -libsa.a: $(SA_OBJS) - rm -f $(SYMROOT)/$(@F) - ar q $(SYMROOT)/$(@F) $^ - ranlib $(SYMROOT)/$(@F) +$(LIBS): $(SA_OBJS) + @echo "\t[RM] $(SYMROOT)/$@" + @rm -f $(SYMROOT)/$@ + @echo "\t[AR] $@" + @ar q $(SYMROOT)/$@ $^ &> /dev/null + @echo "\t[RANLIB] $@" + @ranlib $(SYMROOT)/$@ include ../MakeInc.dir From eb4df18955e8c0829a61db206079d83532b79669 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 10 Nov 2012 15:53:21 +0100 Subject: [PATCH 126/136] Added feedback/output --- i386/libsaio/Makefile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/i386/libsaio/Makefile b/i386/libsaio/Makefile index 63262be..3e13d49 100644 --- a/i386/libsaio/Makefile +++ b/i386/libsaio/Makefile @@ -7,6 +7,7 @@ # - DMAKE_TARGET_MODEL added (PikerAlpha, October 2012). # - Static data selectors added (PikerAlpha, October 2012). # - STATIC_DATA_FILENAME added (PikerAlpha, October 2012). +# - Output added for rm/ar/ranlib actions (PikerAlpha, November 2012). # include ../MakePaths.dir @@ -41,18 +42,20 @@ SAIO_OBJS = table.o asm.o bios.o biosfn.o \ vbe.o hfs.o hfs_compare.o \ xml.o md5c.o device_tree.o \ cpu.o platform.o acpi.o \ - smbios.o efi.o - -SAIO_EXTERN_OBJS = console.o + smbios.o efi.o console.o LIBS = libsaio.a + DIRS_NEEDED = $(OBJROOT) $(SYMROOT) $(MAKEGOAL): $(DIRS_NEEDED) libsaio.h $(LIBS) -libsaio.a: $(SAIO_EXTERN_OBJS) $(SAIO_OBJS) - rm -f $(SYMROOT)/$(@F) - ar q $(SYMROOT)/$(@F) $^ - ranlib $(SYMROOT)/$(@F) +$(LIBS): $(SAIO_OBJS) + @echo "\t[RM] $(SYMROOT)/$@" + @rm -f $@ + @echo "\t[AR] $@" + @ar q $(SYMROOT)/$@ $^ &> /dev/null + @echo "\t[RANLIB] $@" + @ranlib $(SYMROOT)/$@ include ../MakeInc.dir From 31eff7695dc7693c207d2586395bf2faa3494687 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 10 Nov 2012 15:56:24 +0100 Subject: [PATCH 127/136] Bug fix --- i386/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/i386/Makefile b/i386/Makefile index a7ee5b7..57f3137 100644 --- a/i386/Makefile +++ b/i386/Makefile @@ -5,6 +5,7 @@ # # - Major cleanup (PikerAlpha, October 2012). # - Output improvements (PikerAlpha, October 2012). +# - PRODUCT_MODEL_TARGET renamed to MAKE_TARGET_MODEL (PikerAlpha, November 2012). # # @@ -26,7 +27,7 @@ SUBDIRS = util libsa libsaio boot2 $(MAKEGOAL): @for i in ${SUBDIRS}; \ do \ - echo ================= make MODEL=$(PRODUCT_MODEL_TARGET) $@ for: RevoBoot/i386/$$i =================; \ + echo ================= make MODEL=$(MAKE_TARGET_MODEL) $@ for: RevoBoot/i386/$$i =================; \ ( cd $$i; ${MAKE} \ "OBJROOT=$(OBJROOT)/$$i" \ "SYMROOT=$(SYMROOT)" \ From 3558ddae9338d0ac9b5bae73c3ab2958684ab099 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 10 Nov 2012 16:02:43 +0100 Subject: [PATCH 128/136] Be silent --- i386/util/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/i386/util/Makefile b/i386/util/Makefile index 8a4883c..e4ccd5f 100644 --- a/i386/util/Makefile +++ b/i386/util/Makefile @@ -24,8 +24,8 @@ DIRS_NEEDED = $(OBJROOT) $(SYMROOT) $(LANGDIR) $(MAKEGOAL): $(DIRS_NEEDED) $(PROGRAMS) machOconv: machOconv.o - $(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $(SYMROOT)/$(@F) machOconv.o + @$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $(SYMROOT)/$(@F) machOconv.o md: - $(CC) -mdynamic-no-pic -Wall -dead_strip -arch i386 -mmacosx-version-min=10.5 md.c -o $(SYMROOT)/md + @$(CC) -mdynamic-no-pic -Wall -dead_strip -arch i386 -mmacosx-version-min=10.5 md.c -o $(SYMROOT)/md include ../MakeInc.dir From 975d350ebb4c6ab928dd8e20f34d4d93871f26e9 Mon Sep 17 00:00:00 2001 From: Pike Date: Wed, 21 Nov 2012 13:15:26 +0100 Subject: [PATCH 129/136] Ready for NVRAM->efi-boot-device-data reading --- i386/libsaio/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/i386/libsaio/Makefile b/i386/libsaio/Makefile index 3e13d49..1c051eb 100644 --- a/i386/libsaio/Makefile +++ b/i386/libsaio/Makefile @@ -8,6 +8,7 @@ # - Static data selectors added (PikerAlpha, October 2012). # - STATIC_DATA_FILENAME added (PikerAlpha, October 2012). # - Output added for rm/ar/ranlib actions (PikerAlpha, November 2012). +# - SAIO_OBJS changed / base64.o added (PikerAlpha, November 2012). # include ../MakePaths.dir @@ -38,8 +39,8 @@ VPATH = $(OBJROOT):$(SYMROOT) SAIO_OBJS = table.o asm.o bios.o biosfn.o \ disk.o sys.o cache.o bootstruct.o \ - stringTable.o load.o pci.o allocate.o \ - vbe.o hfs.o hfs_compare.o \ + base64.o stringTable.o load.o pci.o \ + allocate.o vbe.o hfs.o hfs_compare.o \ xml.o md5c.o device_tree.o \ cpu.o platform.o acpi.o \ smbios.o efi.o console.o From 4c76bda9a69732bfb3fe3100c9ee347c44b3a629 Mon Sep 17 00:00:00 2001 From: Pike Date: Wed, 21 Nov 2012 13:17:09 +0100 Subject: [PATCH 130/136] Updating file (we sem to have lost stuff) --- i386/libsaio/Makefile | 53 +++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/i386/libsaio/Makefile b/i386/libsaio/Makefile index 1c051eb..a89f67f 100644 --- a/i386/libsaio/Makefile +++ b/i386/libsaio/Makefile @@ -8,8 +8,9 @@ # - Static data selectors added (PikerAlpha, October 2012). # - STATIC_DATA_FILENAME added (PikerAlpha, October 2012). # - Output added for rm/ar/ranlib actions (PikerAlpha, November 2012). +# - Enabled clang compilation (dgsga, PikerAlpha, November 2012. Credits to Evan Lojewski for original work). +# - Output change and now using libtool instead of ar/ranlib (PikerAlpha, November 2012). # - SAIO_OBJS changed / base64.o added (PikerAlpha, November 2012). -# include ../MakePaths.dir @@ -19,31 +20,28 @@ LIBSADIR = ../libsa OPTIM = -Os -Oz DEBUG = -DNOTHING -CFLAGS = $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost \ - -D__ARCHITECTURE__=\"i386\" -DSAIO_INTERNAL_USER \ - -DRCZ_COMPRESSED_FILE_SUPPORT $(DEBUG) \ - -DREVOBOOT_VERSION_INFO=\"RevoBoot\ v$(PRODUCT_VERSION_NUMBER)\" \ - -DMAKE_TARGET_OS=$(PRODUCT_OS_TARGET) \ - -DSETTINGS_FILE=SETTINGS/$(MAKE_TARGET_MODEL).h \ - -DSTATIC_DATA_FILENAME=$(MAKE_TARGET_MODEL).bin \ - -DACPI_DATA_FILE=../../config/$(MAKE_ACPI_DATA_FILE) \ - -DEFI_DATA_FILE=../config/$(MAKE_EFI_DATA_FILE) \ - -DSMBIOS_DATA_FILE=../config/$(MAKE_SMBIOS_DATA_FILE) \ - -fno-builtin -static $(OMIT_FRAME_POINTER_CFLAG) \ - -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ - -march=pentium4 -msse2 -mfpmath=sse -msoft-float +CFLAGS = $(RC_CFLAGS) $(OPTIM) -arch i386 -g -Wmost \ + -D__ARCHITECTURE__=\"i386\" -DSAIO_INTERNAL_USER \ + -DRCZ_COMPRESSED_FILE_SUPPORT $(DEBUG) \ + -DREVOBOOT_VERSION_INFO=\"RevoBoot\ v$(PRODUCT_VERSION_NUMBER)\" \ + -DMAKE_TARGET_OS=$(PRODUCT_OS_TARGET) \ + -DSETTINGS_FILE=SETTINGS/$(MAKE_TARGET_MODEL).h \ + -DSTATIC_DATA_FILENAME=$(MAKE_TARGET_MODEL).bin \ + -DACPI_DATA_FILE=../../config/$(MAKE_ACPI_DATA_FILE) \ + -DEFI_DATA_FILE=../config/$(MAKE_EFI_DATA_FILE) \ + -DSMBIOS_DATA_FILE=../config/$(MAKE_SMBIOS_DATA_FILE) \ + -fno-builtin -static $(OMIT_FRAME_POINTER_CFLAG) \ + -fno-stack-protector \ + -march=pentium4 -msse2 -msoft-float INC = -I. -I$(SYMROOT) -I$(UTILDIR) -I$(LIBSADIR) VPATH = $(OBJROOT):$(SYMROOT) -SAIO_OBJS = table.o asm.o bios.o biosfn.o \ - disk.o sys.o cache.o bootstruct.o \ - base64.o stringTable.o load.o pci.o \ - allocate.o vbe.o hfs.o hfs_compare.o \ - xml.o md5c.o device_tree.o \ - cpu.o platform.o acpi.o \ - smbios.o efi.o console.o +SAIO_OBJS = table.o asm.o bios.o biosfn.o disk.o sys.o cache.o bootstruct.o \ + base64.o stringTable.o load.o pci.o allocate.o vbe.o hfs.o \ + hfs_compare.o xml.o md5c.o device_tree.o cpu.o platform.o \ + acpi.o smbios.o efi.o console.o LIBS = libsaio.a @@ -52,11 +50,12 @@ DIRS_NEEDED = $(OBJROOT) $(SYMROOT) $(MAKEGOAL): $(DIRS_NEEDED) libsaio.h $(LIBS) $(LIBS): $(SAIO_OBJS) - @echo "\t[RM] $(SYMROOT)/$@" - @rm -f $@ - @echo "\t[AR] $@" - @ar q $(SYMROOT)/$@ $^ &> /dev/null - @echo "\t[RANLIB] $@" - @ranlib $(SYMROOT)/$@ + @if [ -f $(SYMROOT)/$@ ]; then \ + echo "\t[RM] $@"; \ + rm -f $(SYMROOT)/$@; \ + fi; + + @echo "\t[LIBTOOL] $@" + @libtool -o $(SYMROOT)/$@ $^ include ../MakeInc.dir From 079a865b501f6ccb75e19c2bb774d624d529b7c9 Mon Sep 17 00:00:00 2001 From: Pike Date: Wed, 21 Nov 2012 13:19:16 +0100 Subject: [PATCH 131/136] Using libtool instead of ar/ranlib --- i386/libsa/Makefile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/i386/libsa/Makefile b/i386/libsa/Makefile index 2b0069d..dfc3fd1 100644 --- a/i386/libsa/Makefile +++ b/i386/libsa/Makefile @@ -5,20 +5,21 @@ # # - Major cleanup (PikerAlpha, October 2012). # - Output added for rm/ar/ranlib actions (PikerAlpha, November 2012). +# - Enabled clang compilation (dgsga, November 2012. Credits to Evan Lojewski for original work). +# - Output change and now using libtool instead of ar/ranlib (PikerAlpha, November 2012). # - include ../MakePaths.dir UTILDIR = ../util LIBSAIODIR = ../libsaio OPTIM = -Os -Oz -CFLAGS = $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost -Werror \ +CFLAGS = $(RC_CFLAGS) $(OPTIM) -arch i386 -g -Wmost -Werror \ -fno-builtin -static $(OMIT_FRAME_POINTER_CFLAG) \ -DSETTINGS_FILE=SETTINGS/$(MAKE_TARGET_MODEL).h \ - -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ - -march=pentium4 -msse2 -mfpmath=sse -msoft-float + -fno-stack-protector \ + -march=pentium4 -msse2 -msoft-float INC = -I. -I$(SYMROOT) -I$(UTILDIR) -I$(LIBSAIODIR) @@ -33,6 +34,15 @@ DIRS_NEEDED = $(OBJROOT) $(SYMROOT) $(MAKEGOAL): $(DIRS_NEEDED) $(LIBS) $(LIBS): $(SA_OBJS) + @if [ -f $(SYMROOT)/$@ ]; then \ + echo "\t[RM] $@"; \ + rm -f $(SYMROOT)/$@; \ + fi; + + @echo "\t[LIBTOOL] $@" + @libtool -o $(SYMROOT)/$@ $^ + +include ../MakeInc.dir @echo "\t[RM] $(SYMROOT)/$@" @rm -f $(SYMROOT)/$@ @echo "\t[AR] $@" From 6f27f1807b2107d97e44cb19334944327acc6ff2 Mon Sep 17 00:00:00 2001 From: Pike Date: Wed, 21 Nov 2012 13:20:21 +0100 Subject: [PATCH 132/136] Using libtool instead of ar/ranlib --- i386/libsa/Makefile | 8 -------- 1 file changed, 8 deletions(-) diff --git a/i386/libsa/Makefile b/i386/libsa/Makefile index dfc3fd1..ce11708 100644 --- a/i386/libsa/Makefile +++ b/i386/libsa/Makefile @@ -42,12 +42,4 @@ $(LIBS): $(SA_OBJS) @echo "\t[LIBTOOL] $@" @libtool -o $(SYMROOT)/$@ $^ -include ../MakeInc.dir - @echo "\t[RM] $(SYMROOT)/$@" - @rm -f $(SYMROOT)/$@ - @echo "\t[AR] $@" - @ar q $(SYMROOT)/$@ $^ &> /dev/null - @echo "\t[RANLIB] $@" - @ranlib $(SYMROOT)/$@ - include ../MakeInc.dir From 4d5d8f66679f6a4a3ab55af20b9309886cc96c6c Mon Sep 17 00:00:00 2001 From: Pike Date: Wed, 21 Nov 2012 13:23:28 +0100 Subject: [PATCH 133/136] Cleanup and output changes --- i386/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/i386/Makefile b/i386/Makefile index 57f3137..9b930a8 100644 --- a/i386/Makefile +++ b/i386/Makefile @@ -6,6 +6,7 @@ # - Major cleanup (PikerAlpha, October 2012). # - Output improvements (PikerAlpha, October 2012). # - PRODUCT_MODEL_TARGET renamed to MAKE_TARGET_MODEL (PikerAlpha, November 2012). +# - Cleanup and output changed (PikerAlpha, October 2012). # # @@ -25,9 +26,9 @@ SUBDIRS = util libsa libsaio boot2 $(MAKEGOAL): - @for i in ${SUBDIRS}; \ + @for i in $(SUBDIRS); \ do \ - echo ================= make MODEL=$(MAKE_TARGET_MODEL) $@ for: RevoBoot/i386/$$i =================; \ + echo ================= RevoBoot/i386/$$i =================; \ ( cd $$i; ${MAKE} \ "OBJROOT=$(OBJROOT)/$$i" \ "SYMROOT=$(SYMROOT)" \ From e87ce170ae04fca7418c972acdeeba544977be68 Mon Sep 17 00:00:00 2001 From: Pike Date: Sat, 29 Dec 2012 10:13:27 +0100 Subject: [PATCH 134/136] Typo --- README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README b/README index f0a28a3..5ee4a81 100644 --- a/README +++ b/README @@ -38,8 +38,8 @@ We also have a configuration README available at: https://github.com/RevoGirl/RevoBoot/blob/master/i386/config/README -There's also RevoBuilder (a great tool for first starters) over at: +There is also a tool called RevoBuilder (great tool for first starters) available over at: https://github.com/blackosx/RevoBuilder/wiki/Using-RevoBuilder -Note: RevoBuilder is most likeky broken for RevoBoot v.1.5.00 and greater! +Note: RevoBuilder is most likely broken as of RevoBoot v.1.5.00! From 13cab597033079068a51bb5f2bca888df0e656b2 Mon Sep 17 00:00:00 2001 From: Pike Date: Fri, 8 Mar 2013 13:12:50 +0100 Subject: [PATCH 135/136] Fix broken model selection --- i386/libsaio/platform.h | 55 +++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/i386/libsaio/platform.h b/i386/libsaio/platform.h index e2dca81..4a6a675 100644 --- a/i386/libsaio/platform.h +++ b/i386/libsaio/platform.h @@ -54,33 +54,34 @@ // Additional model selectors to select a specific target model. //------------------------------------------------------------------------------ -#define IMAC_131 IMAC | (3 << 15) -#define IMAC_111 IMAC | (2 << 15) -#define IMAC_122 IMAC | (1 << 15) -#define IMAC_121 IMAC // Defaults to iMac12,1 - -#define MACBOOK_41 MACBOOK // Defaults to MacBook,1 - -#define MACBOOK_AIR_42 MACBOOK_AIR | (1 << 15) -#define MACBOOK_AIR_41 MACBOOK_AIR // Defaults to MacBookAir4,1 - -#define MACBOOK_PRO_102 MACBOOK_PRO | (6 << 15) -#define MACBOOK_PRO_101 MACBOOK_PRO | (5 << 15) -#define MACBOOK_PRO_91 MACBOOK_PRO | (4 << 15) -#define MACBOOK_PRO_83 MACBOOK_PRO | (3 << 15) -#define MACBOOK_PRO_82 MACBOOK_PRO | (2 << 15) -#define MACBOOK_PRO_81 MACBOOK_PRO | (1 << 15) -#define MACBOOK_PRO_61 MACBOOK_PRO // Defaults to MacBookPro8,1 - -#define MACMINI_62 (MACMINI | (4 << 15)) -#define MACMINI_61 (MACMINI | (3 << 15)) -#define MACMINI_53 (MACMINI | (2 << 15)) -#define MACMINI_52 (MACMINI | (1 << 15)) -#define MACMINI_51 MACMINI // Defaults to Macmini5,1 - -#define MACPRO_51 MACPRO | (2 << 15) -#define MACPRO_41 MACPRO | (1 << 15) -#define MACPRO_31 MACPRO // Defaults to MacPro3,1 +#define IMAC_131 (IMAC | (4 << 15)) +#define IMAC_122 (IMAC | (3 << 15)) +#define IMAC_121 (IMAC | (2 << 15)) +#define IMAC_111 (IMAC | (1 << 15)) +#define IMAC_132 IMAC // Defaults to iMac13,2 + +#define MACBOOK_41 MACBOOK // Defaults to MacBook,1 + +#define MACBOOK_AIR_42 (MACBOOK_AIR | (1 << 15)) +#define MACBOOK_AIR_41 MACBOOK_AIR // Defaults to MacBookAir4,1 + +#define MACBOOK_PRO_102 (MACBOOK_PRO | (6 << 15)) +#define MACBOOK_PRO_101 (MACBOOK_PRO | (5 << 15)) +#define MACBOOK_PRO_91 (MACBOOK_PRO | (4 << 15)) +#define MACBOOK_PRO_83 (MACBOOK_PRO | (3 << 15)) +#define MACBOOK_PRO_82 (MACBOOK_PRO | (2 << 15)) +#define MACBOOK_PRO_81 (MACBOOK_PRO | (1 << 15)) +#define MACBOOK_PRO_61 MACBOOK_PRO // Defaults to MacBookPro8,1 + +#define MACMINI_62 (MACMINI | (4 << 15)) +#define MACMINI_61 (MACMINI | (3 << 15)) +#define MACMINI_53 (MACMINI | (2 << 15)) +#define MACMINI_52 (MACMINI | (1 << 15)) +#define MACMINI_51 MACMINI // Defaults to Macmini5,1 + +#define MACPRO_51 (MACPRO | (2 << 15)) +#define MACPRO_41 (MACPRO | (1 << 15)) +#define MACPRO_31 MACPRO // Defaults to MacPro3,1 //------------------------------------------------------------------------------ From 19992944e6f9f651ae94b7ad91ff51c840cc1718 Mon Sep 17 00:00:00 2001 From: Pike Date: Fri, 8 Mar 2013 13:14:57 +0100 Subject: [PATCH 136/136] Fix compilation error --- i386/libsaio/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i386/libsaio/Makefile b/i386/libsaio/Makefile index a89f67f..cc5eccb 100644 --- a/i386/libsaio/Makefile +++ b/i386/libsaio/Makefile @@ -39,7 +39,7 @@ INC = -I. -I$(SYMROOT) -I$(UTILDIR) -I$(LIBSADIR) VPATH = $(OBJROOT):$(SYMROOT) SAIO_OBJS = table.o asm.o bios.o biosfn.o disk.o sys.o cache.o bootstruct.o \ - base64.o stringTable.o load.o pci.o allocate.o vbe.o hfs.o \ + stringTable.o load.o pci.o allocate.o vbe.o hfs.o \ hfs_compare.o xml.o md5c.o device_tree.o cpu.o platform.o \ acpi.o smbios.o efi.o console.o