X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fgeekos%2Fmain.c;h=9197521498f541565cde5207dfc32b406f10c1d9;hb=3f025fd4e0e535801836faa4259b94b18b94f231;hp=18071b96d91166f0650e46db9ecd24acf29dc858;hpb=158640d601f6c710cfce7bc4a6bd8f7e7847b7a3;p=palacios.git diff --git a/palacios/src/geekos/main.c b/palacios/src/geekos/main.c index 18071b9..9197521 100644 --- a/palacios/src/geekos/main.c +++ b/palacios/src/geekos/main.c @@ -3,7 +3,7 @@ * Copyright (c) 2001,2003,2004 David H. Hovemeyer * Copyright (c) 2003, Jeffrey K. Hollingsworth * Copyright (c) 2004, Iulian Neamtiu - * $Revision: 1.19 $ + * $Revision: 1.23 $ * * This is free software. You are permitted to use, * redistribute, and modify it as specified in the file "COPYING". @@ -120,7 +120,13 @@ void BuzzVM() int x; int j; unsigned char init; - + +#if 0 + __asm__ __volatile__ ( + "popf" + ); + +#endif PrintBoth("Starting To Buzz\n"); @@ -247,25 +253,34 @@ void Main(struct Boot_Info* bootInfo) // Init_IDE(); - Print("Done; stalling\n"); + // Print("Done; stalling\n"); -#if 1 +#if 0 SerialPrint("Dumping VM kernel Code (first 128 bytes @ 0x%x)\n", 0x100000); - SerialMemDump((unsigned char *)0x100000, 128); + SerialMemDump((unsigned char *)0xfe000, 4096); /* SerialPrint("Dumping kernel Code (first 512 bytes @ 0x%x)\n",KERNEL_START); SerialMemDump((unsigned char *)VM_KERNEL_START, 512); */ #endif +#if 0 + SerialPrint("Dumping BIOS code f0000-fffff\n\n"); + SerialMemDump((unsigned char *)0xf0000, 65536); + /* + SerialPrint("Dumping kernel Code (first 512 bytes @ 0x%x)\n",KERNEL_START); + SerialMemDump((unsigned char *)VM_KERNEL_START, 512); + */ +#endif - +#if 1 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); +#endif { struct vmm_os_hooks os_hooks; @@ -285,26 +300,26 @@ void Main(struct Boot_Info* bootInfo) os_hooks.free_page = &Free_VMM_Page; os_hooks.malloc = &VMM_Malloc; os_hooks.free = &VMM_Free; + os_hooks.vaddr_to_paddr = &Identity; + os_hooks.paddr_to_vaddr = &Identity; // DumpGDT(); Init_VMM(&os_hooks, &vmm_ops); + init_shadow_map(&(vm_info.mem_map)); + init_shadow_page_state(&(vm_info.shadow_page_state)); + vm_info.page_mode = SHADOW_PAGING; + + vm_info.cpu_mode = REAL; - init_mem_layout(&(vm_info.mem_layout)); - init_mem_list(&(vm_info.mem_list)); init_vmm_io_map(&(vm_info.io_map)); - add_mem_list_pages(&(vm_info.mem_list), vm_range_start, (vm_range_end - vm_range_start) / PAGE_SIZE); - // add_unmapped_mem_range(&(vm_info.mem_layout), 0, 256); - //add_shared_mem_range(&(vm_info.mem_layout), guest_kernel_start, (guest_kernel_end - guest_kernel_start) / PAGE_SIZE, guest_kernel_start); - //add_guest_mem_range(&(vm_info.mem_layout), guest_kernel_end, 20); - if (0) { // add_shared_mem_range(&(vm_info.mem_layout), 0, 0x800000, 0x10000); - add_shared_mem_range(&(vm_info.mem_layout), 0, 0x1000000, 0); + // add_shared_mem_range(&(vm_info.mem_layout), 0, 0x1000000, 0); rip = (ulong_t)(void*)&BuzzVM; // rip -= 0x10000; @@ -317,13 +332,21 @@ void Main(struct Boot_Info* bootInfo) } else { - add_shared_mem_range(&(vm_info.mem_layout), 0x0, 0x1000, 0x100000); - + //add_shared_mem_range(&(vm_info.mem_layout), 0x0, 0x1000, 0x100000); + // add_shared_mem_range(&(vm_info.mem_layout), 0x0, 0x100000, 0x0); + shadow_region_t *ent = Malloc(sizeof(shadow_region_t));; + init_shadow_region_physical(ent,0,0x100000,GUEST_REGION_PHYSICAL_MEMORY, + 0x100000, HOST_REGION_PHYSICAL_MEMORY); + add_shadow_region(&(vm_info.mem_map),ent); hook_io_port(&(vm_info.io_map), 0x61, &IO_Read, &IO_Write); - - vm_info.rip = 0x0; + /* + vm_info.cr0 = 0; + vm_info.cs.base=0xf000; + vm_info.cs.limit=0xffff; + */ + vm_info.rip = 0xfff0; vm_info.rsp = 0x0; }