update PrintInt and change PutString to PutInt
This commit is contained in:
@@ -173,10 +173,12 @@ ConsoleOutput::PutChar(char ch)
|
||||
}
|
||||
|
||||
void
|
||||
ConsoleOutput::PutString(char *str)
|
||||
ConsoleOutput::PutInt(int value)
|
||||
{
|
||||
ASSERT(putBusy == FALSE);
|
||||
WriteFile(writeFileNo, str, strlen(str));
|
||||
char *printStr = (char*)malloc(sizeof(char)*15);
|
||||
sprintf(printStr, "%d\n", value);
|
||||
WriteFile(writeFileNo, printStr, strlen(printStr)*sizeof(char));
|
||||
putBusy = TRUE;
|
||||
kernel->interrupt->Schedule(this, ConsoleTime, ConsoleWriteInt);
|
||||
}
|
||||
@@ -76,7 +76,7 @@ class ConsoleOutput : public CallBackObj {
|
||||
void PutChar(char ch); // Write "ch" to the console display,
|
||||
// and return immediately. "callWhenDone"
|
||||
// will called when the I/O completes.
|
||||
void PutString(char *str);
|
||||
void PutInt(int n);
|
||||
void CallBack(); // Invoked when next character can be put
|
||||
// out to the display.
|
||||
|
||||
|
||||
@@ -359,3 +359,8 @@ Interrupt::DumpState()
|
||||
cout << "\nEnd of pending interrupts\n";
|
||||
}
|
||||
|
||||
void
|
||||
Interrupt::PrintInt(int value)
|
||||
{
|
||||
return kernel->PrintInt(value);
|
||||
}
|
||||
Reference in New Issue
Block a user