64,6 → 64,9 |
int active_console = 0; |
int prev_console = 0; |
|
/** Phone to the keyboard driver. */ |
static int kbd_phone; |
|
/** Information about framebuffer */ |
struct { |
int phone; /**< Framebuffer phone */ |
141,6 → 144,26 |
async_msg_2(fb_info.phone, FB_CURSOR_GOTO, row, col); |
} |
|
static void screen_yield(void) |
{ |
ipc_call_sync_0_0(fb_info.phone, FB_SCREEN_YIELD); |
} |
|
static void screen_reclaim(void) |
{ |
ipc_call_sync_0_0(fb_info.phone, FB_SCREEN_RECLAIM); |
} |
|
static void kbd_yield(void) |
{ |
ipc_call_sync_0_0(kbd_phone, KBD_YIELD); |
} |
|
static void kbd_reclaim(void) |
{ |
ipc_call_sync_0_0(kbd_phone, KBD_RECLAIM); |
} |
|
static void set_style(int style) |
{ |
async_msg_1(fb_info.phone, FB_SET_STYLE, style); |
330,7 → 353,10 |
async_serialize_start(); |
curs_hide_sync(); |
gcons_in_kernel(); |
screen_yield(); |
kbd_yield(); |
async_serialize_end(); |
|
|
if (__SYSCALL0(SYS_DEBUG_ENABLE_CONSOLE)) { |
prev_console = active_console; |
342,8 → 368,11 |
if (newcons != KERNEL_CONSOLE) { |
async_serialize_start(); |
|
if (active_console == KERNEL_CONSOLE) |
if (active_console == KERNEL_CONSOLE) { |
screen_reclaim(); |
kbd_reclaim(); |
gcons_redraw_console(); |
} |
|
active_console = newcons; |
gcons_change_console(newcons); |
474,6 → 503,7 |
if (!ipc_data_write_receive(&callid, &size)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
|
if (size > CWRITE_BUF_SIZE) |
481,6 → 511,8 |
|
(void) ipc_data_write_finalize(callid, cwrite_buf, size); |
|
async_serialize_start(); |
|
off = 0; |
while (off < size) { |
ch = str_decode(cwrite_buf, &off, size); |
487,6 → 519,8 |
write_char(consnum, ch); |
} |
|
async_serialize_end(); |
|
gcons_notify_char(consnum); |
ipc_answer_1(rid, EOK, size); |
} |
512,6 → 546,8 |
gcons_notify_connect(consnum); |
conn->client_phone = IPC_GET_ARG5(*icall); |
screenbuffer_clear(&conn->screenbuffer); |
if (consnum == active_console) |
clrscr(); |
|
/* Accept the connection */ |
ipc_answer_0(iid, EOK); |
544,7 → 580,9 |
gcons_notify_char(consnum); |
break; |
case CONSOLE_WRITE: |
async_serialize_end(); |
cons_write(consnum, callid, &call); |
async_serialize_start(); |
continue; |
case CONSOLE_CLEAR: |
/* Send message to fb */ |
649,7 → 687,6 |
printf(NAME ": HelenOS Console service\n"); |
|
ipcarg_t phonehash; |
int kbd_phone; |
size_t ib_size; |
int i; |
|