You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
staticconstchar*prof_words[] = {"You can't just delete that!", "Your math is too poor!", "Without the formula, it's meaningless!", "Go back and study linear algebra!", "This is not rigorous.", "We need publish papers!", "Intuition won't work here!", "This is not scientific research!", "You are running blind code!"};
34
+
staticconstchar*prof_words[] = {"\033[91mYou can't just delete that!\033[0m", "\033[93mYour math is too poor!\033[0m", "\033[95mWithout the formula, it's meaningless!\033[0m", "\033[91mGo back and study linear algebra!\033[0m", "\033[96mThis is not rigorous.\033[0m", "\033[96mWe need publish papers!\033[0m", "\033[93mIntuition won't work here!\033[0m", "\033[95mThis is not scientific research!\033[0m", "\033[91mYou are running blind code!\033[0m"};
if (global_timekeeper.ktime_sec-last_yield<30) return;
52
-
if (p->utime%255>233)
53
+
if (p->utime%255<233) return;
54
+
if (p->signal&&p->signal->tty)
53
55
{
54
-
pr_alert("\033[1;31mWarning from Professors with PID=%lld: %s\033[0m\n", p->pid, prof_words[get_cycles()%(sizeof(prof_words)/sizeof(char*))]);
55
-
last_yield=global_timekeeper.ktime_sec;
56
+
charmsg_buf[256] = {0}; uint8_tmsg_len=0;
57
+
msg_len=sprintf(msg_buf, "\033[1;33mWarning from Prof with %s(PID=%lld):\033[0m %s\n", p->comm, p->pid, prof_words[get_cycles()%(sizeof(prof_words)/sizeof(char*))]);
58
+
uart_write233(p->signal->tty, msg_buf, msg_len, 0); // no flush, prevent hardware corruption
56
59
}
60
+
elsepr_alert("\033[1;31mProf was ANGRY with %s(PID=%lld):\033[0m %s\n", p->comm, p->pid, prof_words[get_cycles()%(sizeof(prof_words)/sizeof(char*))]);
0 commit comments