- Timestamp:
- 2008-12-30T19:55:10Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f58321c4
- Parents:
- 6b21292
- Location:
- uspace
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/klog/klog.c
r6b21292 r3ad953c 87 87 return -1; 88 88 } 89 89 90 int devno = sysinfo_value("klog.devno"); 90 91 int inr = sysinfo_value("klog.inr"); 91 int devno = sysinfo_value("klog.devno");92 92 if (ipc_register_irq(inr, devno, 0, NULL) != EOK) { 93 93 printf(NAME ": Error registering klog notifications\n"); -
uspace/srv/console/console.c
r6b21292 r3ad953c 49 49 #include <sys/mman.h> 50 50 #include <stdio.h> 51 #include <sysinfo.h> 51 52 52 53 #include "gcons.h" … … 59 60 */ 60 61 int active_console = 0; 62 int prev_console = 0; 61 63 62 64 /** Information about framebuffer … … 208 210 async_serialize_end(); 209 211 210 if (__SYSCALL0(SYS_DEBUG_ENABLE_CONSOLE)) 212 if (__SYSCALL0(SYS_DEBUG_ENABLE_CONSOLE)) { 213 prev_console = active_console; 211 214 active_console = KERNEL_CONSOLE; 212 else215 } else 213 216 newcons = active_console; 214 217 } … … 236 239 } 237 240 /* This call can preempt, but we are already at the end */ 238 rc = async_req_0_0(fb_info.phone, FB_DRAW_TEXT_DATA); 241 rc = async_req_0_0(fb_info.phone, FB_DRAW_TEXT_DATA); 239 242 } 240 243 … … 244 247 style = &conn->screenbuffer.style; 245 248 246 for (j = 0; j < conn->screenbuffer.size_y; j++) 249 for (j = 0; j < conn->screenbuffer.size_y; j++) 247 250 for (i = 0; i < conn->screenbuffer.size_x; i++) { 248 251 field = get_field_at(&conn->screenbuffer, i, j); … … 341 344 ipcarg_t arg1, arg2; 342 345 connection_t *conn; 343 346 344 347 if ((consnum = find_free_connection()) == -1) { 345 348 ipc_answer_0(iid, ELIMIT); … … 356 359 /* Accept the connection */ 357 360 ipc_answer_0(iid, EOK); 358 361 359 362 while (1) { 360 363 async_serialize_end(); 361 364 callid = async_get_call(&call); 362 365 async_serialize_start(); 363 366 364 367 arg1 = 0; 365 368 arg2 = 0; … … 369 372 370 373 /* Answer all pending requests */ 371 while (conn->keyrequest_counter > 0) { 374 while (conn->keyrequest_counter > 0) { 372 375 conn->keyrequest_counter--; 373 376 ipc_answer_0(fifo_pop(conn->keyrequests), … … 444 447 } 445 448 449 static void interrupt_received(ipc_callid_t callid, ipc_call_t *call) 450 { 451 change_console(prev_console); 452 } 453 446 454 int main(int argc, char *argv[]) 447 455 { … … 451 459 int kbd_phone; 452 460 int i; 453 461 454 462 async_set_client_connection(client_connection); 455 463 456 464 /* Connect to keyboard driver */ 457 465 458 466 kbd_phone = ipc_connect_me_to(PHONE_NS, SERVICE_KEYBOARD, 0, 0); 459 467 while (kbd_phone < 0) { … … 512 520 } 513 521 } 514 522 515 523 curs_goto(0, 0); 516 524 curs_visibility( 517 525 connections[active_console].screenbuffer.is_cursor_visible); 518 526 519 527 /* Register at NS */ 520 528 if (ipc_connect_to_me(PHONE_NS, SERVICE_CONSOLE, 0, 0, &phonehash) != 0) 521 529 return -1; 522 530 531 /* Receive kernel notifications */ 532 if (sysinfo_value("kconsole.present")) { 533 int devno = sysinfo_value("kconsole.devno"); 534 int inr = sysinfo_value("kconsole.inr"); 535 if (ipc_register_irq(inr, devno, 0, NULL) != EOK) 536 printf(NAME ": Error registering kconsole notifications\n"); 537 538 async_set_interrupt_received(interrupt_received); 539 } 540 523 541 // FIXME: avoid connectiong to itself, keep using klog 524 542 // printf(NAME ": Accepting connections\n"); 525 543 async_manager(); 526 527 return 0; 544 545 return 0; 528 546 } 529 547
Note:
See TracChangeset
for help on using the changeset viewer.