Changeset c738d65 in mainline for uspace/console/console.c
- Timestamp:
- 2007-01-15T22:11:24Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d7baee6
- Parents:
- d78d603
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/console/console.c
rd78d603 rc738d65 87 87 * with framebufer used for 88 88 * faster virtual console 89 * switching */89 * switching */ 90 90 91 91 static int kernel_pixmap = -1; /**< Number of fb pixmap, where kernel … … 98 98 static int find_free_connection(void) 99 99 { 100 int i = 0;101 102 for (i =0; i < CONSOLE_COUNT; i++) {100 int i; 101 102 for (i = 0; i < CONSOLE_COUNT; i++) { 103 103 if (!connections[i].used) 104 104 return i; … … 149 149 switch (key) { 150 150 case '\n': 151 scr->position_y += 1;152 scr->position_x = 151 scr->position_y++; 152 scr->position_x = 0; 153 153 break; 154 154 case '\r': … … 179 179 scr->position_y = scr->size_y - 1; 180 180 screenbuffer_clear_line(scr, scr->top_line); 181 scr->top_line = (scr->top_line +1) % scr->size_y;181 scr->top_line = (scr->top_line + 1) % scr->size_y; 182 182 if (console == active_console) 183 183 async_msg(fb_info.phone, FB_SCROLL, 1); … … 264 264 for (i = 0; i < conn->screenbuffer.size_x; i++) 265 265 for (j = 0; j < conn->screenbuffer.size_y; j++) 266 interbuffer[i + j * conn->screenbuffer.size_x] 267 =*get_field_at(&(conn->screenbuffer),266 interbuffer[i + j * conn->screenbuffer.size_x] = 267 *get_field_at(&(conn->screenbuffer), 268 268 i, j); 269 269 /* This call can preempt, but we are already at the end */ … … 389 389 390 390 /* Accept the connection */ 391 ipc_answer_fast(iid, 0,0,0);391 ipc_answer_fast(iid, 0, 0, 0); 392 392 393 393 while (1) { … … 442 442 arg1 = IPC_GET_ARG1(call); 443 443 arg2 = IPC_GET_ARG2(call); 444 screenbuffer_set_style(&conn->screenbuffer, arg1, arg2);444 screenbuffer_set_style(&conn->screenbuffer, arg1, arg2); 445 445 if (consnum == active_console) 446 446 set_style_col(arg1, arg2); … … 485 485 /* Connect to keyboard driver */ 486 486 487 while ((kbd_phone = ipc_connect_me_to(PHONE_NS, SERVICE_KEYBOARD, 0))488 487 kbd_phone = ipc_connect_me_to(PHONE_NS, SERVICE_KEYBOARD, 0); 488 while (kbd_phone < 0) { 489 489 usleep(10000); 490 kbd_phone = ipc_connect_me_to(PHONE_NS, SERVICE_KEYBOARD, 0); 490 491 } 491 492 492 493 if (ipc_connect_to_me(kbd_phone, SERVICE_CONSOLE, 0, &phonehash) != 0) 493 {494 494 return -1; 495 }496 495 async_new_connection(phonehash, 0, NULL, keyboard_events); 497 496 498 497 /* Connect to framebuffer driver */ 499 498 500 while ((fb_info.phone = ipc_connect_me_to(PHONE_NS, SERVICE_VIDEO, 0))501 499 fb_info.phone = ipc_connect_me_to(PHONE_NS, SERVICE_VIDEO, 0); 500 while (fb_info.phone < 0) { 502 501 usleep(10000); 502 fb_info.phone = ipc_connect_me_to(PHONE_NS, SERVICE_VIDEO, 0); 503 503 } 504 504 … … 511 511 async_req(fb_info.phone, FB_FLUSH, 0, NULL); 512 512 /* Enable double buffering */ 513 async_msg_2(fb_info.phone, FB_VIEWPORT_DB, (sysarg_t) -1, 1);513 async_msg_2(fb_info.phone, FB_VIEWPORT_DB, (sysarg_t) -1, 1); 514 514 515 515 async_req_2(fb_info.phone, FB_GET_CSIZE, 0, 0, &(fb_info.rows), … … 530 530 if (screenbuffer_init(&(connections[i].screenbuffer), 531 531 fb_info.cols, fb_info.rows) == NULL) { 532 /* FIXME: handle error */532 /* FIXME: handle error */ 533 533 return -1; 534 534 } … … 536 536 connections[KERNEL_CONSOLE].used = 1; 537 537 538 if ((interbuffer = mmap(NULL, sizeof(keyfield_t) * fb_info.cols * 539 fb_info.rows, PROTO_READ | PROTO_WRITE, MAP_ANONYMOUS | 540 MAP_PRIVATE, 0, 0)) != NULL) { 538 interbuffer = mmap(NULL, 539 sizeof(keyfield_t) * fb_info.cols * fb_info.rows, 540 PROTO_READ | PROTO_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0); 541 if (!interbuffer) { 541 542 if (async_req_3(fb_info.phone, IPC_M_AS_AREA_SEND, (ipcarg_t) 542 543 interbuffer, 0, AS_AREA_READ, NULL, NULL, NULL) != 0) { … … 547 548 } 548 549 549 curs_goto(0, 0);550 curs_goto(0, 0); 550 551 curs_visibility(connections[active_console].screenbuffer.is_cursor_visible); 551 552
Note:
See TracChangeset
for help on using the changeset viewer.