/* * 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); }