Subversion Repositories HelenOS-historic

Rev

Rev 1504 | Rev 1512 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1504 Rev 1506
Line 47... Line 47...
47
 
47
 
48
int active_console = 1;
48
int active_console = 1;
49
 
49
 
50
struct {
50
struct {
51
    int phone;      /**< Framebuffer phone */
51
    int phone;      /**< Framebuffer phone */
52
    int rows;       /**< Framebuffer rows */
52
    ipcarg_t rows;      /**< Framebuffer rows */
53
    int cols;       /**< Framebuffer columns */
53
    ipcarg_t cols;      /**< Framebuffer columns */
54
} fb_info;
54
} fb_info;
55
 
55
 
56
typedef struct {
56
typedef struct {
57
    keybuffer_t keybuffer;
57
    keybuffer_t keybuffer;
58
    FIFO_CREATE_STATIC(keyrequests, ipc_callid_t , MAX_KEYREQUESTS_BUFFERED);
58
    FIFO_CREATE_STATIC(keyrequests, ipc_callid_t , MAX_KEYREQUESTS_BUFFERED);
Line 60... Line 60...
60
    int client_phone;
60
    int client_phone;
61
    int used;
61
    int used;
62
    screenbuffer_t screenbuffer;
62
    screenbuffer_t screenbuffer;
63
} connection_t;
63
} connection_t;
64
 
64
 
-
 
65
 
-
 
66
 
65
connection_t connections[CONSOLE_COUNT];
67
connection_t connections[CONSOLE_COUNT];
66
 
68
 
67
static int find_free_connection()
69
static int find_free_connection()
68
{
70
{
69
    int i = 0;
71
    int i = 0;
Line 152... Line 154...
152
    ipc_call_t call;
154
    ipc_call_t call;
153
    int retval;
155
    int retval;
154
    int i, j;
156
    int i, j;
155
    char c,d;
157
    char c,d;
156
    connection_t *conn;
158
    connection_t *conn;
-
 
159
    keyfield_t *interbuffer = NULL;
157
 
160
 
-
 
161
//  interbuffer = mmap(,, PROTO_READ|PROTO_WRITE, MAP_ANONYMOUS, , );   
-
 
162
   
158
    /* Ignore parameters, the connection is alread opened */
163
    /* Ignore parameters, the connection is alread opened */
159
    while (1) {
164
    while (1) {
160
        callid = async_get_call(&call);
165
        callid = async_get_call(&call);
161
        switch (IPC_GET_METHOD(call)) {
166
        switch (IPC_GET_METHOD(call)) {
162
        case IPC_M_PHONE_HUNGUP:
167
        case IPC_M_PHONE_HUNGUP:
Line 294... Line 299...
294
    };
299
    };
295
   
300
   
296
    if (ipc_connect_to_me(kbd_phone, SERVICE_CONSOLE, 0, &phonehash) != 0) {
301
    if (ipc_connect_to_me(kbd_phone, SERVICE_CONSOLE, 0, &phonehash) != 0) {
297
        return -1;
302
        return -1;
298
    };
303
    };
299
    async_new_connection(phonehash, 0, NULL, keyboard_events);
-
 
300
 
304
 
301
    /* Connect to framebuffer driver */
305
    /* Connect to framebuffer driver */
302
   
306
   
303
    while ((fb_info.phone = ipc_connect_me_to(PHONE_NS, SERVICE_VIDEO, 0)) < 0) {
307
    while ((fb_info.phone = ipc_connect_me_to(PHONE_NS, SERVICE_VIDEO, 0)) < 0) {
304
        usleep(10000);
308
        usleep(10000);
Line 320... Line 324...
320
            /*FIXME: handle error */
324
            /*FIXME: handle error */
321
            return -1;
325
            return -1;
322
        }
326
        }
323
    }
327
    }
324
   
328
   
-
 
329
    async_new_connection(phonehash, 0, NULL, keyboard_events);
-
 
330
   
325
    ipc_call_async_2(fb_info.phone, FB_CURSOR_GOTO, 0, 0, NULL, NULL);
331
    ipc_call_async_2(fb_info.phone, FB_CURSOR_GOTO, 0, 0, NULL, NULL);
326
 
332
 
327
    if (ipc_connect_to_me(PHONE_NS, SERVICE_CONSOLE, 0, &phonehash) != 0) {
333
    if (ipc_connect_to_me(PHONE_NS, SERVICE_CONSOLE, 0, &phonehash) != 0) {
328
        return -1;
334
        return -1;
329
    };
335
    };