summaryrefslogtreecommitdiff
path: root/410guests/tick_tock/kern/fake_console.c
blob: f79a60ef14d01fc33a93d7813f337deff7cc2570 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/** @file console.c
 *  @brief A console driver.
 *
 *  These empty function definitions are provided
 *  so that stdio will build without complaining.
 *  You will need to fill these functions in. This
 *  is the implementation of the console driver.
 *  Important details about its implementation
 *  should go in these comments.
 *
 *  @author Harry Q. Bovik (hqbovik)
 *  @author Fred Hacker (fhacker)
 *  @bug No know bugs.
 */

#include <console.h>

/* Not very reentrant, but enough to lmm_dump() */
#include <simics.h>
int putbyte( char ch )
{
  static char buf[1024], *cp = buf;

  if (ch == '\n') {
    *cp = '\0';
    lprintf("%s", buf);
    cp = buf;
  } else if (cp < buf + sizeof (buf) - 1) {
    *cp++ = ch;
  }
  return ch;
}

void 
putbytes( const char *s, int len )
{
  while (len-- > 0)
    (void) putbyte(*s++);
}

int
set_term_color( int color )
{
  return (-1);
}

void
get_term_color( int *color )
{
}

int
set_cursor( int row, int col )
{
  return (-1);
}

void
get_cursor( int *row, int *col )
{
}

void
hide_cursor()
{
}

void
show_cursor()
{
}

void 
clear_console()
{
}

void
draw_char( int row, int col, int ch, int color )
{
}

char
get_char( int row, int col )
{
  return ' ';
}