Ignore:
Timestamp:
2008-12-16T19:02:07Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5ae4443
Parents:
8fe5980
Message:

kconsole is optional
kernel & uspace framebuffer rewrite with speedups (some things are slightly broken yet)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/console/kconsole.c

    r8fe5980 r76fca31  
    402402}
    403403
    404 /** Kernel console managing thread.
     404/** Kernel console prompt.
    405405 *
    406406 * @param prompt Kernel console prompt (e.g kconsole/panic).
    407  */
    408 void kconsole(void *prompt)
     407 * @param msg    Message to display in the beginning.
     408 * @param kcon   Wait for keypress to show the prompt
     409 *               and never exit.
     410 *
     411 */
     412void kconsole(char *prompt, char *msg, bool kcon)
    409413{
    410414        cmd_info_t *cmd_info;
     
    413417
    414418        if (!stdin) {
    415                 printf("%s: no stdin\n", __func__);
     419                LOG("No stdin for kernel console");
    416420                return;
    417421        }
     422       
     423        if (msg)
     424                printf("%s", msg);
     425       
     426        if (kcon)
     427                _getc(stdin);
    418428       
    419429        while (true) {
     
    422432                if (!len)
    423433                        continue;
     434               
    424435                cmd_info = parse_cmdline(cmdline, len);
    425436                if (!cmd_info)
    426437                        continue;
    427                 if (strncmp(cmd_info->name, "exit",
    428                     min(strlen(cmd_info->name), 5)) == 0)
     438               
     439                if ((!kcon)
     440                    && (strncmp(cmd_info->name, "exit", min(strlen(cmd_info->name), 5)) == 0))
    429441                        break;
     442               
    430443                (void) cmd_info->func(cmd_info->argv);
    431444        }
     445}
     446
     447/** Kernel console managing thread.
     448 *
     449 */
     450void kconsole_thread(void *data)
     451{
     452        kconsole("kconsole", "Kernel console ready (press any key to activate)\n", true);
    432453}
    433454
Note: See TracChangeset for help on using the changeset viewer.