#include <palacios/vmm_io.h>
+#define MAGIC_CODE 0xf1e2d3c4
+
+
+struct layout_region {
+ ulong_t length;
+ ulong_t final_addr;
+};
+
+struct guest_mem_layout {
+ ulong_t magic;
+ ulong_t num_regions;
+ struct layout_region regions[0];
+};
+
+
extern void * g_ramdiskImage;
extern ulong_t s_ramdiskSize;
struct v3_ctrl_ops v3_ops;
struct guest_info * vm_info = 0;
struct v3_vm_config vm_config;
+ void * region_start;
memset(&os_hooks, 0, sizeof(struct v3_os_hooks));
memset(&v3_ops, 0, sizeof(struct v3_ctrl_ops));
extern char _binary___palacios_vm_kernel_start;
PrintBoth(" Guest Load Addr: 0x%x\n", &_binary___palacios_vm_kernel_start);
+
+ struct guest_mem_layout * layout = (struct guest_mem_layout *)&_binary___palacios_vm_kernel_start;
+
+ if (layout->magic != MAGIC_CODE) {
+
+ PrintBoth("Layout Magic Mismatch (0x%x)\n", layout->magic);
+ return -1;
+ }
+
+ PrintBoth("%d layout regions\n", layout->num_regions);
- vm_config.vm_kernel = &_binary___palacios_vm_kernel_start;
+ region_start = (void *)&(layout->regions[layout->num_regions]);
+ PrintBoth("region start = 0x%x\n", region_start);
+
+ {
+ struct layout_region * rombios = &(layout->regions[0]);
+ struct layout_region * vgabios = &(layout->regions[1]);
+
+ vm_config.rombios = region_start;
+ vm_config.rombios_size = rombios->length;
+
+ vm_config.mem_size = 128 * 1024 * 1024;
+
+ region_start += rombios->length;
+
+#ifdef PROFILE_VMM
+ vm_config.enable_profiling = 1;
+#else
+ vm_config.enable_profiling = 0;
+#endif
+ vm_config.enable_pci = 1;
+
+ vm_config.vgabios = region_start;
+ vm_config.vgabios_size = vgabios->length;
+ }
+
+
+
+
if (g_ramdiskImage != NULL) {
- vm_config.use_ramdisk = 1;
+ vm_config.use_ram_cd = 1;
vm_config.ramdisk = g_ramdiskImage;
vm_config.ramdisk_size = s_ramdiskSize;
}
PrintBoth("Allocated Guest\n");
- (v3_ops).config_guest(vm_info, &vm_config);
- PrintBoth("Configured guest\n");
- (v3_ops).init_guest(vm_info);
+
+ PrintBoth("Initializing guest\n");
+ (v3_ops).init_guest(vm_info, &vm_config);
+
PrintBoth("Starting Guest\n");
//Clear_Screen();