Changeset dabe6333 in mainline for generic/src/console/console.c


Ignore:
Timestamp:
2006-03-16T15:56:40Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1ee9ced
Parents:
37e7d2b9
Message:

Added null console for buffering output when no real output available.
Added identity mapper for AMD64 that allows whole physical memory to be
accessed before paging is initialized.

File:
1 edited

Legend:

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

    r37e7d2b9 rdabe6333  
    3939#include <arch/atomic.h>
    4040
     41#define BUFLEN 2048
     42static char debug_buffer[BUFLEN];
     43static size_t offset = 0;
     44/** Initialize stdout to something that does not print, but does not fail
     45 *
     46 * Save data in some buffer so that it could be retrieved in the debugger
     47 */
     48static void null_putchar(chardev_t *d, const char ch)
     49{
     50        if (offset >= BUFLEN)
     51                offset = 0;
     52        debug_buffer[offset++] = ch;
     53}
     54
     55static chardev_operations_t null_stdout_ops = {
     56        .write = null_putchar
     57};
     58chardev_t null_stdout = {
     59        .name = "null",
     60        .op = &null_stdout_ops
     61};
     62
    4163/** Standard input character device. */
    4264chardev_t *stdin = NULL;
    43 chardev_t *stdout = NULL;
     65chardev_t *stdout = &null_stdout;
    4466
    4567/** Get character from character device. Do not echo character.
Note: See TracChangeset for help on using the changeset viewer.