Changeset b27a97bb in mainline for console/console.c


Ignore:
Timestamp:
2006-05-31T15:41:19Z (19 years ago)
Author:
Josef Cejka <malyzelenyhnus@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c0e674a
Parents:
440cff5
Message:

Support for reading from stdin.
Getchar() implemented.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • console/console.c

    r440cff5 rb27a97bb  
    100100                case KBD_PUSHCHAR:
    101101                        /* got key from keyboard driver */
     102                       
    102103                        /* find active console */
     104                       
    103105                        /* if client is awaiting key, send it */
     106                       
    104107                        /*FIXME: else store key to its buffer */
    105108                        retval = 0;
     
    113116                        /* Send it to first FB, DEBUG */
    114117//                      ipc_call_async_2(connections[0].vfb_phone, FB_PUTCHAR, 0, IPC_GET_ARG1(call),NULL,NULL);
    115                         ipc_call_sync_2(connections[0].vfb_phone, FB_PUTCHAR, 0, IPC_GET_ARG1(call),NULL,NULL);
     118//                      ipc_call_sync_2(connections[0].vfb_phone, FB_PUTCHAR, 0, IPC_GET_ARG1(call),NULL,NULL);
    116119
    117120                        break;
     
    149152                        return;
    150153                case CONSOLE_PUTCHAR:
    151                         /* TODO: send message to fb */
     154                        /* Send message to fb */
    152155                        ipc_call_async_2(connections[consnum].vfb_phone, FB_PUTCHAR, IPC_GET_ARG1(call), IPC_GET_ARG2(call), NULL, NULL);
    153156                        break;
    154157                case CONSOLE_GETCHAR:
    155                         /* FIXME: */
    156                         if (!keybuffer_pop(&(connections[active_client].keybuffer), (char *)&arg1)) {
     158                        /* FIXME: Only temporary solution until request storage will be created  */
     159                       
     160                        while (!keybuffer_pop(&(connections[active_client].keybuffer), (char *)&arg1)) {
    157161                                /* FIXME: buffer empty -> store request */
    158                                 arg1 = 'X'; /* Only temporary */
     162                                usleep(10000);
    159163                        };
    160 //ipc_call_async_2(connections[active_client].vfb_phone, FB_PUTCHAR, ' ', arg1, NULL, (void *)NULL);
     164                       
    161165                        break;
    162166                }
    163                 ipc_answer_fast(callid, 0,0,0);
     167                ipc_answer_fast(callid, 0, arg1, 0);
    164168        }
    165169}
     
    190194                /* TODO: init key_buffer */
    191195                while ((connections[i].vfb_phone = ipc_connect_me_to(PHONE_NS, SERVICE_VIDEO, 0)) < 0) {
    192                                
    193                         ipc_call_async_2(connections[i].vfb_phone, FB_PUTCHAR, 'a', 'b', NULL, (void *)NULL);
     196                        usleep(10000);
     197                        //ipc_call_async_2(connections[i].vfb_phone, FB_PUTCHAR, 'a', 'b', NULL, (void *)NULL);
    194198                }
    195199        }
Note: See TracChangeset for help on using the changeset viewer.