Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

StephenM108

macrumors newbie
Original poster
May 30, 2023
11
1
Could someone please help me with some code and how to implement it. I am new to it and I do not know if it is Python, Swift etc.

The code I found on a search is to disable watchdog which is a kernel panic that tells the computer that this program is taking too long to load lets make it non-responsive. It does this a lot with one specific program I have. Also must I get software to run it or what? You can tell I am new to it. Please help.

The code is:



void taskN_handler()
{
watchdog *wd = watchdog_create(100); /* Create an simulated watchdog with timeout of 100 ms */
/* Do init */
while (task1_should_run)
{
watchdog_feed(wd); /* feed it */
/* do stuff */
}
watchdog_destroy(wd); /* destroy when no longer necessary */
}

void watchdog_task_handler()
{
int i;
bool feed_flag = true;
while(1)
{
/* Check if any simulated watchdog has timeout */
for (i = 0; i < getNOfEnabledWatchdogs(); i++)
{
if (watchogHasTimeout(i)) {
feed_flag = false;
break;
}
}

if (feed_flag)
WatchdogFeedTheHardware();

task_sleep(10);





So that is the code if I learn how to use this, in future I can help myself.

Thank you kindly.

Stephen Mannheim
 

Bigwaff

Contributor
Sep 20, 2013
2,768
1,846
The code I found on a search is to disable watchdog which is a kernel panic that tells the computer that this program is taking too long to load lets make it non-responsive. It does this a lot with one specific program I have.
If your goal is to circumvent macOS from kernel panics when the "one specific program" becomes non-responsive by implementing a program yourself, you are terribly misinformed. Any program you write will not affect the "one specific program" when it is executing. Most likely, the "one specific program" is performing some operation which is incompatible with the version of macOS installed.

Perhaps if you provided some specific details about your Mac, it's hardware configuration, the version of macOS installed, what the "one specific program" is and its version, and any kernel panic logs, someone here might be able to help you determine why the "one specific program" interacts w/ macOS so poorly.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.