X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_config.c;h=f0befa8d7478fa89c4dda23e300ea21feed300d9;hb=18cc68af5caa15264a853167e9d2d885cb79317a;hp=89a3f6c6d33cabbb5b9cb21a35122b4ecf8e084c;hpb=c163873b7b96544683030cafba0e73a7ed988171;p=palacios.git diff --git a/palacios/src/palacios/vmm_config.c b/palacios/src/palacios/vmm_config.c index 89a3f6c..f0befa8 100644 --- a/palacios/src/palacios/vmm_config.c +++ b/palacios/src/palacios/vmm_config.c @@ -55,7 +55,6 @@ static int setup_memory_map(struct guest_info * info, struct v3_vm_config * config_ptr); -static int setup_devices(struct guest_info * info, struct v3_vm_config * config_ptr); static struct vm_device * configure_generic(struct guest_info * info, struct v3_vm_config * config_ptr); @@ -79,19 +78,22 @@ int v3_config_guest(struct guest_info * info, struct v3_vm_config * config_ptr) // Amount of ram the Guest will have, rounded to a 4K page boundary info->mem_size = config_ptr->mem_size & ~(addr_t)0xfff; + // Initialize the subsystem data strutures v3_init_time(info); v3_init_io_map(info); v3_init_msr_map(info); v3_init_interrupt_state(info); + v3_init_exception_state(info); v3_init_dev_mgr(info); v3_init_host_events(info); - + + v3_init_decoder(info); v3_init_hypercall_map(info); - + // Initialize the memory map v3_init_shadow_map(info); @@ -116,9 +118,7 @@ int v3_config_guest(struct guest_info * info, struct v3_vm_config * config_ptr) return -1; } - // Configure the devices for the guest - setup_devices(info, config_ptr); - + if (config_ptr->enable_profiling) { info->enable_profiler = 1; v3_init_profiler(info); @@ -137,6 +137,9 @@ int v3_config_guest(struct guest_info * info, struct v3_vm_config * config_ptr) } + + + /* TODO: * The amount of guest memory is stored in info->mem_size * We need to make sure the memory map extends to cover it @@ -188,7 +191,7 @@ static int setup_memory_map(struct guest_info * info, struct v3_vm_config * conf -static int setup_devices(struct guest_info * info, struct v3_vm_config * config_ptr) { +int v3_config_devices(struct guest_info * info, struct v3_vm_config * config_ptr) { struct vm_device * ide = NULL; struct vm_device * ramdisk = NULL; @@ -291,10 +294,16 @@ static int setup_devices(struct guest_info * info, struct v3_vm_config * config_ + + static struct vm_device * configure_generic(struct guest_info * info, struct v3_vm_config * config_ptr) { PrintDebug("Creating Generic Device\n"); struct vm_device * generic = v3_create_generic(); + + // port 0x92: A20 enable/disable (bit 2) (This causes an MMU flush) + + // Make the DMA controller invisible v3_generic_add_port_range(generic, 0x00, 0x07, GENERIC_PRINT_AND_IGNORE); // DMA 1 channels 0,1,2,3 (address, counter) v3_generic_add_port_range(generic, 0xc0, 0xc7, GENERIC_PRINT_AND_IGNORE); // DMA 2 channels 4,5,6,7 (address, counter)