Beispiel #1
0
int Console::LClear(lua_State *state)
{
    // function clear()
    // Clear the console.
    Console *self = static_cast<Console*>(lua_touserdata(state, lua_upvalueindex(1)));
    self->Clear();
    return 0;
}
Beispiel #2
0
bool ConsoleManager::RunCommand(char* buf) 
{

	if (strcmp(buf, "user") == 0) {
		go_user();
	}

	//! exit command
	if (strcmp(buf, "exit") == 0) {
		return true;
	}

	//! clear screen
	else if (strcmp(buf, "cls") == 0) {
		console.Clear();
	}

	//! help
	else if (strcmp(buf, "help") == 0) {

		console.Print("Orange OS Console Help\n");		
		console.Print(" - exit: quits and halts the system\n");
		console.Print(" - cls: clears the display\n");
		console.Print(" - help: displays this message\n");
		console.Print(" - read: reads a file\n");
		console.Print(" - reset: Resets and recalibrates floppy for reading\n");
		console.Print(" - proc: Run process\n");		
	}

	//! read sector
	else if (strcmp(buf, "read") == 0) {
		cmd_read();
	}
	else if (strcmp(buf, "memstate") == 0) {
		cmd_memstate();
	}
	else if (strcmp(buf, "alloc") == 0) {
		cmd_alloc();
	}
	else if (strcmp(buf, "memtask") == 0) {
		cmd_memtask();
	}

	//! run process
	else if (strcmp(buf, "proc") == 0) {
		cmd_proc();
	}
	else
	{
		console.Print("Unknown Command\n");
	}

	return false;
}
Beispiel #3
0
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);
}