Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


V3VEE compiles. Segfaults, but the callback structures work.
[palacios-OLD.git] / kitten / palacios-glue / vm.c
index 438a303..be49efb 100644 (file)
 
 
 
-#include <palacios-glue/vmm_stubs.h>
-#include <palacios-glue/vm.h>
-
 #include <lwk/kernel.h>
-
 #include <lwk/palacios.h>
 
 #include <palacios/vmm.h>
 
 
 int RunVMM() {
-  struct v3_os_hooks os_hooks;
-  struct v3_ctrl_ops v3_ops;
+  struct v3_ctrl_ops v3_ops = {};
   struct guest_info * vm_info = 0;
-  struct v3_vm_config vm_config;
-
-  void * ramdiskImage=&initrd_start;
-  ulong_t ramdiskSize=(&initrd_end)-(&initrd_start);
 
-  memset(&os_hooks, 0, sizeof(struct v3_os_hooks));
-  memset(&v3_ops, 0, sizeof(struct v3_ctrl_ops));
-  memset(&vm_config, 0, sizeof(struct v3_vm_config));
-
-  
-  os_hooks.print_debug = &printk;  // serial print ideally
-  os_hooks.print_info = &printk;   // serial print ideally
-  os_hooks.print_trace = &printk;  // serial print ideally
-  os_hooks.allocate_pages = &Allocate_VMM_Pages; // defined in vmm_stubs
-  os_hooks.free_page = &Free_VMM_Page; // defined in vmm_stubs
-  os_hooks.malloc = &kmem_alloc;
-  os_hooks.free = &kmem_free;
-  os_hooks.vaddr_to_paddr = &kitten_va_to_pa;
-  os_hooks.paddr_to_vaddr = &kitten_pa_to_va;
-  os_hooks.hook_interrupt = &kitten_hook_interrupt;
-  os_hooks.ack_irq = &ack_irq;
-  os_hooks.get_cpu_khz = &get_cpu_khz;
+  void * ramdiskImage=initrd_start;
+  uintptr_t ramdiskSize=initrd_end-initrd_start;
 
 
   
-  Init_V3(&os_hooks, &v3_ops);
+  Init_V3(&v3vee_os_hooks, &v3_ops);
 
   
-  vm_config.rombios = &rombios_start;
-  vm_config.rombios_size = (&rombios_end)-(&rombios_start);
-  vm_config.vgabios = &vgabios_start;
-  vm_config.vgabios_size = (&vgabios_end)-(&vgabios_start);
+       struct v3_vm_config vm_config = {
+               .rombios = &rombios_start,
+               .rombios_size = (&rombios_end)-(&rombios_start),
+               .vgabios = &vgabios_start,
+               .vgabios_size = (&vgabios_end)-(&vgabios_start),
+       };
   
   
   if (ramdiskImage != NULL) {
@@ -89,7 +67,7 @@ int RunVMM() {
   //PrintBoth("Configured guest\n");
 
   (v3_ops).init_guest(vm_info);
-  PrintBoth("Starting Guest\n");
+  printk("Starting Guest\n");
   //Clear_Screen();
 
   (v3_ops).start_guest(vm_info);