Ejemplo n.º 1
0
void printPrettyTime()
{
    tcputs(itoa(getHours()),COLOR_WHITE);
    tcputs(":",COLOR_WHITE);
    tcputs(itoa(getMinutes()),COLOR_WHITE);
    tcputs(":",COLOR_WHITE);
    tcputs(itoa(getSeconds()),COLOR_WHITE);
    tputs("\n");
}
Ejemplo n.º 2
0
void testTimer()
{
  tcputs("Testing Timer....\n",COLOR_WHITE);
  int i = 0;
  for (i = 0; i < 10; i++)
  {
    wait(1000);  //wait for 100 milliseconds
    tcputs("TICK\n",COLOR_WHITE);
  }
}
Ejemplo n.º 3
0
void help()
{
  tcputs("Availible Commands:\n",COLOR_WHITE);
  NODE* current = &head;
  for (int i = 0; i < numOfCmds; i++)
  {
    tcputs(current->name, COLOR_WHITE);
    tputs("\n");
    current = current->next;  
  }
}
Ejemplo n.º 4
0
NODE* findCommand(char* command)
{
  int i = 0;
  NODE* current;
  current = &head;
  for(i = 0; i<numOfCmds; i++)//while(current->next)
  {
    if (current->c1 == command[0])
    {
      if (current->c2 == command[1])
      {
        if (current->c3 == command[2])
        {
          if (current->len == (strlen(command)))
          {
            return current;
          }
        }
      }
    }
    current = current->next;
  }
  tcputs("ERROR COMMAND NOT FOUND\n", COLOR_RED);
  return NULL;
}
Ejemplo n.º 5
0
void init_shell()
{
  getCmdCount();
  populateCommands();
  tcputs("$>> ", COLOR_GREEN);
  irq_install_handler(1, keyboard_handler);
  waitCmd();
}
Ejemplo n.º 6
0
void runShell(char* command)
{
  NODE* cmd;
  cmd = findCommand(command);
  if (cmd)
    cmd->cmd();
  tcputs("$>> ", COLOR_GREEN);
  waitCmd();
}
Ejemplo n.º 7
0
void mallocTestCmd()
{
  tcputs("MallocTest\n", COLOR_WHITE);
  int* testArray = (int*)malloc(5*sizeof(int));
  int test[5] = {1,2,3,4,5};

  tputs("Array is allocated at: ");
  tputs(itoa(testArray));
  tputs("\n");

  testArray[0] = 10;
  testArray[1] = 22;
  testArray[2] = 33;
  testArray[3] = 45;
  testArray[4] = 56;

  if (testArray[0] == 10)
    tputs("\tPASS\n");
  else
    tcputs("\tFAIL\n", COLOR_RED);
  if (testArray[1] == 22)
    tputs("\tPASS\n");
  else
    tcputs("\tFAIL\n", COLOR_RED);
  if (testArray[2] == 33)
    tputs("\tPASS\n");
  else
    tcputs("\tFAIL\n", COLOR_RED);
  if (testArray[3] == 45)
    tputs("\tPASS\n");
  else
    tcputs("\tFAIL\n", COLOR_RED);
  if (testArray[4] == 56)
    tputs("\tPASS\n");
  else
    tcputs("\tFAIL\n", COLOR_RED);
  int* test2 = (int*)malloc(100*sizeof(int));
  int i = 0;
  for (i = 0; i<100; i++)
   test2[i] = i;
  for (i = 0; i<100; i++)
  {
   tputs(itoa(test2[i])); 
  }
  tputs(itoa(test2));
  tputs("\n");
  tputs(itoa(test));
  tputs("\n");
}
Ejemplo n.º 8
0
void runShell()
{
	tcputs("$>> ", COLOR_GREEN);
}
Ejemplo n.º 9
0
void init_shell()
{
	tcputs("$>> ", COLOR_GREEN);
	irq_install_handler(1, keyboard_handler);
	//doesn't work because init_shell() will return as soon as it passes this if branch
}
Ejemplo n.º 10
0
void initForth()
{
  tcputs("ok\n", COLOR_WHITE);
  for(;;);
}
Ejemplo n.º 11
0
void info()
{
  tcputs("HobbyOS\nCopyright GPUJake 2014\n", COLOR_WHITE);
}
Ejemplo n.º 12
0
void run()
{
  tcputs("Running...\n",COLOR_WHITE);
}