update PrintInt and change PutString to PutInt

This commit is contained in:
ChenYen-Yen
2024-10-22 16:27:49 +08:00
committed by Yi-Ting Shih
parent a2e956164f
commit 69f2502823
9 changed files with 21 additions and 36 deletions

View File

@@ -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);
}