Changeset 549 for Whitix/branches/hybrid/video/console.c
- Timestamp:
- 05/24/08 09:58:45 (6 months ago)
- Files:
-
- 1 modified
-
Whitix/branches/hybrid/video/console.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Whitix/branches/hybrid/video/console.c
r493 r549 118 118 } 119 119 120 int printf(char* str,...)121 {122 DWORD flags;123 char printBuf[512];124 int len;125 va_list args;126 127 IrqSaveFlags(flags);128 129 va_start(args,str);130 len=vsprintf(printBuf,str,args);131 va_end(args);132 133 ConsoleWriteString(currConsole,printBuf,len);134 IrqRestoreFlags(flags);135 136 return len;137 }138 139 SYMBOL_EXPORT(printf);140 141 120 void putc(int c) 142 121 { … … 146 125 unsigned char colorTable[] = {0, 4, 2, 6, 1, 5, 3, 7}; 147 126 148 static int ConsoleWriteString(int console,char* str,int length)127 int ConsoleWriteString(int console, char* str, int length) 149 128 { 150 129 struct Console* currCons=&consoles[console]; … … 297 276 } 298 277 278 SYMBOL_EXPORT(ConsoleWriteString); 279 299 280 extern void KeyboardDoAlarm(); 300 281 … … 376 357 } 377 358 359 void ConsoleWriteOutput(char* message, int length) 360 { 361 ConsoleWriteString(currConsole, message, length); 362 } 363 378 364 static void ConsoleClearScreen(int index) 379 365 { … … 426 412 } 427 413 414 static void ConsoleGetCursorPos() 415 { 416 DWORD flags; 417 WORD position; 418 419 IrqSaveFlags(flags); 420 421 outb(0x3D4, 14); 422 position=inb(0x3D5) << 8; 423 outb(0x3D4, 15); 424 position |= inb(0x3D5); 425 426 IrqRestoreFlags(flags); 427 428 curX=position % 80; 429 curY=position/80; 430 } 431 428 432 static void ConsoleNewLine(int index) 429 433 { … … 581 585 if (item->events & POLL_OUT) 582 586 item->revents |= POLL_OUT; 583 584 // printf("ConsolePoll(%u)\n", ListEmpty(&cons->waitQueue.list));585 587 586 588 PollAddWait(pollQueue, &cons->waitQueue); … … 622 624 } 623 625 626 /* Get the current cursor position, and take over from the early console driver. */ 627 ConsoleGetCursorPos(); 628 629 KeSetOutput(ConsoleWriteOutput); 630 624 631 return 0; 625 632 }