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.


source code clean up,
[palacios.git] / palacios / src / geekos / vm.c
index 6c74852..a6f5bb0 100644 (file)
 #include <palacios/vmm_dev_mgr.h>
 #include <palacios/vmm_time.h>
 
+//test decoder
+//#include <palacios/vmm_decoder.h>
+
+extern int parse();
+
 #define SPEAKER_PORT 0x61
 
 static inline void VM_Out_Byte(ushort_t port, uchar_t value)
@@ -199,6 +204,8 @@ int RunVMM(struct Boot_Info * bootInfo) {
 
 
 
+
+
     memset(&os_hooks, 0, sizeof(struct vmm_os_hooks));
     memset(&vmm_ops, 0, sizeof(struct vmm_ctrl_ops));
     memset(&vm_info, 0, sizeof(struct guest_info));
@@ -212,12 +219,18 @@ int RunVMM(struct Boot_Info * bootInfo) {
     os_hooks.free = &VMM_Free;
     os_hooks.vaddr_to_paddr = &Identity;
     os_hooks.paddr_to_vaddr = &Identity;
-    os_hooks.hook_interrupt = &hook_irq_stub;
-    os_hooks.hook_interrupt_new = &geekos_hook_interrupt_new;
+    os_hooks.hook_interrupt = &geekos_hook_interrupt_new;
     os_hooks.ack_irq = &ack_irq;
     os_hooks.get_cpu_khz = &get_cpu_khz;
 
-    Init_VMM(&os_hooks, &vmm_ops);
+
+
+    Init_V3(&os_hooks, &vmm_ops);
+
+    //test decoder
+    PrintBoth("testing decoder\n");
+    parse();
+    PrintBoth("testing decoder done\n");
   
 
     /* MOVE THIS TO AN INIT GUEST ROUTINE */
@@ -271,8 +284,8 @@ int RunVMM(struct Boot_Info * bootInfo) {
 
       add_shadow_region_passthrough(&vm_info, 0x0, 0x100000, 0x100000);
 
-      hook_io_port(&(vm_info.io_map), 0x61, &IO_Read, &IO_Write, NULL);
-      hook_io_port(&(vm_info.io_map), 0x05, &IO_Read, &IO_Write_to_Serial, NULL);
+      v3_hook_io_port(&(vm_info.io_map), 0x61, &IO_Read, &IO_Write, NULL);
+      v3_hook_io_port(&(vm_info.io_map), 0x05, &IO_Read, &IO_Write_to_Serial, NULL);
       
       /*
        vm_info.cr0 = 0;
@@ -347,20 +360,22 @@ int RunVMM(struct Boot_Info * bootInfo) {
       //add_shadow_region_passthrough(&vm_info, 0x100000, 0x2000000, (addr_t)Allocate_VMM_Pages(8192));
       add_shadow_region_passthrough(&vm_info, 0x100000, 0x1000000, (addr_t)Allocate_VMM_Pages(4096));
 
+      add_shadow_region_passthrough(&vm_info, 0x1000000, 0x8000000, (addr_t)Allocate_VMM_Pages(32768));
+
       // test - give linux accesss to PCI space - PAD
       add_shadow_region_passthrough(&vm_info, 0xc0000000,0xffffffff,0xc0000000);
 
 
       print_shadow_map(&(vm_info.mem_map));
 
-      hook_io_port(&(vm_info.io_map), 0x61, &IO_Read, &IO_Write, NULL);
-      //hook_io_port(&(vm_info.io_map), 0x05, &IO_Read, &IO_Write_to_Serial, NULL);
+      v3_hook_io_port(&(vm_info.io_map), 0x61, &IO_Read, &IO_Write, NULL);
+      //v3_hook_io_port(&(vm_info.io_map), 0x05, &IO_Read, &IO_Write_to_Serial, NULL);
 
 
-      hook_io_port(&(vm_info.io_map), 0x400, &IO_Read, &IO_Write_to_Serial, NULL);
-      hook_io_port(&(vm_info.io_map), 0x401, &IO_Read, &IO_Write_to_Serial, NULL);
-      hook_io_port(&(vm_info.io_map), 0x402, &IO_Read, &IO_BOCHS_info, NULL);
-      hook_io_port(&(vm_info.io_map), 0x403, &IO_Read, &IO_BOCHS_debug, NULL);
+      v3_hook_io_port(&(vm_info.io_map), 0x400, &IO_Read, &IO_Write_to_Serial, NULL);
+      v3_hook_io_port(&(vm_info.io_map), 0x401, &IO_Read, &IO_Write_to_Serial, NULL);
+      v3_hook_io_port(&(vm_info.io_map), 0x402, &IO_Read, &IO_BOCHS_info, NULL);
+      v3_hook_io_port(&(vm_info.io_map), 0x403, &IO_Read, &IO_BOCHS_debug, NULL);
 
       {
        
@@ -426,17 +441,17 @@ int RunVMM(struct Boot_Info * bootInfo) {
 
 #endif
 
-       attach_device(&(vm_info), nvram);
-       //attach_device(&(vm_info), timer);
-       attach_device(&(vm_info), pic);
-       attach_device(&(vm_info), pit);
-       attach_device(&(vm_info), keyboard);
-       // attach_device(&(vm_info), serial);
+       v3_attach_device(&(vm_info), nvram);
+       //v3_attach_device(&(vm_info), timer);
+       v3_attach_device(&(vm_info), pic);
+       v3_attach_device(&(vm_info), pit);
+       v3_attach_device(&(vm_info), keyboard);
+       // v3_attach_device(&(vm_info), serial);
 
 
 #if GENERIC
        // Important that this be attached last!
-       attach_device(&(vm_info), generic);
+       v3_attach_device(&(vm_info), generic);
 
 #endif
 
@@ -449,15 +464,15 @@ int RunVMM(struct Boot_Info * bootInfo) {
       
 #if 1
       // give floppy controller to vm
-      hook_irq_for_guest_injection(&vm_info, 6);
+      v3_hook_irq_for_guest_injection(&vm_info, 6);
 #endif
 
 #if 1
       //primary ide
-      hook_irq_for_guest_injection(&vm_info, 14);
+      v3_hook_irq_for_guest_injection(&vm_info, 14);
 
       // secondary ide
-      hook_irq_for_guest_injection(&vm_info, 15);
+      v3_hook_irq_for_guest_injection(&vm_info, 15);
 #endif