1 /* 2 * Copyright 2004-2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7 #include "console.h" 8 #include "keyboard.h" 9 10 #include <SupportDefs.h> 11 #include <util/kernel_cpp.h> 12 #include <boot/stage2.h> 13 14 #include <string.h> 15 16 17 class Console : public ConsoleNode { 18 public: 19 Console(); 20 21 virtual ssize_t ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize); 22 virtual ssize_t WriteAt(void *cookie, off_t pos, const void *buffer, size_t bufferSize); 23 }; 24 25 26 27 static Console sInput, sOutput; 28 FILE *stdin, *stdout, *stderr; 29 30 31 static void 32 scroll_up() 33 { 34 } 35 36 37 // #pragma mark - 38 39 40 Console::Console() 41 : ConsoleNode() 42 { 43 } 44 45 46 ssize_t 47 Console::ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize) 48 { 49 // don't seek in character devices 50 // not implemented (and not yet? needed) 51 return B_ERROR; 52 } 53 54 55 ssize_t 56 Console::WriteAt(void *cookie, off_t /*pos*/, const void *buffer, size_t bufferSize) 57 { 58 return 0; 59 } 60 61 62 // #pragma mark - 63 64 65 void 66 console_clear_screen(void) 67 { 68 69 } 70 71 72 int32 73 console_width(void) 74 { 75 return 80; 76 } 77 78 79 int32 80 console_height(void) 81 { 82 return 25; 83 } 84 85 86 void 87 console_set_cursor(int32 x, int32 y) 88 { 89 90 } 91 92 93 void 94 console_set_color(int32 foreground, int32 background) 95 { 96 97 } 98 99 100 int 101 console_wait_for_key(void) 102 { 103 return 0; 104 } 105 106 107 status_t 108 console_init(void) 109 { 110 return B_OK; 111 } 112 113