Subversion Repositories HelenOS-historic

Rev

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

Rev 607 Rev 609
Line 38... Line 38...
38
#include <arch.h>
38
#include <arch.h>
39
#include <macros.h>
39
#include <macros.h>
40
#include <debug.h>
40
#include <debug.h>
41
#include <func.h>
41
#include <func.h>
42
#include <symtab.h>
42
#include <symtab.h>
-
 
43
#include <macros.h>
43
 
44
 
44
/** Simple kernel console.
45
/** Simple kernel console.
45
 *
46
 *
46
 * The console is realized by kernel thread kconsole.
47
 * The console is realized by kernel thread kconsole.
47
 * It doesn't understand any useful command on its own,
48
 * It doesn't understand any useful command on its own,
Line 393... Line 394...
393
 
394
 
394
/** Kernel console managing thread.
395
/** Kernel console managing thread.
395
 *
396
 *
396
 * @param arg Not used.
397
 * @param arg Not used.
397
 */
398
 */
398
void kconsole(void *arg)
399
void kconsole(void *prompt)
399
{
400
{
400
    cmd_info_t *cmd_info;
401
    cmd_info_t *cmd_info;
401
    count_t len;
402
    count_t len;
402
    char *cmdline;
403
    char *cmdline;
403
 
404
 
Line 405... Line 406...
405
        printf("%s: no stdin\n", __FUNCTION__);
406
        printf("%s: no stdin\n", __FUNCTION__);
406
        return;
407
        return;
407
    }
408
    }
408
   
409
   
409
    while (true) {
410
    while (true) {
410
        cmdline = clever_readline(__FUNCTION__, stdin);
411
        cmdline = clever_readline(prompt, stdin);
411
        len = strlen(cmdline);
412
        len = strlen(cmdline);
412
        if (!len)
413
        if (!len)
413
            continue;
414
            continue;
414
        cmd_info = parse_cmdline(cmdline, len);
415
        cmd_info = parse_cmdline(cmdline, len);
415
        if (!cmd_info)
416
        if (!cmd_info)
416
            continue;
417
            continue;
-
 
418
        if (strncmp(cmd_info->name,"exit", \
-
 
419
                min(strlen(cmd_info->name),5)) == 0)
-
 
420
            break;
417
        (void) cmd_info->func(cmd_info->argv);
421
        (void) cmd_info->func(cmd_info->argv);
418
    }
422
    }
419
}
423
}
420
 
424
 
421
static int parse_int_arg(char *text, size_t len, __native *result)
425
static int parse_int_arg(char *text, size_t len, __native *result)