Chameleon

Chameleon Commit Details

Date:2016-06-18 21:21:30 (7 years 10 months ago)
Author:ErmaC
Commit:2836
Parents: 2835
Message:Add csrInfo (boot.c)
Changes:
M/trunk/i386/boot2/boot.c

File differences

trunk/i386/boot2/boot.c
970970
971971
972972
973
973
974974
975975
976976
977977
978978
979
979980
980981
981982
982
983
984983
985984
986985
......
990989
991990
992991
992
993
994
995
996
997
993998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
9941022
9951023
9961024
if ( getIntForKey(kCsrActiveConfig, &csrValue, &bootInfo->chameleonConfig) && (csrValue >= 0 && csrValue <= 127) )
{
bootArgs->csrActiveConfig= csrValue;
csrInfo(csrValue, 1);
}
else
{
// zenith432
bootArgs->csrActiveConfig= 0x67;
csrInfo(0x67, 0);
}
// ===============================================================================
verbose("CsrActiveConfig set to 0x%x\n", bootArgs->csrActiveConfig);
// ===============================================================================
}
// =========================================================================
// ErmaC
void csrInfo(int csrValue, bool custom)
{
int mask = 0x20;
verbose("System Integrity Protection status: %s ", (csrValue == 0) ? "enabled":"disabled");
verbose("(%s Configuration).\nCsrActiveConfig = 0x%02x (", custom ? "Custom":"Default", csrValue);
// Display integer number into binary using bitwise operator
((csrValue & 0x20) == 0) ? verbose("0"): verbose("1");
while (mask != 0)
{
( ((csrValue & mask) == 0) ? verbose("0"): verbose("1") );
mask = mask >> 1;
}
verbose(")\n");
if (csrValue != 0)
{
verbose("\nConfiguration:\n");
verbose("Kext Signing: %s\n", ((csrValue & 0x01) == 0) ? "enabled":"disabled"); /* (1 << 0) Allow untrusted kexts */
verbose("Filesystem Protections: %s\n", ((csrValue & 0x02) == 0) ? "enabled":"disabled"); /* (1 << 1) Allow unrestricted file system. */
verbose("Task for PID: %s\n", ((csrValue & 0x04) == 0) ? "enabled":"disabled"); /* (1 << 2) */
verbose("Debugging Restrictions: %s\n", ((csrValue & 0x08) == 0) ? "enabled":"disabled"); /* (1 << 3) */
verbose("Apple Internal: %s\n", ((csrValue & 0x10) == 0) ? "enabled":"disabled"); /* (1 << 4) */
verbose("DTrace Restrictions: %s\n", ((csrValue & 0x20) == 0) ? "enabled":"disabled"); /* (1 << 5) Allow unrestricted dtrace */
verbose("NVRAM Protections: %s\n", ((csrValue & 0x40) == 0) ? "enabled":"disabled"); /* (1 << 6) Allow unrestricted NVRAM */
//verbose("DEVICE configuration: %s\n", ((csrValue & 0x80) == 0) ? "enabled":"disabled"); /* (1 << 7) Allow device configuration */
}
verbose("\n");
}
// =========================================================================
/*!

Archive Download the corresponding diff file

Revision: 2836