X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fgeekos%2Fvm.c;h=661f5d18ef1f046cc660d4e7ead8597453dfa241;hb=f7cc83b3bae64c853f5b7b63e2830b1ea92dfed9;hp=7170ecc2d7edd525de7d9f2c7a30c2c577ee4820;hpb=57e3d7d1e671a261befef967b4a441e5d7dc2303;p=palacios.git diff --git a/palacios/src/geekos/vm.c b/palacios/src/geekos/vm.c index 7170ecc..661f5d1 100644 --- a/palacios/src/geekos/vm.c +++ b/palacios/src/geekos/vm.c @@ -18,6 +18,11 @@ #include #include +//test decoder +//#include + +extern int parse(); + #define SPEAKER_PORT 0x61 static inline void VM_Out_Byte(ushort_t port, uchar_t value) @@ -199,6 +204,8 @@ int RunVMM(struct Boot_Info * bootInfo) { + + memset(&os_hooks, 0, sizeof(struct vmm_os_hooks)); memset(&vmm_ops, 0, sizeof(struct vmm_ctrl_ops)); memset(&vm_info, 0, sizeof(struct guest_info)); @@ -213,10 +220,18 @@ int RunVMM(struct Boot_Info * bootInfo) { os_hooks.vaddr_to_paddr = &Identity; os_hooks.paddr_to_vaddr = &Identity; os_hooks.hook_interrupt = &hook_irq_stub; + os_hooks.hook_interrupt_new = &geekos_hook_interrupt_new; os_hooks.ack_irq = &ack_irq; os_hooks.get_cpu_khz = &get_cpu_khz; + + Init_VMM(&os_hooks, &vmm_ops); + + //test decoder + PrintBoth("testing decoder\n"); + parse(); + PrintBoth("testing decoder done\n"); /* MOVE THIS TO AN INIT GUEST ROUTINE */ @@ -375,10 +390,9 @@ int RunVMM(struct Boot_Info * bootInfo) { #if GENERIC generic_port_range_type range[] = { -#if 0 +#if 1 {0x00, 0x07, GENERIC_PRINT_AND_IGNORE}, // DMA 1 channels 0,1,2,3 (address, counter) - {0xc0, 0xc7, GENERIC_PRINT_AND_ -IGNORE}, // DMA 2 channels 4,5,6,7 (address, counter) + {0xc0, 0xc7, GENERIC_PRINT_AND_IGNORE}, // DMA 2 channels 4,5,6,7 (address, counter) {0x87, 0x87, GENERIC_PRINT_AND_IGNORE}, // DMA 1 channel 0 page register {0x83, 0x83, GENERIC_PRINT_AND_IGNORE}, // DMA 1 channel 1 page register {0x81, 0x81, GENERIC_PRINT_AND_IGNORE}, // DMA 1 channel 2 page register @@ -391,7 +405,7 @@ IGNORE}, // DMA 2 channels 4,5,6,7 (address, counter) {0xd0, 0xde, GENERIC_PRINT_AND_IGNORE}, // DMA 2 misc registers #endif - + {0x3f8, 0x3f8+7, GENERIC_PRINT_AND_IGNORE}, // COM 1 {0x2f8, 0x2f8+7, GENERIC_PRINT_AND_IGNORE}, // COM 2 {0x3e8, 0x3e8+7, GENERIC_PRINT_AND_IGNORE}, // COM 3 @@ -449,15 +463,16 @@ IGNORE}, // DMA 2 channels 4,5,6,7 (address, counter) #if 1 // give floppy controller to vm - hook_irq(&vm_info, 6); + hook_irq_for_guest_injection(&vm_info, 6); #endif +#if 1 //primary ide - hook_irq(&vm_info, 14); + hook_irq_for_guest_injection(&vm_info, 14); // secondary ide - hook_irq(&vm_info, 15); - + hook_irq_for_guest_injection(&vm_info, 15); +#endif vm_info.rip = 0xfff0;