X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=nautilus%2Fconsole.c;fp=nautilus%2Fconsole.c;h=f571a83b13ed357cec3e50cdf14e272a7bb140db;hp=0000000000000000000000000000000000000000;hb=66c338acdc299d7496da982999ff3cd3828e442a;hpb=68f8c4cd303c5da40c1083cbabdaf6395e4dbaa1 diff --git a/nautilus/console.c b/nautilus/console.c new file mode 100644 index 0000000..f571a83 --- /dev/null +++ b/nautilus/console.c @@ -0,0 +1,140 @@ +/* + Interface to Nautilus screen and keyboard +*/ + +#include +#include +#include +#include + + +#include + +#include +#include + +#include "palacios.h" + +/* + This is a gruesome hack to allow the VM designated by the + host as "the_vm" to do I/O to the standard VGA text mode console +*/ + +extern void *the_vm; + +static void * palacios_tty_open(void * private_data, unsigned int width, unsigned int height) +{ + if (width!=80 || height!=25) { + ERROR("Console is wrong size\n"); + return 0; + } + INFO("Console connected\n"); + return (void*)1; +} + + +static int palacios_tty_cursor_set(void * console, int x, int y) +{ + if (console) { + term_setpos(x,y); + return 0; + } else { + return -1; + } +} + +static int palacios_tty_character_set(void * console, int x, int y, char c, unsigned char style) +{ + if (console) { + term_putc(c,style,x,y); + return 0; + } else { + return -1; + } +} + +static int palacios_tty_scroll(void * console, int lines) +{ + if (console) { + int i; + for (i=0;i