Not so far ago, I was lost on the net, and I found a piece of code to simulate a Kernel Panic in the osxbook site.
Well, and as we are Mac Users, we don’t see this kind of thing very often [TROLL]Not like on Windows[/TROLL], so I decided to share this little piece of code ![]()
#include <sys/types.h>
#include <sys/sysctl.h>
#define KERN_PANICINFO_TEST (KERN_PANICINFO_IMAGE + 2)
int main(void)
{
size_t oldnewlen = 0;
int mib[3] = { CTL_KERN, KERN_PANICINFO, KERN_PANICINFO_TEST };
return sysctl(mib, 3, NULL, (void*)&oldnewlen, NULL, oldnewlen);
}
gcc panic_test.c -o panic_test sudo ./panic_test
You have to be root to execute the program, because of sysctl()
In this site there is another post to show how you can change your panic screen, if you don’t know what to do…
I really find this is a great interesting subject. Never looked over this subject in this manner. If you are planning to create more articles about this subject, I will be back soon!