63 pScreen->
drawString(panic_output, 0, 0, DebuggerIO::Red, DebuggerIO::Black);
85 Line.append(entry.timestamp, 10, 8,
'0');
100 Line.append(entry.timestamp, 10, 8,
'0');
112 pScreen->
drawString(Line, nLines + iUsedEntries, 0, DebuggerIO::White, DebuggerIO::Black);
120 fprintf(stderr,
"panic: %s\n", msg);
129 if (terminalShutdown && !terminalTlbFailure) {
130 shutdownFailure.append(
"Shutdown failed. Filesystems may be unclean.\nPhase: ");
131 shutdownFailure.append(Machine::shutdownPhaseName());
132 shutdownFailure.append(
"\nReason: ");
133 shutdownFailure.append(msg);
138 if (Machine::instance().getNumSerial()) {
141 serial->write_str(
"PANIC: ");
142 serial->write_str(msg);
143 serial->write_str(
"\r\n");
147 bool processorsStopped =
true;
149 if (terminalTlbFailure) {
152 if (!processorsStopped) {
155 }
while (!processorsStopped);
159 if (!processorsStopped && !terminalTlbFailure && !terminalShutdown) {
160 ERROR_NOLOCK(
"panic: not all other processors stopped");
164 if (terminalShutdown && !terminalTlbFailure) {
167 if (processorsStopped) {
168 Vga* console = Machine::instance().
getNumVga() ? Machine::instance().
getVga(0) :
nullptr;
170 console->enterPanicMode();
173 }
else if (Machine::instance().getNumSerial()) {
174 Machine::instance().
getSerial(0)->write_str(shutdownFailure);
175 Machine::instance().
getSerial(0)->write_str(
"\r\n");
181 if (terminalTlbFailure) {
184 SerialIO serialIO(Machine::instance().getSerial(0));
185 serialIO.
drawString(
"PANIC: ", 0, 0, DebuggerIO::Red, DebuggerIO::Black);
186 serialIO.
drawString(msg, 0, 7, DebuggerIO::Red, DebuggerIO::Black);
192 if (processorsStopped) {
193 static String graphicsService(
"graphics");
197 ByteSet(¶ms, 0,
sizeof(params));
198 params.wantTextMode =
false;
202 bool bSuccess =
false;
203 if (ServiceManager::instance().tryGetService(graphicsService, pService, pFeatures) &&
209 if (bSuccess && params.providerFound && !params.providerResult.
bTextModes &&
210 params.providerResult.pDisplay) {
218 SerialIO serialIO(Machine::instance().getSerial(0));
223 if (Machine::instance().getNumVga())
225 static LocalIO localIO(Machine::instance().getVga(0), Machine::instance().getKeyboard());
226#if DONT_LOG_TO_SERIAL
227 pInterfaces[0] = &localIO;
230 pInterfaces[0] = &localIO;
231 pInterfaces[1] = &serialIO;
235#if !DONT_LOG_TO_SERIAL
237 pInterfaces[0] = &serialIO;
242 for (
int nIFace = 0; nIFace < nInterfaces; nIFace++)
243 _panic(msg, pInterfaces[nIFace]);