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.


fix thread exit behavior to allow stopping of guests
[palacios.git] / test / geekos_test_vm / src / geekos / main.c
index 177771a..8dd05ab 100644 (file)
@@ -17,7 +17,7 @@
 #include <geekos/crc32.h>
 #include <geekos/tss.h>
 #include <geekos/int.h>
-#include <geekos/kthread.h>
+#include <geekos/kthread.h> 
 #include <geekos/trap.h>
 #include <geekos/timer.h>
 #include <geekos/keyboard.h>
@@ -241,17 +241,15 @@ void Main(struct Boot_Info* bootInfo)
 {
   struct Kernel_Thread * key_thread;
   struct Kernel_Thread * spkr_thread;
-
-
-
   ulong_t doIBuzz = 0;
 
   Init_BSS();
+  Init_VMCons();
   Init_Screen();
   InitSerial();
-
-  Init_VMCons();
+  Print("Initializing Memory\n");
   Init_Mem(bootInfo);
+  Print("Memory Done\n");
   Init_CRC32();
   Init_TSS();
   Init_Interrupts();
@@ -267,10 +265,6 @@ void Main(struct Boot_Info* bootInfo)
 
 
 
-
-
-
-
   PrintBoth("\n\nHello, Welcome to this horrid output-only serial interface\n");
   PrintBoth("Eventually, this will let us control the VMM\n\n");
  
@@ -291,8 +285,39 @@ void Main(struct Boot_Info* bootInfo)
 
 
   PrintBoth("Next: setup GDT\n");
+  {
+    uint_t addr = 0xe0000;
+    uint_t hi = 0;
 
 
+   
+    //    wrmsr(SYMBIOTIC_MSR, hi, addr);
+    {
+       uint_t msr_num = 0x0000001B;
+       __asm__ __volatile__ ("rdmsr" : : "c"(msr_num) : "%eax","%edx","memory");
+    }
+    {
+       uint_t msr_num = 0x0000001c;
+       __asm__ __volatile__ ("rdmsr" : : "c"(msr_num) : "%eax","%edx","memory");
+    }
+
+
+    {
+       uint_t msr_num = 0x0000001B;
+       __asm__ __volatile__ ("wrmsr" : : "c"(msr_num), "a"(hi), "d"(addr) : "memory");
+    }
+
+
+
+    {
+       uint_t msr_num = 0x535;
+       __asm__ __volatile__ ("wrmsr" : : "c"(msr_num), "a"(hi), "d"(addr) : "memory");
+    }
+
+
+    while (1) {}
+
+  }
   if (TEST_PAGING) {
       int i = 0;
       for (i = 0; i < 1024; i++) {
@@ -304,7 +329,7 @@ void Main(struct Boot_Info* bootInfo)
 
       
       //  Invalidate_PG((void *)0x2000);
-      
+       
       //  VM_Test(bootInfo, 32);  
       //VM_Test(bootInfo, 1536);
   }