2 * This file is part of the Palacios Virtual Machine Monitor developed
3 * by the V3VEE Project with funding from the United States National
4 * Science Foundation and the Department of Energy.
6 * The V3VEE Project is a joint project between Northwestern University
7 * and the University of New Mexico. You can find out more at
10 * Copyright (c) 2010, Jack Lange <jarusl@cs.northwestern.edu>
11 * Copyright (c) 2010, Erik van der Kouwe <vdkouwe@cs.vu.nl>
12 * Copyright (c) 2010, The V3VEE Project <http://www.v3vee.org>
13 * All rights reserved.
15 * Author: Jack Lange <jarusl@cs.northwestern.edu>
16 * Author: Erik van der Kouwe <vdkouwe@cs.vu.nl>
18 * This is free software. You are permitted to use,
19 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
23 #ifndef __VMM_CONSOLE_H__
24 #define __VMM_CONSOLE_H__
26 #include <palacios/vmm.h>
31 typedef void * v3_console_t;
33 v3_console_t v3_console_open(struct v3_vm_info * vm, uint32_t width, uint32_t height);
34 void v3_console_close(v3_console_t cons);
36 int v3_console_set_cursor(v3_console_t cons, int x, int y);
37 int v3_console_set_char(v3_console_t cons, int x, int y, char c, uint8_t style);
38 int v3_console_scroll(v3_console_t cons, int lines);
39 int v3_console_update(v3_console_t cons);
40 int v3_console_set_text_resolution(v3_console_t cons, int cols, int rows);
46 struct v3_console_hooks {
47 /* open console device, mode is a combination of TTY_OPEN_MODE_* flags */
48 void *(*open)(void * priv_data, unsigned int width, unsigned int height);
50 void (*close)(void * tty);
52 /* set cursor position */
53 int (*set_cursor)(void * tty, int x, int y);
55 /* output character c with specified style at (x, y) */
56 int (*set_character)(void * tty, int x, int y, char c, unsigned char style);
58 /* scroll the console down the specified number of lines */
59 int (*scroll)(void * tty, int lines);
61 /* change the text resolution (always followed by a full screen update) */
62 int (*set_text_resolution)(void * tty, int cols, int rows);
64 /* force update of console display; all updates by above functions
65 * may be defferred until the next tty_update call
67 int (*update)(void * tty);
71 extern void V3_Init_Console(struct v3_console_hooks * hooks);