Changeset c1d2c9d in mainline for console/console.c
- Timestamp:
- 2006-06-01T21:51:35Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- da0c91e7
- Parents:
- 3993b3d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
console/console.c
r3993b3d rc1d2c9d 41 41 #include <screenbuffer.h> 42 42 43 static void sysput(char c)44 {45 __SYSCALL3(SYS_IO, 1, &c, 1);46 }47 48 //#define CONSOLE_COUNT VFB_CONNECTIONS49 43 #define CONSOLE_COUNT 8 50 44 #define MAX_KEYREQUESTS_BUFFERED 32 … … 103 97 int retval; 104 98 int i, j; 105 char c; 99 char c,d; 100 connection_t *conn; 106 101 107 102 /* Ignore parameters, the connection is alread opened */ … … 118 113 retval = 0; 119 114 c = IPC_GET_ARG1(call); 120 // ipc_call_sync_2(connections[3].vfb_phone, FB_PUTCHAR, 0, c,NULL,NULL);121 122 115 /* switch to another virtual console */ 123 116 117 conn = &connections[active_console]; 124 118 if ((c >= KBD_KEY_F1) && (c < KBD_KEY_F1 + CONSOLE_COUNT)) { 125 119 /*FIXME: draw another console content from buffer */ 126 120 127 121 active_console = c - KBD_KEY_F1; 122 conn = &connections[active_console]; 123 124 ipc_call_async(fb_info.phone, FB_CURSOR_VISIBILITY, 0, NULL, NULL); 128 125 ipc_call_async_2(fb_info.phone, FB_CLEAR, 0, 0, NULL, NULL); 129 ipc_call_sync_3(fb_info.phone, FB_PUTCHAR, 'a', 0, 0,NULL,NULL, NULL);130 131 for (i = 0; i < connections[active_console].screenbuffer.size_x; i++)132 for (j = 0; j < connections[active_console].screenbuffer.size_y; j++) {133 134 ipc_call_async_3(fb_info.phone, FB_PUTCHAR, get_field_at(&(connections[active_console].screenbuffer),\135 i, j)->character, j, i, NULL, NULL, NULL);136 }126 for (i = 0; i < conn->screenbuffer.size_x; i++) 127 for (j = 0; j < conn->screenbuffer.size_y; j++) { 128 d = get_field_at(&(conn->screenbuffer),i, j)->character; 129 if (d && d != ' ') 130 ipc_call_async_3(fb_info.phone, FB_PUTCHAR, d, j, i, NULL, NULL); 131 } 132 ipc_call_async_2(fb_info.phone, FB_CURSOR_GOTO, conn->screenbuffer.position_y, conn->screenbuffer.position_x, NULL, NULL); 133 ipc_call_async(fb_info.phone, FB_CURSOR_VISIBILITY, 1, NULL, NULL); 137 134 138 135 break; … … 140 137 141 138 /* if client is awaiting key, send it */ 142 if (conn ections[active_console].keyrequest_counter > 0) {143 conn ections[active_console].keyrequest_counter--;144 ipc_answer_fast(fifo_pop(conn ections[active_console].keyrequests), 0, c, 0);139 if (conn->keyrequest_counter > 0) { 140 conn->keyrequest_counter--; 141 ipc_answer_fast(fifo_pop(conn->keyrequests), 0, c, 0); 145 142 break; 146 143 } 147 144 148 145 /*FIXME: else store key to its buffer */ 149 keybuffer_push(&(connections[active_console].keybuffer), c); 150 151 /* Send it to first FB, DEBUG */ 152 // ipc_call_async_2(connections[0].vfb_phone, FB_PUTCHAR, 0, IPC_GET_ARG1(call),NULL,NULL); 153 // ipc_call_sync_2(connections[4].vfb_phone, FB_PUTCHAR, 0, c,NULL,NULL); 154 146 keybuffer_push(&conn->keybuffer, c); 147 155 148 break; 156 149 default: … … 192 185 /* Send message to fb */ 193 186 if (consnum == active_console) { 194 ipc_call_ sync_3(fb_info.phone, FB_PUTCHAR, IPC_GET_ARG2(call), connections[consnum].screenbuffer.position_y, \195 connections[consnum].screenbuffer.position_x, NULL, NULL , NULL);187 ipc_call_async_3(fb_info.phone, FB_PUTCHAR, IPC_GET_ARG2(call), connections[consnum].screenbuffer.position_y, \ 188 connections[consnum].screenbuffer.position_x, NULL, NULL); 196 189 } 197 190 … … 226 219 }; 227 220 keybuffer_pop(&(connections[consnum].keybuffer), (char *)&arg1); 228 // ipc_call_sync_2(connections[6].vfb_phone, FB_PUTCHAR, 0, arg1,NULL,NULL);229 221 230 222 break; … … 258 250 } 259 251 260 ipc_call_sync_3(fb_info.phone, FB_PUTCHAR, '1', 0, 0,NULL,NULL, NULL);261 252 ipc_call_sync_2(fb_info.phone, FB_GET_CSIZE, 0, 0, &(fb_info.rows), &(fb_info.cols)); 253 ipc_call_sync(fb_info.phone, FB_CURSOR_VISIBILITY, 1, NULL); 262 254 263 255 /* Init virtual consoles */ 264 256 for (i = 0; i < CONSOLE_COUNT; i++) { 265 ipc_call_sync_3(fb_info.phone, FB_PUTCHAR, '$', 2*i, 1,NULL,NULL, NULL);266 257 connections[i].used = 0; 267 258 keybuffer_init(&(connections[i].keybuffer)); 268 ipc_call_sync_3(fb_info.phone, FB_PUTCHAR, '>', 2*i+1, 1,NULL,NULL, NULL);269 259 270 260 connections[i].keyrequests.head = connections[i].keyrequests.tail = 0; … … 272 262 connections[i].keyrequest_counter = 0; 273 263 274 ipc_call_sync_3(fb_info.phone, FB_PUTCHAR, '?', 2*i+1, 1,NULL,NULL, NULL);275 264 if (screenbuffer_init(&(connections[i].screenbuffer), fb_info.cols, fb_info.rows ) == NULL) { 276 265 /*FIXME: handle error */ … … 283 272 }; 284 273 285 ipc_call_sync_3(fb_info.phone, FB_PUTCHAR, 'M', 3, 3,NULL,NULL, NULL);286 274 async_manager(); 287 275
Note:
See TracChangeset
for help on using the changeset viewer.