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.


updated test_vm
[palacios.git] / misc / test_vm / src / geekos / main.c
index 80283a4..177771a 100644 (file)
@@ -3,12 +3,13 @@
  * Copyright (c) 2001,2003,2004 David H. Hovemeyer <daveho@cs.umd.edu>
  * Copyright (c) 2003, Jeffrey K. Hollingsworth <hollings@cs.umd.edu>
  * Copyright (c) 2004, Iulian Neamtiu <neamtiu@cs.umd.edu>
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
  * 
  * This is free software.  You are permitted to use,
  * redistribute, and modify it as specified in the file "COPYING".
  */
 
+#include <geekos/debug.h>
 #include <geekos/bootinfo.h>
 #include <geekos/string.h>
 #include <geekos/screen.h>
 #include <geekos/mem.h>
 #include <geekos/paging.h>
 #include <geekos/ide.h>
-
+#include <geekos/vm_cons.h>
+#include <geekos/pci.h>
 #include <geekos/gdt.h>
 
 
+
+#define TEST_PAGING 0
+#define TEST_PCI 1
+
 /*
   static inline unsigned int cpuid_ecx(unsigned int op)
   {
@@ -53,6 +59,10 @@ extern uint_t Get_ESP();
 extern uint_t Get_EBP();
 
 
+
+extern void Invalidate_PG(void * addr);
+
+
 int foo=42;
 
 #define SPEAKER_PORT 0x61
@@ -182,12 +192,10 @@ void Keyboard_Listener(ulong_t arg) {
 
   while ((key_press = Wait_For_Key())) {    
     if (key_press == KEY_F4) {
-      Print("\nToggling Speaker Port\n");
-      SerialPrintLevel(100,"\nToggling Speaker Port\n");
+      PrintBoth("\nToggling Speaker Port\n");
       *doIBuzz = (*doIBuzz + 1) % 2;
     } else if (key_press == KEY_F5) {
-      Print("\nMachine Restart\n");
-      SerialPrintLevel(100,"\nMachine Restart\n");
+      PrintBoth("\nMachine Restart\n");
       machine_real_restart();
     }
   }
@@ -241,13 +249,15 @@ void Main(struct Boot_Info* bootInfo)
   Init_BSS();
   Init_Screen();
   InitSerial();
+
+  Init_VMCons();
   Init_Mem(bootInfo);
   Init_CRC32();
   Init_TSS();
   Init_Interrupts();
   Init_Scheduler();
   Init_Traps();
-  Init_Timer();
+  //  Init_Timer();
   Init_Keyboard();
   Init_VM(bootInfo);
   Init_Paging();
@@ -261,17 +271,17 @@ void Main(struct Boot_Info* bootInfo)
 
 
 
-  SerialPrint("\n\nHello, Welcome to this horrid output-only serial interface\n");
-  SerialPrint("Eventually, this will let us control the VMM\n\n");
+  PrintBoth("\n\nHello, Welcome to this horrid output-only serial interface\n");
+  PrintBoth("Eventually, this will let us control the VMM\n\n");
  
-  SerialPrint("\n\n===>");
+  PrintBoth("\n\n===>");
   
 
 
   
 
   
-  SerialPrintLevel(1000,"Launching Noisemaker and keyboard listener threads\n");
+  PrintBoth("Launching Noisemaker and keyboard listener threads\n");
   
   key_thread = Start_Kernel_Thread(Keyboard_Listener, (ulong_t)&doIBuzz, PRIORITY_NORMAL, false);
   spkr_thread = Start_Kernel_Thread(Buzzer, (ulong_t)&doIBuzz, PRIORITY_NORMAL, false);
@@ -280,8 +290,31 @@ void Main(struct Boot_Info* bootInfo)
 
 
 
-  SerialPrintLevel(1000,"Next: setup GDT\n");
+  PrintBoth("Next: setup GDT\n");
+
 
+  if (TEST_PAGING) {
+      int i = 0;
+      for (i = 0; i < 1024; i++) {
+         uint_t * addr = (uint_t *)0xa00000;
+         uint_t foo = *addr;
+         
+         PrintBoth("Read From 0x%x=%d\n", (uint_t)addr, foo);
+      }
+
+      
+      //  Invalidate_PG((void *)0x2000);
+      
+      //  VM_Test(bootInfo, 32);  
+      //VM_Test(bootInfo, 1536);
+  }
+
+
+  if (TEST_PCI) {
+      Init_PCI();
+
+
+  }
 
   while(1);