Chameleon

Chameleon Commit Details

Date:2016-06-18 21:19:30 (4 years 5 months ago)
Author:ErmaC
Commit:2835
Parents: 2834
Message:Add csrInfo (boot.c)
Changes:
M/branches/ErmaC/Enoch/i386/boot2/boot.c

File differences

branches/ErmaC/Enoch/i386/boot2/boot.c
966966
967967
968968
969
969
970970
971971
972972
973973
974974
975
975976
976977
977978
978
979
980979
981980
982981
......
986985
987986
988987
988
989
990
991
992
993
989994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
9901018
9911019
9921020
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: 2835