Rev 1521 | Rev 1523 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1521 | Rev 1522 | ||
---|---|---|---|
Line 39... | Line 39... | ||
39 | #include <async.h> |
39 | #include <async.h> |
40 | #include <libadt/fifo.h> |
40 | #include <libadt/fifo.h> |
41 | #include <screenbuffer.h> |
41 | #include <screenbuffer.h> |
42 | #include <sys/mman.h> |
42 | #include <sys/mman.h> |
43 | 43 | ||
- | 44 | #include "gcons.h" |
|
- | 45 | ||
44 | #define MAX_KEYREQUESTS_BUFFERED 32 |
46 | #define MAX_KEYREQUESTS_BUFFERED 32 |
45 | 47 | ||
46 | #define NAME "CONSOLE" |
48 | #define NAME "CONSOLE" |
47 | 49 | ||
48 | int active_console = 0; |
50 | int active_console = 0; |
Line 175... | Line 177... | ||
175 | /* switch to another virtual console */ |
177 | /* switch to another virtual console */ |
176 | 178 | ||
177 | conn = &connections[active_console]; |
179 | conn = &connections[active_console]; |
178 | // if ((c >= KBD_KEY_F1) && (c < KBD_KEY_F1 + CONSOLE_COUNT)) { |
180 | // if ((c >= KBD_KEY_F1) && (c < KBD_KEY_F1 + CONSOLE_COUNT)) { |
179 | if ((c >= '0') && (c < '0' + CONSOLE_COUNT)) { |
181 | if ((c >= '0') && (c < '0' + CONSOLE_COUNT)) { |
180 | - | ||
181 | if (c == '0') { |
182 | if (c == '0') { |
182 | /* switch to kernel console*/ |
183 | /* switch to kernel console*/ |
183 | sync_send_2(fb_info.phone, FB_CURSOR_VISIBILITY, 0, 0, NULL, NULL); |
184 | sync_send_2(fb_info.phone, FB_CURSOR_VISIBILITY, 0, 0, NULL, NULL); |
184 | nsend_call_2(fb_info.phone, FB_SET_STYLE, DEFAULT_FOREGROUND_COLOR, DEFAULT_BACKGROUND_COLOR); |
185 | nsend_call_2(fb_info.phone, FB_SET_STYLE, DEFAULT_FOREGROUND_COLOR, DEFAULT_BACKGROUND_COLOR); |
185 | nsend_call(fb_info.phone, FB_CLEAR, 0); |
186 | nsend_call(fb_info.phone, FB_CLEAR, 0); |
Line 190... | Line 191... | ||
190 | } else { |
191 | } else { |
191 | c = c - '1'; |
192 | c = c - '1'; |
192 | if (c == active_console) |
193 | if (c == active_console) |
193 | break; |
194 | break; |
194 | active_console = c; |
195 | active_console = c; |
- | 196 | gcons_change_console(c); |
|
- | 197 | ||
195 | } |
198 | } |
196 | 199 | ||
197 | conn = &connections[active_console]; |
200 | conn = &connections[active_console]; |
198 | 201 | ||
199 | nsend_call(fb_info.phone, FB_CURSOR_VISIBILITY, 0); |
202 | nsend_call(fb_info.phone, FB_CURSOR_VISIBILITY, 0); |
Line 334... | Line 337... | ||
334 | /* Connect to framebuffer driver */ |
337 | /* Connect to framebuffer driver */ |
335 | 338 | ||
336 | while ((fb_info.phone = ipc_connect_me_to(PHONE_NS, SERVICE_VIDEO, 0)) < 0) { |
339 | while ((fb_info.phone = ipc_connect_me_to(PHONE_NS, SERVICE_VIDEO, 0)) < 0) { |
337 | usleep(10000); |
340 | usleep(10000); |
338 | } |
341 | } |
- | 342 | ||
- | 343 | /* Initialize gcons */ |
|
- | 344 | gcons_init(fb_info.phone); |
|
- | 345 | /* Synchronize, the gcons can have something in queue */ |
|
- | 346 | sync_send_2(fb_info.phone, FB_GET_CSIZE, 0, 0, NULL, NULL); |
|
- | 347 | ||
339 | 348 | ||
340 | ipc_call_sync_2(fb_info.phone, FB_GET_CSIZE, 0, 0, &(fb_info.rows), &(fb_info.cols)); |
349 | ipc_call_sync_2(fb_info.phone, FB_GET_CSIZE, 0, 0, &(fb_info.rows), &(fb_info.cols)); |
341 | nsend_call_2(fb_info.phone, FB_SET_STYLE, DEFAULT_FOREGROUND_COLOR, DEFAULT_BACKGROUND_COLOR); |
350 | nsend_call_2(fb_info.phone, FB_SET_STYLE, DEFAULT_FOREGROUND_COLOR, DEFAULT_BACKGROUND_COLOR); |
342 | nsend_call(fb_info.phone, FB_CLEAR, 0); |
351 | nsend_call(fb_info.phone, FB_CLEAR, 0); |
343 | 352 | ||
Line 365... | Line 374... | ||
365 | 374 | ||
366 | /* FIXME: save kernel console screen */ |
375 | /* FIXME: save kernel console screen */ |
367 | 376 | ||
368 | async_new_connection(phonehash, 0, NULL, keyboard_events); |
377 | async_new_connection(phonehash, 0, NULL, keyboard_events); |
369 | 378 | ||
370 | nsend_call_2(fb_info.phone, FB_CURSOR_GOTO, 0, 0); |
379 | sync_send_2(fb_info.phone, FB_CURSOR_GOTO, 0, 0, NULL, NULL); |
371 | nsend_call(fb_info.phone, FB_CURSOR_VISIBILITY, 1); |
380 | nsend_call(fb_info.phone, FB_CURSOR_VISIBILITY, 1); |
372 | 381 | ||
373 | /* Register at NS */ |
382 | /* Register at NS */ |
374 | if (ipc_connect_to_me(PHONE_NS, SERVICE_CONSOLE, 0, &phonehash) != 0) { |
383 | if (ipc_connect_to_me(PHONE_NS, SERVICE_CONSOLE, 0, &phonehash) != 0) { |
375 | return -1; |
384 | return -1; |