Permalink
Browse files

Initial changed for El Capitan

1 parent f738eb4 commit 66f373c61f5af74252772eafe7c3dba232cb6ea9 @Piker-Alpha committed Aug 24, 2015
Showing with 88 additions and 1 deletion.
  1. +9 −0 TODO.txt
  2. +22 −0 src/boot/BootArgs.cpp
  3. +26 −1 src/boot/BootArgs.h
  4. +31 −0 src/boot/StdAfx.h
View
@@ -1,4 +1,13 @@
+OS X 10.11 El Capitan TODO list:
+--------------------------------
+
+1.) Implement SIP support.
+
+Phase 1: Status - Work In Progress
+
+
+
OS X 10.10 Yosemite TODO list:
------------------------------
View
@@ -336,6 +336,28 @@ EFI_STATUS BlInitializeBootArgs(EFI_DEVICE_PATH_PROTOCOL* bootDevicePath, EFI_DE
AcpiGetPciConfigSpaceInfo(&bootArgs->PCIConfigSpaceBaseAddress, &bootArgs->PCIConfigSpaceStartBusNumber, &bootArgs->PCIConfigSpaceEndBusNumber);
//
+ // System Integrity Protection settings.
+ //
+ // Values: kBootArgsFlagCSRActiveConfig, kBootArgsFlagCSRConfigMode or kBootArgsFlagCSRBoot (like rootless=0)
+ //
+ bootArgs->Flags |= kBootArgsFlagCSRActiveConfig;
+
+ //
+ // For now set SIP to fully enabled (we want to read NVRAM and check csr-data and csr-active-config).
+ //
+ bootArgs->CsrActiveConfig = 0;
+
+ //
+ // System Integrity Protection Capabilties
+ //
+ bootArgs->CsrCapabilities = CSR_VALID_FLAGS
+
+ //
+ // Power Management (set to 0 = no limit)
+ //
+ bootArgs->Boot_SMC_plimit = 0;
+
+ //
// get root node
//
DEVICE_TREE_NODE* rootNode = DevTreeFindNode(CHAR8_CONST_STRING("/"), FALSE);
View
@@ -205,9 +205,34 @@ typedef struct _BOOT_ARGS
UINT32 PCIConfigSpaceEndBusNumber;
//
+ //
+ //
+ UINT32 CsrActiveConfig;
+
+ //
+ //
+ //
+ UINT32 CsrCapabilities;
+
+ //
+ //
+ //
+ UINT32 Boot_SMC_plimit;
+
+ //
+ //
+ //
+ UINT16 BootProgressMeterStart;
+
+ //
+ //
+ //
+ UINT16 BootProgressMeterEnd;
+
+ //
// padding
//
- UINT32 Reserved3[730];
+ UINT32 Reserved3[726];
}BOOT_ARGS;
#include <poppack.h>
View
@@ -33,6 +33,37 @@
#define DEBUG_LDRP_CALL_CSPRINTF 0
+#ifndef kBootArgsFlagCSRActiveConfig
+ #define kBootArgsFlagCSRActiveConfig (1 << 3) // 8
+#endif
+
+#ifndef kBootArgsFlagCSRConfigMode
+ #define kBootArgsFlagCSRConfigMode (1 << 4) // 16
+#endif
+
+#ifndef kBootArgsFlagCSRBoot
+ #define kBootArgsFlagCSRBoot (1 << 5) // 32
+#endif
+
+#ifndef CSR_VALID_FLAGS
+ /* Rootless configuration flags */
+ #define CSR_ALLOW_UNTRUSTED_KEXTS (1 << 0) // 1
+ #define CSR_ALLOW_UNRESTRICTED_FS (1 << 1) // 2
+ #define CSR_ALLOW_TASK_FOR_PID (1 << 2) // 4
+ #define CSR_ALLOW_KERNEL_DEBUGGER (1 << 3) // 8
+ #define CSR_ALLOW_APPLE_INTERNAL (1 << 4) // 16
+ #define CSR_ALLOW_UNRESTRICTED_DTRACE (1 << 5) // 32
+ #define CSR_ALLOW_UNRESTRICTED_NVRAM (1 << 6) // 64
+
+ #define CSR_VALID_FLAGS (CSR_ALLOW_UNTRUSTED_KEXTS | \
+ CSR_ALLOW_UNRESTRICTED_FS | \
+ CSR_ALLOW_TASK_FOR_PID | \
+ CSR_ALLOW_KERNEL_DEBUGGER | \
+ CSR_ALLOW_APPLE_INTERNAL | \
+ CSR_ALLOW_UNRESTRICTED_DTRACE | \
+ CSR_ALLOW_UNRESTRICTED_NVRAM)
+#endif
+
#include "EfiCommon.h"
#include "EfiApi.h"
#include "EfiImage.h"

0 comments on commit 66f373c

Please sign in to comment.