#include <devices/ram_hd.h>
#include <devices/net_hd.h>
-#include <devices/video.h>
+#include <devices/telnet_cons.h>
-#ifndef CONFIG_VIDEO
+#ifdef CONFIG_PASSTHROUGH_VIDEO
static int passthrough_mem_write(addr_t guest_addr, void * src, uint_t length, void * priv_data) {
return length;
#endif
int v3_pre_config_guest(struct guest_info * info, struct v3_vm_config * config_ptr) {
- extern v3_cpu_arch_t v3_cpu_type;
+ extern v3_cpu_arch_t v3_cpu_types[];
// Amount of ram the Guest will have, rounded to a 4K page boundary
info->mem_size = config_ptr->mem_size & ~(addr_t)0xfff;
+ info->cpu_id = config_ptr->guest_cpu;
+
/*
* Initialize the subsystem data strutures
*/
// Initialize the memory map
v3_init_shadow_map(info);
- if ((v3_cpu_type == V3_SVM_REV3_CPU) &&
+ if ((v3_cpu_types[info->cpu_id] == V3_SVM_REV3_CPU) &&
(config_ptr->enable_nested_paging == 1)) {
PrintDebug("Guest Page Mode: NESTED_PAGING\n");
info->shdw_pg_mode = NESTED_PAGING;
*/
static int setup_memory_map(struct guest_info * info, struct v3_vm_config * config_ptr) {
-#ifndef CONFIG_VIDEO
+#ifdef CONFIG_PASSTHROUGH_VIDEO
PrintDebug("Setting up memory map (memory size=%dMB)\n", (uint_t)(info->mem_size / (1024 * 1024)));
// VGA frame buffer
v3_create_device(info, "VMNET", NULL);
+ v3_create_device(info, "CGA_VIDEO", (void *)1);
+ {
+ struct telnet_cons_cfg cons_cfg = {"CGA_VIDEO", 19997};
+ v3_create_device(info, "TELNET_CONSOLE", &cons_cfg);
+ }
if (config_ptr->enable_pci == 1) {
struct ide_cfg ide_config = {"PCI", "PIIX3"};
v3_create_device(info, "LNX_VIRTIO_BALLOON", "PCI");
v3_create_device(info, "SYM_SWAP", "LNX_VIRTIO_BLK");
- v3_create_device(info, "VIDEO", "PCI");
-
v3_create_device(info, "IDE", &ide_config);
} else {
v3_create_device(info, "IDE", NULL);
#endif
-#ifndef CONFIG_VIDEO
+#ifdef CONFIG_PASTHROUGH_VIDEO
// Monitor graphics card operations