//! something is wrong--bail out void _cdecl kernel_panic (const char* fmt, ...) { _asm cli va_list args; static char buf[1024]; va_start (args, fmt); va_end (args); char* disclamer="We apologize, MOS has encountered a problem and has been shut down\n\ to prevent damage to your computer. Any unsaved work might be lost.\n\ We are sorry for the inconvenience this might have caused.\n\n\ Please report the following information and restart your computer.\n\ The system has been halted.\n\n"; console.Clear(); //console.WriteString(sickpc, White, Black); //console.WriteString(disclamer, White, Black); //sprintf(buf, "*** STOP: %s", fmt); console.WriteString((char *)fmt, White, Black); //DebugPuts (sickpc); //DebugPuts (disclamer); //DebugPrintf ("*** STOP: %s", fmt); for (;;); }
void WelComeMessage() { console.Clear(); char* szWelcome = "Welcome to Orange OS!!"; char szBuf[256]; strcpy(szBuf, szWelcome); console.WriteString(szBuf, White, Black); console.WriteString("This is a C++ OS.", White, Black); SYSTEMTIME sysTime; GetLocalTime(&sysTime); memset(szBuf, 0, 256); sprintf(szBuf, "LocalTime : %d/%d %d:%d", (int)sysTime.wMonth, (int)sysTime.wDay, (int)sysTime.wHour, (int)sysTime.wMinute); console.WriteString(szBuf, White, Black); sprintf(szBuf, "Address : %x", &g_var); console.WriteString(szBuf, White, Black); }
KERNELAPI int CrtPrintf(const char *fmt, ...) { va_list arg; int ret; char buf[256]; va_start(arg, fmt); ret = vsprintf(buf, fmt, arg); va_end(arg); console.WriteString(buf, White, Black); return ret; }
void ConsoleFrame::DoHandleMessage(const wnd_message_t *msg) { wchar_t *str; size_t length; switch (msg->code) { case NEW_STRING: str = (wchar_t*) msg->params.generic[0]; length = msg->params.generic[1]; m_console.WriteString(str, length); free(str); break; default: WindowImpl::DoHandleMessage(msg); break; } }
void DbgError(char* pMsg) { console.WriteString(pMsg, White, Black); while (1); }