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.


a guest kernel that works equally well on the dell+HP
[palacios.git] / palacios / src / geekos / vm.c
index 4375e43..6ceda0a 100644 (file)
@@ -8,6 +8,7 @@
 #include <devices/nvram.h>
 #include <devices/timer.h>
 #include <devices/simple_pic.h>
+#include <devices/8259a.h>
 #include <palacios/vmm_intr.h>
 
 
@@ -175,7 +176,8 @@ 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.ack_irq = &ack_irq;
  
     //   DumpGDT();
     Init_VMM(&os_hooks, &vmm_ops);
@@ -268,11 +270,19 @@ int RunVMM(struct Boot_Info * bootInfo) {
        region_start += reg->length;
       }
       
-      add_shadow_region_passthrough(&vm_info, 0xc0000, 0xc8000, 0xc0000);
+      //     
       add_shadow_region_passthrough(&vm_info, 0x0, 0xa0000, (addr_t)Allocate_VMM_Pages(160));
       add_shadow_region_passthrough(&vm_info, 0xa0000, 0xc0000, 0xa0000); 
-      if (add_shadow_region_passthrough(&vm_info, 0xc8000, 0xf0000, (addr_t)Allocate_VMM_Pages(40)) == -1) {
-       PrintDebug("Error adding shadow region\n");
+      
+
+      if (1) {
+       add_shadow_region_passthrough(&vm_info, 0xc7000, 0xc8000, (addr_t)Allocate_VMM_Pages(1));
+       if (add_shadow_region_passthrough(&vm_info, 0xc8000, 0xf0000, (addr_t)Allocate_VMM_Pages(40)) == -1) {
+         PrintDebug("Error adding shadow region\n");
+       }
+      } else {
+       add_shadow_region_passthrough(&vm_info, 0xc0000, 0xc8000, 0xc0000);
+       add_shadow_region_passthrough(&vm_info, 0xc8000, 0xf0000, 0xc8000);
       }
 
 
@@ -281,11 +291,12 @@ int RunVMM(struct Boot_Info * bootInfo) {
       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);
 
-      hook_io_port(&(vm_info.io_map), 0x20, &IO_Read, &IO_Write_to_Serial, NULL);
-      hook_io_port(&(vm_info.io_map), 0x21, &IO_Read, &IO_Write_to_Serial, NULL);
-      hook_io_port(&(vm_info.io_map), 0xa0, &IO_Read, &IO_Write_to_Serial, NULL);
-      hook_io_port(&(vm_info.io_map), 0xa1, &IO_Read, &IO_Write_to_Serial, NULL);
-
+      /*
+       hook_io_port(&(vm_info.io_map), 0x20, &IO_Read, &IO_Write_to_Serial, NULL);
+       hook_io_port(&(vm_info.io_map), 0x21, &IO_Read, &IO_Write_to_Serial, NULL);
+       hook_io_port(&(vm_info.io_map), 0xa0, &IO_Read, &IO_Write_to_Serial, NULL);
+       hook_io_port(&(vm_info.io_map), 0xa1, &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_debug, NULL);
@@ -301,9 +312,6 @@ int RunVMM(struct Boot_Info * bootInfo) {
        attach_device(&(vm_info), pic);
 
        PrintDebugDevMgr(&(vm_info.dev_mgr));
-       
-
-
       }