X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=misc%2Ftest_vm%2Fsrc%2Fgeekos%2Fmain.c;fp=misc%2Ftest_vm%2Fsrc%2Fgeekos%2Fmain.c;h=9d48319fc7da03c54dd5651d765372bd66bcce8f;hp=0000000000000000000000000000000000000000;hb=ddc16b0737cf58f7aa90a69c6652cdf4090aec51;hpb=626595465a2c6987606a6bc697df65130ad8c2d3 diff --git a/misc/test_vm/src/geekos/main.c b/misc/test_vm/src/geekos/main.c new file mode 100644 index 0000000..9d48319 --- /dev/null +++ b/misc/test_vm/src/geekos/main.c @@ -0,0 +1,308 @@ +/* + * GeekOS C code entry point + * Copyright (c) 2001,2003,2004 David H. Hovemeyer + * Copyright (c) 2003, Jeffrey K. Hollingsworth + * Copyright (c) 2004, Iulian Neamtiu + * $Revision: 1.2 $ + * + * This is free software. You are permitted to use, + * redistribute, and modify it as specified in the file "COPYING". + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +/* + static inline unsigned int cpuid_ecx(unsigned int op) + { + unsigned int eax, ecx; + + __asm__("cpuid" + : "=a" (eax), "=c" (ecx) + : "0" (op) + : "bx", "dx" ); + + return ecx; + } +*/ + + + +extern void Get_MSR(ulong_t msr, unsigned int *val1, unsigned int *val2); +extern void Set_MSR(ulong_t msr, ulong_t val1, ulong_t val2); +extern uint_t Get_EIP(); +extern uint_t Get_ESP(); +extern uint_t Get_EBP(); + + + +extern void Invalidate_PG(void * addr); + + +int foo=42; + +#define SPEAKER_PORT 0x61 + + +void Buzz(unsigned delay, unsigned num) +{ + volatile int x; + int i,j; + unsigned char init; + + init=In_Byte(SPEAKER_PORT); + + for (i=0;i"); + + + + + + + SerialPrintLevel(1000,"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); + + + + + + SerialPrintLevel(1000,"Next: setup GDT\n"); + + { + int i = 0; + for (i = 0; i < 1024; i++) { + uint_t * addr = (uint_t *)0xa00000; + uint_t foo = *addr; + + SerialPrint("Read From 0x%x=%d\n", (uint_t)addr, foo); + } + + } + // Invalidate_PG((void *)0x2000); + + // VM_Test(bootInfo, 32); + //VM_Test(bootInfo, 1536); + + while(1); + + /* Now this thread is done. */ + Exit(0); +}