int v3_cons_get_fb(struct vm_device * frontend_dev, uint8_t * dst, uint_t offset, uint_t length);
+int v3_console_register_cga(struct vm_device * cga_dev, struct v3_console_ops * ops, void * private_data);
#endif // ! __V3VEE__
#include <palacios/vmm_emulator.h>
#include <palacios/vm_guest_mem.h>
-#include <devices/cga.h>
+#include <devices/console.h>
struct video_internal * state = (struct video_internal *)dev->private_data;
uint_t fb_offset = guest_addr - START_ADDR;
uint_t screen_byte_offset = state->screen_offset * BYTES_PER_COL;
+ uint_t screen_length;
PrintDebug("Guest address: %p length = %d, fb_offset=%d, screen_offset=%d\n",
(void *)guest_addr, length, fb_offset, screen_byte_offset);
if (state->ops) {
PrintDebug("\tcalling update_screen()\n");
- state->ops->update_screen(x, y, length, state->private_data);
+
+ /* avoid updates past end of screen */
+ screen_length = SCREEN_SIZE - screen_byte_offset;
+ if (screen_length > length) screen_length = length;
+ state->ops->update_screen(x, y, screen_length, state->private_data);
}
}
#include <palacios/vmm_string.h>
#include <palacios/vmm_socket.h>
-#include <devices/cga.h>
+#include <devices/console.h>
+#if 0
#include <devices/telnet_cons.h>
+#endif
#define NUM_ROWS 25
#define NUM_COLS 80
state->connected = 0;
V3_Close_Socket(state->client_fd);
}
+
+ return -1;
}