Changeset ad123964 in mainline for console


Ignore:
Timestamp:
2006-06-01T00:21:19Z (19 years ago)
Author:
Josef Cejka <malyzelenyhnus@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cf28036c
Parents:
c594489
Message:

Fixed some bugs.

Location:
console
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • console/console.c

    rc594489 rad123964  
    4545}
    4646//#define CONSOLE_COUNT VFB_CONNECTIONS
    47 #define CONSOLE_COUNT 6
     47#define CONSOLE_COUNT 8
    4848
    4949#define NAME "CONSOLE"
    5050
    51 int active_client = 0;
     51int active_console = 1;
    5252
    5353
     
    9494        int retval;
    9595        int i;
     96        char c;
    9697
    9798        /* Ignore parameters, the connection is alread opened */
     
    112113                        /*FIXME: else store key to its buffer */
    113114                        retval = 0;
    114                         i = IPC_GET_ARG1(call) & 0xff;
     115                        c = IPC_GET_ARG1(call);
     116//                      ipc_call_sync_2(connections[3].vfb_phone, FB_PUTCHAR, 0, c,NULL,NULL);
    115117                        /* switch to another virtual console */
    116                         if ((i >= KBD_KEY_F1) && (i < KBD_KEY_F1 + CONSOLE_COUNT)) {
    117                                 active_client = i - KBD_KEY_F1;
     118                        if ((c >= KBD_KEY_F1) && (c < KBD_KEY_F1 + CONSOLE_COUNT)) {
     119                                active_console = c - KBD_KEY_F1;
    118120                                break;
    119121                        }
    120                         keybuffer_push(&(connections[active_client].keybuffer), i);
     122                        keybuffer_push(&(connections[active_console].keybuffer), c);
     123                       
    121124                        /* Send it to first FB, DEBUG */
    122125//                      ipc_call_async_2(connections[0].vfb_phone, FB_PUTCHAR, 0, IPC_GET_ARG1(call),NULL,NULL);
    123 //                      ipc_call_sync_2(connections[0].vfb_phone, FB_PUTCHAR, 0, IPC_GET_ARG1(call),NULL,NULL);
     126//                      ipc_call_sync_2(connections[4].vfb_phone, FB_PUTCHAR, 0, c,NULL,NULL);
    124127
    125128                        break;
     
    157160                        return;
    158161                case CONSOLE_PUTCHAR:
     162                        if (consnum != active_console) {
     163                        }
    159164                        /* Send message to fb */
    160                         ipc_call_async_2(connections[consnum].vfb_phone, FB_PUTCHAR, IPC_GET_ARG1(call), IPC_GET_ARG2(call), NULL, NULL);
    161                         break;
     165                        ipc_call_sync_2(connections[consnum].vfb_phone, FB_PUTCHAR, IPC_GET_ARG1(call), IPC_GET_ARG2(call), NULL, NULL);
     166//                      ipc_call_sync_2(connections[6].vfb_phone, FB_PUTCHAR, 0, IPC_GET_ARG2(call),NULL,NULL);
     167                        break;
     168                case CONSOLE_CLEAR:
     169                        break;
     170                case CONSOLE_GOTO:
     171                        break;
     172
    162173                case CONSOLE_GETCHAR:
    163174                        /* FIXME: Only temporary solution until request storage will be created  */
    164                         while (!keybuffer_pop(&(connections[active_client].keybuffer), (char *)&arg1)) {
     175                        while (keybuffer_empty(&(connections[consnum].keybuffer))) {
    165176                                /* FIXME: buffer empty -> store request */
    166                                 async_usleep(100000);
     177                                async_usleep(1000);
    167178                        };
     179                        keybuffer_pop(&(connections[consnum].keybuffer), (char *)&arg1);
     180//                      ipc_call_sync_2(connections[6].vfb_phone, FB_PUTCHAR, 0, arg1,NULL,NULL);
    168181                       
    169182                        break;
  • console/console.h

    rc594489 rad123964  
    3030#define __CONSOLE_H__
    3131
    32 #define CONSOLE_GETCHAR 1025
     32#define CONSOLE_GETCHAR 1026
    3333#define CONSOLE_PUTCHAR 1027
     34#define CONSOLE_CLEAR   1028
     35#define CONSOLE_GOTO    1029
    3436
    3537#endif
Note: See TracChangeset for help on using the changeset viewer.